User:Kingoomieiii/monobook.js

//Stolen from Animum

//--------------------------------

// Stuff for everyone

//---------------------------------

///////////////////////////////////////////////

///////////////////////////////////////////////

//unwatch

importScript('User:Alex Smotrov/wlunwatch.js');

///////////////////////////////////////////////

///////////////////////////////////////////////

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

//importScript('User:Animum/liveclock.js');

// Disabling broken scripts:

//importScript('User:Animum/twinklespeedy.js'); //Same as AzaToth's real version, but with modified summaries.

//importScript('User:AzaToth/morebits.js');

importScript('Wikipedia:WikiProject User scripts/Scripts/Watchlist since');

///////////////////////////////////////////////

///////////////////////////////////////////////

//Status

addOnloadHook(function () { //Status changer by Misza13

var subpage = "/Status";

var subpagelink = mw.config.get('wgServer') + "/wiki/User:" + mw.config.get('wgUserName') + subpage;

var logout = document.getElementById( 'pt-logout' );

//Add the links

mw.util.addPortletLink("p-personal", subpagelink + "?action=edit&newstatus=online", "╣╣In", "pt-status-in", "I'm in!", "", logout);

mw.util.addPortletLink("p-personal", subpagelink + "?action=edit&newstatus=around", "Around", "pt-status-in", "I'm around!", "", logout);

mw.util.addPortletLink("p-personal", subpagelink + "?action=edit&newstatus=busy", "Busy", "pt-status-busy", "I'm busy!", "", logout);

mw.util.addPortletLink("p-personal", subpagelink + "?action=edit&newstatus=offline", "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 = "\{\{Template:Statustop|"+status+"|offset=40|offsettop=1\}\}";

document.getElementById('wpSummary').value = "Status: "+status;

document.getElementById('wpMinoredit').checked = 'checked';

//Submit it!

document.getElementById('editform').submit();

});

///////////////////////////////////////////////

///////////////////////////////////////////////

//Popups Config

popupHideDelay=0.1;

popupDelay=0.2;

popupAdminLinks=false;

popupsFixDabs=true;

popupRedlinkRemoval=true;

popupStructure='menus';

///////////////////////////////////////////////

///////////////////////////////////////////////

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

importScript('User:Tra/sidebartranslate.js');

importScript('User:Voice of All/Addtabs/monobook.js');

importScript('Wikipedia:WikiProject User scripts/Scripts/Add LI menu');

importScript('Wikipedia:WikiProject User scripts/Scripts/Add tab');

importScript('Wikipedia:WikiProject User scripts/Scripts/Add toolbox link');

///////////////////////////////////////////////

///////////////////////////////////////////////

//wikiEd config

var wikEdFrameCSS = {};

wikEdFrameCSS['.wikEdFrameBodyPlain'] = 'background: #FFFFFF; margin: 0px; padding: 0.2em; overflow: -moz-scrollbars-vertical; overflow-x: auto; font-family: sans-serif;';

wikEdFrameCSS['.wikEdFrameBodySyntax'] = 'background: #FFFFFF; margin: 0px; padding: 0.2em; overflow: -moz-scrollbars-vertical; overflow-x: auto; font-family: sans-serif;';

///////////////////////////////////////////////

// install User:Cacycle/wikEd in-browser text editor

mw.loader.load('https://en.wikipedia.org/w/index.php?title=User:Cacycle/wikEd.js'

+ '&action=raw&ctype=text/javascript');

///////////////////////////////////////////////

///////////////////////////////////////////////

$(function() {

if( mw.config.get('wgCanonicalNamespace') == "Template" && document.getElementById("doc_editlinks") ) {

var editsection = document.getElementById("doc_editlinks");

editsection.innerHTML = '[view]' + " " + '[edit]';

}

});

var subpagename = mw.config.get('wgPageName').split( '/' )[1];

$(function() {

addToolboxLink('http://en.wikipedia.org/w/index.php?title=' + mw.config.get('wgPageName') + '&action=purge', "Purge this page", , , '', "Purge the cache for this page.");

if(mw.config.get('wgNamespaceNumber') != 0 && !subpagename) {

addToolboxLink(mw.config.get('wgServer') + mw.config.get('wgScript') + "?title=Special:Prefixindex/" + mw.config.get('wgPageName') + "/", "Subpages", , , '', 'View the subpages of this page'); }

if((mw.config.get('wgNamespaceNumber') == "3" || mw.config.get('wgNamespaceNumber') == "2") && !subpagename) {

addToolboxLink("http://en.wikipedia.org/w/index.php?title=Special:DeletedContributions&target=" + mw.config.get('wgTitle'), 'Deleted Contributions', , , ''); }

var tb = document.getElementById('p-tb').getElementsByTagName('ul')[0];

addlilink(tb, '/wiki/Special:Newpages', 'New pages', 'newpages-ln');

addlilink(tb, '/wiki/Wikipedia:Usernames_for_administrator_attention', 'Usernames', 'uaa-ln');

addlilink(tb, '/wiki/Wikipedia:List_of_protected pages', 'Protected pages', 'pp-ln');

addlilink(tb, '/wiki/Wikipedia:Administrator_intervention_against_vandalism','Vandalism','aiv-ln');

addlilink(tb, '/wiki/Category:Candidates_for_speedy_deletion','Speedy deletions','speedy-ln');

addlilink(tb, '/wiki/Wikipedia:Requests for page protection','Protection requests','rfpp-ln');

addlilink(tb, '/wiki/Wikipedia:Administrators%27_noticeboard','Noticeboard','AN-ln');

});

function PortletMenu( id ) // Taken from User:KnowledgeOfSelf/monobook.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 ) {

try { this[ id ].getElementsByTagName( 'a' )[ 0 ].firstChild.data = txt }

catch (e) {}

}

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');

if(document.getElementById('ca-edit')) document.getElementById('ca-edit').firstChild.innerHTML = 'edit';

if(document.getElementById('ca-talk')) document.getElementById('ca-talk').firstChild.innerHTML = 'talk';

});

///////////////////////////////////////////////

///////////////////////////////////////////////

//Twinkle and Friendly

importScript('User:Ioeth/friendly.js');

importScript('User:AzaToth/twinkle.js');

///////////////////////////////////////////////

///////////////////////////////////////////////

//AFD helper

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

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

importScript('User:M/reword.js')

///////////////////////////////////////////////

///////////////////////////////////////////////

//Google search

document.write('