Wikipedista:Juandev/JavaScript
Vzhled
// --------- custom edit toolbar --------- // Repair by Juandev due to mwCustomEditButtons loss
mw.loader.using('mediawiki.action.edit', function () {
var button = { id: 'button-comment', imageFile: "http://upload.wikimedia.org/wikipedia/commons/a/a5/Buttonexperimenty.png", speedTip: "Experimenty", tagOpen: "\x7b\x7bexperimenty}} \x7E\x7E\x7E\x7E", tagClose: "", sampleText: "" }; mw.toolbar.addButton(button.imageFile, button.speedTip, button.tagOpen, button.tagClose, button.sampleText, button.id, button.id);
var button = { id: 'button-comment',
imageFile: "http://upload.wikimedia.org/wikipedia/en/c/c8/Button_redirect.png", speedTip: "Přesměrování", tagOpen: "#REDIRECT [[", tagClose: "]]", sampleText: "cíl" }; mw.toolbar.addButton(button.imageFile, button.speedTip, button.tagOpen, button.tagClose, button.sampleText, button.id, button.id);
var button = { id: 'button-comment',
imageFile: "http://upload.wikimedia.org/wikipedia/commons/1/16/Buttonexperimenty2.png", speedTip: "Experimenty2", tagOpen: "\x7b\x7bexperimenty2}} \x7E\x7E\x7E\x7E", tagClose: "", sampleText: "" }; mw.toolbar.addButton(button.imageFile, button.speedTip, button.tagOpen, button.tagClose, button.sampleText, button.id, button.id);
var button = { id: 'button-comment',
imageFile: "http://upload.wikimedia.org/wikipedia/commons/4/4a/Button_welcome.png", speedTip: "Vítejte", tagOpen: "\x7b\x7bsubst:vítejte}} \x7E\x7E\x7E\x7E", tagClose: "", sampleText: "" }; mw.toolbar.addButton(button.imageFile, button.speedTip, button.tagOpen, button.tagClose, button.sampleText, button.id, button.id);
var button = { id: 'button-comment',
imageFile: "http://upload.wikimedia.org/wikipedia/commons/f/f8/Button_Tool_commons.png", speedTip: "Commons", tagOpen: "\x7b\x7bCommons|", tagClose: "}}", sampleText: "" }; mw.toolbar.addButton(button.imageFile, button.speedTip, button.tagOpen, button.tagClose, button.sampleText, button.id, button.id);
var button = { id: 'button-comment',
imageFile: "http://upload.wikimedia.org/wikipedia/commons/6/6c/Button_commons.png", speedTip: "CommonsPresun", tagOpen: "\x7b\x7bsubst:Používejte Commons}} \x7E\x7E\x7E\x7E", tagClose: "", sampleText: "" }; mw.toolbar.addButton(button.imageFile, button.speedTip, button.tagOpen, button.tagClose, button.sampleText, button.id, button.id);
var button = { id: 'button-comment',
imageFile: "http://upload.wikimedia.org/wikipedia/commons/9/91/Button_cite_web.png", speedTip: "Citace elektronické monografie (webu)", tagOpen: "[1]", tagClose: "", sampleText: "" }; mw.toolbar.addButton(button.imageFile, button.speedTip, button.tagOpen, button.tagClose, button.sampleText, button.id, button.id);
var button = { id: 'button-comment',
imageFile: "http://upload.wikimedia.org/wikipedia/commons/4/46/Topdown1.png", speedTip: "Infobox chráněné území v Česku", tagOpen: "\x7b\x7bInfobox chráněné území v Česku\n| typ = \n| název =\n| foto = \n| popis = \n| vyhlášena = [[]] \n| vyhlásil = \n| úsop = \n| lokalita = \n| výška = – \n| výměra = \n| okres = \n| poznámky = \n| commons = Category: \n}}", tagClose: "", sampleText: "" }; mw.toolbar.addButton(button.imageFile, button.speedTip, button.tagOpen, button.tagClose, button.sampleText, button.id, button.id);
var button = { id: 'button-comment',
imageFile: "http://upload.wikimedia.org/wikipedia/commons/b/b8/Button_Globe.png", speedTip: "České GEO", tagOpen: "Šablona:Geo cz", tagClose: "", sampleText: "" };
mw.toolbar.addButton(button.imageFile, button.speedTip, button.tagOpen, button.tagClose, button.sampleText, button.id, button.id); });
//End of toolbar script
function insertGeoCz() {
var strGeoLoc = window.prompt( "Zadejte lokaci", "" ); if( strGeoLoc ) { strGeoCz = strGeoLoc.replace( / *(?:Loc:)? *(\d+)°(\d+)'([\d.]+)"N[,;] *(\d+)°(\d+)'([\d.]+)"E */, "Šablona:Geo cz" ); insertTags( strGeoCz , "", ""); }
}
function addInsertGeoCzButton() {
var nodToolbar = document.getElementById( "toolbar" ); if( nodToolbar ) { var nodGeoCz = document.createElement( "img" ); nodGeoCz.src = "http://upload.wikimedia.org/wikipedia/commons/b/b8/Button_Globe.png"; nodGeoCz.title = "Geo cz"; var nodGeoCzClick = document.createAttribute( "onclick" ); nodGeoCzClick.value = "insertGeoCz();"; nodGeoCz.setAttributeNode( nodGeoCzClick ); nodToolbar.appendChild( nodGeoCz ); }
}
if (window.addEventListener)
{ window.addEventListener ("load", addInsertGeoCzButton, false) }
else if (window.attachEvent)
{ window.attachEvent ("onload", addInsertGeoCzButton) };
- ↑ \x7b\x7bCitace elektronické monografie\n | příjmení = \n | jméno = \n | odkaz na autora = \n | titul = \n | url = \n | datum vydání = \n | datum aktualizace = \n | datum přístupu = " + (y = new Date().getFullYear ()) + "-" + (m = new Date ().getMonth () + 1) + "-" + (d = new Date ().getDate ()) + "\n | vydavatel = \n | místo = \n | jazyk = \n}}