首页
随机
最近更改
特殊页面
社群首页
参数设置
关于WHY42
免责声明
WHY42
搜索
用户菜单
登录
欢迎来到Riguz的小站!这是一个私人wiki,用来记录一些我的笔记。
查看“MediaWiki:Common.js”的源代码
←
MediaWiki:Common.js
因为以下原因,您没有权限编辑该页面:
您请求的操作仅限属于该用户组的用户执行:
用户
此页面为本wiki上的软件提供界面文本,并受到保护以防止滥用。 如欲修改所有wiki的翻译,请访问
translatewiki.net
上的MediaWiki本地化项目。
您无权编辑此JavaScript页面,因为编辑此页面可能会影响所有访问者。
您可以查看和复制此页面的源代码。
/* see: https://www.mediawiki.org/wiki/Extension:WikiEditor/Toolbar_customization */ var customizeToolbar = function () { $('#wpTextbox1').wikiEditor('addToToolbar', { 'section': 'advanced', 'group': 'format', 'tools': { 'inline-code': { label: 'Inline code', // or use labelMsg for a localized label, see above type: 'button', icon: '//riguz.com/images/2/27/Code-tags.svg', action: { type: 'encapsulate', options: { pre: "<syntaxhighlight lang=\"bash\" inline>", post: "</syntaxhighlight>" } } } } }); $('#wpTextbox1').wikiEditor('addToToolbar', { 'section': 'advanced', 'group': 'insert', 'tools': { 'code': { label: 'Code', // or use labelMsg for a localized label, see above type: 'button', icon: '//riguz.com/images/f/f4/Code-block-tags.svg', action: { type: 'encapsulate', options: { pre: "<syntaxhighlight lang=\"bash\">\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 () { // This can be the string "0" if the user disabled the preference ([[phab:T54542#555387]]) if (mw.user.options.get('usebetatoolbar') == 1) { $.when( mw.loader.using('ext.wikiEditor'), $.ready ).then(customizeToolbar); } }); }
返回
MediaWiki:Common.js
。