Note: After saving, you have to bypass your browser's cache to see the changes. Internet Explorer: press Ctrl-F5, Mozilla: hold down Shift while clicking Reload (or press Ctrl-Shift-R), Opera/Konqueror: press F5, Safari: hold down Shift + Alt while clicking Reload, Chrome: hold down Shift while clicking Reload.
functionall_commas(str){str=str.replace(/ţ/g,"ț");str=str.replace(/Ţ/g,"Ț");str=str.replace(/ş/g,"ș");str=str.replace(/Ş/g,"Ș");returnstr;}save_new_diacritics=function(){varwgPageName=mw.config.get('wgPageName');varupload_form=document.getElementById('mw-upload-form');if(wgPageName=="Special:Upload"&&upload_form){upload_form.onsubmit=function(){varta=document.getElementById('wpUploadDescription');vartitle=document.getElementById('wpDestFile');if(!ta||!title){returntrue;}varnewvalue=ta.value;varnewtitle=title.value;varturkish_regexp=/(<(span) lang=[^<>]*>(.|\r|\n)*?<\/\2>)|(<(gallery)(.*?)>(.|\r|\n)*?<\/\5>)/gi;varturkish_phrases=newvalue.match(turkish_regexp);newvalue=all_commas(newvalue);varmixed_phrases=newvalue.match(turkish_regexp);if(mixed_phrases!=null&&turkish_phrases!=null){for(vari=0;i<turkish_phrases.length;i++){newvalue=newvalue.replace(mixed_phrases[i],turkish_phrases[i]);}}//restore the value to the editboxta.value=newvalue;if(ta.value.search("{{titlu corect")>-1){//we found the template, do not replace the titlereturntrue;}title.value=all_commas(newtitle);returntrue;}}}addOnloadHook(save_new_diacritics);