Proyectos de Subversion Moodle

Rev

Rev 1 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1 Rev 1441
Línea 21... Línea 21...
21
 * @license     http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
21
 * @license     http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
22
 */
22
 */
Línea 23... Línea 23...
23
 
23
 
24
import {
24
import {
25
    audioButtonName,
25
    audioButtonName,
-
 
26
    videoButtonName,
-
 
27
    screenButtonName,
26
    videoButtonName
28
    videoContextMenuName,
27
} from './common';
29
} from './common';
28
import {
30
import {
29
    addMenubarItem,
31
    addMenubarItem,
Línea 30... Línea 32...
30
} from 'editor_tiny/utils';
32
} from 'editor_tiny/utils';
31
 
33
 
32
const configureMenu = (menu) => {
34
const configureMenu = (menu) => {
33
    const items = menu.insert.items.split(' ');
35
    const items = menu.insert.items.split(' ');
34
    const inserted = items.some((item, index) => {
36
    const inserted = items.some((item, index) => {
35
        // Append after the media or video button.
37
        // Append after the media or video button.
36
        if (item.match(/(media|video)\b/)) {
38
        if (item.match(/(media|video)\b/)) {
37
            items.splice(index + 1, 0, audioButtonName, videoButtonName);
39
            items.splice(index + 1, 0, audioButtonName, videoButtonName, screenButtonName);
Línea 38... Línea 40...
38
            return true;
40
            return true;
39
        }
41
        }
Línea 40... Línea 42...
40
 
42
 
41
        return false;
43
        return false;
42
    });
44
    });
43
 
45
 
44
    if (inserted) {
46
    if (inserted) {
Línea 45... Línea 47...
45
        menu.insert.items = items.join(' ');
47
        menu.insert.items = items.join(' ');
46
    } else {
48
    } else {
Línea 58... Línea 60...
58
    return toolbar.map((section) => {
60
    return toolbar.map((section) => {
59
        if (section.name === 'content') {
61
        if (section.name === 'content') {
60
            const inserted = section.items.some((item, index) => {
62
            const inserted = section.items.some((item, index) => {
61
                // Append after the media or video button.
63
                // Append after the media or video button.
62
                if (item.match(/(media|video)\b/)) {
64
                if (item.match(/(media|video)\b/)) {
63
                    section.items.splice(index + 1, 0, audioButtonName, videoButtonName);
65
                    section.items.splice(index + 1, 0, audioButtonName, videoContextMenuName);
64
                    return true;
66
                    return true;
65
                }
67
                }
66
                return false;
68
                return false;
67
            });
69
            });
Línea 68... Línea 70...
68
 
70
 
69
            if (!inserted) {
71
            if (!inserted) {
70
                section.items.unshift(audioButtonName, videoButtonName);
72
                section.items.unshift(audioButtonName, videoContextMenuName);
71
            }
73
            }
Línea 72... Línea 74...
72
        }
74
        }
73
 
75