MediaWiki:Edittools.js
Catatan: Setelah menerbitkan, Anda mungkin perlu melewati tembolok peramban web Anda untuk melihat perubahan.
- Firefox/Safari: Tekan dan tahan Shift sembari mengeklik Reload, atau tekan Ctrl-F5 atau Ctrl-R (⌘-R di Mac)
- Google Chrome: Tekan Ctrl-Shift-R (⌘-Shift-R di Mac)
- Edge: Tahan Ctrl sembari mengeklik Refresh, atau tekan Ctrl-F5
/* <pre><nowiki> Top of Javascript */
// Drop down box for the Special character menu in [[MediaWiki:Edittools]]
// will be called from [[MediaWiki:Monobook.js]].
// Adapted from:
// http://de.wiktionary.org/wiki/MediaWiki:Onlyifediting.js ,
// http://de.wikipedia.org/wiki/MediaWiki:Onlyifediting.js and
// http://en.wiktionary.org/wiki/MediaWiki:Monobook.js
function addCharSubsetMenu() {
var specialchars = document.getElementById('specialchars');
if (specialchars) {
var menu = "<select style=\"display:inline\" onChange=\"chooseCharSubset(selectedIndex)\">";
menu += "<option>Standar</option>";
menu += "<option>Templat</option>";
menu += "<option>Arab</option>";
menu += "<option>Ceko</option>";
menu += "<option>Devanāgarī</option>";
menu += "<option>Esperanto</option>";
menu += "<option>Estonia</option>";
menu += "<option>Hawaii</option>";
menu += "<option>Hungaria</option>";
menu += "<option>IPA</option>";
menu += "<option>Ibrani</option>";
menu += "<option>Inggris kuno</option>";
menu += "<option>Islandia</option>";
menu += "<option>Italia</option>";
menu += "<option>Jerman</option>";
menu += "<option>Katalan</option>";
menu += "<option>Latin</option>";
menu += "<option>Latvia</option>";
menu += "<option>Malta</option>";
menu += "<option>Perancis</option>";
menu += "<option>Pinyin</option>";
menu += "<option>Polandia</option>";
menu += "<option>Portugis</option>";
menu += "<option>Romaji</option>";
menu += "<option>Rumania</option>";
menu += "<option>Serbia</option>";
menu += "<option>Sirilik</option>";
menu += "<option>Skandinavia</option>";
menu += "<option>Spanyol</option>";
menu += "<option>Turki</option>";
menu += "<option>Vietnam</option>";
menu += "<option>Wales</option>";
menu += "<option>Yiddish</option>";
menu += "<option>Yunani</option>";
menu += "</select>";
specialchars.innerHTML = menu + specialchars.innerHTML;
// Standard-CharSubset
chooseCharSubset(0);
}
}
// CharSubset selection
function chooseCharSubset(s) {
var l = document.getElementById('specialchars').getElementsByTagName('p');
for (var i = 0; i < l.length ; i++) {
l[i].style.display = i == s ? 'inline' : 'none';
// l[i].style.visibility = i == s ? 'visible' : 'hidden';
}
}
// Menu insertion
if (window.addEventListener)
window.addEventListener("load", addCharSubsetMenu, false);
else if (window.attachEvent)
window.attachEvent("onload", addCharSubsetMenu);
/* Bottom of Javascript </nowiki></pre> */