MediaWiki:Gadget-Edittools-vector.js:修订间差异
跳到导航
跳到搜索
imported>=海豚= 无编辑摘要 |
imported>=海豚= 无编辑摘要 |
||
| 第40行: | 第40行: | ||
'group': 'format', | 'group': 'format', | ||
'tools': { | 'tools': { | ||
' | 'justify-left': { | ||
label: ' | label: ' 左对齐', | ||
type: 'button', | type: 'button', | ||
icon: '//upload.wikimedia.org/wikipedia/commons/ | icon: '//upload.wikimedia.org/wikipedia/commons/thumb/7/7f/OOjs_UI_icon_alignLeft.svg/24px-OOjs_UI_icon_alignLeft.svg.png', | ||
action: { | action: { | ||
type: 'encapsulate', | type: 'encapsulate', | ||
options: { | options: { | ||
pre: " | pre: "<div style=\"text-align: left;\">", | ||
post: "</div>" | |||
post: " | |||
} | } | ||
} | } | ||
}, | }, | ||
' | 'justify-center': { | ||
label: ' | label: ' 居中', | ||
type: 'button', | type: 'button', | ||
icon: '//upload.wikimedia.org/wikipedia/commons/thumb/ | icon: '//upload.wikimedia.org/wikipedia/commons/thumb/b/ba/OOjs_UI_icon_alignCenter.svg/24px-OOjs_UI_icon_alignCenter.svg.png', | ||
action: { | action: { | ||
type: 'encapsulate', | type: 'encapsulate', | ||
options: { | options: { | ||
pre: "< | pre: "<div style=\"text-align: center;\">", | ||
post: "</ | post: "</div>" | ||
} | } | ||
} | } | ||
}, | }, | ||
' | 'justify-right': { | ||
label: ' | label: ' 右对齐', | ||
type: 'button', | type: 'button', | ||
icon: '//upload.wikimedia.org/wikipedia/commons/thumb/ | icon: '//upload.wikimedia.org/wikipedia/commons/thumb/1/13/OOjs_UI_icon_alignRight.svg/24px-OOjs_UI_icon_alignRight.svg.png', | ||
action: { | action: { | ||
type: 'encapsulate', | type: 'encapsulate', | ||
options: { | options: { | ||
pre: "< | pre: "<div style=\"text-align: right;\">", | ||
post: "</ | post: "</div>" | ||
} | } | ||
} | } | ||
}, | }, | ||
' | |||
label: ' | 'bolditalic': { | ||
label: ' 粗斜体', | |||
type: 'button', | type: 'button', | ||
icon: '//upload.wikimedia.org/wikipedia/commons/ | icon: '//upload.wikimedia.org/wikipedia/commons/b/be/Toolbaricon_bolditalic_A.png', | ||
action: { | action: { | ||
type: 'encapsulate', | type: 'encapsulate', | ||
options: { | options: { | ||
pre: " | pre: "'''''", | ||
post: " | periMsg: '粗斜体文字', | ||
post: "'''''" | |||
} | } | ||
} | } | ||
}, | }, | ||
' | 'strikethrough': { | ||
label: ' | label: ' 删除线', | ||
type: 'button', | type: 'button', | ||
icon: '//upload.wikimedia.org/wikipedia/commons/thumb/7/ | icon: '//upload.wikimedia.org/wikipedia/commons/thumb/7/72/VisualEditor_-_Icon_-_Strikethrough-s.svg/24px-VisualEditor_-_Icon_-_Strikethrough-s.svg.png', | ||
action: { | action: { | ||
type: 'encapsulate', | type: 'encapsulate', | ||
options: { | options: { | ||
pre: "< | pre: "<s>", | ||
post: "</ | post: "</s>" | ||
} | } | ||
} | } | ||
}, | }, | ||
' | 'underline': { | ||
label: ' | label: ' 下划线', | ||
type: 'button', | type: 'button', | ||
icon: '//upload.wikimedia.org/wikipedia/commons/thumb/ | icon: '//upload.wikimedia.org/wikipedia/commons/thumb/a/a9/VisualEditor_-_Icon_-_Underline-u.svg/24px-VisualEditor_-_Icon_-_Underline-u.svg.png', | ||
action: { | action: { | ||
type: 'encapsulate', | type: 'encapsulate', | ||
options: { | options: { | ||
pre: "< | pre: "<u>", | ||
post: "</ | post: "</u>" | ||
} | } | ||
} | } | ||
}, | }, | ||
' | 'quote': { | ||
label: ' | label: ' 块引用', | ||
type: 'button', | type: 'button', | ||
icon: '//upload.wikimedia.org/wikipedia/commons/thumb/ | icon: '//upload.wikimedia.org/wikipedia/commons/thumb/d/d8/VisualEditor_-_Icon_-_Block-quote.svg/24px-VisualEditor_-_Icon_-_Block-quote.svg.png', | ||
action: { | action: { | ||
type: 'encapsulate', | type: 'encapsulate', | ||
options: { | options: { | ||
pre: "< | pre: "<blockquote>", | ||
post: "</ | post: "</blockquote>" | ||
} | } | ||
} | } | ||
2021年5月6日 (四) 22:07的版本
// <nowiki>
/* Generic code */
window.customizeToolbar = function( customizer ) {
/* Check if we are in edit mode and the required modules are available and then customize the toolbar */
if ( $.inArray( mw.config.get( 'wgAction' ), ['edit', 'submit'] ) !== -1 ) {
if ( mw.user.options.get('usebetatoolbar') ) {
mw.loader.using( 'ext.wikiEditor', function () {
$(document).ready( function() {
customizer.call( $( '#wpTextbox1' ) );
} );
} );
}
}
}
/* If the user manually chose this gadget */
if ( mw.user.options.get('gadget-Edittools-vector') ) {
customizeToolbar( function() {
this.wikiEditor('addToToolbar', {
'section': 'main',
'group': 'insert',
'tools': {
'category': {
label: '分类',
type: 'button',
icon: '//upload.wikimedia.org/wikipedia/commons/thumb/0/0c/VisualEditor_-_Icon_-_Tag.svg/24px-VisualEditor_-_Icon_-_Tag.svg.png',
action: {
type: 'encapsulate',
options: {
pre: "[\[分类:",
post: "]]"
}
}
}
}
} );
this.wikiEditor('addToToolbar', {
'section': 'advanced',
'group': 'format',
'tools': {
'justify-left': {
label: '左对齐',
type: 'button',
icon: '//upload.wikimedia.org/wikipedia/commons/thumb/7/7f/OOjs_UI_icon_alignLeft.svg/24px-OOjs_UI_icon_alignLeft.svg.png',
action: {
type: 'encapsulate',
options: {
pre: "<div style=\"text-align: left;\">",
post: "</div>"
}
}
},
'justify-center': {
label: '居中',
type: 'button',
icon: '//upload.wikimedia.org/wikipedia/commons/thumb/b/ba/OOjs_UI_icon_alignCenter.svg/24px-OOjs_UI_icon_alignCenter.svg.png',
action: {
type: 'encapsulate',
options: {
pre: "<div style=\"text-align: center;\">",
post: "</div>"
}
}
},
'justify-right': {
label: '右对齐',
type: 'button',
icon: '//upload.wikimedia.org/wikipedia/commons/thumb/1/13/OOjs_UI_icon_alignRight.svg/24px-OOjs_UI_icon_alignRight.svg.png',
action: {
type: 'encapsulate',
options: {
pre: "<div style=\"text-align: right;\">",
post: "</div>"
}
}
},
'bolditalic': {
label: '粗斜体',
type: 'button',
icon: '//upload.wikimedia.org/wikipedia/commons/b/be/Toolbaricon_bolditalic_A.png',
action: {
type: 'encapsulate',
options: {
pre: "'''''",
periMsg: '粗斜体文字',
post: "'''''"
}
}
},
'strikethrough': {
label: '删除线',
type: 'button',
icon: '//upload.wikimedia.org/wikipedia/commons/thumb/7/72/VisualEditor_-_Icon_-_Strikethrough-s.svg/24px-VisualEditor_-_Icon_-_Strikethrough-s.svg.png',
action: {
type: 'encapsulate',
options: {
pre: "<s>",
post: "</s>"
}
}
},
'underline': {
label: '下划线',
type: 'button',
icon: '//upload.wikimedia.org/wikipedia/commons/thumb/a/a9/VisualEditor_-_Icon_-_Underline-u.svg/24px-VisualEditor_-_Icon_-_Underline-u.svg.png',
action: {
type: 'encapsulate',
options: {
pre: "<u>",
post: "</u>"
}
}
},
'quote': {
label: '块引用',
type: 'button',
icon: '//upload.wikimedia.org/wikipedia/commons/thumb/d/d8/VisualEditor_-_Icon_-_Block-quote.svg/24px-VisualEditor_-_Icon_-_Block-quote.svg.png',
action: {
type: 'encapsulate',
options: {
pre: "<blockquote>",
post: "</blockquote>"
}
}
},
'source': {
label: '源代码',
type: 'button',
icon: '//upload.wikimedia.org/wikipedia/commons/thumb/2/2c/VisualEditor_-_Icon_-_Source.svg/24px-VisualEditor_-_Icon_-_Source.svg.png',
action: {
type: 'encapsulate',
options: {
pre: "<syntaxhighlight lang=\"text\">",
post: '</syntaxhighlight>'
}
}
}
}
} );
this.wikiEditor('addToToolbar', {
'section': 'advanced',
'group': 'insert',
'tools': {
'hidden': {
label: '注释或隐藏文字',
type: 'button',
icon: '//upload.wikimedia.org/wikipedia/commons/thumb/d/d1/VisualEditor_-_Icon_-_Comment.svg/24px-VisualEditor_-_Icon_-_Comment.svg.png',
action: {
type: 'encapsulate',
options: {
pre: "<!-- ",
post: " -->"
}
}
},
'hline': {
label: '水平线',
type: 'button',
icon: '//upload.wikimedia.org/wikipedia/commons/thumb/0/0e/VisualEditor_-_Icon_-_Remove-item.svg/24px-VisualEditor_-_Icon_-_Remove-item.svg.png',
action: {
type: 'encapsulate',
options: {
pre: "----",
ownline: true
}
}
},
'references': {
label: '参考文献区',
type: 'button',
icon: '//upload.wikimedia.org/wikipedia/commons/thumb/f/f9/VisualEditor_-_Icon_-_References.svg/24px-VisualEditor_-_Icon_-_References.svg.png',
action: {
type: 'encapsulate',
options: {
pre: "\n==参考文献==\n{\{reflist}}\n",
}
}
}
}
} );
} );
}
// </nowiki>