User:Interiot/js/RealTitle.js: Difference between revisions

Content deleted Content added
m rv
rm debugging bits, it basically works now
Line 5:
// An element with id=DisableRealTitle disables the function.
addOnloadHook(function() {
//try {
var realTitleBanner = document.getElementById("RealTitleBanner");
if (realTitleBanner && !document.getElementById("DisableRealTitle")) {
Line 17:
verifyTitle = verifyTitle.replace(/ /g, "_"); // spaces to underscores
verifyTitle = verifyTitle.charAt(0).toUpperCase() + verifyTitle.substring(1, verifyTitle.length); // uppercase first character
alert("1. '" + verifyTitle + "'");
 
// if the namespace prefix is there, remove it on our verification copy. If it isn't there, add it to the original realValue copy.
Line 27 ⟶ 26:
}
}
alert("2a. '" + verifyTitle + "'");
alert("2b. '" + realTitle + "'");
 
// verify whether wgTitle matches
Line 35 ⟶ 32:
verifyTitle = verifyTitle.charAt(0).toUpperCase() + verifyTitle.substring(1, verifyTitle.length); // uppercase first character
isPasteable = (verifyTitle == wgTitle);
alert("3. '" + verifyTitle + "' == '" + wgTitle + "' => " + isPasteable);
 
var h1 = document.getElementsByTagName("h1")[0];
Line 45 ⟶ 41:
}
}
//} catch (e) {
/* Something went wrong. */
//}
});