User:Drrngrvy/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 can be added at User:Drrngrvy/monobook.css. |
// [[User:Zocky/PicturePopups.js]]
document.write('<script type="text/javascript" src="'
+ 'http://en.wikipedia.org/w/index.php?title=User:Zocky/PicturePopups.js'
+ '&action=raw&ctype=text/javascript&dontcountme=s"></script>');
try {
var ch = get("//div[@id='bodyContent']/dl/dd/span[@class='plainlinks']/i[contains(.,'initial letter is capitalized')]/b").snapshotItem(0);
var correction = ch.innerHTML;
var articleTitle = get("//div[@id='content']/h1[@class='firstHeading']").snapshotItem(0);
var template = ch.parentNode.parentNode.parentNode;
// check if the original and correct versions match
// this avoids acting on non-"real" uses of the template
if(articleTitle.innerHTML.toLowerCase() == correction.toLowerCase()) {
// Correct the page title
document.title = document.title.replace(articleTitle.innerHTML, correction);
// Correct the article title
articleTitle.innerHTML = correction;
// Remove template
template.style.display = "none";
}
}
catch(e){}
function get(query, context) {
return document.evaluate(
query,
document,
null,
XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,
context
);
}