User:Thedjatclubrock/animum.js

//animum's importScript('User:Animum/reset.js'); importScript('User:Animum/editsection.js'); importScript('User:Animum/liveclock.js'); importScript('User:AzaToth/morebits.js'); importScript('Wikipedia:WikiProject User scripts/Scripts/MotD closure script'); importStylesheet('Wikipedia:WikiProject User scripts/Scripts/Add LI menu/css'); importScript('User:Animum/count.js'); importScript('Wikipedia:WikiProject User scripts/Scripts/Fix lowercase first letter problem'); importScript('User:Voice_of_All/Adminwarnings/monobook.js'); importScript('User:Voice of All/Addtabs/monobook.js'); importScript('User:Animum/derhexer.js'); addOnloadHook(function { if(wgAction=="edit") { document.forms["editform"].wpWatchthis.checked = false; } }); //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_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) {     addPortletLink('p-cactions', 'javascript:autoafd_result', "close"); addPortletLink('p-cactions', 'javascript:autoafd_relist', "relist"); } } addOnloadHook(autoafd_add_afd_tabs); //end AfD closing script function addLink(where, url, name, id, title, key, after) { // addLink accepts either an id or a DOM node, addPortletLink only takes a node if (after && !after.cloneNode) after = document.getElementById(after); return addPortletLink(where, url, name, id, title, key, after); } //Interiot's javascript edit counter if (document.title.indexOf('User:Interiot/Tool2/code.js') != -1) { mw.loader.load('https://en.wikipedia.org/w/index.php?title=User:Interiot/Tool2/code.js&action=raw&ctype=text/javascript'); }

importScript('Wikipedia:WikiProject User scripts/Scripts/warn.js'); importScript('Wikipedia:WikiProject User scripts/Scripts/Add toolbox link'); importScript('Wikipedia:WikiProject User scripts/Scripts/Add tab'); // // STATUS CHANGER addOnloadHook(function { var subpage = "/Status";  var scheme = "/StatusTemplate";  var subpagelink = wgServer + "/wiki/User:" + wgUserName + subpage;  var logout = document.getElementById( 'pt-logout' );  //Add the links  addPortletLink("p-personal", subpagelink + "?action=edit&newstatus=in", "in", "pt-status-in", "I'm in!", "", logout);  addPortletLink("p-personal", subpagelink + "?action=edit&newstatus=busy", "busy", "pt-status-busy", "I'm busy!", "", logout);  addPortletLink("p-personal", subpagelink + "?action=edit&newstatus=out", "out", "pt-status-out", "I'm out!", "", logout);  if (location.href.indexOf("?action=edit&newstatus=") == -1) return; //Are we here to auto-edit the status?  //Get new status  var statusRegExp = /\?action=edit&newstatus=(.*)/;  var status = statusRegExp.exec(location.href)[1];  //Modify the form  document.getElementById('wpTextbox1').value = "{{User:"+wgUserName+scheme+"|"+status+"}}"; document.getElementById('wpSummary').value = "Status: "+status; document.getElementById('wpMinoredit').checked = 'checked'; //Submit it! document.getElementById('editform').submit; }); function makeDocLink { if( wgCanonicalNamespace == "Template" && document.getElementById("doc_editlinks") ) {    var editsection = document.getElementById("doc_editlinks");    editsection.innerHTML = '[view]' + " " + '[edit]';  } } addOnloadHook(makeDocLink); function addPurgeLinkToToolbox {    addToolboxLink('http://en.wikipedia.org/w/index.php?title=' + wgPageName + '&action=purge', "Purge this page", , , '', "Purge the cache for this page."); } addOnloadHook(addPurgeLinkToToolbox); function tagArticle {    var template = prompt("What tag to place?");    document.editform.wpTextbox1.value = "\{\{" + template + "\}\}\n" + document.editform.wpTextbox1.value; document.editform.wpSummary.value = "\+\{\{" + template.toLowerCase + "\}\}"; document.editform.wpMinoredit.checked = true; document.editform.wpSave.click; } function addTagLink { if( (wgNamespaceNumber != -1) && wgAction == "edit") { addToolboxLink('javascript:tagArticle', "Tag page", , , '', "Tag this page with a template"); } } addOnloadHook(addTagLink); function addSubpageLink { var subpagename = wgPageName.split( '/' )[1]; if( wgNamespaceNumber != 0 && !subpagename ) { addToolboxLink(mw.config.get('wgServer') + mw.config.get('wgScript') + "?title=Special:Prefixindex/" + wgPageName + "/", "Subpages", , , '', 'View the subpages of this page'); } } addOnloadHook(addSubpageLink); function addRightsLink { var subpagename = wgPageName.split( '/' )[1]; if( ( wgNamespaceNumber == "3" || wgNamespaceNumber == "2" ) && !subpagename ) { addToolboxLink("http://en.wikipedia.org/w/index.php?title=Special%3AListusers&username=" + wgTitle + "&group=&limit=1", "User\'s rights", , , "View the access roles to which this user has access"); } } addOnloadHook(addRightsLink);

importScript('User:Ais523/votesymbols.js');

function PortletMenu( id ) // Taken from User:KnowledgeOfSelf/monobook-normal.js { this.menu = document.getElementById( id ); this.list = this.menu.getElementsByTagName( 'ul' )[ 0 ]; // bypass " Views ", etc. var LIs = this.list.getElementsByTagName( 'li' ); for ( var i = 0; i < LIs.length; i++ ) { this[ LIs[ i ].id ] = LIs[ i ]; } this.newItem = function( id, txt, url ) { var li = document.createElement( 'li' ); li.id  = id; var a = document.createElement( 'a'  );  a.href = url; a.appendChild( document.createTextNode( txt ) ); li.appendChild( a ); this[ id ] = li; // watch this!!! return li; } this.append = function( id, txt, url ) { this.list.appendChild( this.newItem( id, txt, url ) ); } this.insertBefore = function( old, id, txt, url ) { this.list.insertBefore( this.newItem( id, txt, url ), this[ old ] ); } this.getText = function( id     ) { return this[ id ].getElementsByTagName( 'a' )[ 0 ].firstChild.data } this.setText = function( id, txt ) {       this[ id ].getElementsByTagName( 'a' )[ 0 ].firstChild.data = txt } this.getHref = function( id     ) { return this[ id ].getElementsByTagName( 'a' )[ 0 ].href       } this.setHref = function( id, url ) {       this[ id ].getElementsByTagName( 'a' )[ 0 ].href = url } }

addOnloadHook(function { usermenu = new PortletMenu('p-personal');    document.getElementById('p-personal').getElementsByTagName('ul')[0].style.textTransform = 'none';    usermenu.setText('pt-mytalk', 'talk');    usermenu.setText('pt-preferences', 'preferences');    usermenu.setText('pt-watchlist', 'watchlist');    usermenu.setText('pt-mycontris', 'contribs');    usermenu.setText('pt-logout', 'logout'); });