AntiVandal › Documentation

Welcome to the AntiVandal documentation
This page describes the tools that actually ship in User:WikiDwarf/AntiVandal.js. Report bugs or ask for a feature on Bharatpedia talk:AntiVandal.

AntiVandal is a userscript for logged-in editors. On BharatpediaNeo it adds a red hazard control to the title action row. From there you can revert, warn, welcome a new editor, request protection, draft an AIV line, or restore an older revision.

Installation[edit source]

See Bharatpedia:AntiVandal#Install. In short: add this to Special:MyPage/common.js, then hard-refresh.

mw.loader.load('/w/index.php?title=User:WikiDwarf/AntiVandal.js&action=raw&ctype=text/javascript');

BharatpediaNeo should also keep <span id="antivandal-slot"></span> immediately before the Edit link.

Quick start[edit source]

  1. Open an existing article (not Special: or the main page).
  2. Look in the title action row — Edit, History, Watch, Like, Share, More.
  3. A red warning icon sits immediately before Edit.
  4. Click it. That row is replaced by AntiVandal tools.
  5. Click close (first icon) to get the original buttons back.

If you see no red icon, you are on an old copy of the script, not logged in, or the title row is not rendered. See troubleshooting on the main page.

Title row[edit source]

AntiVandal does not draw a bar above the heading. It uses the existing .bpneo-title-actions row.

After you open it the row is:

Close · Revert · Restore · Latest · Warn user · Welcome new user · Protect · More

Dialogs use a compact card: red top edge, title and close on one row, red primary button.

Open / close[edit source]

  • Open — red ri-error-warning-fill before Edit.
  • Close — first icon after the row swaps. Restores Edit, History, and the rest.

Nothing is saved when you open or close the row.

Revert[edit source]

Opens a dialog:

  • Editor to revert (defaults to the last editor)
  • Reason preset
  • Edit summary (filled from the preset; you can edit it)
  • Warn user after revert — optional; opens the warn dialog if the revert succeeds
  • Revert all recent edits by this user when possible — on by default

Presets: vandalism, blanking, test edit, unsourced, spam/promo, POV/attack, custom summary.

If that last box is checked:

  • accounts with rollback use MediaWiki rollback (all consecutive edits by that user)
  • otherwise the script undoes back to the last revision by someone else (up to 50 revisions)

If the box is unchecked, only the latest revision is undone.

Do not use the vandalism preset on an edit that could be a test or an honest mistake.

Warn user[edit source]

Posts a substituted template to the target talk page. Same tool as More → Warn user.

  • Recent editors on this page (up to five)
  • User (name or IP; type two letters to search accounts)
  • Line showing who the save will sign as
  • Related article (defaults to the page you are on)
  • Notice type
  • Level 1–4 when the template is levelled
  • Extra note (second parameter)

Suggested level is read from existing uw-* templates on that talk page.

Built-in types: vandalism, test, content removal, unsourced, error/hoax, spam, advertising, BLP, defamation, joke, not-a-vote, talk-as-chat, welcome, welcome-after-test.

The template must already exist (for example {{uw-vandalism1}}). If it does not, the API error is shown in the toast.

Welcome new user[edit source]

Posts one welcome template to the target talk page.

The drop-down is filled from Category:Welcome templates (template namespace) when the dialog opens. A template added to that category appears the next time you open the tool.

If the category is empty or the API fails, the list falls back to {{Welcome}} and {{Welcometest}}.

Saves as {{subst:TemplateName}} plus your signature.

Latest revision[edit source]

Opens the current page as diff=cur&oldid=prev.

Restore this revision[edit source]

On the title row. Replaces the current text with the revision you are viewing (oldid or current revid), after confirm. Use this when later editors have piled on and a single-user revert is not enough.

Request protection[edit source]

Shows the current protection, a requested level, and a reason.

More[edit source]

A small menu:

  • Warn user
  • Welcome new user
  • New talk-page message — new section; subject + wikitext; signed as the account in this tab
  • Report at AIV — draft * {{vandal|…}} and open Bharatpedia:Administrator intervention against vandalism as a new section
  • Report to administrators
  • Privacy request
  • Multiple notices — check recent editors on this page and post the same notice to each selected talk page (confirm first)
  • Pending review — lists pending-changes pages if that extension is enabled
  • Preferences

Rollback and restore[edit source]

AntiVandal has one revert dialog, not a row of colour-coded rollback icons.

  • Use revert on the latest editor.
  • Tick Revert all recent edits by this user when possible when they made several consecutive edits.
  • If several other editors have piled on, open the revision you want and use Restore this revision.

On Special:Contributions, a small revert control is added next to each row when the script can read the diff link.

Empty summaries, and calling something vandalism when it is not, can cost rollback rights.

Shift + right-click[edit source]

Hold Shift and right-click a link to a user page. The menu offers:

  • User page
  • Talk page
  • Contributions
  • New message
  • Warn user
  • Welcome new user

Firefox and some extensions steal Shift+right-click. If the menu does not appear, use the title-row tools instead.

Preferences[edit source]

Stored in this browser as antivandal-prefs-v1. Not synced.

  • Prefer software rollback when the account has the right (used when “revert all” is checked)

Older “bar placement” values are ignored on BharatpediaNeo; the title row is always used.

There is no theme picker or animation setting.

Abuse[edit source]

You confirm every save. Administrators can block or strip rights if the script is used as a blunt instrument.

See also Bharatpedia:AntiVandal#Abuse.

Pages[edit source]