Pengguna:Kenrick95/edittools.js: Perbedaan antara revisi
Tampilan
Konten dihapus Konten ditambahkan
k ←Membuat halaman berisi '/** == Edittools == Drop down box for the Special character menu in MediaWiki:Edittools Adapted from: http://de.wiktionary.org/wiki/MediaWiki:Onlyifediting.js , ...' |
Tidak ada ringkasan suntingan |
||
Baris 93: | Baris 93: | ||
/** |
/** |
||
Dari [[MediaWiki:Common.js]] dengan pengubahan |
|||
*/ |
Revisi terkini sejak 19 Februari 2011 15.52
/**
== Edittools ==
Drop down box for the Special character menu in [[MediaWiki:Edittools]]
Adapted from:
http://de.wiktionary.org/wiki/MediaWiki:Onlyifediting.js ,
http://de.wiki-indonesia.club/wiki/MediaWiki:Onlyifediting.js and
http://en.wiktionary.org/wiki/MediaWiki:Monobook.js
<pre><nowiki> */
function addCharSubsetMenu() {
if ( load_edittools != true ) return;
var specialchars = document.getElementById('specialchars');
if (specialchars) {
var menu = "<select style=\"display:inline\" onChange=\"chooseCharSubset(selectedIndex)\">";
menu += "<option>Standar+Templat</option>";
menu += "<option>IPA</option>";
menu += "<option>Latin</option>";
menu += "<option>Pinyin</option>";
menu += "<option>Romaji</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>Ibrani</option>";
menu += "<option>Inggris kuno</option>";
menu += "<option>Islandia</option>";
menu += "<option>Italia</option>";
menu += "<option>Jawa Kuna</option>";
menu += "<option>Jerman</option>";
menu += "<option>Katalan</option>";
menu += "<option>Latvia</option>";
menu += "<option>Malta</option>";
menu += "<option>Perancis</option>";
menu += "<option>Polandia</option>";
menu += "<option>Portugis</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
addOnloadHook( addCharSubsetMenu );
// Move the toolbar to the top
function fixToolbar() {
if ( load_edittools != true ) return;
var wpEditToolbar = document.getElementById( "wikiEditor-ui-toolbar" );
var editTools = document.getElementById( "specialchars" );
elementMoveto( editTools, wpEditToolbar , 'after' );
if( editTools ) editTools.style.display = "block";
var editspecialchars = document.getElementById( "editpage-specialchars" );
elementMoveto( editTools, wpEditToolbar , 'after' );
}
onloadFuncts.push( fixToolbar );
// Helper function to move DOM element
function elementMoveto( node, refNode, pos ) {
if(node && refNode){
var parent=refNode.parentNode;
if (pos && pos=='after') { refNode=refNode.nextSibling; }
try {
parent.insertBefore( node, refNode );
} catch ( DOMException ) {};
}
}
/* </nowiki></pre> */
/**
Dari [[MediaWiki:Common.js]] dengan pengubahan
*/