HEX
Server: Apache
System: Linux webm010.cluster103.gra.hosting.ovh.net 6.18.42-ovh-vps-grsec-zfs+ #1 SMP PREEMPT_DYNAMIC Wed Aug 5 15:59:48 CEST 2026 x86_64
User: iestorre (46869)
PHP: 8.0.30
Disabled: _dyuweyrj4,_dyuweyrj4r,dl
Upload Files
File: /home/iestorre/moodleAW/moodle505/lib/editor/tinymce/plugins/moodleemoticon/tinymce/js/dialog.js
var MoodleEmoticonDialog = {

    init : function() {
        // Register event handlers for the table rows.
        tinymce.each(tinymce.DOM.select('tr.emoticoninfo', document), function(row) {

            tinymce.dom.Event.add(row, 'mouseover', function(e) {
                this.style.backgroundColor = 'white';
            }, row);

            tinymce.dom.Event.add(row, 'mouseout', function(e) {
                this.style.backgroundColor = 'transparent';
            }, row);

            tinymce.dom.Event.add(row, 'click', function(e) {
                var matches = /^emoticoninfo emoticoninfo-index-([0-9]+)$/.exec(this.className);
                if (matches.length != 2) {
                    // continue with the next row
                    return true;
                }
                var index = matches[1];
                MoodleEmoticonDialog.insert(index);
            }, row);

        });
    },

    insert : function(index) {
        emoticons = tinyMCEPopup.editor._emoticons;
        i = 0;
        for (var emoticon in emoticons) {
            if (i == index) {
                if (tinymce.isIE) {
                    tinyMCEPopup.restoreSelection();
                }
                tinyMCEPopup.editor.execCommand('mceInsertContent', false, emoticons[emoticon]);
                tinyMCEPopup.close();
                return;
            }
            i++;
        }
    },

    highlight : function(row) {
        row.style.backgroundColor="white";
    },

    unhighlight : function(row) {
        row.style.backgroundColor="transparent";
    }

};

tinyMCEPopup.onInit.add(MoodleEmoticonDialog.init, MoodleEmoticonDialog);