User:MER-C/monobook.js
From Wikipedia, the free encyclopedia
If a message on your talk page led you here, please be wary of who left it. The code below could contain malicious content capable of compromising your account; if your account appears to be compromised, it will be blocked. If you are unsure whether the code is safe, you can ask at the appropriate village pump.
Note: After saving, you have to bypass your browser's cache to see the changes. In Internet Explorer and Firefox, hold down the Ctrl key and click the Refresh or Reload button. Opera users have to clear their caches through Tools→Preferences, see the instructions for Opera. Konqueror and Safari users can just click the Reload button.
//<nowiki> //twinklefluff config TwinkleConfig = { revertMaxRevisions : 50, userTalkPageMode : 'window', showSharedIPNotice : true, openTalkPage : [ 'vand' ], openTalkPageOnAutoRevert : false, openAOLAnonTalkPage : false, addAdToSummary : false, summaryAd : " ", watchRevertedPages : [ "" ], overrideWatchRevertedPages : [ ], markRevertedPagesAsMinor : [ 'agf', 'norm', 'vand', 'torev' ], overrideMarkRevertedPagesAsMinor : [ 'agf', 'norm', 'vand', 'torev' ], markWarningsAsMinor : true, markAIVReportAsMinor : true, offerReasonOnNormalRevert : false }; //stuff importScript('Wikipedia:WikiProject User scripts/Scripts/Add LI menu'); importStylesheet('Wikipedia:WikiProject User scripts/Scripts/Add LI menu/css'); importScript('Wikipedia:WikiProject User scripts/Scripts/Easy db'); importScript('User:AzaToth/morebits.js'); importScript('User:AzaToth/twinklearv.js'); importScript('User:Howcheng/quickimgdelete.js'); importScript('User:Lupin/popupsdev.js'); // [[User:Lupin/popupsdev.js]] - please include this line // popup customisation popupSubpopups = false; popupStructure='shortmenus'; popupImages = false; // I prefer + instead of new section addOnloadHook(function() { var tab = document.getElementById('ca-addsection'); if(!tab) return; var tablink = tab.getElementsByTagName('a')[0]; if(!tablink) return; tablink.firstChild.nodeValue = '+'; }); // last button function twinklediff() { if( wgNamespaceNumber < 0 ) return; addPortletLink( 'p-cactions' , wgServer + wgScriptPath + '/index.php?title=' + wgPageName + '&diff=cur&oldid=prev', 'last', 'tw-lastdiff', 'Show most recent diff' ); } addOnloadHook( twinklediff ); // customised version of User:AzaToth/twinklewarn.js; uses different edit summaries, stripped out irrelevant and/or unneeded bits function tagadd( tag , summary) { var article; if( QueryString.exists( 'vanarticle' ) ) { article = decodeURI(QueryString.get( 'vanarticle' )).replace( /^(Image|Category):/i, ':$1:' ); } var textbox = document.getElementById( 'wpTextbox1' ); if ( textbox.value.length > 0 ) { textbox.value += '\n'; } var date = new Date(); var notice = ""; var header = ""; var headerRe = new RegExp( "^==\\s*" + date.getUTCMonthName() + "\\s+" + date.getUTCFullYear() + "\\s*==", 'm' ); if( !headerRe.exec( textbox.value ) ) { header += "== " + date.getUTCMonthName() + " " + date.getUTCFullYear() + " ==\n"; } notice += header; notice += "{{subst:" + tag + ( article != null ? '|' + article : '' ) + "}} ~~" + "~~"; if ( TwinkleConfig.showSharedIPNotice && isIPAddress( wgTitle ) ) { switch( QueryString.get( 'type' ) ) { case 'vand': notice += "\n:''If this is a shared [[IP address]], and you didn't make any [[Wikipedia:vandalism|unconstructive]] edits, please ignore this warning.'' "; break; default: notice += "\n:''If this is a shared [[IP address]], and you didn't make the edit, please ignore this notice.'' "; break; } } textbox.value += "\n" + notice; document.getElementById( 'wpSummary' ).value = summary; if( TwinkleConfig.markWarningsAsMinor ) { document.getElementById( 'wpMinoredit' ).checked = true; } } //Quick warning tabs function add_warn_tabs() { var tabs = document.getElementById('p-cactions').getElementsByTagName('ul')[0]; if ( wgNamespaceNumber == 3 && ( QueryString.equals( 'action', 'edit' ) || QueryString.equals( 'action', 'submit' ) || QueryString.equals( 'action', 'editredlink' )) ) { addlimenu(tabs, '[1]', 'generalnotefunc'); addPortletLink('generalnotefunc', 'javascript:tagadd("uw-vandalism1", "warning user (test1)")', 'Vandalism', ''); addPortletLink('generalnotefunc', 'javascript:tagadd("uw-delete1", "warning user (blank1)")', 'Page blanking, removal', ''); addPortletLink('generalnotefunc', 'javascript:tagadd("uw-test1", "General note: Tests")', 'Editing tests', ''); addPortletLink('generalnotefunc', 'javascript:tagadd("uw-upv1", "General note: Userpage vandalism")', 'Userpage vandalism', ''); addPortletLink('generalnotefunc', 'javascript:tagadd("uw-tpv1", "warning user (tpv1)")', 'Talkpage vandalism', ''); addPortletLink('generalnotefunc', 'javascript:tagadd("uw-error1", "General note: Factual errors")', 'Factual errors', ''); addPortletLink('generalnotefunc', 'javascript:tagadd("uw-mos1", "General note: Manual of style")', 'Manual of style', ''); addPortletLink('generalnotefunc', 'javascript:tagadd("uw-agf1", "General note: Assume good faith")', 'AGF', ''); addPortletLink('generalnotefunc', 'javascript:tagadd("uw-npa1", "General note: Personal attack")', 'Personal attack', ''); addPortletLink('generalnotefunc', 'javascript:tagadd("uw-defamatory1", "General note: Defamatory")', 'Defamation', ''); addPortletLink('generalnotefunc', 'javascript:tagadd("uw-joke1", "General note: Improper humour")', 'Improper humour', ''); addPortletLink('generalnotefunc', 'javascript:tagadd("uw-biog1", "General note: Negative bio")', 'Negative bio', ''); addPortletLink('generalnotefunc', 'javascript:tagadd("uw-npov1", "General note: NPOV")', 'NPOV', ''); addPortletLink('generalnotefunc', 'javascript:tagadd("uw-spam1", "warning user (spam1)")', 'Spam', ''); addPortletLink('generalnotefunc', 'javascript:tagadd("uw-copyright1", "warning user (copyvio1)")', 'Copyright', ''); addPortletLink('generalnotefunc', 'javascript:tagadd("uw-creation1", "warning user (test1article")', 'Creation', ''); addPortletLink('generalnotefunc', 'javascript:tagadd("uw-image1", "General note: Image")', 'Image', ''); addPortletLink('generalnotefunc', 'javascript:tagadd("uw-notcensored1", "General note: Censorship")', 'Censorship', ''); addPortletLink('generalnotefunc', 'javascript:tagadd("uw-unsourced1", "General note: Unsourced")', 'Unsourced', ''); addPortletLink('generalnotefunc', 'javascript:tagadd("uw-move1", "General note: Moves")', 'Moves', ''); addPortletLink('generalnotefunc', 'javascript:tagadd("uw-afd1", "warning user (drmafd1)")', 'Afd', ''); addPortletLink('generalnotefunc', 'javascript:tagadd("uw-speedy1", "warning user (drmspeedy1)")', 'Speedy', ''); addPortletLink('generalnotefunc', 'javascript:tagadd("uw-legal1", "General note: Legal threat")', 'Legal threat', ''); addlimenu(tabs, '[2]', 'cautionfunc'); addPortletLink('cautionfunc', 'javascript:tagadd("uw-vandalism2", "warning user (test2)")', 'Vandalism', ''); addPortletLink('cautionfunc', 'javascript:tagadd("uw-delete2", "warning user (blank2)")', 'Page blanking, removal', ''); addPortletLink('cautionfunc', 'javascript:tagadd("uw-test2", "Caution: Tests")', 'Editing tests', ''); addPortletLink('cautionfunc', 'javascript:tagadd("uw-upv2", "Caution: Userpage vandalism")', 'Userpage vandalism', ''); addPortletLink('cautionfunc', 'javascript:tagadd("uw-tpv2", "warning user (tpv2)")', 'Talkpage vandalism', ''); addPortletLink('cautionfunc', 'javascript:tagadd("uw-error2", "Caution: Factual errors")', 'Factual errors', ''); addPortletLink('cautionfunc', 'javascript:tagadd("uw-mos2", "Caution: Manual of style")', 'Manual of style', ''); addPortletLink('cautionfunc', 'javascript:tagadd("uw-agf2", "Caution: Assume good faith")', 'AGF', ''); addPortletLink('cautionfunc', 'javascript:tagadd("uw-npa2", "Caution: Personal attack")', 'Personal attack', ''); addPortletLink('cautionfunc', 'javascript:tagadd("uw-defamatory2", "Caution: Defamatory")', 'Defamation', ''); addPortletLink('cautionfunc', 'javascript:tagadd("uw-joke2", "Caution: Improper humour")', 'Improper humour', ''); addPortletLink('cautionfunc', 'javascript:tagadd("uw-biog2", "Caution: Negative bio")', 'Negative bio', ''); addPortletLink('cautionfunc', 'javascript:tagadd("uw-npov2", "Caution: NPOV")', 'NPOV', ''); addPortletLink('cautionfunc', 'javascript:tagadd("uw-spam2", "warning user (spam2)")', 'Spam', ''); addPortletLink('cautionfunc', 'javascript:tagadd("uw-copyright2", "warning user (copyvio2)")', 'Copyright', ''); addPortletLink('cautionfunc', 'javascript:tagadd("uw-creation2", "warning user (test2article)")', 'Creation', ''); addPortletLink('cautionfunc', 'javascript:tagadd("uw-image2", "Caution: Image")', 'Image', ''); addPortletLink('cautionfunc', 'javascript:tagadd("uw-notcensored2", "Caution: Censorship")', 'Censorship', ''); addPortletLink('cautionfunc', 'javascript:tagadd("uw-unsourced2", "Caution: Unsourced")', 'Unsourced', ''); addPortletLink('cautionfunc', 'javascript:tagadd("uw-move2", "Caution: Moves")', 'Moves', ''); addPortletLink('cautionfunc', 'javascript:tagadd("uw-afd2", "warning user (drmafd2)")', 'Afd', ''); addPortletLink('cautionfunc', 'javascript:tagadd("uw-speedy2", "warning user (drmspeedy2)")', 'Speedy', ''); addPortletLink('cautionfunc', 'javascript:tagadd("uw-legal2", "Caution: Legal threat")', 'Legal threat', ''); addlimenu(tabs, '[3]', 'warningfunc'); addPortletLink('warningfunc', 'javascript:tagadd("uw-vandalism3", "warning user (test3)")', 'Vandalism', ''); addPortletLink('warningfunc', 'javascript:tagadd("uw-delete3", "warning user (blank3)")', 'Page blanking, removal', ''); addPortletLink('warningfunc', 'javascript:tagadd("uw-test3", "Warning: Tests")', 'Editing tests', ''); addPortletLink('warningfunc', 'javascript:tagadd("uw-upv3", "Warning: Userpage vandalism")', 'Userpage vandalism', ''); addPortletLink('warningfunc', 'javascript:tagadd("uw-tpv3", "Warning: Talkpage vandalism")', 'Talkpage vandalism', ''); addPortletLink('warningfunc', 'javascript:tagadd("uw-error3", "Warning: Factual errors")', 'Factual errors', ''); addPortletLink('warningfunc', 'javascript:tagadd("uw-mos3", "Warning: Manual of style")', 'Manual of style', ''); addPortletLink('warningfunc', 'javascript:tagadd("uw-agf3", "Warning: Assume good faith")', 'AGF', ''); addPortletLink('warningfunc', 'javascript:tagadd("uw-npa3", "Warning: Personal attack")', 'Personal attack', ''); addPortletLink('warningfunc', 'javascript:tagadd("uw-defamatory3", "Warning: Defamatory")', 'Defamation', ''); addPortletLink('warningfunc', 'javascript:tagadd("uw-joke3", "Warning: Improper humour")', 'Improper humour', ''); addPortletLink('warningfunc', 'javascript:tagadd("uw-biog3", "Warning: Negative bio")', 'Negative bio', ''); addPortletLink('warningfunc', 'javascript:tagadd("uw-npov3", "Warning: NPOV")', 'NPOV', ''); addPortletLink('warningfunc', 'javascript:tagadd("uw-spam3", "warning user (spam3)")', 'Spam', ''); addPortletLink('warningfunc', 'javascript:tagadd("uw-copyright3", "warning user (copyvio3)")', 'Copyright', ''); addPortletLink('warningfunc', 'javascript:tagadd("uw-creation3", "warning user (test3article)")', 'Creation', ''); addPortletLink('warningfunc', 'javascript:tagadd("uw-image3", "Warning: Image")', 'Image', ''); addPortletLink('warningfunc', 'javascript:tagadd("uw-notcensored3", "Warning: Censorship")', 'Censorship', ''); addPortletLink('warningfunc', 'javascript:tagadd("uw-unsourced3", "Warning: Unsourced")', 'Unsourced', ''); addPortletLink('warningfunc', 'javascript:tagadd("uw-move3", "Warning: Moves")', 'Moves', ''); addPortletLink('warningfunc', 'javascript:tagadd("uw-afd3", "warning user (drmafd3)")', 'Afd', ''); addPortletLink('warningfunc', 'javascript:tagadd("uw-speedy3", "warning user (drmspeedy3)")', 'Speedy', ''); addPortletLink('warningfunc', 'javascript:tagadd("uw-legal3", "Warning: Legal threat")', 'Legal threat', ''); addlimenu(tabs, '[4]', 'fwarningfunc'); addPortletLink('fwarningfunc', 'javascript:tagadd("uw-vandalism4", "warning user (test4)")', 'Vandalism', ''); addPortletLink('fwarningfunc', 'javascript:tagadd("uw-vandalism4im", "warning user (test4im)")', 'Vandalism (im)', ''); addPortletLink('fwarningfunc', 'javascript:tagadd("uw-delete4", "warning user (blank4)")', 'Page blanking, removal', ''); addPortletLink('fwarningfunc', 'javascript:tagadd("uw-delete4im", "warning user (blank4im)")', 'Page blanking, removal (im)', ''); addPortletLink('fwarningfunc', 'javascript:tagadd("uw-npa4", "Final warning: Personal attack")', 'Personal attack', ''); addPortletLink('fwarningfunc', 'javascript:tagadd("uw-npa4im", "Only warning: Personal attack")', 'Personal attack (im)', ''); addPortletLink('fwarningfunc', 'javascript:tagadd("uw-defamatory4", "Final warning: Defamatory")', 'Defamation', ''); addPortletLink('fwarningfunc', 'javascript:tagadd("uw-defamatory4im", "Only warning: Defamatory")', 'Defamation (im)', ''); addPortletLink('fwarningfunc', 'javascript:tagadd("uw-joke4", "Final warning: Improper humour")', 'Improper humour', ''); addPortletLink('fwarningfunc', 'javascript:tagadd("uw-biog4", "Final warning: Negative bio")', 'Negative bio', ''); addPortletLink('fwarningfunc', 'javascript:tagadd("uw-npov4", "Final warning: NPOV")', 'NPOV', ''); addPortletLink('fwarningfunc', 'javascript:tagadd("uw-spam4", "warning user (spam4)")', 'Spam', ''); addPortletLink('fwarningfunc', 'javascript:tagadd("uw-spam4im", "warning user (spam4im)")', 'Spam (im)', ''); addPortletLink('fwarningfunc', 'javascript:tagadd("uw-copyright4", "warning user (copyvio4)")', 'Copyright', ''); addPortletLink('fwarningfunc', 'javascript:tagadd("uw-creation4", "warning user (test4article)")', 'Creation', ''); addPortletLink('fwarningfunc', 'javascript:tagadd("uw-image4", "Final warning: Image")', 'Image', ''); addPortletLink('fwarningfunc', 'javascript:tagadd("uw-image4im", "Only warning: Image")', 'Image (im)', ''); addPortletLink('fwarningfunc', 'javascript:tagadd("uw-move4", "Final warning: Moves")', 'Moves', ''); addPortletLink('fwarningfunc', 'javascript:tagadd("uw-afd4", "warning user (drmafd4)")', 'Afd', ''); addPortletLink('fwarningfunc', 'javascript:tagadd("uw-speedy4", "warning user (drmspeedy4)")', 'Speedy', ''); addlimenu(tabs, '[S]', 'singlefunc'); addPortletLink('singlefunc', 'javascript:tagadd("uw-3rr", "in danger of violating the [[WP:3RR|three-revert rule]]")', '3RR', ''); } } addOnloadHook(add_warn_tabs); // something to prod crap easily function prod(type) { var title = wgPageName.replace("&", "%26"); location.assign("/w/index.php?title=" + wgPageName + "&action=edit&prod=" + type); } addOnloadHook(function() { //check if called from deletion request if (document.title.indexOf("Editing ") != -1) { if (document.URL.lastIndexOf("&prod=") == -1) return; var type = document.URL.substring(document.URL.lastIndexOf("&prod=") + 6, document.URL.length); var f = document.editform, t = f.wpTextbox1; t.value = type + "\n" + t.value; f.wpSummary.value = "Prodded"; document.getElementById('wpWatchthis').checked = true; f.wpSave.click(); return; } else if (wgNamespaceNumber == 0 || wgNamespaceNumber == 2) { var tabs = document.getElementById('p-cactions').getElementsByTagName('ul')[0]; addlimenu(tabs, 'prod', 'prod'); addPortletLink('prod', 'javascript:prod("{{subst:prod-nn}}")', 'Non-notable', ''); addPortletLink('prod', 'javascript:prod("{{subst:User:MER-C/Prod}}")', 'User page', ''); addPortletLink('prod', 'javascript:prod("{{subst:prod|[[WP:VSCA|Vanispamcruftisement]]}}")', 'Vanispamcruftisement', ''); addPortletLink('prod', 'javascript:prod("{{subst:transwiki|wiktionary|{{PAGENAME}}}}")', 'Transwikiied (wikt)', ''); addPortletLink('prod', 'javascript:prod("{{subst:transwiki|wikibooks|{{PAGENAME}}}}")', 'Transwikiied (wikibooks)', ''); } }); // utc clock, a hybrid of [[User:Voice of All/UTCclock.js]] and [[User:AzaToth/liveclock.js]] function liveClock() { var query = { 'title': wgPageName, 'action': 'purge' }; liveClock.node = addPortletLink( 'p-personal', wgServer + wgScriptPath + '/index.php?' + QueryString.create( query ), '', 'utcdate' ); showTime(); } addOnloadHook(liveClock); function showTime() { var dateNode = liveClock.node; if( !dateNode ) { return; } var now = new Date(); var timeValue = now.toUTCString().substring(0,22) + " UTC"; dateNode.firstChild.replaceChild( document.createTextNode(timeValue), dateNode.firstChild.firstChild ); window.setTimeout(showTime, 1000); } //</nowiki>

