User:Cacycle/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:Cacycle/monobook.css. |
/* <pre><nowiki> */
// Include a local JavaScript file (UTF-8):
// With Mozilla or Firefox, there is a security feature:
// 1. Enter "about:config" in the location bar.
// 2. Find the "security.checkloaduri" option and double-click on it
// 3. Set to "false"
// document.write('<script type="text/javascript" src="file:///C:/monobook.js"></script>');
// loads each tool after loading the page
window.onload = function Main() {
// SetupEditor();
// addLink('p-personal', '/wiki/User:Cacycle/monobook.css', 'My monobook.css', 'pt-monobookcss', 'monobook.css is used for storing user CSS styles', '', '');
addLink('p-personal', '/wiki/User:Cacycle/monobook.js', 'My monobook.js', 'pt-monobookjs', 'monobook.js is used for storing user javascripts', '', '');
addLink('p-personal', '/wiki/User:Cacycle/editor.js', 'editor.js', 'pt-monobookjs', '', '', '');
addLink('p-personal', '/wiki/User:Cacycle/editor_dev.js', 'editor_dev.js', 'pt-monobookjs', '', '', '');
if (document.getElementById('ca-edit')) {
document.getElementById('ca-edit').firstChild.innerHTML = 'edit';
}
// unwatchlinks();
}
// include scripts from other pages from [[User:Quarl/monobook.js]]
function winc(s) {
document.write('<script type="text/javascript" src="'
+ 'http://en.wikipedia.org/w/index.php?title=' + s
+ '&action=raw&ctype=text/javascript&dontcountme=s"></script>');
}
// loads the editor
// preset for combo box select options
presetOptions = [];
presetOptions['summary'] = [
'Copyedit',
'Linkfix',
'Reverting vandalism',
'Formatting source text',
'Capitalizing (link) lists as per [[Wikipedia:List]] and [[Wikipedia:Manual_of_Style]]',
'Improving source text examples as per [[Wikipedia_talk:Manual_of_Style/Archive_39#Improving_the_source_text | Wikipedia_talk:Manual_of_Style]]'
];
// Live Preview [[User:Pilaf/livepreview.js]]
wpUserName = 'Cacycle'; // User name to display in signatures
wpShowImages = true; // Enable downloading and displaying of images
// install [[User:Cacycle/diff]] text diff code
document.write('<script type="text/javascript" src="'
+ 'http://en.wikipedia.org/w/index.php?title=User:Cacycle/diff.js'
+ '&action=raw&ctype=text/javascript&dontcountme=s"></script>');
// install [[User:Pilaf/Live_Preview]] page preview tool
document.write('<script type="text/javascript" src="'
+ 'http://en.wikipedia.org/w/index.php?title=User:Pilaf/livepreview.js'
+ '&action=raw&ctype=text/javascript&dontcountme=s"></script>');
// install [[User:Cacycle/editor]] edit tool
document.write('<script type="text/javascript" src="'
+ 'http://en.wikipedia.org/w/index.php?title=User:Cacycle/editor.js'
+ '&action=raw&ctype=text/javascript&dontcountme=s"></script>');
// [[User:Lupin]]'s crazy navigation popups [[User:Lupin/popups.js]]
// (http://en.wikipedia.org/wiki/Wikipedia:Tools#Navigation_popups)
popupDelay = 0.5;
popupAdminLinks = true;
popupFixRedirs = true;
popupFixDabs = true;
popupStructure = 'original'
imagePopupsForImages=false;
winc('User:Lupin/popups.js');
// shows difference between my last edit and current version ([[Wikipedia:WikiProject User scripts/Scripts/Changes since I last edited]])
//winc('User:Cacycle/monobook.js/addsincetab.js');
// [[User:Quarl/watchlist.js]] adds an unwatch link after each entry on the regular watchlist. (Original by Omegatron, AJAX version by Quarl)
winc('User:Quarl/watchlist.js');
// a helper function to add extra navigation links, from [[User:Trilobite/Tools]] and [[Wikipedia:WikiProject User scripts/Scripts/Add LI link]]
// winc('User:Cacycle/monobook.js/addlink.js');
// from [[User:Omegatron/monobook.js/addlink.js]]
function addLink(where, url, name, id, title, key, after) {
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);
var tabs = document.getElementById(where).getElementsByTagName('ul')[0];
if (after) {
tabs.insertBefore(li,document.getElementById(after));
}
else {
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;
}
/* </nowiki></pre> */