User:Nx/monobook.js
The UESPWiki – Your source for The Elder Scrolls since 1995
< User:Nx
Note: After saving, you may have to bypass your browser's cache to see the changes.
- Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
- Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
- Internet Explorer: Hold Ctrl while clicking Refresh, or press Ctrl-F5
- Opera: Go to Menu → Settings (Opera → Preferences on a Mac) and then to Privacy & security → Clear browsing data → Cached images and files.
//<pre>
importScript('UESPWiki:Javascript/subpages.js');
importScript('UESPWiki:Javascript/addpurge.js');
importScript('UESPWiki:Javascript/comments in local time.js');
importScript('User:Nx/navpopup.js');
importStylesheet('User:Nx/navpopup.css');
/*workaround for IE6 which doesn't support :hover on any element*/
var REG_MSIE = /msie (5|6)/i;
var REG_COMPAT = /backcompat/i;
function iehover_hide(container) {
var hovertargets = getElementsByClassName(container,"*","hover_target");
for (var j = 0; j< hovertargets.length; j++) {
target = hovertargets[j];
target.style.display="none";
}
}
function iehover_display(container) {
var hovertargets = getElementsByClassName(container,"*","hover_target");
for (var j = 0; j< hovertargets.length; j++) {
target = hovertargets[j];
if (hasClass(target,"inline")) {
target.style.display="inline";
} else {
target.style.display="block";
}
}
}
function iehover() {
if(!REG_MSIE.test(navigator.userAgent) && !REG_COMPAT.test(window.document.compatMode)) {
return;
}
var hovercontainers = getElementsByClassName(document.getElementById("bodyContent"),"*","hover_collapse");
for (var i = 0; i<hovercontainers.length; i++) {
container = hovercontainers[i];
container.attachEvent('onmouseenter',function(e) {iehover_display(e.srcElement);});
container.attachEvent('onmouseleave',function(e) {iehover_hide(e.srcElement);});
iehover_hide(container);
}
}
addOnloadHook(iehover);
var button = {
"imageFile": "images/images.new/f/fb/MW-Icon-scroll_open_01.png", // image to be shown on the button (may be a full URL too), 22x22 pixels
"speedTip": "Welcome", // text shown in a tooltip when hovering the mouse over the button
"tagOpen": "{{subst" + ":Project:Messages/Welcome}}", // the text to use to mark the beginning of the block
"tagClose": "", // the text to use to mark the end of the block (if any)
"sampleText": "" // the sample text to place inside the block
};
mwCustomEditButtons.push(button);
//</pre>