MediaWiki:Gadget-classicToolbarButtons.js

// 	'use strict';
 * (function($, mw) {

if (!( mw.user.options.get( 'showtoolbar' ) && //!mw.user.options.get( 'usebetatoolbar' ) && ['edit', 'submit'].indexOf(mw.config.get('wgAction')) > -1 )) return;

const buttons = [ [			'//upload.wikimedia.org/wikipedia/commons/c/c9/Button_strike.png', 'Strike', ' ',			' ',			'Strike-through text' ],		[			'//upload.wikimedia.org/wikipedia/commons/3/34/Button_hide_comment.png', 'Insert hidden Comment', '',			'Comment' ],		[			'//upload.wikimedia.org/wikipedia/commons/f/fd/Button_blockquote.png', 'Insert block of quoted text', ' \n', '\n ', 'Block quote' ]	];

function init { const $toolbar = $( '.section-advanced > .group-insert' ); const $currentFocused = $('#wpTextbox1');

buttons.forEach(function(button) {			const $button = $( ' ' ).attr( { src: button[0], alt: button[1], title: button[1], 'class': 'mw-toolbar-editbutton' });			$button.on('click', function { $currentFocused.textSelection(					'encapsulateSelection', {						pre: button[2],						peri: button[4],						post: button[3]					}				); });			$toolbar.append($button);			//mw.toolbar.addButton.apply( null, button );		}); }

mw.loader.using( 'ext.wikiEditor' ).then(init); })(window.jQuery, window.mediaWiki); //