Common.js: Porovnání verzí
Z Beta: Franklinova expedice
(další) |
(zpět, problém byl jinde) |
||
(Není zobrazeno 6 mezilehlých verzí od stejného uživatele.) | |||
Řá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: ' | label: 'Person', | ||
insertBefore: '<span class="name-person">', | insertBefore: '<span class="name-person">', | ||
insertAfter: '</span>', | insertAfter: '</span>', | ||
sampleText: ' | sampleText: 'Osoba' | ||
}); | }); | ||
// 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({ | krInsertWikiEditorButton({ | ||
id: | id: "mw-customeditbutton-inlinequote", | ||
icon: | icon: "/wiki/resources/assets/custom-icons/button-quote.png", | ||
label: ' | label: 'Řádková citace', | ||
insertBefore: ' | insertBefore: '<q>', | ||
insertAfter: ' | insertAfter: '</q>', | ||
sampleText: ' | sampleText: 'Citovaný text' | ||
}); | }); | ||
}); | }); | ||
Aktuální verze z 10. 7. 2023, 10:08
/* 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: 'Person', insertBefore: '<span class="name-person">', insertAfter: '</span>', sampleText: 'Osoba' }); // 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' }); }); /* 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' } ); } ); } );