JSFiddle - React, Tailwind, and code Playground
JavaScript
/* Any JavaScript here will be loaded for all users on every page load. */
/* https://www.mediawiki.org/wiki/Extension:WikiEditor/Toolbar_customization */
/* Example stuff can be seen in the /extentions/WikiEditor/modules/jquery.wikiEditor.dialogs.config.js */
/*
*/
$( '#wpTextbox1' ).on( 'wikiEditor-toolbar-doneInitialSections', function () {
function changeToolbar(){
if($('#wikiEditor-ui-toolbar [title="mytool"]') && $('#wikiEditor-ui-toolbar [title="Embedded file"]')){//if mytool is activated
$('#wikiEditor-ui-toolbar [title="Embedded file"]').hide();//hide the normal embed image button
}
if(!$.wikiEditor.modules.dialogs.modules.mytool){
$( '#wpTextbox1' ).wikiEditor( 'addModule', mytool());
console.log("oha. postLoad of module was needed!")
}
}
var mytool = function(){
return { dialogs:{
mytool:{
titleMsg: 'wikieditor-toolbar-tool-mytool-title',
id: 'wikieditor-toolbar-mytool-dialog',
html:'<div id="wikieditor-toolbar-mytool-step1Container"> <!-- what do you want to do wrapper-->\
<!-- wizard buttons go here-->\
</div>\
<div id="wikieditor-toolbar-mytool-step2Container">\
<p id="wikieditor-toolbar-mytool-step2Container-helptext">To use an image, please upload it first (show <span href="#" class="wikieditor-toolbar-mytool-highlightUploadButton">upload button</span>) <br> or create put in a filename, save the page and click the link you created to upload the picture</p>\
<div id="wikieditor-toolbar-mytool-recentimagesContainer">\
<p id="wikieditor-toolbar-mytool-recentimagesContainer-helptext">Your recent uploads</p>\
<!-- insert image goes here-->\
</div>\
<div id="wikieditor-toolbar-mytool-generatelinktext-container">\
<p id="id="wikieditor-toolbar-mytool-generatelinktext-container-helptext">\
<!--a text with: "try uploading first, its easier!" and "you can generate a upload link, it will..."...