@oat-sa/tao-core-ui 1.58.1 → 1.58.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/actionbar.js +386 -395
- package/dist/adder.js +21 -19
- package/dist/animable/absorbable/absorbable.js +204 -213
- package/dist/animable/absorbable/css/absorb.css +1 -0
- package/dist/animable/absorbable/css/absorb.css.map +1 -1
- package/dist/animable/pulsable/pulsable.js +168 -177
- package/dist/autocomplete/css/autocomplete.css +1 -0
- package/dist/autocomplete/css/autocomplete.css.map +1 -1
- package/dist/autocomplete.js +68 -66
- package/dist/badge/badge.js +188 -197
- package/dist/badge/css/badge.css +1 -0
- package/dist/badge/css/badge.css.map +1 -1
- package/dist/breadcrumbs.js +275 -284
- package/dist/btngrouper.js +5 -5
- package/dist/bulkActionPopup.js +490 -495
- package/dist/button.js +283 -291
- package/dist/cascadingComboBox.js +249 -258
- package/dist/ckeditor/ckConfigurator.js +26 -19
- package/dist/ckeditor/dtdHandler.js +11 -9
- package/dist/class/selector.js +441 -450
- package/dist/component/resizable.js +1 -1
- package/dist/component/windowed.js +285 -294
- package/dist/component.js +419 -428
- package/dist/contextualPopup.js +417 -426
- package/dist/dashboard.js +300 -309
- package/dist/datalist.js +753 -762
- package/dist/datatable/filterStrategy/multiple.js +1 -1
- package/dist/datatable/filterStrategy/single.js +1 -1
- package/dist/datatable.js +1527 -1550
- package/dist/dateRange/dateRange.js +393 -402
- package/dist/datetime/picker.js +665 -672
- package/dist/deleter.js +368 -377
- package/dist/destination/selector.js +286 -295
- package/dist/dialog/alert.js +3 -3
- package/dist/dialog/confirm.js +1 -1
- package/dist/dialog/confirmDelete.js +216 -225
- package/dist/dialog.js +650 -654
- package/dist/disabler.js +8 -8
- package/dist/documentViewer/providers/pdfViewer/fallback/viewer.js +166 -175
- package/dist/documentViewer/providers/pdfViewer/pdfjs/findBar.js +518 -527
- package/dist/documentViewer/providers/pdfViewer/pdfjs/pageView.js +380 -389
- package/dist/documentViewer/providers/pdfViewer/pdfjs/searchEngine.js +539 -548
- package/dist/documentViewer/providers/pdfViewer/pdfjs/viewer.js +369 -378
- package/dist/documentViewer/providers/pdfViewer.js +184 -193
- package/dist/documentViewer.js +292 -301
- package/dist/dropdown.js +383 -392
- package/dist/durationer.js +5 -5
- package/dist/dynamicComponent.js +597 -598
- package/dist/feedback.js +356 -362
- package/dist/figure/FigureStateActive.js +117 -108
- package/dist/filesender.js +2 -2
- package/dist/filter.js +230 -239
- package/dist/form/dropdownForm.js +355 -357
- package/dist/form/form.js +919 -690
- package/dist/form/simpleForm.js +1 -1
- package/dist/form/validator/renderer.js +233 -235
- package/dist/form/validator/validator.js +257 -189
- package/dist/form/widget/definitions.js +1 -1
- package/dist/form/widget/providers/checkBox.js +254 -259
- package/dist/form/widget/providers/comboBox.js +187 -192
- package/dist/form/widget/providers/default.js +8 -9
- package/dist/form/widget/providers/hidden.js +170 -179
- package/dist/form/widget/providers/hiddenBox.js +262 -267
- package/dist/form/widget/providers/radioBox.js +216 -225
- package/dist/form/widget/providers/textArea.js +187 -196
- package/dist/form/widget/providers/textBox.js +2 -3
- package/dist/form/widget/widget.js +473 -475
- package/dist/formValidator/formValidator.js +1 -1
- package/dist/formValidator/highlighters/message.js +1 -1
- package/dist/generis/form/form.js +314 -323
- package/dist/generis/validator/validator.js +209 -218
- package/dist/generis/widget/checkBox/checkBox.js +218 -227
- package/dist/generis/widget/comboBox/comboBox.js +179 -188
- package/dist/generis/widget/hiddenBox/hiddenBox.js +220 -229
- package/dist/generis/widget/textBox/textBox.js +169 -178
- package/dist/generis/widget/widget.js +246 -255
- package/dist/groupedComboBox.js +222 -231
- package/dist/groupvalidator.js +2 -2
- package/dist/highlighter.js +967 -958
- package/dist/image/ImgStateActive/helper.js +7 -5
- package/dist/image/ImgStateActive/initHelper.js +49 -43
- package/dist/image/ImgStateActive/initMediaEditor.js +24 -20
- package/dist/image/ImgStateActive/mediaSizer.js +14 -12
- package/dist/image/ImgStateActive.js +72 -70
- package/dist/incrementer.js +6 -6
- package/dist/inplacer.js +6 -6
- package/dist/itemButtonList/css/item-button-list.css +1 -0
- package/dist/itemButtonList/css/item-button-list.css.map +1 -1
- package/dist/itemButtonList.js +439 -435
- package/dist/keyNavigation/navigableDomElement.js +51 -38
- package/dist/keyNavigation/navigator.js +85 -70
- package/dist/listbox.js +460 -469
- package/dist/liststyler.js +8 -8
- package/dist/loadingButton/loadingButton.js +209 -218
- package/dist/lock.js +476 -485
- package/dist/login/login.js +475 -484
- package/dist/maths/calculator/basicCalculator.js +235 -244
- package/dist/maths/calculator/calculatorComponent.js +3 -3
- package/dist/maths/calculator/core/board.js +772 -781
- package/dist/maths/calculator/core/expression.js +476 -485
- package/dist/maths/calculator/core/labels.js +228 -237
- package/dist/maths/calculator/core/tokenizer.js +1 -1
- package/dist/maths/calculator/core/tokens.js +163 -170
- package/dist/maths/calculator/plugins/keyboard/templateKeyboard/templateKeyboard.js +244 -253
- package/dist/maths/calculator/plugins/screen/simpleScreen/simpleScreen.js +279 -288
- package/dist/maths/calculator/scientificCalculator.js +327 -336
- package/dist/mediaEditor/mediaEditorComponent.js +238 -245
- package/dist/mediaEditor/plugins/mediaAlignment/helper.js +7 -7
- package/dist/mediaEditor/plugins/mediaAlignment/mediaAlignmentComponent.js +229 -235
- package/dist/mediaEditor/plugins/mediaDimension/mediaDimensionComponent.js +580 -589
- package/dist/mediaplayer/players/html5.js +666 -675
- package/dist/mediaplayer/players/youtube.js +419 -424
- package/dist/mediaplayer/support.js +11 -10
- package/dist/mediaplayer/utils/reminder.js +14 -13
- package/dist/mediaplayer/utils/timeObserver.js +10 -11
- package/dist/mediaplayer/youtubeManager.js +164 -145
- package/dist/mediaplayer.js +1565 -1520
- package/dist/mediasizer.js +669 -678
- package/dist/modal.js +10 -17
- package/dist/pageSizeSelector.js +219 -228
- package/dist/pagination/providers/pages.js +280 -289
- package/dist/pagination/providers/simple.js +192 -201
- package/dist/previewer.js +30 -30
- package/dist/progressbar.js +4 -4
- package/dist/report.js +347 -356
- package/dist/resource/filters.js +271 -280
- package/dist/resource/list.js +1264 -1273
- package/dist/resource/selector.js +865 -874
- package/dist/resource/tree.js +1483 -1492
- package/dist/resourcemgr/fileBrowser.js +564 -569
- package/dist/resourcemgr/filePreview.js +16 -16
- package/dist/resourcemgr/fileSelector.js +515 -524
- package/dist/resourcemgr/util/updatePermissions.js +2 -2
- package/dist/resourcemgr.js +306 -315
- package/dist/searchModal/advancedSearch.js +796 -767
- package/dist/searchModal.js +114 -91
- package/dist/switch/switch.js +298 -307
- package/dist/tabs.js +598 -575
- package/dist/taskQueue/status.js +312 -321
- package/dist/taskQueue/table.js +375 -384
- package/dist/taskQueue/taskQueueModel.js +488 -472
- package/dist/taskQueueButton/taskable.js +264 -273
- package/dist/taskQueueButton/treeButton.js +189 -198
- package/dist/themeLoader.js +24 -23
- package/dist/themes.js +1 -1
- package/dist/toggler.js +3 -3
- package/dist/tooltip.js +295 -304
- package/dist/transformer.js +2 -2
- package/dist/tristateCheckboxGroup.js +311 -320
- package/dist/uploader.js +687 -696
- package/dist/validator/Report.js +1 -1
- package/dist/validator/Validator.js +3 -3
- package/dist/validator/validators.js +9 -9
- package/dist/validator.js +240 -230
- package/dist/waitForMedia.js +1 -1
- package/package.json +3 -3
- package/src/animable/absorbable/css/absorb.css +1 -0
- package/src/animable/absorbable/css/absorb.css.map +1 -1
- package/src/autocomplete/css/autocomplete.css +1 -0
- package/src/autocomplete/css/autocomplete.css.map +1 -1
- package/src/badge/css/badge.css +1 -0
- package/src/badge/css/badge.css.map +1 -1
- package/src/ckeditor/ckConfigurator.js +4 -0
- package/src/itemButtonList/css/item-button-list.css +1 -0
- package/src/itemButtonList/css/item-button-list.css.map +1 -1
- package/src/.DS_Store +0 -0
- package/src/css/basic.css +0 -7826
- package/src/css/basic.css.map +0 -1
- package/src/css/ckeditor/skins/tao/css/dialog.css +0 -950
- package/src/css/ckeditor/skins/tao/css/dialog.css.map +0 -1
- package/src/css/ckeditor/skins/tao/css/editor.css +0 -1850
- package/src/css/ckeditor/skins/tao/css/editor.css.map +0 -1
- package/src/scss/.DS_Store +0 -0
- package/src/scss/basic.scss +0 -16
- package/src/scss/ckeditor/skins/tao/scss/dialog.scss +0 -763
- package/src/scss/ckeditor/skins/tao/scss/editor.scss +0 -111
- package/src/scss/ckeditor/skins/tao/scss/inc/_ck-icons.scss +0 -59
- package/src/scss/ckeditor/skins/tao/scss/inc/_colorpanel.scss +0 -118
- package/src/scss/ckeditor/skins/tao/scss/inc/_elementspath.scss +0 -69
- package/src/scss/ckeditor/skins/tao/scss/inc/_mainui.scss +0 -194
- package/src/scss/ckeditor/skins/tao/scss/inc/_menu.scss +0 -181
- package/src/scss/ckeditor/skins/tao/scss/inc/_panel.scss +0 -200
- package/src/scss/ckeditor/skins/tao/scss/inc/_presets.scss +0 -32
- package/src/scss/ckeditor/skins/tao/scss/inc/_reset.scss +0 -101
- package/src/scss/ckeditor/skins/tao/scss/inc/_richcombo.scss +0 -213
- package/src/scss/ckeditor/skins/tao/scss/inc/_tao.scss +0 -59
- package/src/scss/ckeditor/skins/tao/scss/inc/_toolbar.scss +0 -301
- package/src/scss/font/source-sans-pro/source-sans-pro-italic.eot +0 -0
- package/src/scss/font/source-sans-pro/source-sans-pro-italic.eot.b64 +0 -1
- package/src/scss/font/source-sans-pro/source-sans-pro-italic.woff +0 -0
- package/src/scss/font/source-sans-pro/source-sans-pro-italic.woff.b64 +0 -1
- package/src/scss/font/source-sans-pro/source-sans-pro-regular.eot +0 -0
- package/src/scss/font/source-sans-pro/source-sans-pro-regular.eot.b64 +0 -1
- package/src/scss/font/source-sans-pro/source-sans-pro-regular.woff +0 -0
- package/src/scss/font/source-sans-pro/source-sans-pro-regular.woff.b64 +0 -1
- package/src/scss/font/source-sans-pro/source-sans-pro-semibold-italic.eot +0 -0
- package/src/scss/font/source-sans-pro/source-sans-pro-semibold-italic.eot.b64 +0 -1
- package/src/scss/font/source-sans-pro/source-sans-pro-semibold-italic.woff +0 -0
- package/src/scss/font/source-sans-pro/source-sans-pro-semibold-italic.woff.b64 +0 -1
- package/src/scss/font/source-sans-pro/source-sans-pro-semibold.eot +0 -0
- package/src/scss/font/source-sans-pro/source-sans-pro-semibold.eot.b64 +0 -1
- package/src/scss/font/source-sans-pro/source-sans-pro-semibold.woff +0 -0
- package/src/scss/font/source-sans-pro/source-sans-pro-semibold.woff.b64 +0 -1
- package/src/scss/font/tao/tao.eot +0 -0
- package/src/scss/font/tao/tao.svg +0 -235
- package/src/scss/font/tao/tao.ttf +0 -0
- package/src/scss/font/tao/tao.woff +0 -0
- package/src/scss/inc/_base.scss +0 -496
- package/src/scss/inc/_bootstrap.scss +0 -6
- package/src/scss/inc/_buttons.scss +0 -114
- package/src/scss/inc/_colors.scss +0 -88
- package/src/scss/inc/_feedback.scss +0 -150
- package/src/scss/inc/_flex-grid.scss +0 -15
- package/src/scss/inc/_fonts.scss +0 -4
- package/src/scss/inc/_forms.scss +0 -827
- package/src/scss/inc/_functions.scss +0 -283
- package/src/scss/inc/_grid.scss +0 -66
- package/src/scss/inc/_jquery.nouislider.scss +0 -254
- package/src/scss/inc/_normalize.scss +0 -528
- package/src/scss/inc/_report.scss +0 -68
- package/src/scss/inc/_secondary-properties.scss +0 -89
- package/src/scss/inc/_select2.scss +0 -634
- package/src/scss/inc/_toolbars.scss +0 -155
- package/src/scss/inc/_tooltip.scss +0 -312
- package/src/scss/inc/_variables.scss +0 -21
- package/src/scss/inc/base/_highlight.scss +0 -5
- package/src/scss/inc/base/_list-style.scss +0 -59
- package/src/scss/inc/base/_svg.scss +0 -3
- package/src/scss/inc/base/_table.scss +0 -63
- package/src/scss/inc/fonts/_source-sans-pro.scss +0 -29
- package/src/scss/inc/fonts/_tao-icon-classes.scss +0 -226
- package/src/scss/inc/fonts/_tao-icon-def.scss +0 -12
- package/src/scss/inc/fonts/_tao-icon-vars.scss +0 -240
|
@@ -23,14 +23,14 @@ define(function () { 'use strict';
|
|
|
23
23
|
* @type {RegExp}
|
|
24
24
|
* @private
|
|
25
25
|
*/
|
|
26
|
-
|
|
26
|
+
var reAppleMobiles = /ip(hone|od)/i;
|
|
27
27
|
/**
|
|
28
28
|
* A list of MIME types with codec declaration
|
|
29
29
|
* @type {Object}
|
|
30
30
|
* @private
|
|
31
31
|
*/
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
var supportedMimeTypes = {
|
|
34
34
|
// video
|
|
35
35
|
'video/webm': 'video/webm; codecs="vp8, vorbis"',
|
|
36
36
|
'video/mp4': 'video/mp4; codecs="avc1.42E01E, mp4a.40.2"',
|
|
@@ -49,7 +49,9 @@ define(function () { 'use strict';
|
|
|
49
49
|
* @private
|
|
50
50
|
*/
|
|
51
51
|
|
|
52
|
-
|
|
52
|
+
var findSupport = function findSupport(media, mimeType) {
|
|
53
|
+
return media.canPlayType(mimeType).replace(/no/, '');
|
|
54
|
+
};
|
|
53
55
|
/**
|
|
54
56
|
* Support detection
|
|
55
57
|
* @type {Object}
|
|
@@ -64,8 +66,8 @@ define(function () { 'use strict';
|
|
|
64
66
|
* @returns {Boolean}
|
|
65
67
|
* @private
|
|
66
68
|
*/
|
|
67
|
-
checkSupport(media, mimeType) {
|
|
68
|
-
|
|
69
|
+
checkSupport: function checkSupport(media, mimeType) {
|
|
70
|
+
var support = media.canPlayType;
|
|
69
71
|
|
|
70
72
|
if (support && mimeType) {
|
|
71
73
|
return !!(supportedMimeTypes[mimeType] && findSupport(media, supportedMimeTypes[mimeType]) || findSupport(media, mimeType));
|
|
@@ -80,7 +82,7 @@ define(function () { 'use strict';
|
|
|
80
82
|
* @param {String} [mime] A media MIME type to check
|
|
81
83
|
* @returns {Boolean}
|
|
82
84
|
*/
|
|
83
|
-
canPlay(type, mime) {
|
|
85
|
+
canPlay: function canPlay(type, mime) {
|
|
84
86
|
if (type) {
|
|
85
87
|
switch (type.toLowerCase()) {
|
|
86
88
|
case 'audio':
|
|
@@ -105,7 +107,7 @@ define(function () { 'use strict';
|
|
|
105
107
|
* @param {String} [mime] A media MIME type to check
|
|
106
108
|
* @returns {Boolean}
|
|
107
109
|
*/
|
|
108
|
-
canPlayAudio(mime) {
|
|
110
|
+
canPlayAudio: function canPlayAudio(mime) {
|
|
109
111
|
return this.checkSupport(document.createElement('audio'), mime);
|
|
110
112
|
},
|
|
111
113
|
|
|
@@ -114,7 +116,7 @@ define(function () { 'use strict';
|
|
|
114
116
|
* @param {String} [mime] A media MIME type to check
|
|
115
117
|
* @returns {Boolean}
|
|
116
118
|
*/
|
|
117
|
-
canPlayVideo(mime) {
|
|
119
|
+
canPlayVideo: function canPlayVideo(mime) {
|
|
118
120
|
return this.checkSupport(document.createElement('video'), mime);
|
|
119
121
|
},
|
|
120
122
|
|
|
@@ -122,10 +124,9 @@ define(function () { 'use strict';
|
|
|
122
124
|
* Checks if the browser allows to control the media playback
|
|
123
125
|
* @returns {Boolean}
|
|
124
126
|
*/
|
|
125
|
-
canControl() {
|
|
127
|
+
canControl: function canControl() {
|
|
126
128
|
return !reAppleMobiles.test(window.navigator.userAgent);
|
|
127
129
|
}
|
|
128
|
-
|
|
129
130
|
};
|
|
130
131
|
|
|
131
132
|
return support;
|
|
@@ -49,18 +49,18 @@ define(function () { 'use strict';
|
|
|
49
49
|
*/
|
|
50
50
|
function reminderManagerFactory() {
|
|
51
51
|
// Keep track of the running state
|
|
52
|
-
|
|
52
|
+
var running = false; // Timestamp of the last start
|
|
53
53
|
|
|
54
|
-
|
|
54
|
+
var last = 0; // A list of reminders to callback
|
|
55
55
|
|
|
56
|
-
|
|
56
|
+
var reminders = new Map();
|
|
57
57
|
/**
|
|
58
58
|
* Cancels a schedule for a particular reminder.
|
|
59
59
|
* @param {object} state - A sate object containing the timeout handler for the reminder.
|
|
60
60
|
* @private
|
|
61
61
|
*/
|
|
62
62
|
|
|
63
|
-
|
|
63
|
+
var stopReminder = function stopReminder(state) {
|
|
64
64
|
if (state && state.timeout) {
|
|
65
65
|
clearTimeout(state.timeout);
|
|
66
66
|
state.timeout = null;
|
|
@@ -72,15 +72,17 @@ define(function () { 'use strict';
|
|
|
72
72
|
*/
|
|
73
73
|
|
|
74
74
|
|
|
75
|
-
|
|
75
|
+
var stopAllReminders = function stopAllReminders() {
|
|
76
|
+
return reminders.forEach(stopReminder);
|
|
77
|
+
};
|
|
76
78
|
/**
|
|
77
79
|
* Schedule all reminders.
|
|
78
80
|
* @private
|
|
79
81
|
*/
|
|
80
82
|
|
|
81
83
|
|
|
82
|
-
|
|
83
|
-
reminders.forEach((state, reminder)
|
|
84
|
+
var startAllReminders = function startAllReminders() {
|
|
85
|
+
reminders.forEach(function (state, reminder) {
|
|
84
86
|
stopReminder(state);
|
|
85
87
|
state.timeout = setTimeout(reminder, state.delay);
|
|
86
88
|
});
|
|
@@ -128,7 +130,7 @@ define(function () { 'use strict';
|
|
|
128
130
|
* @function start
|
|
129
131
|
* @memberOf reminderManager
|
|
130
132
|
*/
|
|
131
|
-
start() {
|
|
133
|
+
start: function start() {
|
|
132
134
|
running = true;
|
|
133
135
|
last = performance.now();
|
|
134
136
|
startAllReminders();
|
|
@@ -142,7 +144,7 @@ define(function () { 'use strict';
|
|
|
142
144
|
* @function stop
|
|
143
145
|
* @memberOf reminderManager
|
|
144
146
|
*/
|
|
145
|
-
stop() {
|
|
147
|
+
stop: function stop() {
|
|
146
148
|
running = false;
|
|
147
149
|
stopAllReminders();
|
|
148
150
|
return this;
|
|
@@ -158,11 +160,11 @@ define(function () { 'use strict';
|
|
|
158
160
|
* @function remind
|
|
159
161
|
* @memberOf reminderManager
|
|
160
162
|
*/
|
|
161
|
-
remind(cb, delay) {
|
|
163
|
+
remind: function remind(cb, delay) {
|
|
162
164
|
if ('function' === typeof cb && delay) {
|
|
163
165
|
stopReminder(reminders.get(cb));
|
|
164
166
|
reminders.set(cb, {
|
|
165
|
-
delay
|
|
167
|
+
delay: delay
|
|
166
168
|
});
|
|
167
169
|
}
|
|
168
170
|
|
|
@@ -177,7 +179,7 @@ define(function () { 'use strict';
|
|
|
177
179
|
* @function forget
|
|
178
180
|
* @memberOf reminderManager
|
|
179
181
|
*/
|
|
180
|
-
forget(cb) {
|
|
182
|
+
forget: function forget(cb) {
|
|
181
183
|
if ('undefined' !== typeof cb) {
|
|
182
184
|
stopReminder(reminders.get(cb));
|
|
183
185
|
reminders.delete(cb);
|
|
@@ -188,7 +190,6 @@ define(function () { 'use strict';
|
|
|
188
190
|
|
|
189
191
|
return this;
|
|
190
192
|
}
|
|
191
|
-
|
|
192
193
|
};
|
|
193
194
|
}
|
|
194
195
|
|
|
@@ -52,13 +52,13 @@ define(['core/eventifier'], function (eventifier) { 'use strict';
|
|
|
52
52
|
*/
|
|
53
53
|
|
|
54
54
|
function timeObserverFactory() {
|
|
55
|
-
|
|
55
|
+
var interval = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1;
|
|
56
56
|
// Current time position
|
|
57
|
-
|
|
57
|
+
var position = 0; // Total duration expected
|
|
58
58
|
|
|
59
|
-
|
|
59
|
+
var duration = 0; // Last position forced
|
|
60
60
|
|
|
61
|
-
|
|
61
|
+
var _seek = 0;
|
|
62
62
|
/**
|
|
63
63
|
* Defines the API of a time observer.
|
|
64
64
|
*
|
|
@@ -101,8 +101,8 @@ define(['core/eventifier'], function (eventifier) { 'use strict';
|
|
|
101
101
|
* @function init
|
|
102
102
|
* @memberOf timeObserver
|
|
103
103
|
*/
|
|
104
|
-
init(initPosition, initDuration) {
|
|
105
|
-
position =
|
|
104
|
+
init: function init(initPosition, initDuration) {
|
|
105
|
+
position = _seek = initPosition;
|
|
106
106
|
duration = initDuration;
|
|
107
107
|
return this;
|
|
108
108
|
},
|
|
@@ -116,8 +116,8 @@ define(['core/eventifier'], function (eventifier) { 'use strict';
|
|
|
116
116
|
*
|
|
117
117
|
* @fires irregularity
|
|
118
118
|
*/
|
|
119
|
-
update(newPosition) {
|
|
120
|
-
if (newPosition >
|
|
119
|
+
update: function update(newPosition) {
|
|
120
|
+
if (newPosition > _seek && newPosition - position > interval) {
|
|
121
121
|
/**
|
|
122
122
|
* Notifies an irregularity in the time update
|
|
123
123
|
* @event irregularity
|
|
@@ -137,11 +137,10 @@ define(['core/eventifier'], function (eventifier) { 'use strict';
|
|
|
137
137
|
* @param {number} seekPosition
|
|
138
138
|
* @returns {timeObserver}
|
|
139
139
|
*/
|
|
140
|
-
seek(seekPosition) {
|
|
141
|
-
position =
|
|
140
|
+
seek: function seek(seekPosition) {
|
|
141
|
+
position = _seek = seekPosition;
|
|
142
142
|
return this;
|
|
143
143
|
}
|
|
144
|
-
|
|
145
144
|
});
|
|
146
145
|
}
|
|
147
146
|
|
|
@@ -1,171 +1,190 @@
|
|
|
1
1
|
define(['jquery'], function ($) { 'use strict';
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
$ = $ && Object.prototype.hasOwnProperty.call($, 'default') ? $['default'] : $;
|
|
4
|
+
|
|
5
|
+
function _toConsumableArray(arr) {
|
|
6
|
+
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
function _arrayWithoutHoles(arr) {
|
|
10
|
+
if (Array.isArray(arr)) return _arrayLikeToArray(arr);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
function _iterableToArray(iter) {
|
|
14
|
+
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
function _unsupportedIterableToArray(o, minLen) {
|
|
18
|
+
if (!o) return;
|
|
19
|
+
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
20
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
21
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
22
|
+
if (n === "Map" || n === "Set") return Array.from(o);
|
|
23
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function _arrayLikeToArray(arr, len) {
|
|
27
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
28
|
+
|
|
29
|
+
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
30
|
+
|
|
31
|
+
return arr2;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function _nonIterableSpread() {
|
|
35
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* CDN for the YouTube API
|
|
40
|
+
* @type {String}
|
|
41
|
+
*/
|
|
42
|
+
|
|
43
|
+
var youtubeApi = 'https://www.youtube.com/iframe_api';
|
|
44
|
+
/**
|
|
45
|
+
* A Regex to extract ID from Youtube URLs
|
|
46
|
+
* @type {RegExp}
|
|
47
|
+
*/
|
|
48
|
+
|
|
49
|
+
var reYoutube = /([?&\/]v[=\/])([\w-]+)([&\/]?)/;
|
|
50
|
+
/**
|
|
51
|
+
* Installs a Youtube player. The Youtube API must be ready
|
|
52
|
+
* @param {String|jQuery|HTMLElement} elem
|
|
53
|
+
* @param {Object} player
|
|
54
|
+
* @param {Object} [options]
|
|
55
|
+
* @param {Boolean} [options.controls]
|
|
56
|
+
*/
|
|
57
|
+
|
|
58
|
+
function addYoutubePlayer(elem, player) {
|
|
59
|
+
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
60
|
+
var $elem = $(elem);
|
|
61
|
+
new window.YT.Player($elem.get(0), {
|
|
62
|
+
height: '360',
|
|
63
|
+
width: '640',
|
|
64
|
+
videoId: $elem.data('videoId'),
|
|
65
|
+
playerVars: {
|
|
66
|
+
//hd: true,
|
|
67
|
+
autoplay: 0,
|
|
68
|
+
controls: options && options.controls ? 1 : 0,
|
|
69
|
+
rel: 0,
|
|
70
|
+
showinfo: 0,
|
|
71
|
+
wmode: 'transparent',
|
|
72
|
+
modestbranding: 1,
|
|
73
|
+
disablekb: 1,
|
|
74
|
+
playsinline: 1,
|
|
75
|
+
enablejsapi: 1,
|
|
76
|
+
origin: location.hostname
|
|
77
|
+
},
|
|
78
|
+
events: {
|
|
79
|
+
onReady: function onReady(ev) {
|
|
80
|
+
return player.onReady(ev);
|
|
81
|
+
},
|
|
82
|
+
onStateChange: function onStateChange(ev) {
|
|
83
|
+
return player.onStateChange(ev);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* A local manager for Youtube players.
|
|
90
|
+
* Relies on https://developers.google.com/youtube/iframe_api_reference
|
|
91
|
+
* @type {Object}
|
|
92
|
+
*/
|
|
4
93
|
|
|
5
|
-
/**
|
|
6
|
-
* This program is free software; you can redistribute it and/or
|
|
7
|
-
* modify it under the terms of the GNU General Public License
|
|
8
|
-
* as published by the Free Software Foundation; under version 2
|
|
9
|
-
* of the License (non-upgradable).
|
|
10
|
-
*
|
|
11
|
-
* This program is distributed in the hope that it will be useful,
|
|
12
|
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13
|
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
14
|
-
* GNU General Public License for more details.
|
|
15
|
-
*
|
|
16
|
-
* You should have received a copy of the GNU General Public License
|
|
17
|
-
* along with this program; if not, write to the Free Software
|
|
18
|
-
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
19
|
-
*
|
|
20
|
-
* Copyright (c) 2015-2021 (original work) Open Assessment Technologies SA ;
|
|
21
|
-
*/
|
|
22
|
-
/**
|
|
23
|
-
* CDN for the YouTube API
|
|
24
|
-
* @type {String}
|
|
25
|
-
*/
|
|
26
94
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
* @type {RegExp}
|
|
31
|
-
*/
|
|
95
|
+
function youtubeManagerFactory() {
|
|
96
|
+
// The Youtube API injection state
|
|
97
|
+
var injected = false; // The Youtube API ready state
|
|
32
98
|
|
|
33
|
-
|
|
99
|
+
var ready = false; // A list of pending players
|
|
100
|
+
|
|
101
|
+
var pending = [];
|
|
34
102
|
/**
|
|
35
|
-
*
|
|
36
|
-
* @
|
|
37
|
-
* @param {Object} player
|
|
38
|
-
* @param {Object} [options]
|
|
39
|
-
* @param {Boolean} [options.controls]
|
|
103
|
+
* Checks if the Youtube API is ready to use
|
|
104
|
+
* @returns {Boolean}
|
|
40
105
|
*/
|
|
41
106
|
|
|
42
|
-
function
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
modestbranding: 1,
|
|
57
|
-
disablekb: 1,
|
|
58
|
-
playsinline: 1,
|
|
59
|
-
enablejsapi: 1,
|
|
60
|
-
origin: location.hostname
|
|
61
|
-
},
|
|
62
|
-
events: {
|
|
63
|
-
onReady: ev => player.onReady(ev),
|
|
64
|
-
onStateChange: ev => player.onStateChange(ev)
|
|
65
|
-
}
|
|
66
|
-
});
|
|
107
|
+
function isApiReady() {
|
|
108
|
+
var apiReady = typeof window.YT !== 'undefined' && typeof window.YT.Player !== 'undefined';
|
|
109
|
+
|
|
110
|
+
if (apiReady && !ready) {
|
|
111
|
+
ready = true;
|
|
112
|
+
pending.forEach(function (args) {
|
|
113
|
+
if (args) {
|
|
114
|
+
addYoutubePlayer.apply(void 0, _toConsumableArray(args));
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
pending = [];
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
return apiReady;
|
|
67
121
|
}
|
|
68
122
|
/**
|
|
69
|
-
*
|
|
70
|
-
* Relies on https://developers.google.com/youtube/iframe_api_reference
|
|
71
|
-
* @type {Object}
|
|
123
|
+
* Injects the Youtube API into the page
|
|
72
124
|
*/
|
|
73
125
|
|
|
74
126
|
|
|
75
|
-
function
|
|
76
|
-
|
|
77
|
-
|
|
127
|
+
function injectApi() {
|
|
128
|
+
if (!isApiReady()) {
|
|
129
|
+
window.require([youtubeApi], function () {
|
|
130
|
+
var check = function check() {
|
|
131
|
+
if (!isApiReady()) {
|
|
132
|
+
setTimeout(check, 100);
|
|
133
|
+
}
|
|
134
|
+
};
|
|
78
135
|
|
|
79
|
-
|
|
136
|
+
check();
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
injected = true;
|
|
141
|
+
}
|
|
80
142
|
|
|
81
|
-
|
|
143
|
+
return {
|
|
82
144
|
/**
|
|
83
|
-
*
|
|
84
|
-
* @
|
|
145
|
+
* Adds a Youtube player
|
|
146
|
+
* @param {String|jQuery|HTMLElement} elem
|
|
147
|
+
* @param {Object} player
|
|
148
|
+
* @param {Object} [options]
|
|
149
|
+
* @param {Boolean} [options.controls]
|
|
85
150
|
*/
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
}
|
|
96
|
-
});
|
|
97
|
-
pending = [];
|
|
151
|
+
add: function add(elem, player, options) {
|
|
152
|
+
if (ready) {
|
|
153
|
+
addYoutubePlayer(elem, player, options);
|
|
154
|
+
} else {
|
|
155
|
+
pending.push([elem, player, options]);
|
|
156
|
+
|
|
157
|
+
if (!injected) {
|
|
158
|
+
injectApi();
|
|
159
|
+
}
|
|
98
160
|
}
|
|
161
|
+
},
|
|
99
162
|
|
|
100
|
-
return apiReady;
|
|
101
|
-
}
|
|
102
163
|
/**
|
|
103
|
-
*
|
|
164
|
+
* Removes a pending Youtube player
|
|
165
|
+
* @param {String|jQuery|HTMLElement} elem
|
|
166
|
+
* @param {Object} player
|
|
104
167
|
*/
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
window.require([youtubeApi], () => {
|
|
110
|
-
const check = () => {
|
|
111
|
-
if (!isApiReady()) {
|
|
112
|
-
setTimeout(check, 100);
|
|
113
|
-
}
|
|
114
|
-
};
|
|
115
|
-
|
|
116
|
-
check();
|
|
117
|
-
});
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
injected = true;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
return {
|
|
124
|
-
/**
|
|
125
|
-
* Adds a Youtube player
|
|
126
|
-
* @param {String|jQuery|HTMLElement} elem
|
|
127
|
-
* @param {Object} player
|
|
128
|
-
* @param {Object} [options]
|
|
129
|
-
* @param {Boolean} [options.controls]
|
|
130
|
-
*/
|
|
131
|
-
add(elem, player, options) {
|
|
132
|
-
if (ready) {
|
|
133
|
-
addYoutubePlayer(elem, player, options);
|
|
134
|
-
} else {
|
|
135
|
-
pending.push([elem, player, options]);
|
|
136
|
-
|
|
137
|
-
if (!injected) {
|
|
138
|
-
injectApi();
|
|
139
|
-
}
|
|
168
|
+
remove: function remove(elem, player) {
|
|
169
|
+
pending.forEach(function (args, idx) {
|
|
170
|
+
if (args && elem === args[0] && player === args[1]) {
|
|
171
|
+
pending[idx] = null;
|
|
140
172
|
}
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
/**
|
|
144
|
-
* Removes a pending Youtube player
|
|
145
|
-
* @param {String|jQuery|HTMLElement} elem
|
|
146
|
-
* @param {Object} player
|
|
147
|
-
*/
|
|
148
|
-
remove(elem, player) {
|
|
149
|
-
pending.forEach((args, idx) => {
|
|
150
|
-
if (args && elem === args[0] && player === args[1]) {
|
|
151
|
-
pending[idx] = null;
|
|
152
|
-
}
|
|
153
|
-
});
|
|
154
|
-
},
|
|
155
|
-
|
|
156
|
-
/**
|
|
157
|
-
* Extracts the ID of a Youtube video from an URL
|
|
158
|
-
* @param {String} url
|
|
159
|
-
* @returns {String}
|
|
160
|
-
*/
|
|
161
|
-
extractYoutubeId(url) {
|
|
162
|
-
const res = reYoutube.exec(url);
|
|
163
|
-
return res && res[2] || url;
|
|
164
|
-
}
|
|
173
|
+
});
|
|
174
|
+
},
|
|
165
175
|
|
|
166
|
-
|
|
167
|
-
|
|
176
|
+
/**
|
|
177
|
+
* Extracts the ID of a Youtube video from an URL
|
|
178
|
+
* @param {String} url
|
|
179
|
+
* @returns {String}
|
|
180
|
+
*/
|
|
181
|
+
extractYoutubeId: function extractYoutubeId(url) {
|
|
182
|
+
var res = reYoutube.exec(url);
|
|
183
|
+
return res && res[2] || url;
|
|
184
|
+
}
|
|
185
|
+
};
|
|
186
|
+
}
|
|
168
187
|
|
|
169
|
-
|
|
188
|
+
return youtubeManagerFactory;
|
|
170
189
|
|
|
171
190
|
});
|