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. |
//
window.leftEditLinkFontSize = 'large';
window.leftEditLinkSpacing = '10em';
// importScript("MediaWiki:Gadget-lefteditlinks.js");
addOnloadHook( function() {
// user customizable variables via monobook.js:
// font-size css definition for edit link span
if (typeof(leftEditLinkFontSize) == 'undefined') { var leftEditLinkFontSize = 'small'; }
// css definition for spacing after heading text span
if (typeof(leftEditLinkSpacing) == 'undefined') { var leftEditLinkSpacing = '0.2em'; }
// recursively fix all spans inside headings
var bodyContent = document.getElementById('bodyContent');
var LeftEditLink = function(level) {
// get all heading of this level
var headings = bodyContent.getElementsByTagName('h' + level);
for (var i = 0; i < headings.length; i ++) {
var heading = headings[i];
// get edit span
var editSpan = heading.firstChild;
if (editSpan == null) { continue }
if (editSpan.className != 'editsection') { continue }
// get blank
var blank = editSpan.nextSibling;
if (blank == null) { continue }
if (blank.nodeValue != ' ') { continue }
// get heading span
var headingSpan = blank.nextSibling;
if (headingSpan == null) { continue }
if (headingSpan.nodeName != 'SPAN') { continue }
// move blank after heading text
heading.appendChild(blank);
// move edit span after blank
heading.appendChild(editSpan);
// get rid of evil edit span floating
editSpan.style.styleFloat = 'none';
editSpan.style.cssFloat = 'none';
// set edit span font size
editSpan.style.fontSize = leftEditLinkFontSize;
// set heading span right margin
headingSpan.style.marginRight = leftEditLinkSpacing;
}
// recurse through heading levels
if (level < 6) {
LeftEditLink(level + 1);
}
return;
};
// call recursive function
LeftEditLink(1);
});
// importScript('User:Cacycle/recent2.js');
wikEdUseWikEdPreset = false;
// importScript("User:Lupin/recent2.js");
var wikEdShowSourceButton = true;
var wikEdRegExTypoFix = true;
var wikEdShowTableModeButton = true;
//var wikEdLoadDiffScript = false;
//var wikEdLoadDiff = false;
//
var wikEdSkipBrowserTest = 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"></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>');
*/
/*
// install [[User:Cacycle/wikEd]] editing page extension - DEV
document.write('<script type="text/javascript" src="'
+ 'http://en.wikipedia.org/w/index.php?title=User:Cacycle/wikEd_dev.js'
+ '&action=raw&ctype=text/javascript"></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"></script>');
*/
/*
// install [[User:Cacycle/wikiWatch]]
document.write('<script type="text/javascript" src="'
+ 'http://en.wikipedia.org/w/index.php?title=User:Cacycle/wikiWatch.js'
+ '&action=raw&ctype=text/javascript"></script>');
*/
/*
// install [[user:js/watchlist.js]]
document.write('<script type="text/javascript" src="'
+ 'http://en.wikipedia.org/w/index.php?title=user:js/watchlist.js'
+ '&action=raw&ctype=text/javascript"></script>');
*/
addOnloadHook(
function() {
addPortletLink('p-personal', '/wiki/User:Cacycle/tricks', 'tricks', '', '', '', '');
addPortletLink('p-personal', '/wiki/User:Cacycle/monobook.js', 'monobook.js', '', '', '', '');
addPortletLink('p-personal', '/wiki/User:Cacycle/wikEd', 'wikEd', '', '', '', '');
addPortletLink('p-personal', '/wiki/User_talk:Cacycle/wikEd', 'wikEd talk', '', '', '', '');
addPortletLink('p-personal', '/wiki/User:Cacycle/wikEd_help', 'wikEd help', '', '', '', '');
addPortletLink('p-personal', '/wiki/User:Cacycle/wikEd.js', 'wikEd.js', '', '', '', '');
addPortletLink('p-personal', '/wiki/User:Cacycle/wikEd_development', 'wikEd dev', '', '', '', '');
addPortletLink('p-personal', '/wiki/User_talk:Cacycle/wikEd_development', 'wikEd dev talk', '', '', '', '');
addPortletLink('p-personal', '/wiki/User:Cacycle/wikEd_dev.js', 'wikEd_dev.js', '', '', '', '');
addPortletLink('p-personal', '/wiki/User:Cacycle/wikiWatch', 'wikiWatch', '', '', '', '');
addPortletLink('p-personal', '/wiki/User:Cacycle/wikiWatch.js', 'wikiWatch.js', '', '', '', '');
if (document.getElementById('ca-edit') != null) {
document.getElementById('ca-edit').firstChild.innerHTML = 'edit';
}
}
);
/* </nowiki></pre> */