/* DokuWiki MoaiEditor Hint.js file Version : 0.5 (May 5, 2026) Author : MoaiTools License : GPL 3 (http://www.gnu.org/licenses/gpl.html) */ /* Hint class ‾‾‾‾‾‾‾‾‾‾ Creates a little animated graphical element to draw the user's attention to a GUI element. It lasts only a few seconds on screen before dissapearing. Example: ╭────────╮ Click me ━━▶ │ Button │ ╰────────╯ */ MoaiEditor.Hint = class { constructor (type, text, parent, x, y) { if (type == 'arrow-right') this.element = this.arrowRight(text, parent, x, y); if (type == 'arrow-corner-left-down') this.element = this.arrowCornerLeftDown(text, parent, x, y); parent.appendChild(this.element); } // ──────────────────────────────────── start () { this.element.classList.add('moaied-hint-animate'); } // ──────────────────────────────────── disable () { this.element.classList.remove('moaied-hint-animate'); } // ──────────────────────────────────── arrowRight(text, parent, x, y) { const arrow = moaiEditor.icons.ico_arrowright; const wrapper = moaiEditor.createHTML('
'); const content = moaiEditor.createHTML(''+text+''+arrow+''); wrapper.appendChild(content); wrapper.style.top = y+'px'; wrapper.style.right = x+'px'; return wrapper; } // ──────────────────────────────────── arrowCornerLeftDown(text, parent, x, y) { const arrow = moaiEditor.icons.ico_arrow_corner_leftdown; const wrapper = moaiEditor.createHTML('
'); const content = moaiEditor.createHTML(''+arrow+''+text+''); wrapper.appendChild(content); wrapper.style.top = -y+'px'; wrapper.style.left = x+'px'; return wrapper; } }; // End Class