User:Manop/monobook.js
From Wikipedia
ເອົາໃຈໃສ່: ຫຼັງຈາກບັນທຶກ, ທ່ານອາດຈຳເປັນຕ້ອງເວັ້ນຜ່ານ ຂໍ້ມູນເກົ່າທີ່ ໂປແກມທ່ອງເວັບ ຂອງ ທ່ານບັນທຶກໄວ້ເພື່ອເບິ່ງຜົນການປ່ຽນແປງ. Mozilla / Firefox / Safari: ກົດ Shift ໃນເວລາຄລິກ Reload, ຫຼືກົດ Ctrl-Shift-R (Cmd-Shift-R ໃນ ເມັກຄິນທົສ); IE: ກົດ Ctrl ໃນເວລາຄລິກ Refresh, ຫຼືກົດ Ctrl-F5; Konqueror:: ກົດປຸ່ມ Reload , ຫຼື ກົດ F5; Opera ຜູ້ໃຊ້ອາດຈຳເປັນຕ້ອງລຶບ ຂໍ້ມູນບັນທຶກໂດຍສິ້ນເຊີງ ໃນ Tools→Preferences.
/* <nowiki> */ function addlilink(tabs, url, name, id, title, key){ var na = document.createElement('a'); na.href = url; na.appendChild(document.createTextNode(name)); var li = document.createElement('li'); if(id) li.id = id; li.appendChild(na); tabs.appendChild(li); na.accesskey = key; var pref = 'alt-'; if(((clientPC.indexOf('AppleWebKit')!=-1) && (clientPC.indexOf('spoofer')==-1)) || navigator.userAgent.toLowerCase().indexOf( 'mac' ) != -1 ) pref = 'control-'; if(clientPC.indexOf('opera')!=-1) pref = 'shift-esc-'; if(key && title) na.title = title + ' [' + pref + key + ']'; else if(title) na.title = title; else if(key) na.title = '[' + pref + key + ']'; return li; } function addTab(url, name, id, title, key){ var tabs = document.getElementById('p-cactions').getElementsByTagName('ul')[0]; addlilink(tabs, url, name, id, title, key); } function getPname() { z=document.getElementById("content").childNodes; for (var n=0;n<z.length;n++) { if (z[n].className=="firstHeading") return z[n].textContent; }; } // ========== Replace string ========== // Javascript from http://www.irt.org/script/242.htm function replace(string,text,by) { // Replaces text with by in string var strLength = string.length, txtLength = text.length; if ((strLength == 0) || (txtLength == 0)) return string; var i = string.indexOf(text); if ((!i) && (text != string.substring(0,txtLength))) return string; if (i == -1) return string; var newstr = string.substring(0,i) + by; if (i+txtLength < strLength) newstr += replace(string.substring(i+txtLength,strLength),text,by); return newstr; } // ========== Using new template style ========== function doConvertNumber() { text = document.editform.wpTextbox1.value; text = replace(text,'{{template:','{{'); document.editform.wpTextbox1.value = text; document.editform.wpSummary.value = " "; } function addConvertNumber() { addTab("javascript:doConvertNumber()", "temp ->tempN", "ca-tanum", "changing to new template", ""); akeytt(); } if (document.title.indexOf("ພວມດັດແກ້ ") == 0) { if (window.addEventListener) window.addEventListener("load", addConvertNumber, false); else if (window.attachEvent) window.attachEvent("onload", addConvertNumber); }