@oat-sa/tao-core-ui 1.63.0 → 1.64.0
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 +2 -109
- package/dist/animable/absorbable/absorbable.js +2 -109
- package/dist/animable/pulsable/pulsable.js +2 -109
- package/dist/badge/badge.js +2 -109
- package/dist/breadcrumbs.js +2 -109
- package/dist/bulkActionPopup.js +2 -108
- package/dist/button.js +2 -110
- package/dist/cascadingComboBox.js +2 -108
- package/dist/class/selector.js +2 -108
- package/dist/component/windowed.js +2 -108
- package/dist/component.js +2 -109
- package/dist/contextualPopup.js +2 -109
- package/dist/dashboard.js +2 -108
- package/dist/datalist.js +2 -108
- package/dist/datatable.js +3 -108
- package/dist/dateRange/dateRange.js +2 -108
- package/dist/datetime/picker.js +2 -108
- package/dist/deleter.js +2 -108
- package/dist/destination/selector.js +2 -108
- package/dist/dialog/confirmDelete.js +2 -108
- package/dist/dialog.js +2 -108
- package/dist/documentViewer/providers/pdfViewer/fallback/viewer.js +2 -110
- package/dist/documentViewer/providers/pdfViewer/pdfjs/findBar.js +2 -109
- package/dist/documentViewer/providers/pdfViewer/pdfjs/pageView.js +2 -110
- package/dist/documentViewer/providers/pdfViewer/pdfjs/searchEngine.js +2 -109
- package/dist/documentViewer/providers/pdfViewer/pdfjs/viewer.js +2 -109
- package/dist/documentViewer/providers/pdfViewer.js +2 -109
- package/dist/documentViewer.js +2 -109
- package/dist/dropdown.js +2 -109
- package/dist/dynamicComponent.js +2 -109
- package/dist/feedback.js +2 -109
- package/dist/figure/FigureStateActive.js +25 -113
- package/dist/filter.js +2 -108
- package/dist/form/dropdownForm.js +2 -108
- package/dist/form/form.js +2 -109
- package/dist/form/validator/renderer.js +2 -109
- package/dist/form/widget/providers/checkBox.js +2 -108
- package/dist/form/widget/providers/comboBox.js +2 -110
- package/dist/form/widget/providers/hidden.js +2 -110
- package/dist/form/widget/providers/hiddenBox.js +2 -108
- package/dist/form/widget/providers/radioBox.js +2 -110
- package/dist/form/widget/providers/textArea.js +2 -110
- package/dist/form/widget/widget.js +2 -108
- package/dist/generis/form/form.js +2 -108
- package/dist/generis/validator/validator.js +2 -109
- package/dist/generis/widget/checkBox/checkBox.js +2 -108
- package/dist/generis/widget/comboBox/comboBox.js +2 -109
- package/dist/generis/widget/hiddenBox/hiddenBox.js +2 -109
- package/dist/generis/widget/textBox/textBox.js +2 -109
- package/dist/generis/widget/widget.js +2 -108
- package/dist/groupedComboBox.js +2 -108
- package/dist/itemButtonList.js +2 -110
- package/dist/listbox.js +2 -108
- package/dist/loadingButton/loadingButton.js +2 -109
- package/dist/lock.js +2 -108
- package/dist/login/login.js +2 -108
- package/dist/maths/calculator/basicCalculator.js +2 -109
- package/dist/maths/calculator/core/board.js +2 -108
- package/dist/maths/calculator/core/expression.js +2 -109
- package/dist/maths/calculator/core/labels.js +2 -109
- package/dist/maths/calculator/plugins/keyboard/templateKeyboard/templateKeyboard.js +2 -109
- package/dist/maths/calculator/plugins/screen/simpleScreen/simpleScreen.js +2 -109
- package/dist/maths/calculator/scientificCalculator.js +2 -108
- package/dist/mediaEditor/mediaEditorComponent.js +2 -109
- package/dist/mediaEditor/plugins/mediaAlignment/helper.js +49 -2
- package/dist/mediaEditor/plugins/mediaAlignment/mediaAlignmentComponent.js +2 -110
- package/dist/mediaEditor/plugins/mediaDimension/mediaDimensionComponent.js +2 -109
- package/dist/mediaplayer/players/html5.js +2 -110
- package/dist/mediaplayer/players/youtube.js +2 -110
- package/dist/mediaplayer.js +2 -109
- package/dist/mediasizer.js +2 -109
- package/dist/pageSizeSelector.js +2 -109
- package/dist/pagination/providers/pages.js +2 -109
- package/dist/pagination/providers/simple.js +2 -110
- package/dist/propertySelector/propertySelector.js +2 -110
- package/dist/report.js +2 -109
- package/dist/resource/filters.js +2 -108
- package/dist/resource/list.js +29 -119
- package/dist/resource/selector.js +2 -108
- package/dist/resource/tree.js +29 -119
- package/dist/resourcemgr/fileBrowser.js +478 -585
- package/dist/resourcemgr/fileSelector.js +2 -108
- package/dist/resourcemgr.js +2 -109
- package/dist/searchModal/advancedSearch.js +2 -109
- package/dist/searchModal.js +16 -107
- package/dist/switch/switch.js +2 -108
- package/dist/tabs.js +2 -109
- package/dist/taskQueue/status.js +2 -108
- package/dist/taskQueue/table.js +2 -108
- package/dist/taskQueueButton/taskable.js +2 -108
- package/dist/taskQueueButton/treeButton.js +2 -109
- package/dist/tooltip.js +2 -109
- package/dist/tristateCheckboxGroup.js +2 -108
- package/dist/uploader.js +2 -108
- package/package.json +2 -2
- package/scss/inc/_feedback.scss +4 -0
- package/src/css/basic.css +4 -0
- package/src/css/basic.css.map +1 -1
- package/src/figure/FigureStateActive.js +15 -5
- package/src/mediaEditor/plugins/mediaAlignment/helper.js +48 -0
- package/scss/.DS_Store +0 -0
- package/scss/ckeditor/.DS_Store +0 -0
- package/scss/ckeditor/skins/.DS_Store +0 -0
- package/scss/ckeditor/skins/tao/.DS_Store +0 -0
- package/scss/ckeditor/skins/tao/scss/.DS_Store +0 -0
- package/scss/font/.DS_Store +0 -0
- package/scss/inc/.DS_Store +0 -0
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
define(['exports'], function (exports) { 'use strict';
|
|
1
|
+
define(['exports', 'lodash'], function (exports, _) { 'use strict';
|
|
2
|
+
|
|
3
|
+
_ = _ && Object.prototype.hasOwnProperty.call(_, 'default') ? _['default'] : _;
|
|
2
4
|
|
|
3
5
|
/**
|
|
4
6
|
* This program is free software; you can redistribute it and/or
|
|
@@ -17,9 +19,30 @@ define(['exports'], function (exports) { 'use strict';
|
|
|
17
19
|
*
|
|
18
20
|
* Copyright (c) 2021-2022 (original work) Open Assessment Technologies SA;
|
|
19
21
|
*/
|
|
20
|
-
|
|
21
22
|
const FLOAT_LEFT_CLASS = 'wrap-left';
|
|
22
23
|
const FLOAT_RIGHT_CLASS = 'wrap-right';
|
|
24
|
+
const searchRecurse = (parentElement, serial) => {
|
|
25
|
+
if (!parentElement) {
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
28
|
+
if (parentElement.serial === serial) {
|
|
29
|
+
return parentElement;
|
|
30
|
+
}
|
|
31
|
+
let found = null;
|
|
32
|
+
_.some(parentElement['elements'], childElement => {
|
|
33
|
+
if (childElement.serial === serial) {
|
|
34
|
+
found = parentElement;
|
|
35
|
+
} else if (childElement['elements']) {
|
|
36
|
+
found = searchRecurse(childElement, serial);
|
|
37
|
+
} else if (childElement['prompt']) {
|
|
38
|
+
found = searchRecurse(childElement.prompt.bdy, serial);
|
|
39
|
+
}
|
|
40
|
+
if (found) {
|
|
41
|
+
return true;
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
return found;
|
|
45
|
+
};
|
|
23
46
|
const positionFloat = function positionFloat(widget, position) {
|
|
24
47
|
if (!position) {
|
|
25
48
|
return;
|
|
@@ -41,11 +64,35 @@ define(['exports'], function (exports) { 'use strict';
|
|
|
41
64
|
// Update DOM
|
|
42
65
|
widget.$container.addClass(className);
|
|
43
66
|
// Update model
|
|
67
|
+
const prevClassName = widget.element.attr('class') || '';
|
|
44
68
|
if (className) {
|
|
45
69
|
widget.element.attr('class', className);
|
|
46
70
|
} else {
|
|
47
71
|
widget.element.removeAttr('class');
|
|
48
72
|
}
|
|
73
|
+
if (prevClassName !== className) {
|
|
74
|
+
// Re-build Figure widget to toggle between inline/block
|
|
75
|
+
const parent = searchRecurse(widget.element.bdy.rootElement.bdy, widget.serial);
|
|
76
|
+
// avoid changes on Figure in a prompt
|
|
77
|
+
if (parent.contentModel && parent.contentModel === 'inlineStatic') {
|
|
78
|
+
_.defer(() => {
|
|
79
|
+
widget.element.data('widget').refresh();
|
|
80
|
+
});
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
widget.element.data('widget').changeState('sleep');
|
|
84
|
+
_.defer(() => {
|
|
85
|
+
if (parent && parent.data('widget')) {
|
|
86
|
+
parent.data('widget').changeState('active');
|
|
87
|
+
_.defer(() => {
|
|
88
|
+
parent.data('widget').changeState('sleep');
|
|
89
|
+
_.defer(() => {
|
|
90
|
+
widget.element.data('widget').changeState('active');
|
|
91
|
+
});
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
}
|
|
49
96
|
widget.$original.trigger('contentChange.qti-widget');
|
|
50
97
|
};
|
|
51
98
|
const initAlignment = function initAlignment(widget) {
|
|
@@ -1,117 +1,10 @@
|
|
|
1
|
-
define(['jquery', 'lodash', 'ui/component', 'handlebars', '
|
|
1
|
+
define(['jquery', 'lodash', 'ui/component', 'handlebars', 'lib/handlebars/helpers', 'css!ui/mediaEditor/plugins/mediaAlignment/style.css'], function ($$1, _, component, Handlebars, Helpers0, style_css) { 'use strict';
|
|
2
2
|
|
|
3
3
|
$$1 = $$1 && Object.prototype.hasOwnProperty.call($$1, 'default') ? $$1['default'] : $$1;
|
|
4
4
|
_ = _ && Object.prototype.hasOwnProperty.call(_, 'default') ? _['default'] : _;
|
|
5
5
|
component = component && Object.prototype.hasOwnProperty.call(component, 'default') ? component['default'] : component;
|
|
6
6
|
Handlebars = Handlebars && Object.prototype.hasOwnProperty.call(Handlebars, 'default') ? Handlebars['default'] : Handlebars;
|
|
7
|
-
|
|
8
|
-
DOMPurify = DOMPurify && Object.prototype.hasOwnProperty.call(DOMPurify, 'default') ? DOMPurify['default'] : DOMPurify;
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* This program is free software; you can redistribute it and/or
|
|
12
|
-
* modify it under the terms of the GNU General Public License
|
|
13
|
-
* as published by the Free Software Foundation; under version 2
|
|
14
|
-
* of the License (non-upgradable).
|
|
15
|
-
*
|
|
16
|
-
* This program is distributed in the hope that it will be useful,
|
|
17
|
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
18
|
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
19
|
-
* GNU General Public License for more details.
|
|
20
|
-
*
|
|
21
|
-
* You should have received a copy of the GNU General Public License
|
|
22
|
-
* along with this program; if not, write to the Free Software
|
|
23
|
-
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
24
|
-
*
|
|
25
|
-
* Copyright (c) 2013-2019 (original work) Open Assessment Technologies SA (under the project TAO-PRODUCT);
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*/
|
|
29
|
-
function Helpers0 (hb) {
|
|
30
|
-
//register a i18n helper
|
|
31
|
-
hb.registerHelper('__', function (key) {
|
|
32
|
-
return __(key);
|
|
33
|
-
});
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* Register dompurify helper
|
|
37
|
-
*
|
|
38
|
-
* https://github.com/cure53/DOMPurify
|
|
39
|
-
* with config SAFE_FOR_TEMPLATES: true
|
|
40
|
-
* to make output safe for template systems
|
|
41
|
-
*/
|
|
42
|
-
hb.registerHelper('dompurify', function (context) {
|
|
43
|
-
return DOMPurify.sanitize(context);
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* Register join helper
|
|
48
|
-
*
|
|
49
|
-
* Example :
|
|
50
|
-
* var values = {a:v1, b:v2, c:v3};
|
|
51
|
-
* Using {{{join attributes '=' ' ' '"'}}} will return : a="v1" b="v2" c="v3"
|
|
52
|
-
* Using {{{join values null ' or ' '*'}}} will return : *v1* or *v2* or *v3*
|
|
53
|
-
*/
|
|
54
|
-
hb.registerHelper('join', function (arr, keyValueGlue, fragmentGlue, wrapper) {
|
|
55
|
-
var fragments = [];
|
|
56
|
-
keyValueGlue = typeof keyValueGlue === 'string' ? keyValueGlue : undefined;
|
|
57
|
-
fragmentGlue = typeof fragmentGlue === 'string' ? fragmentGlue : ' ';
|
|
58
|
-
wrapper = typeof wrapper === 'string' ? wrapper : '"';
|
|
59
|
-
_.forIn(arr, function (value, key) {
|
|
60
|
-
var fragment = '';
|
|
61
|
-
if (value !== null || value !== undefined) {
|
|
62
|
-
if (typeof value === 'boolean') {
|
|
63
|
-
value = value ? 'true' : 'false';
|
|
64
|
-
} else if (typeof value === 'object') {
|
|
65
|
-
value = _.values(value).join(' ');
|
|
66
|
-
}
|
|
67
|
-
} else {
|
|
68
|
-
value = '';
|
|
69
|
-
}
|
|
70
|
-
if (keyValueGlue !== undefined) {
|
|
71
|
-
fragment += key + keyValueGlue;
|
|
72
|
-
}
|
|
73
|
-
fragment += wrapper + value + wrapper;
|
|
74
|
-
fragments.push(fragment);
|
|
75
|
-
});
|
|
76
|
-
return fragments.join(fragmentGlue);
|
|
77
|
-
});
|
|
78
|
-
|
|
79
|
-
//register a classic "for loop" helper
|
|
80
|
-
//it also adds a local variable "i" as the index in each iteration loop
|
|
81
|
-
hb.registerHelper('for', function (startIndex, stopIndex, increment, options) {
|
|
82
|
-
var ret = '';
|
|
83
|
-
startIndex = parseInt(startIndex);
|
|
84
|
-
stopIndex = parseInt(stopIndex);
|
|
85
|
-
increment = parseInt(increment);
|
|
86
|
-
for (var i = startIndex; i < stopIndex; i += increment) {
|
|
87
|
-
ret += options.fn(_.extend({}, this, {
|
|
88
|
-
i: i
|
|
89
|
-
}));
|
|
90
|
-
}
|
|
91
|
-
return ret;
|
|
92
|
-
});
|
|
93
|
-
hb.registerHelper('equal', function (var1, var2, options) {
|
|
94
|
-
if (var1 == var2) {
|
|
95
|
-
return options.fn(this);
|
|
96
|
-
} else {
|
|
97
|
-
return options.inverse(this);
|
|
98
|
-
}
|
|
99
|
-
});
|
|
100
|
-
|
|
101
|
-
// register a "get property" helper
|
|
102
|
-
// it gets the named property from the provided context
|
|
103
|
-
hb.registerHelper('property', function (name, context) {
|
|
104
|
-
return context[name] || '';
|
|
105
|
-
});
|
|
106
|
-
|
|
107
|
-
// register an 'includes' helper
|
|
108
|
-
// it checks if value is in array
|
|
109
|
-
hb.registerHelper('includes', function (haystack, needle, options) {
|
|
110
|
-
if (_.contains(haystack, needle)) {
|
|
111
|
-
return options.fn(this);
|
|
112
|
-
}
|
|
113
|
-
});
|
|
114
|
-
}
|
|
7
|
+
Helpers0 = Helpers0 && Object.prototype.hasOwnProperty.call(Helpers0, 'default') ? Helpers0['default'] : Helpers0;
|
|
115
8
|
|
|
116
9
|
if (!Helpers0.__initialized) {
|
|
117
10
|
Helpers0(Handlebars);
|
|
@@ -156,7 +49,6 @@ define(['jquery', 'lodash', 'ui/component', 'handlebars', 'i18n', 'lib/dompurify
|
|
|
156
49
|
*
|
|
157
50
|
* Copyright (c) 2021-2022 (original work) Open Assessment Technologies SA;
|
|
158
51
|
*/
|
|
159
|
-
|
|
160
52
|
const FLOAT_LEFT_CLASS = 'wrap-left';
|
|
161
53
|
const FLOAT_RIGHT_CLASS = 'wrap-right';
|
|
162
54
|
|
|
@@ -1,119 +1,12 @@
|
|
|
1
|
-
define(['jquery', 'lodash', 'ui/component', 'handlebars', '
|
|
1
|
+
define(['jquery', 'lodash', 'ui/component', 'handlebars', 'lib/handlebars/helpers', 'ui/mediaEditor/plugins/mediaDimension/helper', 'nouislider', 'ui/tooltip', 'css!ui/mediaEditor/plugins/mediaDimension/style.css'], function ($$1, _, component, Handlebars, Helpers0, helper, nouislider, tooltip, style_css) { 'use strict';
|
|
2
2
|
|
|
3
3
|
$$1 = $$1 && Object.prototype.hasOwnProperty.call($$1, 'default') ? $$1['default'] : $$1;
|
|
4
4
|
_ = _ && Object.prototype.hasOwnProperty.call(_, 'default') ? _['default'] : _;
|
|
5
5
|
component = component && Object.prototype.hasOwnProperty.call(component, 'default') ? component['default'] : component;
|
|
6
6
|
Handlebars = Handlebars && Object.prototype.hasOwnProperty.call(Handlebars, 'default') ? Handlebars['default'] : Handlebars;
|
|
7
|
-
|
|
8
|
-
DOMPurify = DOMPurify && Object.prototype.hasOwnProperty.call(DOMPurify, 'default') ? DOMPurify['default'] : DOMPurify;
|
|
7
|
+
Helpers0 = Helpers0 && Object.prototype.hasOwnProperty.call(Helpers0, 'default') ? Helpers0['default'] : Helpers0;
|
|
9
8
|
helper = helper && Object.prototype.hasOwnProperty.call(helper, 'default') ? helper['default'] : helper;
|
|
10
9
|
|
|
11
|
-
/**
|
|
12
|
-
* This program is free software; you can redistribute it and/or
|
|
13
|
-
* modify it under the terms of the GNU General Public License
|
|
14
|
-
* as published by the Free Software Foundation; under version 2
|
|
15
|
-
* of the License (non-upgradable).
|
|
16
|
-
*
|
|
17
|
-
* This program is distributed in the hope that it will be useful,
|
|
18
|
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
19
|
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
20
|
-
* GNU General Public License for more details.
|
|
21
|
-
*
|
|
22
|
-
* You should have received a copy of the GNU General Public License
|
|
23
|
-
* along with this program; if not, write to the Free Software
|
|
24
|
-
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
25
|
-
*
|
|
26
|
-
* Copyright (c) 2013-2019 (original work) Open Assessment Technologies SA (under the project TAO-PRODUCT);
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*/
|
|
30
|
-
function Helpers0 (hb) {
|
|
31
|
-
//register a i18n helper
|
|
32
|
-
hb.registerHelper('__', function (key) {
|
|
33
|
-
return __(key);
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* Register dompurify helper
|
|
38
|
-
*
|
|
39
|
-
* https://github.com/cure53/DOMPurify
|
|
40
|
-
* with config SAFE_FOR_TEMPLATES: true
|
|
41
|
-
* to make output safe for template systems
|
|
42
|
-
*/
|
|
43
|
-
hb.registerHelper('dompurify', function (context) {
|
|
44
|
-
return DOMPurify.sanitize(context);
|
|
45
|
-
});
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* Register join helper
|
|
49
|
-
*
|
|
50
|
-
* Example :
|
|
51
|
-
* var values = {a:v1, b:v2, c:v3};
|
|
52
|
-
* Using {{{join attributes '=' ' ' '"'}}} will return : a="v1" b="v2" c="v3"
|
|
53
|
-
* Using {{{join values null ' or ' '*'}}} will return : *v1* or *v2* or *v3*
|
|
54
|
-
*/
|
|
55
|
-
hb.registerHelper('join', function (arr, keyValueGlue, fragmentGlue, wrapper) {
|
|
56
|
-
var fragments = [];
|
|
57
|
-
keyValueGlue = typeof keyValueGlue === 'string' ? keyValueGlue : undefined;
|
|
58
|
-
fragmentGlue = typeof fragmentGlue === 'string' ? fragmentGlue : ' ';
|
|
59
|
-
wrapper = typeof wrapper === 'string' ? wrapper : '"';
|
|
60
|
-
_.forIn(arr, function (value, key) {
|
|
61
|
-
var fragment = '';
|
|
62
|
-
if (value !== null || value !== undefined) {
|
|
63
|
-
if (typeof value === 'boolean') {
|
|
64
|
-
value = value ? 'true' : 'false';
|
|
65
|
-
} else if (typeof value === 'object') {
|
|
66
|
-
value = _.values(value).join(' ');
|
|
67
|
-
}
|
|
68
|
-
} else {
|
|
69
|
-
value = '';
|
|
70
|
-
}
|
|
71
|
-
if (keyValueGlue !== undefined) {
|
|
72
|
-
fragment += key + keyValueGlue;
|
|
73
|
-
}
|
|
74
|
-
fragment += wrapper + value + wrapper;
|
|
75
|
-
fragments.push(fragment);
|
|
76
|
-
});
|
|
77
|
-
return fragments.join(fragmentGlue);
|
|
78
|
-
});
|
|
79
|
-
|
|
80
|
-
//register a classic "for loop" helper
|
|
81
|
-
//it also adds a local variable "i" as the index in each iteration loop
|
|
82
|
-
hb.registerHelper('for', function (startIndex, stopIndex, increment, options) {
|
|
83
|
-
var ret = '';
|
|
84
|
-
startIndex = parseInt(startIndex);
|
|
85
|
-
stopIndex = parseInt(stopIndex);
|
|
86
|
-
increment = parseInt(increment);
|
|
87
|
-
for (var i = startIndex; i < stopIndex; i += increment) {
|
|
88
|
-
ret += options.fn(_.extend({}, this, {
|
|
89
|
-
i: i
|
|
90
|
-
}));
|
|
91
|
-
}
|
|
92
|
-
return ret;
|
|
93
|
-
});
|
|
94
|
-
hb.registerHelper('equal', function (var1, var2, options) {
|
|
95
|
-
if (var1 == var2) {
|
|
96
|
-
return options.fn(this);
|
|
97
|
-
} else {
|
|
98
|
-
return options.inverse(this);
|
|
99
|
-
}
|
|
100
|
-
});
|
|
101
|
-
|
|
102
|
-
// register a "get property" helper
|
|
103
|
-
// it gets the named property from the provided context
|
|
104
|
-
hb.registerHelper('property', function (name, context) {
|
|
105
|
-
return context[name] || '';
|
|
106
|
-
});
|
|
107
|
-
|
|
108
|
-
// register an 'includes' helper
|
|
109
|
-
// it checks if value is in array
|
|
110
|
-
hb.registerHelper('includes', function (haystack, needle, options) {
|
|
111
|
-
if (_.contains(haystack, needle)) {
|
|
112
|
-
return options.fn(this);
|
|
113
|
-
}
|
|
114
|
-
});
|
|
115
|
-
}
|
|
116
|
-
|
|
117
10
|
if (!Helpers0.__initialized) {
|
|
118
11
|
Helpers0(Handlebars);
|
|
119
12
|
Helpers0.__initialized = true;
|
|
@@ -1,122 +1,14 @@
|
|
|
1
|
-
define(['jquery', 'util/urlParser', 'core/eventifier', 'ui/mediaplayer/support', 'handlebars', '
|
|
1
|
+
define(['jquery', 'util/urlParser', 'core/eventifier', 'ui/mediaplayer/support', 'handlebars', 'lib/handlebars/helpers', 'ui/mediaplayer/utils/reminder', 'ui/mediaplayer/utils/timeObserver'], function ($$1, UrlParser, eventifier, support, Handlebars, Helpers0, reminderManagerFactory, timeObserverFactory) { 'use strict';
|
|
2
2
|
|
|
3
3
|
$$1 = $$1 && Object.prototype.hasOwnProperty.call($$1, 'default') ? $$1['default'] : $$1;
|
|
4
4
|
UrlParser = UrlParser && Object.prototype.hasOwnProperty.call(UrlParser, 'default') ? UrlParser['default'] : UrlParser;
|
|
5
5
|
eventifier = eventifier && Object.prototype.hasOwnProperty.call(eventifier, 'default') ? eventifier['default'] : eventifier;
|
|
6
6
|
support = support && Object.prototype.hasOwnProperty.call(support, 'default') ? support['default'] : support;
|
|
7
7
|
Handlebars = Handlebars && Object.prototype.hasOwnProperty.call(Handlebars, 'default') ? Handlebars['default'] : Handlebars;
|
|
8
|
-
|
|
9
|
-
_ = _ && Object.prototype.hasOwnProperty.call(_, 'default') ? _['default'] : _;
|
|
10
|
-
DOMPurify = DOMPurify && Object.prototype.hasOwnProperty.call(DOMPurify, 'default') ? DOMPurify['default'] : DOMPurify;
|
|
8
|
+
Helpers0 = Helpers0 && Object.prototype.hasOwnProperty.call(Helpers0, 'default') ? Helpers0['default'] : Helpers0;
|
|
11
9
|
reminderManagerFactory = reminderManagerFactory && Object.prototype.hasOwnProperty.call(reminderManagerFactory, 'default') ? reminderManagerFactory['default'] : reminderManagerFactory;
|
|
12
10
|
timeObserverFactory = timeObserverFactory && Object.prototype.hasOwnProperty.call(timeObserverFactory, 'default') ? timeObserverFactory['default'] : timeObserverFactory;
|
|
13
11
|
|
|
14
|
-
/**
|
|
15
|
-
* This program is free software; you can redistribute it and/or
|
|
16
|
-
* modify it under the terms of the GNU General Public License
|
|
17
|
-
* as published by the Free Software Foundation; under version 2
|
|
18
|
-
* of the License (non-upgradable).
|
|
19
|
-
*
|
|
20
|
-
* This program is distributed in the hope that it will be useful,
|
|
21
|
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
22
|
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
23
|
-
* GNU General Public License for more details.
|
|
24
|
-
*
|
|
25
|
-
* You should have received a copy of the GNU General Public License
|
|
26
|
-
* along with this program; if not, write to the Free Software
|
|
27
|
-
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
28
|
-
*
|
|
29
|
-
* Copyright (c) 2013-2019 (original work) Open Assessment Technologies SA (under the project TAO-PRODUCT);
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*/
|
|
33
|
-
function Helpers0 (hb) {
|
|
34
|
-
//register a i18n helper
|
|
35
|
-
hb.registerHelper('__', function (key) {
|
|
36
|
-
return __(key);
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* Register dompurify helper
|
|
41
|
-
*
|
|
42
|
-
* https://github.com/cure53/DOMPurify
|
|
43
|
-
* with config SAFE_FOR_TEMPLATES: true
|
|
44
|
-
* to make output safe for template systems
|
|
45
|
-
*/
|
|
46
|
-
hb.registerHelper('dompurify', function (context) {
|
|
47
|
-
return DOMPurify.sanitize(context);
|
|
48
|
-
});
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
* Register join helper
|
|
52
|
-
*
|
|
53
|
-
* Example :
|
|
54
|
-
* var values = {a:v1, b:v2, c:v3};
|
|
55
|
-
* Using {{{join attributes '=' ' ' '"'}}} will return : a="v1" b="v2" c="v3"
|
|
56
|
-
* Using {{{join values null ' or ' '*'}}} will return : *v1* or *v2* or *v3*
|
|
57
|
-
*/
|
|
58
|
-
hb.registerHelper('join', function (arr, keyValueGlue, fragmentGlue, wrapper) {
|
|
59
|
-
var fragments = [];
|
|
60
|
-
keyValueGlue = typeof keyValueGlue === 'string' ? keyValueGlue : undefined;
|
|
61
|
-
fragmentGlue = typeof fragmentGlue === 'string' ? fragmentGlue : ' ';
|
|
62
|
-
wrapper = typeof wrapper === 'string' ? wrapper : '"';
|
|
63
|
-
_.forIn(arr, function (value, key) {
|
|
64
|
-
var fragment = '';
|
|
65
|
-
if (value !== null || value !== undefined) {
|
|
66
|
-
if (typeof value === 'boolean') {
|
|
67
|
-
value = value ? 'true' : 'false';
|
|
68
|
-
} else if (typeof value === 'object') {
|
|
69
|
-
value = _.values(value).join(' ');
|
|
70
|
-
}
|
|
71
|
-
} else {
|
|
72
|
-
value = '';
|
|
73
|
-
}
|
|
74
|
-
if (keyValueGlue !== undefined) {
|
|
75
|
-
fragment += key + keyValueGlue;
|
|
76
|
-
}
|
|
77
|
-
fragment += wrapper + value + wrapper;
|
|
78
|
-
fragments.push(fragment);
|
|
79
|
-
});
|
|
80
|
-
return fragments.join(fragmentGlue);
|
|
81
|
-
});
|
|
82
|
-
|
|
83
|
-
//register a classic "for loop" helper
|
|
84
|
-
//it also adds a local variable "i" as the index in each iteration loop
|
|
85
|
-
hb.registerHelper('for', function (startIndex, stopIndex, increment, options) {
|
|
86
|
-
var ret = '';
|
|
87
|
-
startIndex = parseInt(startIndex);
|
|
88
|
-
stopIndex = parseInt(stopIndex);
|
|
89
|
-
increment = parseInt(increment);
|
|
90
|
-
for (var i = startIndex; i < stopIndex; i += increment) {
|
|
91
|
-
ret += options.fn(_.extend({}, this, {
|
|
92
|
-
i: i
|
|
93
|
-
}));
|
|
94
|
-
}
|
|
95
|
-
return ret;
|
|
96
|
-
});
|
|
97
|
-
hb.registerHelper('equal', function (var1, var2, options) {
|
|
98
|
-
if (var1 == var2) {
|
|
99
|
-
return options.fn(this);
|
|
100
|
-
} else {
|
|
101
|
-
return options.inverse(this);
|
|
102
|
-
}
|
|
103
|
-
});
|
|
104
|
-
|
|
105
|
-
// register a "get property" helper
|
|
106
|
-
// it gets the named property from the provided context
|
|
107
|
-
hb.registerHelper('property', function (name, context) {
|
|
108
|
-
return context[name] || '';
|
|
109
|
-
});
|
|
110
|
-
|
|
111
|
-
// register an 'includes' helper
|
|
112
|
-
// it checks if value is in array
|
|
113
|
-
hb.registerHelper('includes', function (haystack, needle, options) {
|
|
114
|
-
if (_.contains(haystack, needle)) {
|
|
115
|
-
return options.fn(this);
|
|
116
|
-
}
|
|
117
|
-
});
|
|
118
|
-
}
|
|
119
|
-
|
|
120
12
|
if (!Helpers0.__initialized) {
|
|
121
13
|
Helpers0(Handlebars);
|
|
122
14
|
Helpers0.__initialized = true;
|
|
@@ -1,119 +1,11 @@
|
|
|
1
|
-
define(['jquery', 'core/eventifier', 'ui/mediaplayer/support', 'ui/mediaplayer/youtubeManager', 'handlebars', '
|
|
1
|
+
define(['jquery', 'core/eventifier', 'ui/mediaplayer/support', 'ui/mediaplayer/youtubeManager', 'handlebars', 'lib/handlebars/helpers'], function ($$1, eventifier, support, youtubeManagerFactory, Handlebars, Helpers0) { 'use strict';
|
|
2
2
|
|
|
3
3
|
$$1 = $$1 && Object.prototype.hasOwnProperty.call($$1, 'default') ? $$1['default'] : $$1;
|
|
4
4
|
eventifier = eventifier && Object.prototype.hasOwnProperty.call(eventifier, 'default') ? eventifier['default'] : eventifier;
|
|
5
5
|
support = support && Object.prototype.hasOwnProperty.call(support, 'default') ? support['default'] : support;
|
|
6
6
|
youtubeManagerFactory = youtubeManagerFactory && Object.prototype.hasOwnProperty.call(youtubeManagerFactory, 'default') ? youtubeManagerFactory['default'] : youtubeManagerFactory;
|
|
7
7
|
Handlebars = Handlebars && Object.prototype.hasOwnProperty.call(Handlebars, 'default') ? Handlebars['default'] : Handlebars;
|
|
8
|
-
|
|
9
|
-
_ = _ && Object.prototype.hasOwnProperty.call(_, 'default') ? _['default'] : _;
|
|
10
|
-
DOMPurify = DOMPurify && Object.prototype.hasOwnProperty.call(DOMPurify, 'default') ? DOMPurify['default'] : DOMPurify;
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* This program is free software; you can redistribute it and/or
|
|
14
|
-
* modify it under the terms of the GNU General Public License
|
|
15
|
-
* as published by the Free Software Foundation; under version 2
|
|
16
|
-
* of the License (non-upgradable).
|
|
17
|
-
*
|
|
18
|
-
* This program is distributed in the hope that it will be useful,
|
|
19
|
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
20
|
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
21
|
-
* GNU General Public License for more details.
|
|
22
|
-
*
|
|
23
|
-
* You should have received a copy of the GNU General Public License
|
|
24
|
-
* along with this program; if not, write to the Free Software
|
|
25
|
-
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
26
|
-
*
|
|
27
|
-
* Copyright (c) 2013-2019 (original work) Open Assessment Technologies SA (under the project TAO-PRODUCT);
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*/
|
|
31
|
-
function Helpers0 (hb) {
|
|
32
|
-
//register a i18n helper
|
|
33
|
-
hb.registerHelper('__', function (key) {
|
|
34
|
-
return __(key);
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* Register dompurify helper
|
|
39
|
-
*
|
|
40
|
-
* https://github.com/cure53/DOMPurify
|
|
41
|
-
* with config SAFE_FOR_TEMPLATES: true
|
|
42
|
-
* to make output safe for template systems
|
|
43
|
-
*/
|
|
44
|
-
hb.registerHelper('dompurify', function (context) {
|
|
45
|
-
return DOMPurify.sanitize(context);
|
|
46
|
-
});
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* Register join helper
|
|
50
|
-
*
|
|
51
|
-
* Example :
|
|
52
|
-
* var values = {a:v1, b:v2, c:v3};
|
|
53
|
-
* Using {{{join attributes '=' ' ' '"'}}} will return : a="v1" b="v2" c="v3"
|
|
54
|
-
* Using {{{join values null ' or ' '*'}}} will return : *v1* or *v2* or *v3*
|
|
55
|
-
*/
|
|
56
|
-
hb.registerHelper('join', function (arr, keyValueGlue, fragmentGlue, wrapper) {
|
|
57
|
-
var fragments = [];
|
|
58
|
-
keyValueGlue = typeof keyValueGlue === 'string' ? keyValueGlue : undefined;
|
|
59
|
-
fragmentGlue = typeof fragmentGlue === 'string' ? fragmentGlue : ' ';
|
|
60
|
-
wrapper = typeof wrapper === 'string' ? wrapper : '"';
|
|
61
|
-
_.forIn(arr, function (value, key) {
|
|
62
|
-
var fragment = '';
|
|
63
|
-
if (value !== null || value !== undefined) {
|
|
64
|
-
if (typeof value === 'boolean') {
|
|
65
|
-
value = value ? 'true' : 'false';
|
|
66
|
-
} else if (typeof value === 'object') {
|
|
67
|
-
value = _.values(value).join(' ');
|
|
68
|
-
}
|
|
69
|
-
} else {
|
|
70
|
-
value = '';
|
|
71
|
-
}
|
|
72
|
-
if (keyValueGlue !== undefined) {
|
|
73
|
-
fragment += key + keyValueGlue;
|
|
74
|
-
}
|
|
75
|
-
fragment += wrapper + value + wrapper;
|
|
76
|
-
fragments.push(fragment);
|
|
77
|
-
});
|
|
78
|
-
return fragments.join(fragmentGlue);
|
|
79
|
-
});
|
|
80
|
-
|
|
81
|
-
//register a classic "for loop" helper
|
|
82
|
-
//it also adds a local variable "i" as the index in each iteration loop
|
|
83
|
-
hb.registerHelper('for', function (startIndex, stopIndex, increment, options) {
|
|
84
|
-
var ret = '';
|
|
85
|
-
startIndex = parseInt(startIndex);
|
|
86
|
-
stopIndex = parseInt(stopIndex);
|
|
87
|
-
increment = parseInt(increment);
|
|
88
|
-
for (var i = startIndex; i < stopIndex; i += increment) {
|
|
89
|
-
ret += options.fn(_.extend({}, this, {
|
|
90
|
-
i: i
|
|
91
|
-
}));
|
|
92
|
-
}
|
|
93
|
-
return ret;
|
|
94
|
-
});
|
|
95
|
-
hb.registerHelper('equal', function (var1, var2, options) {
|
|
96
|
-
if (var1 == var2) {
|
|
97
|
-
return options.fn(this);
|
|
98
|
-
} else {
|
|
99
|
-
return options.inverse(this);
|
|
100
|
-
}
|
|
101
|
-
});
|
|
102
|
-
|
|
103
|
-
// register a "get property" helper
|
|
104
|
-
// it gets the named property from the provided context
|
|
105
|
-
hb.registerHelper('property', function (name, context) {
|
|
106
|
-
return context[name] || '';
|
|
107
|
-
});
|
|
108
|
-
|
|
109
|
-
// register an 'includes' helper
|
|
110
|
-
// it checks if value is in array
|
|
111
|
-
hb.registerHelper('includes', function (haystack, needle, options) {
|
|
112
|
-
if (_.contains(haystack, needle)) {
|
|
113
|
-
return options.fn(this);
|
|
114
|
-
}
|
|
115
|
-
});
|
|
116
|
-
}
|
|
8
|
+
Helpers0 = Helpers0 && Object.prototype.hasOwnProperty.call(Helpers0, 'default') ? Helpers0['default'] : Helpers0;
|
|
117
9
|
|
|
118
10
|
if (!Helpers0.__initialized) {
|
|
119
11
|
Helpers0(Handlebars);
|