查看“MediaWiki:Common.js”的源代码
因为以下原因,您没有权限编辑该页面:
您可以查看和复制此页面的源代码。
/* see:
https://www.mediawiki.org/wiki/Extension:WikiEditor/Toolbar_customization
*/
var customizeToolbar = function () {
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
'section': 'advanced',
'group': 'insert',
'tools': {
'smile': {
label: 'Code', // or use labelMsg for a localized label, see above
type: 'button',
icon: '//riguz.com/images/0/09/WikiEditor-Code.png',
action: {
type: 'encapsulate',
options: {
pre: "<syntaxhighlight lang=\"java\">\n",
post: "\n</syntaxhighlight>"
}
}
}
}
});
};
/* Check if view is in edit mode and that the required modules are available. Then, customize the toolbar … */
if ( [ 'edit', 'submit' ].indexOf( mw.config.get( 'wgAction' ) ) !== -1 ) {
mw.loader.using( 'user.options' ).then( function () {
000
1:0