Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
// This file is part of Moodle - http://moodle.org/
2
//
3
// Moodle is free software: you can redistribute it and/or modify
4
// it under the terms of the GNU General Public License as published by
5
// the Free Software Foundation, either version 3 of the License, or
6
// (at your option) any later version.
7
//
8
// Moodle is distributed in the hope that it will be useful,
9
// but WITHOUT ANY WARRANTY; without even the implied warranty of
10
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11
// GNU General Public License for more details.
12
//
13
// You should have received a copy of the GNU General Public License
14
// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
15
 
16
/**
17
 * Options helper for Tiny Record RTC plugin.
18
 *
19
 * @module      tiny_recordrtc/options
20
 * @copyright   2022, Stevani Andolo <stevani@hotmail.com.au>
21
 * @license     http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
22
 */
23
 
24
import {pluginName} from './common';
25
import {getPluginOptionName} from 'editor_tiny/options';
26
 
27
const dataName = getPluginOptionName(pluginName, 'data');
28
const videoAllowedName = getPluginOptionName(pluginName, 'videoAllowed');
29
const audioAllowedName = getPluginOptionName(pluginName, 'audioAllowed');
30
 
31
export const register = (editor) => {
32
    const registerOption = editor.options.register;
33
 
34
    registerOption(dataName, {
35
        processor: 'object',
36
    });
37
 
38
    registerOption(videoAllowedName, {
39
        processor: 'boolean',
40
        "default": false,
41
    });
42
 
43
    registerOption(audioAllowedName, {
44
        processor: 'boolean',
45
        "default": false,
46
    });
47
};
48
 
49
export const getData = (editor) => editor.options.get(dataName);
50
 
51
/**
52
 * Whether video may be recorded in this instance.
53
 *
54
 * @param {TinyMCE} editor
55
 * @returns {boolean}
56
 */
57
export const isAudioAllowed = (editor) => editor.options.get(audioAllowedName);
58
 
59
/**
60
 * Whether audio may be recorded in this instance.
61
 *
62
 * @param {TinyMCE} editor
63
 * @returns {boolean}
64
 */
65
export const isVideoAllowed = (editor) => editor.options.get(videoAllowedName);