User:Harryboyles/monobook.js
From Wikipedia, the free encyclopedia
If a message on your talk page led you here, please be wary of who left it. The code below could contain malicious content capable of compromising your account; if your account appears to be compromised, it will be blocked. If you are unsure whether the code is safe, you can ask at the appropriate village pump.
Note: After saving, you have to bypass your browser's cache to see the changes. In Internet Explorer and Firefox, hold down the Ctrl key and click the Refresh or Reload button. Opera users have to clear their caches through Tools→Preferences, see the instructions for Opera. Konqueror and Safari users can just click the Reload button.
//External scripts //---------------- //Floating sidebar - test //Navigation popups importScript('User:Lupin/popups.js'); //Adjusts Special:Log to present information in a easy to read table importScript('User:Alex_Smotrov/logpage.js'); //Enhances Special:Whatlinkshere with more options for filtering the list importScript('User:Barticus88/WhatLinksHere.js'); //Adds a tab to edit the 0'th section of the page importScript('Wikipedia:WikiProject User scripts/Scripts/Add edit section 0'); //Adds a "Changes since last load" link to your watchlist importScript('Wikipedia:WikiProject_User_scripts/Scripts/Watchlist_since'); //Adds a tab which shows the diff since the current user last edited the page importScript('Wikipedia:WikiProject User scripts/Scripts/Changes since I last edited'); //Adds AJAX unwatch links (x) to each entry in the watchlist. importScript('User:Alex Smotrov/wlunwatch.js'); //Adds a tab to hide the "top" diffs on Special:Contributions importScript('User:Ais523/hidetopcontrib.js'); //Edit suggestion improvement importScript('User:Cameltrader/Advisor.js'); //Dispenser's Link checker importScript('User:Dispenser/Link checker/toolbox.js'); //Dr pda's category template script importScript('User:Dr pda/templatecheck.js'); //Dr pda's edit references script importScript('User:Dr pda/editrefs.js'); //Dr pda's article history script importScript('User:Dr pda/articlehistory.js'); //Articles for creation improvement if(wgPageName.split("/")[0] == "Wikipedia:Articles_for_creation") { // [[User:Henrik/afc-helper]] importScript('User:Henrik/js/afc-helper.js'); } //Alters the history tab (see User talk:Alex Smotrov/histcomb.js for description if(wgAction == 'history') { histCombNoCollapse=true; importScript('User:Alex Smotrov/histcomb.js'); } //Navigation popups configuration popupDelay=0.75; popupHideDelay=0.25; popupOnEditSelection=false;// Popups will not appear in the edit box popupSubpopups=false;// Popups won't appear when pointing at a link in a popup popupFixDabs=true; popupContribsPreviewLimit=10;// Adjusts the number of contributions shown for a user //Changes since I last edited configuration defaultdiffs = 1000; //Internal scripts //------------------- //Trims "Wikipedia, the free encyclopedia" from the title of the page TrimTitle(); function TrimTitle(){ var pagetitle= document.title; var endtext = 35; document.title = String(pagetitle).substring(0,pagetitle.length - endtext); } //Adds a list of empty categories in an article to the top of the page addOnloadHook(function DupCats(){ if(document.getElementById('catlinks')&&wgNamespaceNumber==0) { var newcatlinks = document.getElementById('catlinks').cloneNode(true); newcatlinks.id = 'emptycats'; var newlinkscount = 0; var listitems = newcatlinks.firstChild.getElementsByTagName('a'); for (i=0;i<listitems.length;i++) { if(listitems[i].className != 'new') { listitems[i].parentNode.removeChild(listitems[i]); i--; } else { newlinkscount++; } } listitems = newcatlinks.firstChild.getElementsByTagName('a'); if(newlinkscount > 0) { sitebyline = document.getElementById("siteSub"); sitebyline.parentNode.insertBefore(newcatlinks, sitebyline.nextSibling); } } }); //Replace edit summary info link with plain text and minor edit link addOnloadHook(function RemoveEditSummaryLink(){ if(linkElementBox = document.getElementById('wpSummaryLabel')) { var linkElementSpan = linkElementBox.firstChild.firstChild; var newText = document.createTextNode('Edit summary '); linkElementSpan.removeChild(linkElementSpan.firstChild); linkElementSpan.insertBefore(newText,linkElementSpan.firstChild); } if(linkMinorEdit = document.getElementById('minoredit_helplink')) { linkMinorEdit.parentNode.removeChild(linkMinorEdit); } }) //Various links for information about users in the toolbox on the left hand side if (wgCanonicalNamespace == "User" || wgCanonicalNamespace == "User_talk") addOnloadHook(AddUserInformationLinks); function AddUserInformationLinks(){ var UserName = wgTitle.split(":")[0]; UserName = UserName.split("/")[0]; //Actions performed by user: deletions, protections, etc) url = wgServer + wgScript + "?title=Special:Log&user=" + UserName; addPortletLink("p-tb", url, "Actions by user", "pt-byuserlogs", "Log of actions this user has performed"); //Actions performed on user (promotions, blocks, etc) url = wgServer + wgScript + "?title=Special:Log&page=User:" + UserName; addPortletLink("p-tb", url, "Actions on user", "pt-onuserlog", "Log of actions performed on this user as well as their main user page"); //List of blocks on this user url = wgServer + wgScript + "?title=Special:Log&type=block&user=&page=User:" + UserName; addPortletLink("p-tb", url, "Block log", "pt-blocklog", "Log of blocks applied to this user (if any)"); //Blocked currently? url = wgServer + wgScript + "?title=Special:Ipblocklist&ip=" + UserName; addPortletLink("p-tb", url, "Block status", "pt-blockstatus", "Whether this user or IP address is currently blocked"); //Admin or other permissions? url = wgServer + wgScript + "?title=Special:Listusers&limit=1&username=" + UserName; addPortletLink("p-tb", url, "User permissions", "pt-userrights", "Permissions (if any) granted to the user"); //List of deleted contributions url = wgServer + wgScript + "?title=Special:DeletedContributions&target=" + UserName; addPortletLink("p-tb", url, "Deleted contribs", "pt-deletedcontribs", "List of contributions that have subsequently been deleted"); //Subpages url = wgServer + wgScript +"?title=Special:Prefixindex&namespace=" + wgNamespaceNumber + "&from=" + UserName; addPortletLink("p-tb", url, "Subpages of user", "pt-subpages", "A list of all the subpages existing in a user's userspace"); } //Adds a link to purge the page in the "personal" section (top right of the page). addOnloadHook(function () { addPortletLink('p-personal', wgServer + wgScript + '?title=' + wgPageName + '&action=purge', 'purge', 'ca-purge', 'Purge server cache for this page', '0','pt-logout'); }); //A clock that sits in the top right hand corner (with a purge link included). addOnloadHook(function(){ addPortletLink("p-personal", wgServer + wgScript + '?title=' + wgPageName.replace(/&/g,'%26') + '&action=purge', 'UTC time', 'utcdate'); showtime(); }); function showtime(){ var time = new Date(); var date = time.getUTCDate(); var months = 'January February March April May June July August September October November December'.split(' '); month = months[time.getUTCMonth()]; var year = time.getUTCFullYear(); var hours = '0' + time.getUTCHours(); hours = hours.substr(hours.length-2, hours.length); var minutes = '0' + time.getUTCMinutes(); minutes = minutes.substr(minutes.length-2, minutes.length); var seconds = '0' + time.getUTCSeconds(); seconds = seconds.substr(seconds.length-2, seconds.length); var timeValue = hours + ":" + minutes + ":" + seconds + ", " + date + " " + month + " " + year + " (UTC)"; if (document.getElementById('utcdate')){ document.getElementById('utcdate').firstChild.innerHTML = timeValue; } timerID = setTimeout('showtime()', 1000); } //Adds a tab to view the source wikicode of the page addOnloadHook(function () { if (location.href.indexOf('viewsource=1') != -1) { sl = document.getElementById('wpSummaryLabel'); sl.parentNode.removeChild(sl); ed = document.getElementById('wpSummary').parentNode; ed.parentNode.removeChild(ed); return; } editbutton = document.getElementById('ca-edit'); if (editbutton && location.href.indexOf('action=edit')==-1) { editlink = editbutton.getElementsByTagName('a')[0].href + '&viewsource=1'; tabs = document.getElementById('p-cactions').getElementsByTagName('ul')[0]; na = document.createElement('a'); na.href = editlink; na.appendChild(document.createTextNode('source')); li = document.createElement('li'); li.id = 'ca-viewsource'; li.appendChild(na); tabs.insertBefore(li,editbutton); } }); //Renames the new section link on talk pages addOnloadHook(function () { if(document.getElementById('ca-addsection')) { q=document.getElementById('ca-addsection').firstChild; q.removeChild(q.firstChild); q.appendChild(document.createTextNode("+")); } }); //Renames the talk tab addOnloadHook(function () { if(document.getElementById('ca-talk')) { q=document.getElementById('ca-talk').firstChild; q.removeChild(q.firstChild); q.appendChild(document.createTextNode("talk")); } }); //Adds a tab which links to the last change made on a page addOnloadHook(function () { if(wgCanonicalNamespace != "Special") { addPortletLink('p-cactions', wgServer + wgScript + '?title=' + wgPageName + "&diff=cur&oldid=prev", 'last', 'ca-last', 'Show most recent diff'); } }); //Adds a tab which links to the log for the page addOnloadHook(function () { if(wgCanonicalNamespace != "Special") { url = wgServer + wgScript + "?title=Special:Log&page=" + wgPageName; addPortletLink("p-cactions", url, "page log", "ca-pagelog", "Log of actions performed on this page"); } });

