Szerkesztővita:KeFe/editbuttons.js
/ / Teszt
removeOnloadHook (addCharSubsetMenu '); removeOnloadHook (InsertButtonsToToolBar ');
var allowedSpecialCharacterTypes = ["Vietnami", "Rated", "HTML", "Wikikód", "sablonok", "IPA"];
if (document.URL.indexOf ("action = edit")> 0 | | document.URL.indexOf ("action = submit")> 0 | | document.URL.indexOf ("Speci% C3% A1lis: Upload") > 0) {
/ / ListBox válassza szerkesztő eszközök function __ addCharSubsetMenu () { var specialchars = document.getElementById ('specialchars'); if (specialchars) { var menu = document.createElement ('select'); menu.style.display = 'inline'; menu.onchange = function () { chooseCharSubset (menu.options [menu.selectedIndex]. érték); } var specialCharacterTypes = new Object (); var l = document.getElementById ('specialchars "). getElementsByTagName (' p '); for (var i = 0; i <l.length; i + +) { var title = l [i]. cím; var opt = document.createElement ('option'); opt.appendChild (document.createTextNode (cím)); opt.value = i; specialCharacterTypes [title] = választják; } if (typeof (allowedSpecialCharacterTypes) == "meghatározatlan") { for (var i = 0; i <l.length; i + +) { menu.appendChild (specialCharacterTypes [l [i]. title]); } chooseCharSubset (0); Else {} for (var i = 0; i <allowedSpecialCharacterTypes.length; i + +) { if (typeof (specialCharacterTypes [allowedSpecialCharacterTypes [i]])! = "meghatározatlan") { menu.appendChild (specialCharacterTypes [allowedSpecialCharacterTypes [i]]); } } chooseCharSubset (specialCharacterTypes [allowedSpecialCharacterTypes [0]]. érték); } specialchars.insertBefore (menü, specialchars.firstChild); } } / / Extra gombok a szerkesztési eszköztár alapul en: User: Marks / extraeditbuttons.js function __ InsertButtonsToToolBar () { / / Redirect mwCustomEditButtons [mwCustomEditButtons.length] = { "ImageFile": "http://upload.wikimedia.org/wikipedia/en/c/c8/Button_redirect.png" "SpeedTip": "Átirányítás" "TagOpen": "# REDIRECT [[", "TagClose": "]]", "SampleText": "Cel"} / / Strike-Out gomb mwCustomEditButtons [mwCustomEditButtons.length] = { "ImageFile": "http://upload.wikimedia.org/wikipedia/en/c/c9/Button_strike.png" "SpeedTip": "Áthúzott szoveg", "TagOpen": "" "TagClose": "</ i>", "SampleText": "Áthúzott szoveg"} / / Apróbetűs szöveg mwCustomEditButtons [mwCustomEditButtons.length] = { "ImageFile": "http://upload.wikimedia.org/wikipedia/commons/1/17/Button_small_2.png" "SpeedTip": "Apróbetűs szoveg", "TagOpen": "" "TagClose": "</ small>", "SampleText": "Apróbetűs szoveg"} / / ÍrógépKód mwCustomEditButtons [mwCustomEditButtons.length] = { "ImageFile": "http://upload.wikimedia.org/wikipedia/commons/3/30/Tt_icon.png" "SpeedTip": "Írógép-szoveg", "TagOpen": "" "TagClose": "</ tt>", "SampleText": "Fix szélességű szoveg"} / / Referencia linket gomb mwCustomEditButtons [mwCustomEditButtons.length] = { "ImageFile": "http://upload.wikimedia.org/wikipedia/commons/c/c4/Button_ref.png" "SpeedTip": "Hivatkozás", "TagOpen": "<ref>" "TagClose": "</ ref>", "SampleText": "Hivatkozás szövegének helye"} / / Referencia gombot mwCustomEditButtons [mwCustomEditButtons.length] = { "ImageFile": "http://upload.wikimedia.org/wikipedia/commons/f/fe/Button_refs.png" "SpeedTip": "Hivatkozás lábrész" "TagOpen": "" "TagClose": "", "SampleText": ""} mwCustomEditButtons [mwCustomEditButtons.length] = { "ImageFile": "http://upload.wikimedia.org/wikipedia/commons/e/eb/Button_plantilla.png" "SpeedTip": "Sablon" "TagOpen": "{{", "TagClose": "}}", "SampleText": "Example Sablon"} } addOnloadHook (__addCharSubsetMenu); addOnloadHook (__InsertButtonsToToolBar);
}