VOOZH about

URL: https://minecraft.wiki/w/MediaWiki:Gadget-classicToolbarButtons.js

⇱ MediaWiki:Gadget-classicToolbarButtons.js – Minecraft Wiki


MediaWiki:Gadget-classicToolbarButtons.js

From Minecraft Wiki
Jump to navigation Jump to search
In other languages

Note: After saving, you have to bypass your browser's cache to see the changes.

Google Chrome, Firefox, Microsoft Edge, and Safari: Hold down the key and click the Reload toolbar button.
For details and instructions about other browsers, see Wikipedia:Bypass your cache.

// <nowiki>
;(function(mw){
'use strict';
if(['edit','submit'].indexOf(mw.config.get('wgAction'))===-1)return;
constbuttons=[// ooui icon, label, pre, post, peri, group, section 
[
'strikethrough',
'Strike',
'<s>',
'</s>',
'Strike-through text',
'format',
'main'
],
[
'underline',
'Underline',
'<span style="text-decoration: underline">',
'</span>',
'Underlined text',
'format',
'main'
],
[
'code',
'Insert code',
'<code>',
'</code>',
'Code',
'insert',
'advanced'
],
[
'ongoingConversation',
'Insert hidden Comment',
'<!-- ',
' -->',
'Comment',
'insert',
'advanced'
],
[
'ocr',
'Insert block of quoted text',
'<blockquote>\n',
'\n</blockquote>',
'Block quote',
'insert',
'advanced'
]
];
mw.loader.using([
'oojs-ui.styles.icons-editing-styling',// strikethrough, underline
'oojs-ui.styles.icons-editing-advanced',// code, ocr
'oojs-ui.styles.icons-moderation'// ongoingConversation
]).then(function(){
mw.hook('wikiEditor.toolbarReady').add(function($textarea){
buttons.forEach(function(button){
$textarea.wikiEditor('addToToolbar',{
section:button[6],
group:button[5],
tools:{
mcwCustomButton:{
label:button[1],
type:'button',
oouiIcon:button[0],
action:{
type:'encapsulate',
options:{
pre:button[2],
post:button[3],
peri:button[4]
}
}
}
}
});
});
});
});
})(window.mediaWiki);
// </nowiki>
Retrieved from "https://minecraft.wiki/w/MediaWiki:Gadget-classicToolbarButtons.js?oldid=2309855"

Navigation menu