Перейти к содержанию

MediaWiki:Common.js: различия между версиями

нет описания правки
Нет описания правки
Нет описания правки
Строка 7: Строка 7:
$textarea.wikiEditor( 'addToToolbar', {
$textarea.wikiEditor( 'addToToolbar', {
section: 'main',
section: 'main',
group: 'default',
groups: {
tools: {
list: {
dothing: {
tools: {
type: 'element',
templates: {
element: function ( context ) {
label: 'Templates',
// Note that the `context` object contains various useful references.
type: 'select',
console.log( context );
list: {
var button = new OO.ui.ButtonInputWidget( {
'Ping-button': {
label: 'Do a thing',
label: '{{Ping}}',
icon: 'hieroglyph'
action: {
} );
type: 'encapsulate',
button.connect( null, {
options: {
click: function ( e ) {
pre: '{{Ping|',
// Do whatever is required when the button is clicked.
post: '}}'
console.log( e );
}
OO.ui.alert( 'A thing is done.' );
}
},
'Clear-button': {
label: 'Clear',
action: {
type: 'encapsulate',
options: {
pre: '{{Clear}}'
}
}
},
'Done-button': {
label: 'Done',
action: {
type: 'encapsulate',
options: {
pre: '{{Done}}'
}
}
}
}
}
} );
}
return button.$element;
}
}
}
}