User:M C Y 1008/monobook.js

// /* */ $(addnav) function addnav { var tb = document.getElementById('p-navigation').getElementsByTagName('ul')[0]; addlilink(tb, '/wiki/Special:Newpages', 'New pages', 'n-newpage', 'New pages', ''); addlilink(tb, '/wiki/User:M_C_Y_1008/monobook.js', 'U-monobook.js', 'n-monobook', 'User monobook.js', ''); addlilink(tb, '/wiki/User:M_C_Y_1008/Sandbox', 'U-sandbox', 'n-sandbox', 'User sandbox', ''); addlilink(tb, '/wiki/User:M_C_Y_1008/Test', 'U-test', 'n-test', 'User test', ''); addlilink(tb, '/wiki/User:M_C_Y_1008/Template', 'U-template', 'n-template', 'User template', ''); addlilink(tb, '/wiki/User:M_C_Y_1008/Things to do', 'U-things to do', 'n-things', 'Things to do', ''); }

function addlilink(tabs, url, name, id, title, key){ var na = document.createElement('a'); na.href = url; na.appendChild(document.createTextNode(name)); var li = document.createElement('li'); if(id) li.id = id; li.appendChild(na); tabs.appendChild(li); if(id) {       if(key && title) {           ta[id] = [key, title]; }       else if(key) {           ta[id] = [key, '']; }       else if(title) {           ta[id] = ['', title]; }   }    // re-render the title and accesskeys from existing code in wikibits.js    akeytt; return li; }

// /* */ // User:Lupin/popups.js

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

popupFixDabs=true;

// /* Wikipedia:WikiProject User scripts/Scripts/Edit Top */ // This will add an [edit] link at the top of all pages except preview pages and the main page // by User:Pile0nades

// Add an [edit] link to pages $(function {  // if this is preview page or generated page, stop  if( document.getElementById("wikiPreview") || document.getElementById("histlegend‎") || document.getElementById("difference‎") || document.getElementById("watchdetails") || document.getElementById("ca-viewsource") || window.location.href.indexOf("/wiki/Special:") != -1 ) {   if(window.location.href.indexOf("&action=edit&section=0") != -1) {      document.getElementById("wpSummary").value = "/* Intro */ ";    }    return;  };

// get the page title var pageTitle = wgPageName;

// create div and set innerHTML to link var divContainer = document.createElement("div"); divContainer.innerHTML = ' [edit intro] ';

// insert divContainer into the DOM below the h1 if(window.location.href.indexOf("&action=edit") == -1) { document.getElementById("content").insertBefore(divContainer, document.getElementsByTagName("h1")[0]); }

});

// /* Wikipedia:WikiProject User scripts/Scripts/Add purge to tabs */ // addPurge $(function {    var hist; var url;    if (!(hist = document.getElementById('ca-history') )) return;    if (!(url = hist.getElementsByTagName('a')[0] )) return;    if (!(url = url.href )) return;    mw.util.addPortletLink('p-cactions', url.replace(/([?&]action=)history([&#]|$)/, '$1purge$2'), 'purge', 'ca-purge', 'Purge server cache for this page', '0'); });

// // addLogs $(function {    var hist; var url;    if (!(hist = document.getElementById('ca-history') )) return;    if (!(url = hist.getElementsByTagName('a')[0] )) return;    if (!(url = url.href )) return;    mw.util.addPortletLink('p-cactions', url.replace(/([?&]title)(=|$)/, '$1=Special:Log&page$2'), 'logs', 'ca-logs', 'View logs for this page', '1'); });

// /* Wikipedia:WikiProject User scripts/Scripts/User tabs */ // Please leave the following line // user:Where/usertabs $(function { if (wgTitle.indexOf("/") != -1 || document.title.indexOf("- History -") != -1)  //no subpages or history     return;  if (wgCanonicalNamespace == "User" || wgCanonicalNamespace == "User_talk") {     var username = encodeURIComponent( wgTitle );     mw.util.addPortletLink("p-cactions", wgServer + "/wiki/Special:Contributions/" + username, "Contribs", "ca-contrib", "User contributions");     mw.util.addPortletLink("p-cactions", "http://tools.wikimedia.de/~interiot/cgi-bin/Tool1/wannabe_kate?username=" + username + "&site=en.wikipedia.org", "Edit count", "ca-editcount", "Edit count from Interiot's Tool1");     mw.util.addPortletLink("p-cactions", wgServer + "/w/index.php?title=Special:Log&type=move&user=" + username, "Moves", "ca-pagemoves", "Page moves by this user");     mw.util.addPortletLink("p-cactions", wgServer + "/w/index.php?title=Special:Log&type=block&page=User:" + username, "Blocks rec'd", "ca-blog", "Blocks received by this user"); mw.util.addPortletLink("p-cactions", wgServer + "/w/index.php?title=Special:Prefixindex&from=" + username + "&namespace=2", "Userspace", "", "List of pages in this user's userspace"); mw.util.addPortletLink("p-cactions", wgServer + "/w/index.php?title=Special:Log&type=block&user=" + username, "Blocks given", "", "Blocks by this user"); mw.util.addPortletLink("p-cactions", wgServer + "/w/index.php?title=Special:Log&type=protect&user=" + username, "Protects", "", "Protections by this user"); mw.util.addPortletLink("p-cactions", wgServer + "/w/index.php?title=Special:Log&type=delete&user=" + username, "Dels", "", "Deletions by this user"); } });