| 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 |
* Tiny Media plugin helper function to build queryable data selectors.
|
|
|
18 |
*
|
|
|
19 |
* @module tiny_media/selectors
|
|
|
20 |
* @copyright 2022 Huong Nguyen <huongnv13@gmail.com>
|
|
|
21 |
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
|
|
22 |
*/
|
|
|
23 |
|
|
|
24 |
export default {
|
|
|
25 |
IMAGE: {
|
|
|
26 |
actions: {
|
|
|
27 |
submit: '.tiny_image_urlentrysubmit',
|
|
|
28 |
imageBrowser: '.openimagebrowser',
|
|
|
29 |
addUrl: '.tiny_image_addurl',
|
|
|
30 |
deleteImage: '.tiny_image_deleteicon',
|
|
|
31 |
},
|
|
|
32 |
elements: {
|
|
|
33 |
form: 'form.tiny_image_form',
|
|
|
34 |
alignSettings: '.tiny_image_button',
|
|
|
35 |
alt: '.tiny_image_altentry',
|
|
|
36 |
altWarning: '.tiny_image_altwarning',
|
|
|
37 |
height: '.tiny_image_heightentry',
|
|
|
38 |
width: '.tiny_image_widthentry',
|
|
|
39 |
url: '.tiny_image_urlentry',
|
|
|
40 |
urlWarning: '.tiny_image_urlwarning',
|
|
|
41 |
size: '.tiny_image_size',
|
|
|
42 |
presentation: '.tiny_image_presentation',
|
|
|
43 |
constrain: '.tiny_image_constrain',
|
|
|
44 |
customStyle: '.tiny_image_customstyle',
|
|
|
45 |
preview: '.tiny_image_preview',
|
|
|
46 |
previewBox: '.tiny_image_preview_box',
|
|
|
47 |
loaderIcon: '.tiny_image_loader',
|
|
|
48 |
loaderIconContainer: '.tiny_image_loader_container',
|
|
|
49 |
insertImage: '.tiny_image_insert_image',
|
|
|
50 |
modalFooter: '.modal-footer',
|
|
|
51 |
dropzoneContainer: '.tiny_image_dropzone_container',
|
|
|
52 |
fileInput: '#tiny_image_fileinput',
|
|
|
53 |
fileNameLabel: '.tiny_image_filename',
|
|
|
54 |
sizeOriginal: '.tiny_image_sizeoriginal',
|
|
|
55 |
sizeCustom: '.tiny_image_sizecustom',
|
|
|
56 |
properties: '.tiny_image_properties',
|
| 1441 |
ariadna |
57 |
bodyTemplate: '.tiny_image_body_template',
|
|
|
58 |
footerTemplate: '.tiny_image_footer_template',
|
| 1 |
efrain |
59 |
},
|
|
|
60 |
styles: {
|
|
|
61 |
responsive: 'img-fluid',
|
|
|
62 |
},
|
| 1441 |
ariadna |
63 |
template: {
|
|
|
64 |
body: {
|
|
|
65 |
insertImageBody: 'tiny_media/insert_image_modal_insert',
|
|
|
66 |
insertImageDetailsBody: 'tiny_media/insert_image_modal_details',
|
|
|
67 |
},
|
|
|
68 |
footer: {
|
|
|
69 |
insertImageFooter: 'tiny_media/insert_image_modal_insert_footer',
|
|
|
70 |
insertImageDetailsFooter: 'tiny_media/insert_image_modal_details_footer',
|
|
|
71 |
},
|
|
|
72 |
},
|
|
|
73 |
type: 'IMAGE',
|
| 1 |
efrain |
74 |
},
|
|
|
75 |
EMBED: {
|
|
|
76 |
actions: {
|
|
|
77 |
mediaBrowser: '.openmediabrowser',
|
| 1441 |
ariadna |
78 |
addUrl: '.tiny_media_add_url',
|
|
|
79 |
deleteMedia: '.tiny_media_delete_icon',
|
|
|
80 |
showSubtitleCaption: '[data-action="show-subtitle-caption"]',
|
|
|
81 |
backToMediaDetails: '[data-action="back-to-media-details"]',
|
|
|
82 |
uploadCustomThumbnail: '.upload-custom-thumbnail',
|
|
|
83 |
deleteCustomThumbnail: '.delete-custom-thumbnail',
|
|
|
84 |
deleteThumbnail: '.delete_tiny_thumbnail',
|
|
|
85 |
setPoster: '[data-action="set-poster"]',
|
|
|
86 |
mediaLinkAsAudio: '.link_as_audio',
|
|
|
87 |
mediaLinkAsVideo: '.link_as_video',
|
|
|
88 |
cancelMediaDetails: '[data-action="cancel"]',
|
| 1 |
efrain |
89 |
},
|
|
|
90 |
elements: {
|
|
|
91 |
source: '.tiny_media_source',
|
|
|
92 |
track: '.tiny_media_track',
|
|
|
93 |
posterSource: '.tiny_media_poster_source',
|
|
|
94 |
title: '.tiny_media_title_entry',
|
| 1441 |
ariadna |
95 |
url: '.tiny_media_source_url_entry',
|
| 1 |
efrain |
96 |
width: '.tiny_media_width_entry',
|
|
|
97 |
height: '.tiny_media_height_entry',
|
|
|
98 |
trackSource: '.tiny_media_track_source',
|
|
|
99 |
trackLabel: '.tiny_media_track_label_entry',
|
|
|
100 |
trackLang: '.tiny_media_track_lang_entry',
|
|
|
101 |
trackDefault: '.tiny_media_track_default',
|
|
|
102 |
mediaControl: '.tiny_media_controls',
|
|
|
103 |
mediaAutoplay: '.tiny_media_autoplay',
|
|
|
104 |
mediaMute: '.tiny_media_mute',
|
|
|
105 |
mediaLoop: '.tiny_media_loop',
|
| 1441 |
ariadna |
106 |
bodyTemplate: '.tiny_media_body_template',
|
|
|
107 |
footerTemplate: '.tiny_media_footer_template',
|
|
|
108 |
dropzoneContainer: '.tiny_media_dropzone_container',
|
|
|
109 |
fromUrl: '.tiny_media_from_url_entry',
|
|
|
110 |
urlWarning: '.tiny_media_url_warning',
|
|
|
111 |
loaderIcon: '.tiny_media_loader',
|
|
|
112 |
loaderIconContainer: '.tiny_media_loader_container',
|
|
|
113 |
insertMedia: '.tiny_media_insert_media',
|
|
|
114 |
modalFooter: '.modal-footer',
|
|
|
115 |
fileNameLabel: '.tiny_media_filename',
|
|
|
116 |
previewBox: '.tiny_media_preview_box',
|
|
|
117 |
sizeOriginal: '.tiny_media_sizeoriginal',
|
|
|
118 |
sizeCustom: '.tiny_media_sizecustom',
|
|
|
119 |
properties: '.tiny_media_properties',
|
|
|
120 |
mediaDetailsBody: '#tiny-media-details-body',
|
|
|
121 |
mediaSubtitleCaptionBody: '#tiny-media-subtitle-caption-body',
|
|
|
122 |
mediaMetadataTabPane: '.tab-pane-media-metadata',
|
|
|
123 |
videoThumbnail: '.video-thumbnail',
|
|
|
124 |
mediaSizeProperties: '.media-size-properties',
|
|
|
125 |
thumbnailPreview: '.tiny_media_thumbnail_preview',
|
|
|
126 |
mediaPreviewContainer: '#media-filter-preview-container',
|
| 1 |
efrain |
127 |
},
|
| 1441 |
ariadna |
128 |
template: {
|
|
|
129 |
body: {
|
|
|
130 |
insertMediaBody: 'tiny_media/embed/body/insert_media_body',
|
|
|
131 |
mediaDetailsBody: 'tiny_media/embed/body/media_details_body',
|
|
|
132 |
mediaThumbnailBody: 'tiny_media/embed/body/media_thumbnail_body',
|
|
|
133 |
},
|
|
|
134 |
footer: {
|
|
|
135 |
insertMediaFooter: 'tiny_media/embed/footer/insert_media_footer',
|
|
|
136 |
mediaDetailsFooter: 'tiny_media/embed/footer/media_details_footer',
|
|
|
137 |
mediaThumbnailFooter: 'tiny_media/embed/footer/media_thumbnail_footer',
|
|
|
138 |
},
|
| 1 |
efrain |
139 |
},
|
| 1441 |
ariadna |
140 |
type: 'EMBED',
|
|
|
141 |
externalMediaProvider: 'external-media-provider',
|
| 1 |
efrain |
142 |
},
|
|
|
143 |
};
|