MediaWiki:Gadget-Edittools-vector.js:修订间差异
跳到导航
跳到搜索
imported>=海豚= 无编辑摘要 |
imported>=海豚= |
||
(未显示同一用户的21个中间版本) | |||
第24行: | 第24行: | ||
label: '分类', | label: '分类', | ||
type: 'button', | type: 'button', | ||
icon: '//upload.wikimedia.org/wikipedia/commons/0/0c/VisualEditor_-_Icon_-_Tag.svg', | |||
icon: '//upload.wikimedia.org/wikipedia/commons | |||
action: { | action: { | ||
type: 'encapsulate', | type: 'encapsulate', | ||
第36行: | 第35行: | ||
} | } | ||
} ); | } ); | ||
this.wikiEditor('addToToolbar', { | this.wikiEditor('addToToolbar', { | ||
'section': 'advanced', | 'section': 'advanced', | ||
'group': 'format', | 'group': 'format', | ||
'tools': { | 'tools': { | ||
' | 'strikethrough': { | ||
label: ' | label: ' 删除线', | ||
type: 'button', | type: 'button', | ||
icon: '//upload.wikimedia.org/wikipedia/commons | icon: '//upload.wikimedia.org/wikipedia/commons/7/72/VisualEditor_-_Icon_-_Strikethrough-s.svg', | ||
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/ | icon: '//upload.wikimedia.org/wikipedia/commons/a/a9/VisualEditor_-_Icon_-_Underline-u.svg', | ||
action: { | action: { | ||
type: 'encapsulate', | type: 'encapsulate', | ||
options: { | options: { | ||
pre: "< | pre: "<u>", | ||
post: "</ | post: "</u>" | ||
} | } | ||
} | } | ||
}, | }, | ||
' | 'source': { | ||
label: ' | label: ' 条目引用', | ||
type: 'button', | type: 'button', | ||
icon: '//upload.wikimedia.org/wikipedia/commons/ | icon: '//upload.wikimedia.org/wikipedia/commons/2/2c/VisualEditor_-_Icon_-_Source.svg', | ||
action: { | action: { | ||
type: 'encapsulate', | type: 'encapsulate', | ||
options: { | options: { | ||
pre: " | pre: "[[", | ||
post: | post: ']]' | ||
} | } | ||
} | } | ||
}, | }, | ||
'justify-left': { | |||
' | label: ' 左对齐', | ||
label: ' | |||
type: 'button', | type: 'button', | ||
icon: '//upload.wikimedia.org/wikipedia/commons | icon: '//upload.wikimedia.org/wikipedia/commons/7/7f/OOjs_UI_icon_alignLeft.svg', | ||
action: { | action: { | ||
type: 'encapsulate', | type: 'encapsulate', | ||
options: { | options: { | ||
pre: "< | pre: "<div style=\"text-align: left;\">", | ||
post: "</ | post: "</div>" | ||
} | } | ||
} | } | ||
}, | }, | ||
' | 'justify-center': { | ||
label: ' | label: ' 居中', | ||
type: 'button', | type: 'button', | ||
icon: '//upload.wikimedia.org/wikipedia/commons/ | icon: '//upload.wikimedia.org/wikipedia/commons/b/ba/OOjs_UI_icon_alignCenter.svg', | ||
action: { | action: { | ||
type: 'encapsulate', | type: 'encapsulate', | ||
options: { | options: { | ||
pre: "< | pre: "<center>", | ||
post: "</ | post: "</center>" | ||
} | } | ||
} | } | ||
}, | }, | ||
' | 'justify-right': { | ||
label: ' | label: ' 右对齐', | ||
type: 'button', | type: 'button', | ||
icon: '//upload.wikimedia.org/wikipedia/commons/ | icon: '//upload.wikimedia.org/wikipedia/commons/1/13/OOjs_UI_icon_alignRight.svg', | ||
action: { | action: { | ||
type: 'encapsulate', | type: 'encapsulate', | ||
options: { | options: { | ||
pre: "< | pre: "<div style=\"text-align: right;\">", | ||
post: "</div>" | |||
post: | |||
} | } | ||
} | } | ||
第145行: | 第127行: | ||
label: '注释或隐藏文字', | label: '注释或隐藏文字', | ||
type: 'button', | type: 'button', | ||
icon: '//upload.wikimedia.org/wikipedia/commons | icon: '//upload.wikimedia.org/wikipedia/commons/d/d1/VisualEditor_-_Icon_-_Comment.svg', | ||
action: { | action: { | ||
type: 'encapsulate', | type: 'encapsulate', | ||
第158行: | 第140行: | ||
label: '水平线', | label: '水平线', | ||
type: 'button', | type: 'button', | ||
icon: '//upload.wikimedia.org/wikipedia/commons | icon: '//upload.wikimedia.org/wikipedia/commons/0/0e/VisualEditor_-_Icon_-_Remove-item.svg', | ||
action: { | action: { | ||
type: 'encapsulate', | type: 'encapsulate', | ||
第171行: | 第153行: | ||
label: '参考文献区', | label: '参考文献区', | ||
type: 'button', | type: 'button', | ||
icon: '//upload.wikimedia.org/wikipedia/commons | icon: '//upload.wikimedia.org/wikipedia/commons/f/f9/VisualEditor_-_Icon_-_References.svg', | ||
action: { | action: { | ||
type: 'encapsulate', | type: 'encapsulate', |
2021年11月13日 (六) 21:50的最新版本
// <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/0/0c/VisualEditor_-_Icon_-_Tag.svg',
action: {
type: 'encapsulate',
options: {
pre: "[\[分类:",
post: "]]"
}
}
}
}
} );
this.wikiEditor('addToToolbar', {
'section': 'advanced',
'group': 'format',
'tools': {
'strikethrough': {
label: '删除线',
type: 'button',
icon: '//upload.wikimedia.org/wikipedia/commons/7/72/VisualEditor_-_Icon_-_Strikethrough-s.svg',
action: {
type: 'encapsulate',
options: {
pre: "<s>",
post: "</s>"
}
}
},
'underline': {
label: '下划线',
type: 'button',
icon: '//upload.wikimedia.org/wikipedia/commons/a/a9/VisualEditor_-_Icon_-_Underline-u.svg',
action: {
type: 'encapsulate',
options: {
pre: "<u>",
post: "</u>"
}
}
},
'source': {
label: '条目引用',
type: 'button',
icon: '//upload.wikimedia.org/wikipedia/commons/2/2c/VisualEditor_-_Icon_-_Source.svg',
action: {
type: 'encapsulate',
options: {
pre: "[[",
post: ']]'
}
}
},
'justify-left': {
label: '左对齐',
type: 'button',
icon: '//upload.wikimedia.org/wikipedia/commons/7/7f/OOjs_UI_icon_alignLeft.svg',
action: {
type: 'encapsulate',
options: {
pre: "<div style=\"text-align: left;\">",
post: "</div>"
}
}
},
'justify-center': {
label: '居中',
type: 'button',
icon: '//upload.wikimedia.org/wikipedia/commons/b/ba/OOjs_UI_icon_alignCenter.svg',
action: {
type: 'encapsulate',
options: {
pre: "<center>",
post: "</center>"
}
}
},
'justify-right': {
label: '右对齐',
type: 'button',
icon: '//upload.wikimedia.org/wikipedia/commons/1/13/OOjs_UI_icon_alignRight.svg',
action: {
type: 'encapsulate',
options: {
pre: "<div style=\"text-align: right;\">",
post: "</div>"
}
}
}
}
} );
this.wikiEditor('addToToolbar', {
'section': 'advanced',
'group': 'insert',
'tools': {
'hidden': {
label: '注释或隐藏文字',
type: 'button',
icon: '//upload.wikimedia.org/wikipedia/commons/d/d1/VisualEditor_-_Icon_-_Comment.svg',
action: {
type: 'encapsulate',
options: {
pre: "<!-- ",
post: " -->"
}
}
},
'hline': {
label: '水平线',
type: 'button',
icon: '//upload.wikimedia.org/wikipedia/commons/0/0e/VisualEditor_-_Icon_-_Remove-item.svg',
action: {
type: 'encapsulate',
options: {
pre: "----",
ownline: true
}
}
},
'references': {
label: '参考文献区',
type: 'button',
icon: '//upload.wikimedia.org/wikipedia/commons/f/f9/VisualEditor_-_Icon_-_References.svg',
action: {
type: 'encapsulate',
options: {
pre: "\n\n==注释与外部链接==\n<references/>\n\n",
}
}
}
}
} );
} );
}
// </nowiki>