/* DokuWiki MoaiEditor Adhominem.js file Version : 0.5a (May 6, 2026) Author : MoaiTools License : GPL 3 (http://www.gnu.org/licenses/gpl.html) */ /* This class extends 'MoaiEditor.Template' class and allows to override some methods to support a specific template, in this case 'Ad-hominem'. This is the list of methods you generally can override to support your template: detectTemplate addStartButton find_ElementsToHide find_Messages() find_Toolbar find_Pagetools find_EditSummary find_Form find_Textarea find_EditButtons See 'templates/default.js' to understand each of these methods. See 'README' to learn how to support a new template. */ MoaiEditor.Template_adhominem = class extends MoaiEditor.Template { detectTemplate() { if (DOKU_TPL.endsWith ('tpl/ad-hominem/')) return true; return false; } // ──────────────────────────────────── find_ElementsToHide() { // Find the elements which contain the old editor in order to be hidden. // This method can return a single element or an array of elements. return [ document.body.querySelector("#skip-link"), document.body.querySelector("#header-layout"), document.body.querySelector("#main-layout"), document.body.querySelector("#footer-layout"), document.body.querySelector("#header-layout"), document.body.querySelector("#header-layout"), ] } find_Messages() { // Find the displayed messages (info, error, success, notify) usually rendered by inc/html.php -> html_msgarea(). // Some templates like bootstrap3 implement their own message rendering function and don't use html_msgarea(). // In order to check how (and if) your template's messages are being displayed in this editor, you can simulate // fake messages by either: // a) Adding '&fakemsg' to the browser's URL while in edit mode. // b) Set the MOAIED_FAKE_MESSAGES constant to true in: lib/plugins/moaieditor/action.php var messages = document.body.querySelectorAll('#doku__msgarea div'); return messages; } }; // End Class