MediaWiki:Toolbar.js — различия между версиями
Материал из Hilarious Wiki
MailGik (обсуждение | вклад) |
MailGik (обсуждение | вклад) |
||
Строка 1: | Строка 1: | ||
+ | ( function() { | ||
+ | |||
+ | |||
/** | /** | ||
* Extra classic toolbar options | * Extra classic toolbar options | ||
* | * | ||
− | * | + | * Adds extra buttons to the classic editing toolbar. |
− | |||
− | |||
− | |||
− | |||
*/ | */ | ||
− | |||
− | |||
var buttons = [ | var buttons = [ | ||
[ | [ | ||
− | '//upload.wikimedia.org/wikipedia/ | + | '//upload.wikimedia.org/wikipedia/commons/c/c8/Button_redirect.png', |
− | ' | + | 'Redirect', |
− | '< | + | '#REDIRECT [[', |
+ | ']]', | ||
+ | 'Target page name' | ||
+ | ], | ||
+ | [ | ||
+ | '//upload.wikimedia.org/wikipedia/commons/c/c9/Button_strike.png', | ||
+ | 'Strike', | ||
+ | '<s>', | ||
+ | '</s>', | ||
+ | 'Strike-through text' | ||
], | ], | ||
[ | [ | ||
− | '//upload.wikimedia.org/wikipedia/ | + | '//upload.wikimedia.org/wikipedia/commons/1/13/Button_enter.png', |
− | ' | + | 'Line break', |
− | ' | + | '<br>' |
− | |||
− | |||
], | ], | ||
[ | [ | ||
− | '//upload.wikimedia.org/wikipedia/ | + | '//upload.wikimedia.org/wikipedia/commons/6/6a/Button_sup_letter.png', |
− | ' | + | 'Superscript', |
'<sup>', | '<sup>', | ||
'</sup>', | '</sup>', | ||
− | ' | + | 'Superscript text' |
], | ], | ||
[ | [ | ||
− | '//upload.wikimedia.org/wikipedia/ | + | '//upload.wikimedia.org/wikipedia/commons/a/aa/Button_sub_letter.png', |
− | ' | + | 'Subscript', |
'<sub>', | '<sub>', | ||
'</sub>', | '</sub>', | ||
− | ' | + | 'Subscript text' |
], | ], | ||
[ | [ | ||
− | '//upload.wikimedia.org/wikipedia/ | + | '//upload.wikimedia.org/wikipedia/commons/d/d5/Button_small_text.png', |
− | ' | + | 'Small', |
'<small>', | '<small>', | ||
'</small>', | '</small>', | ||
− | ' | + | 'Small text' |
], | ], | ||
[ | [ | ||
− | + | '//upload.wikimedia.org/wikipedia/commons/3/34/Button_hide_comment.png', | |
− | + | 'Insert hidden Comment', | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | '//upload.wikimedia.org/wikipedia/ | ||
− | ' | ||
'<!-- ', | '<!-- ', | ||
' -->', | ' -->', | ||
− | ' | + | 'Comment' |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
], | ], | ||
[ | [ | ||
'//upload.wikimedia.org/wikipedia/commons/1/12/Button_gallery.png', | '//upload.wikimedia.org/wikipedia/commons/1/12/Button_gallery.png', | ||
− | ' | + | 'Insert a picture gallery', |
'\n<gallery>\n', | '\n<gallery>\n', | ||
'\n</gallery>', | '\n</gallery>', | ||
− | ' | + | 'File:Example.jpg|Caption1\nFile:Example.jpg|Caption2' |
+ | ], | ||
+ | [ | ||
+ | '//upload.wikimedia.org/wikipedia/commons/f/fd/Button_blockquote.png', | ||
+ | 'Insert block of quoted text', | ||
+ | '<blockquote>\n', | ||
+ | '\n</blockquote>', | ||
+ | 'Block quote' | ||
], | ], | ||
[ | [ | ||
'//upload.wikimedia.org/wikipedia/commons/6/60/Button_insert_table.png', | '//upload.wikimedia.org/wikipedia/commons/6/60/Button_insert_table.png', | ||
− | ' | + | 'Insert a table', |
− | '{| class="wikitable"\n | + | '{| class="wikitable"\n|', |
'\n|}', | '\n|}', | ||
− | ' | + | '-\n! header 1\n! header 2\n! header 3\n|-\n| row 1, cell 1\n| row 1, cell 2\n| row 1, cell 3\n|-\n| row 2, cell 1\n| row 2, cell 2\n| row 2, cell 3' |
], | ], | ||
[ | [ | ||
− | '// | + | '//upload.wikimedia.org/wikipedia/commons/7/79/Button_reflink.png', |
− | + | 'Insert a reference', | |
− | + | '<ref>', | |
− | + | '</ref>', | |
− | + | 'Insert footnote text here' | |
− | |||
− | ' | ||
− | ' | ||
− | |||
− | |||
− | '/ | ||
− | ' | ||
− | |||
] | ] | ||
]; | ]; | ||
$.each( buttons, function() { mw.toolbar.addButton.apply( null, this ); } ); | $.each( buttons, function() { mw.toolbar.addButton.apply( null, this ); } ); | ||
+ | |||
} )(); | } )(); |
Версия 12:26, 6 августа 2016
( function() {
/**
* Extra classic toolbar options
*
* Adds extra buttons to the classic editing toolbar.
*/
var buttons = [
[
'//upload.wikimedia.org/wikipedia/commons/c/c8/Button_redirect.png',
'Redirect',
'#REDIRECT [[',
']]',
'Target page name'
],
[
'//upload.wikimedia.org/wikipedia/commons/c/c9/Button_strike.png',
'Strike',
'<s>',
'</s>',
'Strike-through text'
],
[
'//upload.wikimedia.org/wikipedia/commons/1/13/Button_enter.png',
'Line break',
'<br>'
],
[
'//upload.wikimedia.org/wikipedia/commons/6/6a/Button_sup_letter.png',
'Superscript',
'<sup>',
'</sup>',
'Superscript text'
],
[
'//upload.wikimedia.org/wikipedia/commons/a/aa/Button_sub_letter.png',
'Subscript',
'<sub>',
'</sub>',
'Subscript text'
],
[
'//upload.wikimedia.org/wikipedia/commons/d/d5/Button_small_text.png',
'Small',
'<small>',
'</small>',
'Small text'
],
[
'//upload.wikimedia.org/wikipedia/commons/3/34/Button_hide_comment.png',
'Insert hidden Comment',
'<!-- ',
' -->',
'Comment'
],
[
'//upload.wikimedia.org/wikipedia/commons/1/12/Button_gallery.png',
'Insert a picture gallery',
'\n<gallery>\n',
'\n</gallery>',
'File:Example.jpg|Caption1\nFile:Example.jpg|Caption2'
],
[
'//upload.wikimedia.org/wikipedia/commons/f/fd/Button_blockquote.png',
'Insert block of quoted text',
'<blockquote>\n',
'\n</blockquote>',
'Block quote'
],
[
'//upload.wikimedia.org/wikipedia/commons/6/60/Button_insert_table.png',
'Insert a table',
'{| class="wikitable"\n|',
'\n|}',
'-\n! header 1\n! header 2\n! header 3\n|-\n| row 1, cell 1\n| row 1, cell 2\n| row 1, cell 3\n|-\n| row 2, cell 1\n| row 2, cell 2\n| row 2, cell 3'
],
[
'//upload.wikimedia.org/wikipedia/commons/7/79/Button_reflink.png',
'Insert a reference',
'<ref>',
'</ref>',
'Insert footnote text here'
]
];
$.each( buttons, function() { mw.toolbar.addButton.apply( null, this ); } );
} )();