无编辑摘要
imported>=海豚= 无编辑摘要 |
imported>=海豚= 无编辑摘要 |
||
第1行: | 第1行: | ||
/* Generic code */ | /* Generic code */ | ||
window.customizeToolbar = function( customizer ) { | window.customizeToolbar = function( customizer ) { | ||
第5行: | 第4行: | ||
if ( $.inArray( mw.config.get( 'wgAction' ), ['edit', 'submit'] ) !== -1 ) { | if ( $.inArray( mw.config.get( 'wgAction' ), ['edit', 'submit'] ) !== -1 ) { | ||
if ( mw.user.options.get('usebetatoolbar') ) { | if ( mw.user.options.get('usebetatoolbar') ) { | ||
mw.loader.using( 'ext.wikiEditor', function () { | mw.loader.using( 'ext.wikiEditor.toolbar', function () { | ||
$(document).ready( function() { | $(document).ready( function() { | ||
customizer.call( $( '#wpTextbox1' ) ); | customizer.call( $( '#wpTextbox1' ) ); | ||
第22行: | 第21行: | ||
'tools': { | 'tools': { | ||
'category': { | 'category': { | ||
label: '分 | label: '分 類', | ||
type: 'button', | type: 'button', | ||
icon: '//upload.wikimedia.org/wikipedia/commons/0/ | icon: '//upload.wikimedia.org/wikipedia/commons/thumb/0/00/Structure_du_site_ic%C3%B4ne.svg/23px-Structure_du_site_ic%C3%B4ne.svg.png', | ||
action: { | action: { | ||
type: 'encapsulate', | type: 'encapsulate', | ||
options: { | options: { | ||
pre: "[\[ | pre: "[\[Category:", | ||
post: "]]" | post: "]]" | ||
} | } | ||
第35行: | 第34行: | ||
} | } | ||
} ); | } ); | ||
this.wikiEditor('addToToolbar', { | this.wikiEditor('addToToolbar', { | ||
'section': 'advanced', | 'section': 'advanced', | ||
'group': 'format', | 'group': 'format', | ||
'tools': { | 'tools': { | ||
'bolditalic': { | |||
label: '粗斜體', | |||
type: 'button', | |||
icon: '//upload.wikimedia.org/wikipedia/commons/b/be/Toolbaricon_bolditalic_A.png', | |||
action: { | |||
type: 'encapsulate', | |||
options: { | |||
pre: "'''''", | |||
periMsg: '粗斜體文字', | |||
post: "'''''" | |||
} | |||
} | |||
}, | |||
'strikethrough': { | 'strikethrough': { | ||
label: ' | label: ' 刪 除 線', | ||
type: 'button', | type: 'button', | ||
icon: '//upload.wikimedia.org/wikipedia/commons/ | icon: '//upload.wikimedia.org/wikipedia/commons/1/1a/Toolbaricon_strike.png', | ||
action: { | action: { | ||
type: 'encapsulate', | type: 'encapsulate', | ||
第53行: | 第67行: | ||
'underline': { | 'underline': { | ||
label: ' | label: ' 底線', | ||
type: 'button', | type: 'button', | ||
icon: '//upload.wikimedia.org/wikipedia/commons/ | icon: '//upload.wikimedia.org/wikipedia/commons/thumb/9/99/Gnome-format-text-underline.svg/22px-Gnome-format-text-underline.svg.png', | ||
action: { | action: { | ||
type: 'encapsulate', | type: 'encapsulate', | ||
第64行: | 第78行: | ||
} | } | ||
}, | }, | ||
'quote': { | |||
' | label: '引用 區塊', | ||
label: ' | |||
type: 'button', | type: 'button', | ||
icon: '//upload.wikimedia.org/wikipedia/commons/2/ | icon: '//upload.wikimedia.org/wikipedia/commons/2/2f/Toolbaricon_quote_1.png', | ||
action: { | action: { | ||
type: 'encapsulate', | type: 'encapsulate', | ||
options: { | options: { | ||
pre: " | pre: "<blockquote>", | ||
post: | post: "</blockquote>" | ||
} | } | ||
} | } | ||
第79行: | 第92行: | ||
'justify-left': { | 'justify-left': { | ||
label: '左 | label: ' 靠 左 對齊', | ||
type: 'button', | type: 'button', | ||
icon: '//upload.wikimedia.org/wikipedia/commons/ | icon: '//upload.wikimedia.org/wikipedia/commons/8/81/Toolbaricon_justify-left.png', | ||
action: { | action: { | ||
type: 'encapsulate', | type: 'encapsulate', | ||
第92行: | 第105行: | ||
'justify-center': { | 'justify-center': { | ||
label: ' | label: ' 置 中 對齊', | ||
type: 'button', | type: 'button', | ||
icon: '//upload.wikimedia.org/wikipedia/commons/ | icon: '//upload.wikimedia.org/wikipedia/commons/thumb/c/ce/Gnome-format-justify-center.svg/23px-Gnome-format-justify-center.svg.png', | ||
action: { | action: { | ||
type: 'encapsulate', | type: 'encapsulate', | ||
第105行: | 第118行: | ||
'justify-right': { | 'justify-right': { | ||
label: '右 | label: ' 靠 右 對齊', | ||
type: 'button', | type: 'button', | ||
icon: '//upload.wikimedia.org/wikipedia/commons/ | icon: '//upload.wikimedia.org/wikipedia/commons/thumb/f/fb/Gnome-format-justify-right.svg/23px-Gnome-format-justify-right.svg.png', | ||
action: { | action: { | ||
type: 'encapsulate', | type: 'encapsulate', | ||
第113行: | 第126行: | ||
pre: "<div style=\"text-align: right;\">", | pre: "<div style=\"text-align: right;\">", | ||
post: "</div>" | post: "</div>" | ||
} | |||
} | |||
}, | |||
'indent-more': { | |||
label: '定義', | |||
type: 'button', | |||
icon: '//upload.wikimedia.org/wikipedia/commons/thumb/8/84/Gnome-format-indent-more.svg/23px-Gnome-format-indent-more.svg.png', | |||
action: { | |||
type: 'encapsulate', | |||
options: { | |||
pre: ";" | |||
} | |||
} | |||
}, | |||
'source': { | |||
label: '來源', | |||
type: 'button', | |||
icon: '//upload.wikimedia.org/wikipedia/commons/thumb/1/1b/Toolbaricon_source.svg/22px-Toolbaricon_source.svg.png', | |||
action: { | |||
type: 'encapsulate', | |||
options: { | |||
pre: "<source lang=\"text\">", | |||
post: '</source>' | |||
} | } | ||
} | } | ||
第123行: | 第160行: | ||
'group': 'insert', | 'group': 'insert', | ||
'tools': { | 'tools': { | ||
'math': { | |||
label: '數學公式', | |||
type: 'button', | |||
icon: '//upload.wikimedia.org/wikipedia/commons/thumb/c/c2/Nuvola_apps_edu_mathematics-p.svg/22px-Nuvola_apps_edu_mathematics-p.svg.png', | |||
action: { | |||
type: 'encapsulate', | |||
options: { | |||
pre: "<math>", | |||
periMsg: '插入數學公式', | |||
post: "</math>" | |||
} | |||
} | |||
}, | |||
'template': { | |||
label: '模板', | |||
type: 'button', | |||
icon: '//upload.wikimedia.org/wikipedia/commons/thumb/9/9a/Curly_Brackets.svg/22px-Curly_Brackets.svg.png', | |||
action: { | |||
type: 'encapsulate', | |||
options: { | |||
pre: "{\{", | |||
periMsg: '模板名稱', | |||
post: "}}" | |||
} | |||
} | |||
}, | |||
'hidden': { | 'hidden': { | ||
label: ' | label: ' 註解(隱 藏文字 )', | ||
type: 'button', | type: 'button', | ||
icon: '//upload.wikimedia.org/wikipedia/commons/ | icon: '//upload.wikimedia.org/wikipedia/commons/1/11/Toolbaricon_hiddencomment.png', | ||
action: { | action: { | ||
type: 'encapsulate', | type: 'encapsulate', | ||
第138行: | 第202行: | ||
'hline': { | 'hline': { | ||
label: ' | label: ' 分隔線', | ||
type: 'button', | type: 'button', | ||
icon: '//upload.wikimedia.org/wikipedia/commons/ | icon: '//upload.wikimedia.org/wikipedia/commons/2/2c/Norwegian_ndash_sign.png', | ||
action: { | action: { | ||
type: 'encapsulate', | type: 'encapsulate', | ||
第146行: | 第210行: | ||
pre: "----", | pre: "----", | ||
ownline: true | ownline: true | ||
} | |||
} | |||
}, | |||
'hans-hant': { | |||
label: '繁簡轉換', | |||
type: 'button', | |||
icon: '//upload.wikimedia.org/wikipedia/commons/9/9d/Toolbaricon_sr.png', | |||
action: { | |||
type: 'encapsulate', | |||
options: { | |||
pre: "-{", | |||
periMsg: '轉換文字', | |||
post: "}-" | |||
} | |||
} | |||
}, | |||
'mediafile': { | |||
label: '媒體檔案連結', | |||
type: 'button', | |||
icon: '//upload.wikimedia.org/wikipedia/commons/6/65/Toolbaricon_media.png', | |||
action: { | |||
type: 'encapsulate', | |||
options: { | |||
pre: "[[Media:", | |||
periMsg: 'Example.ogg', | |||
post: "]]" | |||
} | } | ||
} | } | ||
第151行: | 第243行: | ||
'references': { | 'references': { | ||
label: ' | label: ' 參 考文 獻(備註)列表', | ||
type: 'button', | type: 'button', | ||
icon: '//upload.wikimedia.org/wikipedia/commons/ | icon: '//upload.wikimedia.org/wikipedia/commons/8/8d/Wikieditor-references.png', | ||
action: { | action: { | ||
type: 'encapsulate', | type: 'encapsulate', | ||
options: { | options: { | ||
pre: " | pre: "\n== 備註==\n{\{reflist}}\n", | ||
} | } | ||
} | } | ||
第165行: | 第257行: | ||
} ); | } ); | ||
} | } | ||