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 $toolbar = $( '.section-advanced > .group-insert' ); const $currentFocused = $('#wpTextbox1'); const buttons = ;

function init { 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.hook( 'wikipage.content').add(init); })(window.mediaWiki); //