imported>=海豚= |
imported>=海豚= |
第1行: |
第1行: |
| /* Generic code */
| | mw.loader.load('https://common.wjghj.cn/js/InPageEdit-v2'); |
| window.customizeToolbar = function( customizer ) {
| | $(function(){ |
| /* Check if we are in edit mode and the required modules are available and then customize the toolbar */
| | $('#ca-view').after( |
| if ( $.inArray( mw.config.get( 'wgAction' ), ['edit', 'submit'] ) !== -1 ) {
| | $('<li>',{ |
| if ( mw.user.options.get('usebetatoolbar') ) {
| | id:'ca-quick-edit', |
| mw.loader.using( 'ext.wikiEditor.toolbar', function () {
| | class:'collapsible' |
| $(document).ready( function() {
| | }).append( |
| customizer.call( $( '#wpTextbox1' ) );
| | $('<span>').append( |
| } );
| | $('<a>',{ |
| } );
| | href: 'javascript:void(0)' |
| }
| | }) |
| }
| | .text(' 快速编辑') |
| }
| | .click(function(){ |
| | | InPageEdit.edit({ |
| /* If the user manually chose this gadget */
| | page: mw.config.get('wgPageName'), |
| if ( mw.user.options.get('gadget-Edittools-vector') ) {
| | revision: mw.config.get('wgRevisionId') |
| customizeToolbar( function() { | | }); |
| this.wikiEditor('addToToolbar', {
| | }) |
| 'section': 'main',
| | ) |
| 'group': 'insert',
| | ) |
| 'tools': {
| | ); |
| 'category': {
| | }); |
| label: '分類',
| |
| type: 'button',
| |
| 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: {
| |
| type: 'encapsulate',
| |
| options: {
| |
| pre: "[\[Category:",
| |
| post: "]]"
| |
| }
| |
| }
| |
| }
| |
| }
| |
| } );
| |
| | |
| this.wikiEditor('addToToolbar', {
| |
| 'section': 'advanced',
| |
| 'group': 'format',
| |
| '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': {
| |
| label: '刪除線',
| |
| type: 'button',
| |
| icon: '//upload.wikimedia.org/wikipedia/commons/1/1a/Toolbaricon_strike.png',
| |
| action: {
| |
| type: 'encapsulate',
| |
| options: {
| |
| pre: "<s>",
| |
| post: "</s>"
| |
| }
| |
| }
| |
| },
| |
| | |
| 'underline': {
| |
| label: '底線',
| |
| type: 'button',
| |
| icon: '//upload.wikimedia.org/wikipedia/commons/thumb/9/99/Gnome-format-text-underline.svg/22px-Gnome-format-text-underline.svg.png',
| |
| action: {
| |
| type: 'encapsulate',
| |
| options: {
| |
| pre: "<u>",
| |
| post: "</u>"
| |
| }
| |
| }
| |
| },
| |
| 'quote': {
| |
| label: '引用區塊',
| |
| type: 'button',
| |
| icon: '//upload.wikimedia.org/wikipedia/commons/2/2f/Toolbaricon_quote_1.png',
| |
| action: {
| |
| type: 'encapsulate',
| |
| options: {
| |
| pre: "<blockquote>",
| |
| post: "</blockquote>"
| |
| }
| |
| }
| |
| },
| |
| | |
| 'justify-left': {
| |
| label: '靠左對齊',
| |
| type: 'button',
| |
| icon: '//upload.wikimedia.org/wikipedia/commons/8/81/Toolbaricon_justify-left.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/c/ce/Gnome-format-justify-center.svg/23px-Gnome-format-justify-center.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/f/fb/Gnome-format-justify-right.svg/23px-Gnome-format-justify-right.svg.png',
| |
| action: {
| |
| type: 'encapsulate',
| |
| options: {
| |
| pre: "<div style=\"text-align: right;\">",
| |
| 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>'
| |
| }
| |
| }
| |
| }
| |
| }
| |
| } ); | |
| | |
| this.wikiEditor('addToToolbar', { | |
| 'section': 'advanced',
| |
| 'group': 'insert',
| |
| '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': {
| |
| label: '註解(隱藏文字)',
| |
| type: 'button',
| |
| icon: '//upload.wikimedia.org/wikipedia/commons/1/11/Toolbaricon_hiddencomment.png',
| |
| action: {
| |
| type: 'encapsulate',
| |
| options: {
| |
| pre: "<!-- ",
| |
| post: " -->"
| |
| }
| |
| }
| |
| },
| |
| | |
| 'hline': {
| |
| label: '分隔線',
| |
| type: 'button',
| |
| icon: '//upload.wikimedia.org/wikipedia/commons/2/2c/Norwegian_ndash_sign.png',
| |
| action: {
| |
| type: 'encapsulate',
| |
| options: {
| |
| pre: "----",
| |
| 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: "]]"
| |
| }
| |
| }
| |
| },
| |
| | |
| 'references': {
| |
| label: '參考文獻(備註)列表',
| |
| type: 'button',
| |
| icon: '//upload.wikimedia.org/wikipedia/commons/8/8d/Wikieditor-references.png',
| |
| action: {
| |
| type: 'encapsulate',
| |
| options: {
| |
| pre: "\n==備註==\n{\{reflist}}\n",
| |
| }
| |
| }
| |
| }
| |
| }
| |
| } );
| |
| } );
| |
| }
| |