User:Mr.Z-man/modern.js

// function checkorphansclick { for (var i in document.links) { if (document.links[i].href.toString.indexOf('Image:') != -1) { document.links[i].href = document.links[i].href + "?checkimage=true"; window.open(document.links[i].href); } } }

function checkorphans { if (document.URL.indexOf('Category:Orphaned_fairuse_images_as_of') != -1) { mw.util.addPortletLink('p-cactions', 'javascript:checkorphansclick', "check images", "ca-orphancheck", "Check images for orphans"); } if(document.URL.indexOf('?checkimage=true') != -1) { license = document.getElementById('imageLicenseText').innerHTML; if(document.getElementById('nolinkstoimage') && license.indexOf('/wiki/Fair_use') != -1) { self.close; } }    } $(checkorphans);

if (mw.config.get('wgNamespaceNumber') == "2" || mw.config.get('wgNamespaceNumber') == "3") { document.write(' '); }

importScript('User:Mr.Z-man/rangecheck.js');

importScript('User:Mr.Z-man/gsearch.js');

importScript('User:Mr.Z-man/hideClosedAFD.js');

importScript('User:Mr.Z-man/refbuttons.js');

function stats { mw.util.addPortletLink('p-cactions', 'http://stats.grok.se/en/200801/' +mw.config.get('wgPageName'), "stats", "ca-stats", "See article stats"); } $(stats); // Feedback tab on article pages function feedbackTab { if (mw.config.get('wgNamespaceNumber') == 0) {     mw.util.addPortletLink('p-cactions', '/wiki/Talk:' + mw.config.get('wgTitle') + '?action=edit&preload=User:Mr.Z-man/preload&editintro=User:Mr.Z-man/editintro&section=new', "feedback", "ca-feedbacktab", "Leave feedback for this article"); } if (mw.config.get('wgNamespaceNumber') == 1 && document.URL.indexOf('?action=edit&preload=User:Mr.Z-man/preload&editintro=User:Mr.Z-man/editintro&section=new') != -1) {     document.editform.wpSummary.value = "Article Feedback"; var el = document.getElementById('talkpagetext'); if (el) el.style.display = 'none'; }     } $(feedbackTab); importScript('User:^demon/vero.js'); // CSD AutoReason importScript('User:^demon/csd.js'); importScript('User:AzaToth/morebits.js'); importScript('User:AzaToth/twinkleunlink.js'); importScript('User:AzaToth/twinklewarn.js'); importScript('User:AzaToth/twinklespeedy.js'); importScript('User:AzaToth/twinkleimage.js'); importScript('User:AzaToth/twinkleprod.js'); importScript('User:AzaToth/twinklexfd.js'); importScript('User:AzaToth/twinkledelimages.js'); importScript('User:AzaToth/twinklebatchdelete.js'); TwinkleConfig = { revertMaxRevisions             :       50, userTalkPageMode               :       'tab', showSharedIPNotice             :       false, openTalkPage                   :       [ 'agf', 'norm', 'vand' ], openTalkPageOnAutoRevert       :       false, openAOLAnonTalkPage            :       true, summaryAd                      :       " using TW", deletionSummaryAd              :       " using TW", protectionSummaryAd            :       " using TW", watchSpeedyPages               :       [], watchProdPages                 :       true, openUserTalkPageOnSpeedyDelete :       [], watchRevertedPages             :       [ 'agf', 'norm', 'vand', 'torev' ], markRevertedPagesAsMinor       :       [ 'agf', 'norm', 'vand', 'torev' ], deleteTalkPageOnDelete         :       false, watchWarnings                  :       false, markAIVReportAsMinor           :       true, markSpeedyPagesAsMinor         :       true, offerReasonOnNormalRevert      :       true, orphanBacklinksOnSpeedyDelete  :       {orphan:true, exclude:['g6', 'g12', 'a3', 'a1', 'u1', 'r1']} };

// VOA Stuff //-- //First loads //Helper tools document.write(' '); //////////////////////

// Admin tools document.write(' ');

//END //************ window.onload = Main; function Main {   watchlist_tab; block_check; } //END VOA Stuff //************

//this helps automate AfD closing by adding a 'close' tab to AfD debates //written by User:Johnleemk based on WikiProject User scripts/Scripts/test-n.js by User:Celestianpower

function autoafd_result { var close = prompt("Result of debate?") var f = document.editform, t = f.wpTextbox1; t.value = t.value.split('{{REMOVE THIS TEMPLATE WHEN CLOSING THIS AfD').join('{{ns:0'); t.value = "{{subst:" + "at" + "}} " + close + ". " + "~" + "~" + "~" + "~" + '\n' + '\n' + t.value; if (t.value.length > 0) t.value += '\n'; t.value += "{{subst:" + "ab" + "}}"; f.wpSummary.value = "Closing debate; result was " + close; } function autoafd_relist { var f = document.editform, t = f.wpTextbox1; if (t.value.length > 0) t.value += '\n'; t.value += "{{subst:" + "relist" + "|~" + "~" + "~" + "~}}"; f.wpSummary.value = "Relisting debate"; } function autoafd_keep { var date = prompt("Nomination was made when?") var votepage = prompt("Vote page is? (Enter 'd' for default.)") var f = document.editform, t = f.wpTextbox1; // If default votepage... if (votepage=="d") {       var temp = document.editform.action.split("/w/index.php?title="); var temp = temp[1].split("&action=submit"); var temp = temp[0].substring(5); var votepage = temp; } t.value = "{{" + "oldafdfull" + "|date=" + date + "|votepage=" + votepage + "}}" + '\n' + '\n' + t.value; f.wpSummary.value = "Article survived AfD"; } function autoafd_no_consensus { var date = prompt("Nomination was made when?") var votepage = prompt("Vote page is? (Enter 'd' for default.)") var f = document.editform, t = f.wpTextbox1; // If default votepage... if (votepage=="d") {       var temp = document.editform.action.split("/w/index.php?title="); var temp = temp[1].split("&action=submit"); var temp = temp[0].substring(5); var votepage = temp; } t.value = "{{" + "oldafdfull" + "|date=" + date + "|result=no consensus|votepage=" + votepage + "}}" + '\n' + '\n' + t.value; f.wpSummary.value = "Article survived AfD with no consensus"; } function autoafd_redirect { var date = prompt("Nomination was made when?") var redirect = prompt("Redirect to?") var votepage = prompt("Vote page is? (Enter 'd' for default.)") var f = document.editform, t = f.wpTextbox1; // If default votepage... if (votepage=="d") {       var temp = document.editform.action.split("/w/index.php?title="); var temp = temp[1].split("&action=submit"); var temp = temp[0].substring(5); var votepage = temp; } t.value = "{{" + "oldafdfull" + "|date=" + date + "|result=redirect to " + redirect + "|votepage=" + votepage + "}}" + '\n' + '\n' + t.value; f.wpSummary.value = "Article redirected to " + redirect + " as per AfD"; } function autoafd_merge { var date = prompt("Nomination was made when?") var redirect = prompt("Merge and redirect to?") var votepage = prompt("Vote page is? (Enter 'd' for default.)") var f = document.editform, t = f.wpTextbox1; // If default votepage... if (votepage=="d") {       var temp = document.editform.action.split("/w/index.php?title="); var temp = temp[1].split("&action=submit"); var temp = temp[0].substring(5); var votepage = temp; } t.value = "{{" + "oldafdfull" + "|date=" + date + "|result=merge and redirect to " + redirect + "|votepage=" + votepage + "}}" + '\n' + '\n' + t.value; f.wpSummary.value = "Article merged and redirected to " + redirect + " as per AfD"; } function autoafd_other { var date = prompt("Nomination was made when?") var result = prompt("Result was?") var votepage = prompt("Vote page is? (Enter 'd' for default.)") var f = document.editform, t = f.wpTextbox1; // If default votepage... if (votepage=="d") {       var temp = document.editform.action.split("/w/index.php?title="); var temp = temp[1].split("&action=submit"); var temp = temp[0].substring(5); var votepage = temp; } t.value = "{{" + "oldafdfull" + "|date=" + date + "|result=" + result + "|votepage=" + votepage + "}}" + '\n' + '\n' + t.value; f.wpSummary.value = "AfDed; result was " + result; } function autoafd_add_afd_tabs { // Only add for pages with the right string somewhere in the title if (document.title.indexOf("Editing Wikipedia:Articles for deletion/") != -1) {     mw.util.addPortletLink('p-cactions', 'javascript:autoafd_result', "close"); mw.util.addPortletLink('p-cactions', 'javascript:autoafd_relist', "relist"); } if (document.title.indexOf("Editing Talk:") != -1) {     mw.util.addPortletLink('p-cactions', 'javascript:autoafd_keep', "keep"); mw.util.addPortletLink('p-cactions', 'javascript:autoafd_no_consensus', "no consensus"); mw.util.addPortletLink('p-cactions', 'javascript:autoafd_redirect', "redirect"); mw.util.addPortletLink('p-cactions', 'javascript:autoafd_merge', "merge"); mw.util.addPortletLink('p-cactions', 'javascript:autoafd_other', "other"); } } $(autoafd_add_afd_tabs); //end AfD closing script // //