MediaWiki:Gadget-EditAddButton.js:修订间差异
来自康健生活
无编辑摘要 |
无编辑摘要 |
||
| 第268行: | 第268行: | ||
} | } | ||
}, | }, | ||
div_900px_tag: { | |||
label: 'Div 900px tag for editors', | label: 'Div 900px tag for editors', | ||
type: 'button', | type: 'button', | ||
| 第278行: | 第278行: | ||
peri: 'Insert comment here', | peri: 'Insert comment here', | ||
post: '</div>' | post: '</div>' | ||
} | |||
} | |||
}, | |||
js_out_tag: { | |||
label: 'Js and console for editors', | |||
type: 'button', | |||
icon: 'images/toolbar_img/js_out.png', | |||
action: { | |||
type: 'encapsulate', | |||
options: { | |||
pre: '{{leftrightflex|<syntaxhighlight lang="javascript">', | |||
peri: 'Insert comment here', | |||
post: '</syntaxhighlight>|{{consoleout|<pre></pre>}}}}' | |||
} | |||
} | |||
}, | |||
bash_out_tag: { | |||
label: 'bash and console for editors', | |||
type: 'button', | |||
icon: 'images/toolbar_img/js_out.png', | |||
action: { | |||
type: 'encapsulate', | |||
options: { | |||
pre: '{{Shc_out|<syntaxhighlight lang="bash">', | |||
peri: 'Insert comment here', | |||
post: '</syntaxhighlight>|<syntaxhighlight lang="bash"></syntaxhighlight>|$|/home/kangkk}}' | |||
} | |||
} | |||
}, | |||
file_text_tag: { | |||
label: 'file text for editors', | |||
type: 'button', | |||
icon: 'images/toolbar_img/file_text.png', | |||
action: { | |||
type: 'encapsulate', | |||
options: { | |||
pre: '{{hc|head=|output=<syntaxhighlight lang="bash">', | |||
peri: 'Insert comment here', | |||
post: '</syntaxhighlight>}}' | |||
} | |||
} | |||
}, | |||
file_text_diff_tag: { | |||
label: 'file text diff for editors', | |||
type: 'button', | |||
icon: 'images/toolbar_img/js_out.png', | |||
action: { | |||
type: 'encapsulate', | |||
options: { | |||
pre: '{{hcdiff|head=|output=<syntaxhighlight lang="bash">', | |||
peri: 'Insert comment here', | |||
post: '</syntaxhighlight>|output2=<syntaxhighlight lang="bash"></syntaxhighlight>}}' | |||
} | } | ||
} | } | ||
2021年4月3日 (六) 18:02的版本
var customizeToolbar = function () {
/* Your code goes here */
jQuery( document ).ready( function ( $ ) {
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
section: 'advanced',
group: 'format',
tools: {
reqular_s_stroke: {
label: 'Comment visible only for editors',
type: 'button',
icon: 'images/toolbar_img/Toolbaricon_regular_S_stroke.png',
action: {
type: 'encapsulate',
options: {
pre: '<!-- ',
peri: 'Insert comment here',
post: ' -->'
}
}
},
toolbar_css_tag: {
label: 'CSS tag for editors',
type: 'button',
icon: 'images/toolbar_img/CSS.png',
action: {
type: 'encapsulate',
options: {
pre: '<syntaxhighlight lang="css">\n',
peri: 'Insert comment here\n',
post: '</syntaxhighlight>'
}
}
},
toolbar_html_tag: {
label: 'HTML tag for editors',
type: 'button',
icon: 'images/toolbar_img/HTML-Button.png',
action: {
type: 'encapsulate',
options: {
pre: '<syntaxhighlight lang="html5">\n',
peri: 'Insert comment here\n',
post: '</syntaxhighlight>'
}
}
},
toolbar_bash_tag: {
label: 'BASH tag for editors',
type: 'button',
icon: 'images/toolbar_img/BASH.png',
action: {
type: 'encapsulate',
options: {
pre: '{{shc|<syntaxhighlight lang="bash">\n',
peri: 'Insert comment here\n',
post: '</syntaxhighlight>}}'
}
}
},
toolbar_js_tag: {
label: 'JAVASCRIPT tag for editors',
type: 'button',
icon: 'images/toolbar_img/JSbutton.png',
action: {
type: 'encapsulate',
options: {
pre: '<syntaxhighlight lang="javascript">\n',
peri: 'Insert comment here\n',
post: '</syntaxhighlight>'
}
}
},
toolbar_blockquote_tag: {
label: 'Blockquote tag for editors',
type: 'button',
icon: 'images/toolbar_img/Button_blockquote.png',
action: {
type: 'encapsulate',
options: {
pre: '<blockquote>\n',
peri: 'Insert comment here\n',
post: '</blockquote>'
}
}
},
toolbar_pre_tag: {
label: 'PRE tag for editors',
type: 'button',
icon: 'images/toolbar_img/Button_insert_table.png',
action: {
type: 'encapsulate',
options: {
pre: '<pre>\n',
peri: 'Insert comment here\n',
post: '</pre>'
}
}
},
toolbar_bq_pre_tag: {
label: 'Blockquote > PRE tag for editors',
type: 'button',
icon: 'images/toolbar_img/BQ_PRE.png',
action: {
type: 'encapsulate',
options: {
pre: '<blockquote><pre>\n',
peri: 'Insert comment here\n',
post: '</pre></blockquote>'
}
}
},
toolbar_button_reflink: {
label: 'Button reflink tag for editors',
type: 'button',
icon: 'images/toolbar_img/Button_reflink.png',
action: {
type: 'encapsulate',
options: {
pre: '<ref>',
peri: 'Insert comment here',
post: '</ref>'
}
}
},
toolbar_button_strong: {
label: 'strong tag for editors',
type: 'button',
icon: 'images/toolbar_img/Button_bold.png',
action: {
type: 'encapsulate',
options: {
pre: "'''",
peri: 'Insert comment here',
post: "'''"
}
}
},
toolbar_button_strike: {
label: 'Button_strike tag for editors',
type: 'button',
icon: 'images/toolbar_img/Button_strike.png',
action: {
type: 'encapsulate',
options: {
pre: '<s>',
peri: 'Insert comment here',
post: '</s>'
}
}
},
toolbar_button_email: {
label: 'Button email tag for editors',
type: 'button',
icon: 'images/toolbar_img/Button_spam2.png',
action: {
type: 'encapsulate',
options: {
pre: '[mailto:',
peri: 'Insert comment here',
post: ']'
}
}
},
toolbar_button_outLink: {
label: 'Button outLink tag for editors',
type: 'button',
icon: 'images/toolbar_img/Button_Link_DifferentName.png',
action: {
type: 'encapsulate',
options: {
pre: '[[|',
peri: 'Insert comment here',
post: ']]'
}
}
},
toolbar_button_redNote: {
label: 'Button redNote tag for editors',
type: 'button',
icon: 'images/toolbar_img/Marco1.png',
action: {
type: 'encapsulate',
options: {
pre: '{{Warning|',
peri: 'Insert comment here',
post: '}}'
}
}
},
toolbar_button_greenNote: {
label: 'Button greenNote tag for editors',
type: 'button',
icon: 'images/toolbar_img/Button_chapitre.png',
action: {
type: 'encapsulate',
options: {
pre: '<div class="pageBoxGreen">',
peri: 'Insert comment here',
post: '</div>'
}
}
},
toolbar_button_hrTag: {
label: 'Button hr tag for editors',
type: 'button',
icon: 'images/toolbar_img/Button_hr.png',
action: {
type: 'encapsulate',
options: {
pre: '<hr>\n',
peri: '',
post: ''
}
}
},
toolbar_button_noToc: {
label: 'Button noToc tag for editors',
type: 'button',
icon: 'images/toolbar_img/Button_stop.png',
action: {
type: 'encapsulate',
options: {
pre: '__NOTOC__\n',
peri: '',
post: ''
}
}
},
toolbar_code_tag: {
label: 'code tag for editors',
type: 'button',
icon: 'images/toolbar_img/Btn_toolbar_commentaire.png',
action: {
type: 'encapsulate',
options: {
pre: '<code>',
peri: 'Insert comment here',
post: '</code>'
}
}
},
div_300px_tag: {
label: 'Div 300px tag for editors',
type: 'button',
icon: 'images/toolbar_img/width300px.png',
action: {
type: 'encapsulate',
options: {
pre: '<div style="width:300px;">',
peri: 'Insert comment here',
post: '</div>'
}
}
},
div_600px_tag: {
label: 'Div 600px tag for editors',
type: 'button',
icon: 'images/toolbar_img/width600px.png',
action: {
type: 'encapsulate',
options: {
pre: '<div style="width:600px;">',
peri: 'Insert comment here',
post: '</div>'
}
}
},
div_900px_tag: {
label: 'Div 900px tag for editors',
type: 'button',
icon: 'images/toolbar_img/width900px.png',
action: {
type: 'encapsulate',
options: {
pre: '<div style="width:900px;">',
peri: 'Insert comment here',
post: '</div>'
}
}
},
js_out_tag: {
label: 'Js and console for editors',
type: 'button',
icon: 'images/toolbar_img/js_out.png',
action: {
type: 'encapsulate',
options: {
pre: '{{leftrightflex|<syntaxhighlight lang="javascript">',
peri: 'Insert comment here',
post: '</syntaxhighlight>|{{consoleout|<pre></pre>}}}}'
}
}
},
bash_out_tag: {
label: 'bash and console for editors',
type: 'button',
icon: 'images/toolbar_img/js_out.png',
action: {
type: 'encapsulate',
options: {
pre: '{{Shc_out|<syntaxhighlight lang="bash">',
peri: 'Insert comment here',
post: '</syntaxhighlight>|<syntaxhighlight lang="bash"></syntaxhighlight>|$|/home/kangkk}}'
}
}
},
file_text_tag: {
label: 'file text for editors',
type: 'button',
icon: 'images/toolbar_img/file_text.png',
action: {
type: 'encapsulate',
options: {
pre: '{{hc|head=|output=<syntaxhighlight lang="bash">',
peri: 'Insert comment here',
post: '</syntaxhighlight>}}'
}
}
},
file_text_diff_tag: {
label: 'file text diff for editors',
type: 'button',
icon: 'images/toolbar_img/js_out.png',
action: {
type: 'encapsulate',
options: {
pre: '{{hcdiff|head=|output=<syntaxhighlight lang="bash">',
peri: 'Insert comment here',
post: '</syntaxhighlight>|output2=<syntaxhighlight lang="bash"></syntaxhighlight>}}'
}
}
},
}
} );
} );
};
/* Check if view is in edit mode and that the required modules are available. Then, customize the toolbar … */
if ( $.inArray( mw.config.get( 'wgAction' ), [ 'edit', 'submit' ] ) !== -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 );
}
} );
}
No categories