/* DokuWiki MoaiEditor Sprintdoc.js file Version : 0.5 (May 5, 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 'Sprintdoc'. 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_sprintdoc = class extends MoaiEditor.Template { detectTemplate() { if (DOKU_TPL.endsWith ('tpl/sprintdoc/')) return true; return false; /* Shown below is an alternative way to identify templates, by using a DOM signature. This might have the advantage of indentifying a template even if it lives in another folder. Say you have 'sprintdoc' and a slighly customized version called 'sprint_personal'. By detecting the template by something other than the file path, you can target many templates with just one file, and without knowing beforehand where it will be located. This example code works with sprintdoc: var element = document.getElementById('dokuwiki__site'); if (element && element.classList.contains('tpl_sprintdoc')) return true; return false; */ } 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 query = ""; var container = "#dokuwiki__content div.msg-area "; query += container + "div.error, "; query += container + "div.info, "; query += container + "div.success, "; query += container + "div.notify "; var messages = document.body.querySelectorAll(query); return messages; } }; // End Class