Discuție Utilizator:Parvus7/Arhivă 04
☎ Trimiteţi un mesaj nou | ☎ Scrieţi mesajele la Discuţii | ☎ Arhivă 01 | 02 | 03 | 04 | 05 | 06 | 07 | 08 | 09 | |
ARHIVĂ Vă rog, Nu scrieţi mesaje în arhivă
/* Script made by ro:Utilizator:Strainu and ro:Utilizator:Gutza. Based on an idea by ro:Utilizator:Alexxed
Documents:
Microsoft UA strings: http://msdn.microsoft.com/en-us/library/ms537503.aspx
- /
hookEvent('load', replaceDiacritics);
function goodToBad(node) {
var i; if (goodToBad.formInputs == undefined) { goodToBad.formInputs = document.getElementsByTagName('form'); }
/* skip the form elements */ for (i = 0; i < goodToBad.formInputs.length; i++) { if(node == goodToBad.formInputs[i]) return; }
if(node.nodeName == '#text') { node.nodeValue = node.nodeValue.replace(/ş/g, 'ş'); node.nodeValue = node.nodeValue.replace(/ţ/g, 'ţ'); node.nodeValue = node.nodeValue.replace(/Ş/g, 'Ş'); node.nodeValue = node.nodeValue.replace(/Ţ/g, 'Ţ'); return; } for(i = 0; i < node.childNodes.length; i++) goodToBad(node.childNodes[i]);
}
function badToGood(node) {
var i; if (goodToBad.formInputs == undefined) { goodToBad.formInputs = document.getElementsByTagName('form'); }
/* skip the form elements */ for (i = 0; i < goodToBad.formInputs.length; i++) { if(node == goodToBad.formInputs[i]) return; }
if(node.nodeName == '#text') { node.nodeValue = node.nodeValue.replace(/ş/g, 'ş'); node.nodeValue = node.nodeValue.replace(/ţ/g, 'ţ'); node.nodeValue = node.nodeValue.replace(/Ş/g, 'Ş'); node.nodeValue = node.nodeValue.replace(/Ţ/g, 'Ţ'); return; }
/* skip Turkish stuff */ if (node.getAttribute != undefined && node.getAttribute('lang')=='tr') { return; }
for(i = 0; i < node.childNodes.length; i++) badToGood(node.childNodes[i]);
}
function replaceDiacritics() {
//var is_ie6m = -1; //var is_vista = -1;
/*ignore history pages and special pages due to performance concerns*/ if(wgAction == "history" || wgCanonicalNamespace == "Special") return;
/*excluding JS files for practical purposes*/ if(wgTitle.indexOf(".js") > -1) return;
//is_ie6m = navigator.userAgent.search(/MSIE [4-6].*/i); //is_vista = navigator.userAgent.search(/Windows NT [6-7].*/i);
//if (is_ie6m > -1 && is_vista == -1) // goodToBad(document.body); //else // badToGood(document.body);
var titleOverride=document.getElementById("full_title"); if (titleOverride!=undefined) { var DOMtitle=document.getElementById("firstHeading"); if (DOMtitle!=undefined) { DOMtitle.innerHTML=titleOverride.innerHTML; } }
var content = document.getElementById("content"); if(content === null) badToGood(document.body); else badToGood(content);
}