User:Anetode/monobook.js

importScript('Wikipedia:WikiProject User scripts/Scripts/addLink'); importScript('Wikipedia:WikiProject User scripts/Scripts/Add LI menu'); importScript('User:Odie5533/SnipManager.user.js'); importScript('User:AzaToth/morebits.js'); importScript('User:AWeenieMan/furme.js'); importScript('User:Lifebaka/closedrv.js'); importScript('User:AzaToth/VoA.js'); importScript('MediaWiki:Gadget-UTCLiveClock.js');

//importScript('User:Voice_of_All/Deletion/monobook.js'); importScript('User:Lupin/recent2.js');

/**** quick image delete ****/ document.write(' ');

/* This is to keep track of who is using this extension: User:Howcheng/quickimgdelete.js */

// User:Krimpet/CH2_en.js importScript('User:Krimpet/CH2_en.js');

if (wgAction == 'view' && wgNamespaceNumber >=0) addOnloadHook(function{ var h2s = document.getElementsByTagName('H2'); var h2 = h2s[0]; if (!h2) return; if (h2.parentNode.id == 'toctitle') h2 = h2s[1]; if (!h2) return; var span = h2.firstChild; if (!span || span.className != 'editsection') return; var zero = span.cloneNode(true); var parent = document.getElementById('bodyContent'); parent.insertBefore(zero, parent.firstChild); var a = zero.getElementsByTagName('A')[0]; a.title = a.title.replace(/:.*$/,': 0'); a.setAttribute('href', a.href.replace(/&section=1/,'&section=0')); }) if (wgAction=='edit' && document.URL.indexOf('&section=0') != -1) addOnloadHook(function{ document.getElementById('wpSummary').value = "/* Intro */ "; })

//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?"); if (close != null && close != "") { var nonadmin = " (non-admin closure)"; if (typeof wgUserGroups == "object" && wgUserGroups) { for ( var g = 0; g < wgUserGroups.length; ++g ) { if ( wgUserGroups[g] == "sysop" ) { nonadmin = ""; break; }                 }                }                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 + "." + nonadmin + " " + "~" + "~" + "~" + "~" + '\n' + '\n' + t.value; if (t.value.length > 0) { t.value += '\n'; }               t.value += "{{subst:" + "ab" + "}}"; f.wpSummary.value = "Closing debate; result was " + close + nonadmin; } }

function autoafd_relist { var f = document.editform, t = f.wpTextbox1; if (t.value.length > 0) { t.value += '\n'; }       t.value += "{{subst:" + "relist" + "|~" + "~" + "~" + "~}}"; var nonadmin = " (non-admin closure)"; if (typeof wgUserGroups == "object" && wgUserGroups) { for ( var g = 0; g < wgUserGroups.length; ++g ) { if ( wgUserGroups[g] == "sysop" ) { nonadmin = ""; break; }         }        }        f.wpSummary.value = "Relisting debate" + nonadmin; }

function autoafd_keep { var date = prompt("Nomination was made when?"); if (date != null && date != "") { var votepage = prompt("Vote page is? (Enter 'd' for default.)"); if (votepage != null && votepage != "") { 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; var nonadmin = " (non-admin closure)"; if (typeof wgUserGroups == "object" && wgUserGroups) { for ( var g = 0; g < wgUserGroups.length; ++g ) { if ( wgUserGroups[g] == "sysop" ) { nonadmin = ""; break; }                         }                        }                        f.wpSummary.value = "Article survived AfD" + nonadmin; }       } }

function autoafd_no_consensus { var date = prompt("Nomination was made when?"); if (date != null && date != "") { var votepage = prompt("Vote page is? (Enter 'd' for default.)") if (votepage != null && votepage != "") { 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?"); if (date != null && date != "") { var redirect = prompt("Redirect to?"); if (redirect != null && redirect != "") { var votepage = prompt("Vote page is? (Enter 'd' for default.)"); if (votepage != null && votepage != "") { 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; var nonadmin = " (non-admin closure)"; if (typeof wgUserGroups == "object" && wgUserGroups) { for ( var g = 0; g < wgUserGroups.length; ++g ) { if ( wgUserGroups[g] == "sysop" ) { nonadmin = ""; break; }                                       }                                }                                f.wpSummary.value = "Article redirected to " + redirect + " as per AfD" + nonadmin; }               }        } }

function autoafd_merge { var date = prompt("Nomination was made when?"); if (date != null && date != "") { var redirect = prompt("Merge and redirect to?"); if (redirect != null && redirect != "") { var votepage = prompt("Vote page is? (Enter 'd' for default.)"); if (redirect != null && redirect != "") { 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?"); if (date != null && date != "") { var result = prompt("Result was?"); if (result != null && result != "") { var votepage = prompt("Vote page is? (Enter 'd' for default.)"); if (votepage != null && votepage != "") { 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; var nonadmin = " (non-admin closure)"; if (typeof wgUserGroups == "object" && wgUserGroups) { for ( var g = 0; g < wgUserGroups.length; ++g ) { if ( wgUserGroups[g] == "sysop" ) { nonadmin = ""; break; }                                 }                                }                                f.wpSummary.value = "AfDed; result was " + result + nonadmin; }               }        } }

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"); } }

addOnloadHook(autoafd_add_afd_tabs);

//end AfD closing script

//