The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.
Shortcuts: BP:AV · BP:ANTIVANDAL
Version: 1.1.1

Jump to: Welcome · Why use AntiVandal? · Install · Abuse · Pages

Welcome

AntiVandal is a userscript for patrolling Bharatpedia. It is written in JavaScript and loaded from your common.js. On the BharatpediaNeo skin it adds a red hazard control next to Edit. Opening that control swaps the title-action row for revert, notice, message, and report tools.

The script is written for this wiki. It takes the general idea of an icon-driven patrol helper and implements it against Bharatpedia’s API, talk-page templates, and noticeboards. It is not a port of another project’s compiled gadget.

Why use AntiVandal?

Why use AntiVandal?

Stays in the title row

BharatpediaNeo already has Edit, History, Watch, Like, Share, and More under the article title. AntiVandal does not add a second toolbar across the page. A single red warning icon sits immediately before Edit. Click it to replace that row with patrol tools; click close to put the original buttons back.

Revert with a reason

Revert the latest editor from a dialog. Choose a preset (vandalism, blanking, test, unsourced, spam, POV/attack) or type a custom summary. If the account has rollback and that option is enabled, the script uses MediaWiki rollback; otherwise it uses undo.

Notice without leaving the article

After a revert—or on its own—open the notice dialog and append a substituted uw-* template to the editor’s talk page. Level 1–4 is available where the template exists. An optional extra sentence can be passed as the second parameter.

New talk section

Send a subject and wikitext as a new section on a user talk page, without opening that page first.

Latest revision and alert on change

Jump straight to the current revision as a diff. Turn on alert-on-change to poll the page about every twelve seconds; a new edit produces a toast (and a browser notification if you allow it) and opens the latest diff.

Protection and AIV drafts

Open Bharatpedia:Requests for page protection from the current article. Under More, draft an AIV line and open Bharatpedia:Administrator intervention against vandalism as a new section. You still review and save those pages yourself.

Restore an older revision

On a diff or an oldid view, More → Restore this revision replaces the current text with that revision after a confirm step.

User-link menu

Hold Shift and right-click a link to a user page for talk, contributions, new message, and notice.

Fast enough to use while you read

Actions run through mw.Api on this wiki. You stay on the article until you choose to reload. Speed still depends on your connection and whether the account has rollback.

Install

Install

  1. Open Special:MyPage/common.js while logged in.
  2. Add:
    mw.loader.load('/w/index.php?title=User:WikiDwarf/AntiVandal.js&action=raw&ctype=text/javascript');
  3. Publish, then hard-refresh an existing article (Ctrl+Shift+R).

The script only runs when you are logged in. The hazard icon only appears on pages that already show .bpneo-title-actions (existing, non-special pages).

The BharatpediaNeo template should include this empty slot immediately before the Edit link so the icon always has a place to land:

<span id="antivandal-slot"></span>

If the slot is missing, the script still tries to insert the icon before the Edit control.

Tools

Tools

Once the title row is swapped:

Control What it does
Close Put the normal title buttons back
Revert Revert the latest editor
Notice Post a talk-page warning template
Message New talk-page section
Latest Current revision as a diff
Alert Watch this page for a new edit
Protect Open the protection-request board
More AIV draft, restore this revision, preferences

Notice templates currently offered: vandalism, test, content removal, unsourced, error/hoax, spam, advertising, BLP issues, defamation, joke edits, talk-as-chat, and welcome variants. The templates must exist on this wiki.

Preferences are stored in this browser only (antivandal-prefs-v1), not on the wiki.

Notes

Notes

AntiVandal is small on purpose. It does not include a live recent-changes drawer, a multiple-user warning bench, Quick Template packs, pending-changes review, or reports to off-wiki safety teams. Use those workflows by hand if you need them.

It can run next to other userscripts. If two tools bind the same keys or inject into the same row, disable one of them.

Feedback and bugs: Bharatpedia talk:AntiVandal.

Abuse

Abuse

You review every action before it is saved. Misuse can lead to a block or loss of rollback.

Discouraged:

  • Treating good-faith tests or honest mistakes as vandalism
  • Using alert-on-change to sit on an article you do not own
  • Repeated empty or misleading revert summaries
  • Posting the wrong warning level, or the same harsh template on newcomers
  • Trying to drive the script as a bot

Rollback with a clear summary is fine. Rollback with no explanation, used as a habit, is not.

Testing

Testing

Practise notices on a sandbox talk page, not on a live editor. Confirm that the uw-* templates you rely on actually exist before using them in the field.

Pages

Pages

Page Role
Bharatpedia:AntiVandal This page
Bharatpedia talk:AntiVandal Bugs and requests
User:WikiDwarf/AntiVandal.js Script (JavaScript content model)
User:WikiDwarf/AntiVandal/rules.json Optional extra notice list
Special:MyPage/common.js Per-user loader

Credits

Credits

Maintained for Bharatpedia by WikiDwarf (talk · contribs). Built as an original userscript for this site’s skin and noticeboards.

See also