1/*  DokuWiki MoaiEditor Mikio.js file
2    Version : 0.5 (May 5, 2026)
3    Author  : MoaiTools <info@moaitools.org>
4    License : GPL 3 (http://www.gnu.org/licenses/gpl.html) */
5/*
6    This class extends 'MoaiEditor.Template' class and allows to override
7    some methods to support a specific template, in this case 'Mikio'.
8
9    This is the list of methods you generally can override to support your
10    template:
11
12        detectTemplate
13        addStartButton
14
15        find_ElementsToHide
16        find_Messages()
17        find_Toolbar
18        find_Pagetools
19        find_EditSummary
20        find_Form
21        find_Textarea
22        find_EditButtons
23
24    See 'templates/default.js' to understand each of these methods.
25
26    See 'README' to learn how to support a new template.
27*/
28MoaiEditor.Template_mikio = class extends MoaiEditor.Template {
29
30    detectTemplate() {
31        if (DOKU_TPL.endsWith ('tpl/mikio/'))
32            return true;
33        return false;
34    }
35    find_Messages() {
36        // Find the displayed messages (info, error, success, notify) usually rendered by inc/html.php -> html_msgarea().
37        // Some templates like bootstrap3 implement their own message rendering function and don't use html_msgarea().
38        // In order to check how (and if) your template's messages are being displayed in this editor, you can simulate
39        // fake messages by either:
40        //    a) Adding '&fakemsg' to the browser's URL while in edit mode.
41        //    b) Set the MOAIED_FAKE_MESSAGES constant to true in: lib/plugins/moaieditor/action.php
42        var query = "";
43        var container = "#dokuwiki__content ";
44        query += container + "div.error,   ";
45        query += container + "div.info,    ";
46        query += container + "div.success, ";
47        query += container + "div.notify   ";
48        var messages = document.body.querySelectorAll(query);
49        return messages;
50    }
51
52}; // End Class
53
54
55
56