Участник:Base/custumedittoolbar.js
Перейти к навигации
Перейти к поиску
//<nowiki>
var customizeToolbar = function() {
/* Your code goes here */
//вкладка сообщенія
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
'sections': {
'messages': {
'type': 'toolbar', // Can also be 'booklet'
'label': 'Повідомлення'
// or 'labelMsg': 'section-emoticons-label' for a localized label
}
}
} );
//группа Замечанія
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
'section': 'messages',
'groups': {
'doitings': {
'label': 'Замечанія' // or use labelMsg for a localized label, see above
}
}
} );
//кнопка категоризируйте шаблоны
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
'section': 'messages',
'group': 'doitings',
'tools': {
'tempcat': {
label: 'Категоризируйте шаблоны', // or use labelMsg for a localized label, see above
type: 'button',
icon: '//upload.wikimedia.org/wikipedia/commons/2/20/Toolbaricon_transclude.png',
action: {
type: 'encapsulate',
options: {
pre: "{{subst:"+"Участник:Base/Стандартныя сообщенія/Категоризація шаблоновъ}}" // text to be inserted
}
}
}
}
} );
//Не очистить а удалить
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
'section': 'messages',
'group': 'doitings',
'tools': {
'tempcat': {
label: 'Не очистити а вилучити', // or use labelMsg for a localized label, see above
type: 'button',
icon: '//upload.wikimedia.org/wikipedia/commons/b/ba/Toolbar_supr.png',
action: {
type: 'encapsulate',
options: {
pre: "{{subst:"+"Участник:Base/Стандартныя сообщенія/Не очистить а удалить}}" // text to be inserted
}
}
}
}
} );
//другое
//перечёркиваніе
$('#wpTextbox1').wikiEditor('addToToolbar', {
section: 'advanced',
group: 'format',
tools: {
"strikethrough": {
label: 'Перечеркнуть',
type: 'button',
icon: '//upload.wikimedia.org/wikipedia/commons/1/1a/Toolbaricon_strike.png',
action: {
type: 'encapsulate',
options: {
pre: "<s>",
post: "</s>"
}
}
}
}
});
//горизонтальная черта
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
section: 'advanced',
group: 'format',
tools: {
"hline": {
label: 'Горизонтальная черта',
type: 'button',
icon: '//upload.wikimedia.org/wikipedia/commons/b/b4/Toolbaricon_rule.png',
action: {
type: 'encapsulate',
options: {
pre: "----",
ownline: true
}
}
}
}
} );
//формула
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
section: 'advanced',
group: 'format',
tools: {
"math": {
label: 'Формула',
type: 'button',
icon: '//upload.wikimedia.org/wikipedia/commons/1/1c/Toolbaricon_math.png',
action: {
type: 'encapsulate',
options: {
pre: "<math>",
post: "</math>"
}
}
}
}
} );
};
/* Check if we are in edit mode and the required modules are available and then customize the toolbar */
if ( $.inArray( mw.config.get( 'wgAction' ), ['edit', 'submit'] ) !== -1 ) {
mw.loader.using( 'user.options', function () {
if ( mw.user.options.get('usebetatoolbar') ) {
mw.loader.using( 'ext.wikiEditor', function () {
$(document).ready( customizeToolbar );
} );
}
} );
}
//</nowiki>