User:Rwarning/monobook.js
Appearance
Code that you insert on this page could contain malicious content capable of compromising your account. If you import a script from another page with "importScript", "mw.loader.load", "iusc", or "lusc", take note that this causes you to dynamically load a remote script, which could be changed by others. Editors are responsible for all edits and actions they perform, including by scripts. User scripts are not centrally supported and may malfunction or become inoperable due to software changes. A guide to help you find broken scripts is available. If you are unsure whether code you are adding to this page is safe, you can ask at the appropriate village pump. This code will be executed when previewing this page. |
The accompanying .css page for this skin is at User:Rwarning/monobook.css. |
/* This function is used to include scripts from other Wikipedia pages in mine. I got it from [[User:Quarl/monobook.js]]. */
/* importScript does the same thing, but is not imported onto other wikis yet, so functions included with it cannot be synchronized */
/* winc also accepts [[text inside brackets]], which I used to turn into links */
function winc(s) {
s = s.replace(/^\[\[/, '').replace(/\]\]$/, '');
document.write('<scr' + 'ipt type="text/javascript" src="'
+ 'http://en.wikipedia.org/w/index.php?title=' + s
+ '&action=raw&ctype=text/javascript"></scr'
+ 'ipt>');
}
/* Included functions */
/* winc('[[User:Omegatron/monobook.js/autolinker.js]]'); /* Make [[links]] and {templates} clickable on this page */
winc('user:js/watchlist.js') /* Can unwatch pages from the watchlist itself, other benefits */
winc('MediaWiki:WikiProject User scripts/Scripts/Compare link.js'); /* Change compare button into a link on History tab so that you can open in other browser tab */
var wikEdDisabledPreset = true; /* For wikEd editing page extension to default to off (installed as Gadget now) */
winc('User:Omegatron/monobook.js/floatingSidebar.js'); /* Make the sidebar stay in position while content scrolls */
winc('User:Omegatron/monobook.js/personalSidebar.js'); /* Move the personal links into the sidebar */
winc('User:Alex Smotrov/histcomb.js'); /* Collapse subsequent edits on history page, etc. */
/* winc('User:Zocky/LinkComplete.js'); /* Autocomplete links? */ // [[User:Zocky/LinkComplete.js]]
/* Functions that add some extra tabs with different functionalities. */
winc('[[User:Omegatron/monobook.js/replacetab.js]]'); // Regex replacements in the text (from [[User:Trilobite/Tools]])
winc('[[User:Omegatron/monobook.js/unverified.js]]'); // Tag unverified images (from [[User:Trilobite/Tools]])
winc('[[User:Omegatron/monobook.js/dashfixer.js]]'); // Converts -- into — and so on (User:Omegatron)
winc('[[User:Omegatron/monobook.js/unitformatter.js]]'); // Formats units according to SI (User:Omegatron)
winc('[[User:Omegatron/monobook.js/mathcharacterfixer.js]]'); // Fixes up some math characters (not TeX) (User:Omegatron)
winc('[[User:Omegatron/monobook.js/headingformattingfixer.js]]'); // Adds and removes whitespace to make formatting consistent and readable (User:Omegatron)
winc('[[User:Omegatron/monobook.js/reffixer.js]]'); // Fixes formatting of reference tags (User:Omegatron)
/* winc('[[User:Omegatron/monobook.js/addsincetab.js]]'); */
// Shows difference between my last edit and current version ([[Wikipedia:WikiProject User scripts/Scripts/Changes since I last edited]]) */
/* Do some things when the page loads */
$(function () {
/* Adds some links to my ''personal tools'' section ("My monobook.js", "My monobook.css", "My sandbox") */
mw.util.addPortletLink('p-personal', '/wiki/User:Omegatron/monobook.js', 'My monobook.js', 'pt-monobookjs', 'monobook.js is used for storing user javascripts', '', 'pt-logout');
mw.util.addPortletLink('p-personal', '/wiki/User:Omegatron/monobook.css', 'My monobook.css', 'pt-monobookcss', 'monobook.css is used for storing user CSS styles', '', 'pt-logout');
mw.util.addPortletLink('p-personal', '/wiki/User:Omegatron/Sandbox', 'My sandbox', 'pt-sandbox', 'My sandbox is used for testing things', '', 'pt-logout');
mw.util.addPortletLink('p-personal', '/w/index.php?title=Special%3AAllpages&from=Omegatron&namespace=2', 'My subpages', 'pt-subpages', 'Subpages of my userspace', '', 'pt-logout');
/* Shorten "edit this page" to just "edit" */
if(document.getElementById('ca-edit')) {
document.getElementById('ca-edit').firstChild.innerHTML = 'Edit';
}
});
/* Duplicate all the tabs from the top on the bottom of the content box, too. */
/* From [[Wikipedia:WikiProject User scripts/Scripts/Duplicate tabs at bottom]]. */
$(function () {
var tabs = document.getElementById('p-cactions').cloneNode(true);
tabs.id = 'mytabs';
var listitems = tabs.getElementsByTagName('LI');
for (i=0;i<listitems.length;i++) {
if(listitems[i].id) listitems[i].id = 'mytabs-' + listitems[i].id;
}
var content = document.getElementById("content"); // Find the content div
content.parentNode.insertBefore(tabs, content.nextSibling); // Place tab list right after content div
});
/* Experiments */
importScript('User:Omegatron/monobook.js/audiopops.js'); /* Popup audio help links experiment */
winc('User:Mr.Z-man/feedbacktab.js'); /* Experimental feedback tab */
winc('[[User:Nohat/IPA.js]]'); /* IPA pop-ups? */