这是林泊百科的迁移技术测试站点,所有改动不会同步到林泊百科上,此站点将会在正式迁移后关闭,请勿存放重要数据
MediaWiki:Gadget-Emoji.js:修订间差异
跳转到导航
跳转到搜索
小无编辑摘要 |
小无编辑摘要 |
||
| 第19行: | 第19行: | ||
}); | }); | ||
$textarea.wikiEditor( 'addToToolbar', { | $textarea.wikiEditor( 'addToToolbar', { | ||
section: ' | section: 'advanced', | ||
group: ' | group: 'format', | ||
tools: { | tools: { | ||
dothing: { | dothing: { | ||
2022年4月3日 (日) 07:49的版本
$(function() {mw.hook( 'wikiEditor.toolbarReady' ).add( function ( $textarea ) {
$textarea.wikiEditor( 'addToToolbar',{
section: 'advanced',
group: 'format',
tools: {
buttonId: {
label: 'Comment visible only for editors',
type: 'button',
action: {
type: 'encapsulate',
options: {
pre: '<!-- ',
peri: 'Insert comment here',
post: ' -->'
}
}
}
}
});
$textarea.wikiEditor( 'addToToolbar', {
section: 'advanced',
group: 'format',
tools: {
dothing: {
type: 'element',
element: function ( context ) {
// Note that the `context` object contains various useful references.
console.log( context );
var button = new OO.ui.ButtonInputWidget( {
label: 'Do a thing',
icon: 'hieroglyph'
} );
button.connect( null, {
click: function ( e ) {
// Do whatever is required when the button is clicked.
console.log( e );
OO.ui.alert( 'A thing is done.' );
}
} );
return button.$element;
}
}
}
} );
});});