User:Lupin/recent2.js

/**

* Anti-Vandal Tool

*

* This tool hits the RSS feed for recent changes every 30 seconds or

* so and checks for common vandalism. It does not make a separate

* server request for every edit.

* @author: en:User:Lupin

* @author: Helder (https://github.com/he7d3r)

* @source: en:User:Lupin/recent2.js

*

* Dual license:

* @license CC-BY 3.0

* @license GFDL 1.2 or any later version

*/

/*jshint

camelcase: false, curly: true, eqeqeq: false, immed: true, latedef: true,

newcap: true, noarg: true, noempty: true, nonew: true, quotmark: single,

trailing: true, undef: false, unused: false, bitwise: false, forin: false,

onevar: false,

boss: true, eqnull: true, evil: true, funcscope: true,

laxbreak: true, scripturl: true, shadow: true,

wsh: true, nonstandard: true

  • /

/*global mw, $, wikEdUseWikEd, WikEdUpdateFrame, setupTooltips,

grabRecentChanges, processRecentChangesSingle, processRecentChanges,

feedFailed, newOutputDiv, processRecentChangesDisplay, getFirstTagContent,

nextChangeSoon, diffCellRe, badWords, spellRe, formatTime, maybeStart,

showHideDetailRange, outputDivs, showHideDetail, loopRecentChanges,

saveBundle, vandalColour, linkmaker, spelldict, hideSysopEdits, marvin,

addMarvin, AVTAutoEdit, self

  • /

//

mw.messages.set( {

'avt-all-rc': 'All recent changes',

'avt-auto-click': 'The "$1" button has been automatically clicked. ' +

'Please wait for the next page to load.',

'avt-auto-click-button-missing': 'Anti-Vandal Tool\n\nautoclick: could not find button "$1".',

'avt-block': 'block',

'avt-continue-question': 'Continue monitoring recent changes?',

'avt-contribs': 'contribs',

'avt-done': 'done up to $1',

'avt-entry-not-found': 'Could not find an entry for $1.',

'avt-error-HTTP-rollback': 'HTTP failed when trying to get rollback link in url\n$1' +

'\n\nHTTP status text: $2',

'avt-error-JSON': 'JSON business failed.\n\n$1\n\nCannot rollback.',

'avt-error-no-bundle': 'No bundle! Please tell Lupin how to reproduce this error - it should not really happen.',

'avt-error-no-rollback-link': 'No rollback link found.\n' +

'Maybe you should try the non-admin rollback by checking the checkbox above?\n' +

'Alternatively, this may be a bug.',

'avt-error-sysop-list': 'Could not process admin list.\n\n"$1"',

'avt-error-unable-to-rollback': 'Could not rollback - someone else has edited since the vandal.\n\n' +

'Page: $1\nVandal: $2\nLast editor: $3\nEdit summary: $4',

'avt-except-templates': '... except for the Template namespace',

'avt-expand-content': 'Automatically expand new content',

'avt-failed': 'failed: $1',

'avt-failed-badly': 'failed badly: $1',

'avt-filter-rc': 'Filter recent changes',

'avt-hide': 'Hide',

'avt-hist': 'hist',

'avt-ignore-my-edits': 'Ignore my edits',

'avt-ignore-outside-main': 'Ignore pages outside the article namespace',

'avt-ignore-safe-pages': 'Ignore safe pages',

'avt-ignore-sysop-edits': 'Hide admin edits',

'avt-ignore-talk-pages': 'Ignore talk pages',

'avt-ip-rc': 'Recent IP edits',

'avt-last': 'last',

'avt-matched': ' matched $1',

'avt-missing-div': 'no such div: diff_div_$1',

'avt-non-admin-rollback': 'Use non-admin rollback',

'avt-only-unchanged': 'Only show edits unchanged after four updates',

'avt-pause': 'Pause updates',

'avt-remove-output': 'remove earlier output',

'avt-resume': 'Resume updates',

'avt-reverted-edits': 'Reverted edits by $1 (talk) to last version by $2',

'avt-rollback': 'rollback',

'avt-rollback-aborted': '$1 seems to be the only editor to $2.\n\nRollback aborted.',

'avt-rolled-back': '[Previously rolled back this editor] $1',

'avt-select-correction': 'Which correction should I use?\nPlease either type a number or another correction.\n',

'avt-show': 'Show',

'avt-show-new': 'show new output',

'avt-spelling-rc': 'Live spellcheck',

'avt-talk': 'talk',

'avt-toggle-details': 'toggle these details',

'avt-unknown-position': 'Unknown position $1 in recent2.js, newOutputDiv.',

'avt-updating': '($1) updating...',

'avt-uw-test': 'uw-test',

'avt-uw-vand': 'uw-vand',

'avt-warning-regex': 'Warning: ignoring odd-looking regexp on line $1 ' +

'of badwords:'

// FIXME: Remove this hack once bugzilla:47395 is fixed

.replace( /\$2/g, 'User:Lupin/badwords' ),

'avt-watched-rc': 'Monitor my watchlist'

} );

var recent2={

// Edit these to your liking.

// Make sure there's a comma at the end of each line.

badwordsPage: 'User:Lupin/badwords',

filterPage: 'User:Lupin/Filter_recent_changes',

allRecentPage: 'User:Lupin/All_recent_changes',

recentIPPage: 'User:Lupin/Recent_IP_edits',

monitorWatchlistPage: 'User:Lupin/Monitor_my_watchlist',

spelldictPage: 'Wikipedia:Lists_of_common_misspellings/For_machines',

liveSpellcheckPage: 'User:Lupin/Live_spellcheck',

safePages: '([Ww]ikipedia:([Ii]ntroduction|[Ss]andbox|[Tt]utorial[^/]*/sandbox)|[Tt]emplate:(X[1-9]|Template sandbox))',

linkify: true,

updateSeconds: 30,

// FIXME: Use