Common.js: Porovnání verzí
Z Beta: Franklinova expedice
(další) |
(citace) |
||
Řádek 11: | Řádek 11: | ||
// Ship | // Ship | ||
krInsertWikiEditorButton({ | krInsertWikiEditorButton({ | ||
id: "mw-customeditbutton- | id: "mw-customeditbutton-ship", | ||
icon: "/wiki/resources/assets/custom-icons/button-ship.png", | icon: "/wiki/resources/assets/custom-icons/button-ship.png", | ||
label: 'Ship', | label: 'Ship', | ||
Řádek 20: | Řádek 20: | ||
// Person | // Person | ||
krInsertWikiEditorButton({ | krInsertWikiEditorButton({ | ||
id: "mw-customeditbutton- | id: "mw-customeditbutton-person", | ||
icon: "/wiki/resources/assets/custom-icons/button-person.png", | icon: "/wiki/resources/assets/custom-icons/button-person.png", | ||
label: 'Ship', | label: 'Ship', | ||
Řádek 29: | Řádek 29: | ||
// Place | // Place | ||
krInsertWikiEditorButton({ | krInsertWikiEditorButton({ | ||
id: "mw-customeditbutton- | id: "mw-customeditbutton-place", | ||
icon: "/wiki/resources/assets/custom-icons/button-place.png", | icon: "/wiki/resources/assets/custom-icons/button-place.png", | ||
label: ' | label: 'Place', | ||
insertBefore: '<span class="name-place">', | insertBefore: '<span class="name-place">', | ||
insertAfter: '</span>', | insertAfter: '</span>', | ||
sampleText: ' | sampleText: 'Místo' | ||
}); | }); | ||
// Date | // Date | ||
krInsertWikiEditorButton({ | krInsertWikiEditorButton({ | ||
id: "mw-customeditbutton- | id: "mw-customeditbutton-date", | ||
icon: "/wiki/resources/assets/custom-icons/button-date.png", | icon: "/wiki/resources/assets/custom-icons/button-date.png", | ||
label: ' | label: 'Date', | ||
insertBefore: '<span class="text-date">', | insertBefore: '<span class="text-date">', | ||
insertAfter: '</span>', | insertAfter: '</span>', | ||
sampleText: ' | sampleText: 'Datum' | ||
}); | |||
// English (blok) | |||
krInsertWikiEditorButton({ | |||
id: "mw-customeditbutton-enblock", | |||
icon: "/wiki/resources/assets/custom-icons/button-en.png", | |||
label: 'English block', | |||
insertBefore: '<div lang="en">', | |||
insertAfter: '</div>', | |||
sampleText: 'English text' | |||
}); | |||
// Citace (blok) | |||
krInsertWikiEditorButton({ | |||
id: "mw-customeditbutton-blockquote", | |||
icon: "/wiki/resources/assets/custom-icons/button-blockquote.png", | |||
label: 'Bloková citace', | |||
insertBefore: '<blockquote>', | |||
insertAfter: '</blockquote>', | |||
sampleText: 'Citovaný odstavec' | |||
}); | |||
// Citace (inline text) | |||
krInsertWikiEditorButton({ | |||
id: "mw-customeditbutton-inlinequote", | |||
icon: "/wiki/resources/assets/custom-icons/button-quote.png", | |||
label: 'Řádková citace', | |||
insertBefore: '<q>', | |||
insertAfter: '</q>', | |||
sampleText: 'Citovaný text' | |||
}); | }); | ||
Verze z 31. 12. 2021, 20:32
/* Zde uvedený JavaScript bude použit pro všechny uživatele při načtení každé stránky. */ /** * Extra buttons in toolbar * @stats [[File:Krinkle_InsertWikiEditorButton.js]] */ $.ajax({ dataType: 'script', cache: true, url: 'https://meta.wikimedia.org/w/index.php?title=User:Krinkle/Scripts/InsertWikiEditorButton.js&action=raw&ctype=text/javascript' }).then(function () { // Ship krInsertWikiEditorButton({ id: "mw-customeditbutton-ship", icon: "/wiki/resources/assets/custom-icons/button-ship.png", label: 'Ship', insertBefore: '<span class="name-ship">', insertAfter: '</span>', sampleText: 'Loď' }); // Person krInsertWikiEditorButton({ id: "mw-customeditbutton-person", icon: "/wiki/resources/assets/custom-icons/button-person.png", label: 'Ship', insertBefore: '<span class="name-person">', insertAfter: '</span>', sampleText: 'Loď' }); // Place krInsertWikiEditorButton({ id: "mw-customeditbutton-place", icon: "/wiki/resources/assets/custom-icons/button-place.png", label: 'Place', insertBefore: '<span class="name-place">', insertAfter: '</span>', sampleText: 'Místo' }); // Date krInsertWikiEditorButton({ id: "mw-customeditbutton-date", icon: "/wiki/resources/assets/custom-icons/button-date.png", label: 'Date', insertBefore: '<span class="text-date">', insertAfter: '</span>', sampleText: 'Datum' }); // English (blok) krInsertWikiEditorButton({ id: "mw-customeditbutton-enblock", icon: "/wiki/resources/assets/custom-icons/button-en.png", label: 'English block', insertBefore: '<div lang="en">', insertAfter: '</div>', sampleText: 'English text' }); // Citace (blok) krInsertWikiEditorButton({ id: "mw-customeditbutton-blockquote", icon: "/wiki/resources/assets/custom-icons/button-blockquote.png", label: 'Bloková citace', insertBefore: '<blockquote>', insertAfter: '</blockquote>', sampleText: 'Citovaný odstavec' }); // Citace (inline text) krInsertWikiEditorButton({ id: "mw-customeditbutton-inlinequote", icon: "/wiki/resources/assets/custom-icons/button-quote.png", label: 'Řádková citace', insertBefore: '<q>', insertAfter: '</q>', sampleText: 'Citovaný text' }); // Monkey krInsertWikiEditorButton({ id: 'mw-customeditbutton-anotherspecialbutton', icon: '//upload.wikimedia.org/wikipedia/commons/thumb/1/1b/Gnome-face-monkey.svg/22px-Gnome-face-monkey.svg.png', label: 'Insert monkey', insertBefore: '[[File:Gnome-face-monkey.svg|21px|', insertAfter: ']]', sampleText: 'Happy face' }); }); /* Viz https://www.mediawiki.org/wiki/Manual:Custom_edit_buttons#Classic_edit_toolbar */ mw.hook( 'wikipage.editform' ).add( function () { mw.loader.using( 'mediawiki.toolbar' ).then( function () { mw.toolbar.addButton( { imageFile: '/wiki/resources/assets/custom-icons/button-ship.png', speedTip: 'Loď', tagOpen: '<span class="name-ship">', tagClose: '</span>', sampleText: 'Jméno lodi', imageId: 'button-ship' } ); mw.toolbar.addButton( { imageFile: '/wiki/resources/assets/custom-icons/button-person.png', speedTip: 'Osoba', tagOpen: '<span class="name-person">', tagClose: '</span>', sampleText: 'Jméno osoby', imageId: 'button-person' } ); mw.toolbar.addButton( { imageFile: '/wiki/resources/assets/custom-icons/button-place.png', speedTip: 'Místo', tagOpen: '<span class="name-place">', tagClose: '</span>', sampleText: 'Jméno místa', imageId: 'button-place' } ); mw.toolbar.addButton( { imageFile: '/wiki/resources/assets/custom-icons/button-date.png', speedTip: 'Datum', tagOpen: '<span class="text-date">', tagClose: '</span>', sampleText: 'Datum', imageId: 'button-date' } ); mw.toolbar.addButton( { imageFile: '/wiki/resources/assets/custom-icons/button-en.png', speedTip: 'English', tagOpen: '<div lang="en">', tagClose: '</div>', sampleText: 'English text', imageId: 'button-english' } ); mw.toolbar.addButton( { imageFile: '/wiki/resources/assets/custom-icons/button-blockquote.png', speedTip: 'Bloková citace', tagOpen: '<blockquote>', tagClose: '</blockquote>', sampleText: 'Citovaný odstavec', imageId: 'button-blockquote' } ); mw.toolbar.addButton( { imageFile: '/wiki/resources/assets/custom-icons/button-quote.png', speedTip: 'Řádková citace', tagOpen: '<q>', tagClose: '</q>', sampleText: 'Citovaný text', imageId: 'button-quote' } ); } ); } );