/* DokuWiki MoaiEditor Start.js file Version : 0.5a (May 6, 2026) Author : MoaiTools License : GPL 3 (http://www.gnu.org/licenses/gpl.html) */ /* Handles the button that starts the editor. It creates two button options, so you can use the one you prefer in your template: a) A small PNG image (intended to be put in the '#size__ctl' element of the native Dokuwiki editor, next to the other small buttons). b) A proper button with an SVG icon (which by default goes next to the submit buttons save, cancel and preview), but you can of course place it anywhere else. */ MoaiEditor.StartButton = class { constructor() { this.png = this.createPNG(); this.button = this.createButton(); } // ──────────────────────────────────── createPNG () { const png = moaiEditor.createHTML(''); png.addEventListener("click", this.onClick.bind(this)); return png; } // ──────────────────────────────────── createButton () { const html = ` `; const button = moaiEditor.createHTML(''); button.addEventListener("click", this.onClick.bind(this)); return button; } // ──────────────────────────────────── onClick () { event.preventDefault(); // Prevent click from submitting the form moaiEditor.startEditor(); // Start the editor now } }; // End Class