User:Cacycle test/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 test/monobook.css. |
/* <pre></nowiki> */
importScript("User:Lupin/recent2.js");
/*
// define custom buttons (id, class, popup title, image src, width, height, alt text, onClick and parameters)
var wikEdButton = [];
wikEdButton[100] = ['wikEdDiv', 'wikEdButton', 'Make the selection a html DIV element', '/media/wikipedia/commons/6/67/WikEd_logo.png', '16', '16', 'DIV', 'javascript:WikEdEditButton(this, this.id, null, TestHandler);' ];
wikEdButton[101] = ['wikEdTest', 'wikEdButton', 'This is a test button', '/media/wikipedia/commons/0/07/WikEd_disabled.png', '16', '16', 'Test', 'javascript:WikEdEditButton(this, this.id, null, TestHandler);' ];
// define custom button bars (id outer, class outer, id inner, class inner, height, grip title, button numbers)
var wikEdButtonBar = [];
wikEdButtonBar['custom1'] = ['wikEdButtonBarCustom1', 'wikEdButtonBarCustom1', 'wikEdButtonsCustom1', 'wikEdButtonsCustom1', 44, 'My custom buttons', [ 100, 'br', 101] ];
wikEdButtonBar['custom2'] = ['wikEdButtonBarCustom2', 'wikEdButtonBarCustom2', 'wikEdButtonsCustom2', 'wikEdButtonsCustom2', 44, 'My custom buttons', [ 100, 'br', 101] ];
// define the function which is called upon clicking the custom button
function TestHandler(obj) {
window.location.reload(true);
return;
}
*/
var wikEdDiffPreset = true;
var wikEdShowSourceButton = true;
// installation of the wikEd editing page extension
//wikEdLoadRegExTypoFix = true;
// install [[User:Cacycle/wikEd international]] English example translation
document.write('<script type="text/javascript" src="'
+ 'http://en.wikipedia.org/w/index.php?title=User:Cacycle/wikEd_international_en.js'
+ '&action=raw&ctype=text/javascript&dontcountme=s"></script>');
// install [[User:Cacycle/wikEdDiff]]
document.write('<script type="text/javascript" src="'
+ 'http://en.wikipedia.org/w/index.php?title=User:Cacycle/wikEdDiff.js'
+ '&action=raw&ctype=text/javascript&dontcountme=s"></script>');
// install [[User:Cacycle/wikEd]] editing page extension
document.write('<script type="text/javascript" src="'
+ 'http://en.wikipedia.org/w/index.php?title=User:Cacycle/wikEd.js'
+ '&action=raw&ctype=text/javascript&dontcountme=s"></script>');
// 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 each tool after loading the page
window.onload = function Main() {
// addLink('p-personal', '/wiki/User:Cacycle/monobook.css', 'monobook.css', 'pt-monobookcss', 'monobook.css', '', '');
addLink('p-personal', '/wiki/User:Cacycle/monobook.js', 'monobook.js', 'pt-monobookjs', 'monobook.js', '', '');
addLink('p-personal', '/wiki/User:Cacycle/wikEd', 'wikEd', 'pt-monobookjs', ' ', '', '');
addLink('p-personal', '/wiki/User_talk:Cacycle/wikEd', 'wikEd talk', 'pt-monobookjs', ' ', '', '');
addLink('p-personal', '/wiki/User:Cacycle/wikEd_help', 'wikEd help', 'pt-monobookjs', ' ', '', '');
addLink('p-personal', '/wiki/User:Cacycle/wikEd.js', 'wikEd.js', 'pt-monobookjs', ' ', '', '');
addLink('p-personal', '/wiki/User:Cacycle/wikEd_development', 'wikEd dev', 'pt-monobookjs', ' ', '', '');
addLink('p-personal', '/wiki/User_talk:Cacycle/wikEd_development', 'wikEd dev talk', 'pt-monobookjs', ' ', '', '');
addLink('p-personal', '/wiki/User:Cacycle/wikEd_dev.js', 'wikEd_dev.js', 'pt-monobookjs', ' ', '', '');
if (document.getElementById('ca-edit')) {
document.getElementById('ca-edit').firstChild.innerHTML = 'edit';
}
}
// Live Preview [[User:Pilaf/livepreview.js]]
wpUserName = 'Cacycle'; // User name to display in signatures
wpShowImages = true; // Enable downloading and displaying of images
// [[User:Lupin]]'s crazy navigation popups [[User:Lupin/popups.js]]
// (http://en.wikipedia.org/wiki/Wikipedia:Tools#Navigation_popups)
popupDelay = 0;
popupHideDelay = 0.2;
popupAdminLinks = true;
popupFixRedirs = true;
popupFixDabs = true;
popupStructure = 'original'
imagePopupsForImages=false;
popupModifier='ctrl' ;
winc('User:Lupin/popupsdev.js');
/*
// Wikipedia:WikiProject_User scripts/Scripts/Twinkle (WP:TW)
importScript('User:AzaToth/morebits.js');
importScript('User:AzaToth/twinklefluff.js');
importScript('Wikipedia:WikiProject User scripts/Scripts/Add LI menu');
importStylesheet('Wikipedia:WikiProject User scripts/Scripts/Add LI menu/css');
importScript('User:AzaToth/twinklewarn.js');
importScript('User:AzaToth/twinklearv.js');
importScript('User:AzaToth/twinklespeedy.js');
importScript('User:AzaToth/twinklediff.js');
importScript('User:AzaToth/twinkleprotect.js');
importScript('User:AzaToth/salt.js');
*/
//Begin Unwatch function
addOnloadHook(function () {
var query_prefix = "title=Special:Watchlist&action=submit&remove=1&id[]=";
//var query_prefix = "action=unwatch&title=";
if (window.location.href.indexOf("Special:Watchlist") == -1) return;
var links = document.getElementById('content').getElementsByTagName('a');
for (var i = 0; i < links.length; i++) {
if (links[i].href.substring(links[i].href.length-15) != '&action=history')
continue;
var unwatch = document.createElement('a');
unwatch.href = "/w/index.php?" + query_prefix + encodeURIComponent(links[i].title);
unwatch.title = "Unwatch "+links[i].title;
unwatch.appendChild(document.createTextNode("unwatch"));
links[i].parentNode.insertBefore(unwatch, links[i].nextSibling);
// kluge to handle case where "diff" is unlinked:
var delim = links[i].previousSibling;
delim = (delim.nodeType == 3 ? delim.nodeValue : "");
links[i].parentNode.insertBefore(document.createTextNode(delim.replace(/^.*diff/, "")), unwatch);
}
});
// End Unwatch function
// 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> */