Proyectos de Subversion Moodle

Rev

Rev 1 | | Comparar con el anterior | 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');
1441 ariadna 30
const screenAllowedName = getPluginOptionName(pluginName, 'screenAllowed');
31
const pausingAllowedName = getPluginOptionName(pluginName, 'pausingAllowed');
1 efrain 32
 
33
export const register = (editor) => {
34
    const registerOption = editor.options.register;
35
 
36
    registerOption(dataName, {
37
        processor: 'object',
38
    });
39
 
40
    registerOption(videoAllowedName, {
41
        processor: 'boolean',
42
        "default": false,
43
    });
44
 
45
    registerOption(audioAllowedName, {
46
        processor: 'boolean',
47
        "default": false,
48
    });
1441 ariadna 49
 
50
    registerOption(screenAllowedName, {
51
        processor: 'boolean',
52
        "default": false,
53
    });
54
 
55
    registerOption(pausingAllowedName, {
56
        processor: 'boolean',
57
        "default": false,
58
    });
1 efrain 59
};
60
 
61
export const getData = (editor) => editor.options.get(dataName);
62
 
63
/**
64
 * Whether video may be recorded in this instance.
65
 *
66
 * @param {TinyMCE} editor
67
 * @returns {boolean}
68
 */
69
export const isAudioAllowed = (editor) => editor.options.get(audioAllowedName);
70
 
71
/**
72
 * Whether audio may be recorded in this instance.
73
 *
74
 * @param {TinyMCE} editor
75
 * @returns {boolean}
76
 */
77
export const isVideoAllowed = (editor) => editor.options.get(videoAllowedName);
1441 ariadna 78
 
79
/**
80
 * Whether screen may be recorded in this instance.
81
 *
82
 * @param {TinyMCE} editor
83
 * @returns {boolean}
84
 */
85
export const isScreenAllowed = (editor) => editor.options.get(screenAllowedName);
86
 
87
/**
88
 * Whether pausing is allowed in this instance.
89
 *
90
 * @param {TinyMCE} editor
91
 * @returns {boolean}
92
 */
93
export const isPausingAllowed = (editor) => editor.options.get(pausingAllowedName);