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

Content deleted Content added
rm debugging bits, it basically works now
No edit summary
Line 15:
// calculate whether the title is pasteable
var verifyTitle = realTitle.replace(/^ +/, ""); // trim left spaces
verifyTitle = verifyTitle.replace(/ /g, "_"); // spaces to underscores
verifyTitle = verifyTitle.charAt(0).toUpperCase() + verifyTitle.substring(1, verifyTitle.length); // uppercase first character
 
// if the namespace prefix is there, remove it on our verification copy. If it isn't there, add it to the original realValue copy.
if (wgNamespaceNumber != 0) {
if (wgCanonicalNamespace == verifyTitle.substr(0, wgCanonicalNamespace.length).replace(/ /g, "_") && verifyTitle.charAt(wgCanonicalNamespace.length) == ":") {
verifyTitle = verifyTitle.substr(wgCanonicalNamespace.length + 1);
} else {