MediaWiki:Gadget-extraEditorOptions.js

// ________________________________________________________________________________________ // |                                                                                        | // |                    === WARNING: GLOBAL GADGET FILE ===                                 | // |                 Changes to this page affect many users. | // |																						| // |																						| // |________________________________________________________________________________________| // // First Release 20.12.2019 var addEditorOptions = function { $('#wpTextbox1').on('wikiEditor-toolbar-doneInitialSections', function {		$('#wpTextbox1').wikiEditor('addToToolbar', { section: 'main', group: 'format', tools: { "underline": { label: 'Underline', type: 'button', action: { type: 'encapsulate', options: { peri: 'Underline Text', pre: " ", post: " " }					}				}			}		});		var buttons = document.getElementById("editform").getElementsByClassName("tool tool-button");		for (var i = 0; i < buttons.length; i++) {			if (buttons[i].className.length === "tool tool-button".length) {				buttons[i].className = "tool tool-button oo-ui-icon-underline pop-editor-button";				break;			}		}	}); };

if (document.readyState!="loading") addEditorOptions; // modern browsers else if (document.addEventListener) document.addEventListener("DOMContentLoaded", addEditorOptions);