这是林泊百科的迁移技术测试站点,所有改动不会同步到林泊百科上,此站点将会在正式迁移后关闭,请勿存放重要数据

MediaWiki:Gadget-Emoji.js:修订间差异

来自Limbo Wiki
跳转到导航 跳转到搜索
Sam0324留言 | 贡献
无编辑摘要
Sam0324留言 | 贡献
无编辑摘要
第5行: 第5行:
tools: {
tools: {
buttonId: {
buttonId: {
label: 'Comment visible only for editors',
label: 'gadget-toolbar-emoji-1',
type: 'button',
type: 'button',
action: {
action: {
第11行: 第11行:
options: {
options: {
pre: '<!-- ',
pre: '<!-- ',
peri: 'Insert comment here',
peri: 'gadget-toolbar-emoji-2',
post: ' -->'
post: ' -->'
}
}
第18行: 第18行:
}
}
});
});
$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;
}
}
}
} );
});});
});});

2022年4月3日 (日) 22:47的版本

$(function() {mw.hook( 'wikiEditor.toolbarReady' ).add( function ( $textarea ) {
	$textarea.wikiEditor( 'addToToolbar',{
		section: 'advanced',
		group: 'format',
		tools: {
			buttonId: {
				label: 'gadget-toolbar-emoji-1',
				type: 'button',
				action: {
					type: 'encapsulate',
					options: {
						pre: '<!-- ',
						peri: 'gadget-toolbar-emoji-2',
						post: ' -->'
					}
				}
			}
		}
	});
});});