@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
package/dist/feedback.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
define(['jquery', 'lodash', 'core/format', 'ui/component', 'util/wrapLongWords', 'util/encode', 'handlebars', '
|
|
1
|
+
define(['jquery', 'lodash', 'core/format', 'ui/component', 'util/wrapLongWords', 'util/encode', 'handlebars', 'lib/handlebars/helpers'], function ($$1, _, format, component, wrapLongWords, encode, Handlebars, Helpers0) { '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'] : _;
|
|
@@ -7,114 +7,7 @@ define(['jquery', 'lodash', 'core/format', 'ui/component', 'util/wrapLongWords',
|
|
|
7
7
|
wrapLongWords = wrapLongWords && Object.prototype.hasOwnProperty.call(wrapLongWords, 'default') ? wrapLongWords['default'] : wrapLongWords;
|
|
8
8
|
encode = encode && Object.prototype.hasOwnProperty.call(encode, 'default') ? encode['default'] : encode;
|
|
9
9
|
Handlebars = Handlebars && Object.prototype.hasOwnProperty.call(Handlebars, 'default') ? Handlebars['default'] : Handlebars;
|
|
10
|
-
|
|
11
|
-
DOMPurify = DOMPurify && Object.prototype.hasOwnProperty.call(DOMPurify, 'default') ? DOMPurify['default'] : DOMPurify;
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* This program is free software; you can redistribute it and/or
|
|
15
|
-
* modify it under the terms of the GNU General Public License
|
|
16
|
-
* as published by the Free Software Foundation; under version 2
|
|
17
|
-
* of the License (non-upgradable).
|
|
18
|
-
*
|
|
19
|
-
* This program is distributed in the hope that it will be useful,
|
|
20
|
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
21
|
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
22
|
-
* GNU General Public License for more details.
|
|
23
|
-
*
|
|
24
|
-
* You should have received a copy of the GNU General Public License
|
|
25
|
-
* along with this program; if not, write to the Free Software
|
|
26
|
-
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
27
|
-
*
|
|
28
|
-
* Copyright (c) 2013-2019 (original work) Open Assessment Technologies SA (under the project TAO-PRODUCT);
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*/
|
|
32
|
-
function Helpers0 (hb) {
|
|
33
|
-
//register a i18n helper
|
|
34
|
-
hb.registerHelper('__', function (key) {
|
|
35
|
-
return __(key);
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* Register dompurify helper
|
|
40
|
-
*
|
|
41
|
-
* https://github.com/cure53/DOMPurify
|
|
42
|
-
* with config SAFE_FOR_TEMPLATES: true
|
|
43
|
-
* to make output safe for template systems
|
|
44
|
-
*/
|
|
45
|
-
hb.registerHelper('dompurify', function (context) {
|
|
46
|
-
return DOMPurify.sanitize(context);
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* Register join helper
|
|
51
|
-
*
|
|
52
|
-
* Example :
|
|
53
|
-
* var values = {a:v1, b:v2, c:v3};
|
|
54
|
-
* Using {{{join attributes '=' ' ' '"'}}} will return : a="v1" b="v2" c="v3"
|
|
55
|
-
* Using {{{join values null ' or ' '*'}}} will return : *v1* or *v2* or *v3*
|
|
56
|
-
*/
|
|
57
|
-
hb.registerHelper('join', function (arr, keyValueGlue, fragmentGlue, wrapper) {
|
|
58
|
-
var fragments = [];
|
|
59
|
-
keyValueGlue = typeof keyValueGlue === 'string' ? keyValueGlue : undefined;
|
|
60
|
-
fragmentGlue = typeof fragmentGlue === 'string' ? fragmentGlue : ' ';
|
|
61
|
-
wrapper = typeof wrapper === 'string' ? wrapper : '"';
|
|
62
|
-
_.forIn(arr, function (value, key) {
|
|
63
|
-
var fragment = '';
|
|
64
|
-
if (value !== null || value !== undefined) {
|
|
65
|
-
if (typeof value === 'boolean') {
|
|
66
|
-
value = value ? 'true' : 'false';
|
|
67
|
-
} else if (typeof value === 'object') {
|
|
68
|
-
value = _.values(value).join(' ');
|
|
69
|
-
}
|
|
70
|
-
} else {
|
|
71
|
-
value = '';
|
|
72
|
-
}
|
|
73
|
-
if (keyValueGlue !== undefined) {
|
|
74
|
-
fragment += key + keyValueGlue;
|
|
75
|
-
}
|
|
76
|
-
fragment += wrapper + value + wrapper;
|
|
77
|
-
fragments.push(fragment);
|
|
78
|
-
});
|
|
79
|
-
return fragments.join(fragmentGlue);
|
|
80
|
-
});
|
|
81
|
-
|
|
82
|
-
//register a classic "for loop" helper
|
|
83
|
-
//it also adds a local variable "i" as the index in each iteration loop
|
|
84
|
-
hb.registerHelper('for', function (startIndex, stopIndex, increment, options) {
|
|
85
|
-
var ret = '';
|
|
86
|
-
startIndex = parseInt(startIndex);
|
|
87
|
-
stopIndex = parseInt(stopIndex);
|
|
88
|
-
increment = parseInt(increment);
|
|
89
|
-
for (var i = startIndex; i < stopIndex; i += increment) {
|
|
90
|
-
ret += options.fn(_.extend({}, this, {
|
|
91
|
-
i: i
|
|
92
|
-
}));
|
|
93
|
-
}
|
|
94
|
-
return ret;
|
|
95
|
-
});
|
|
96
|
-
hb.registerHelper('equal', function (var1, var2, options) {
|
|
97
|
-
if (var1 == var2) {
|
|
98
|
-
return options.fn(this);
|
|
99
|
-
} else {
|
|
100
|
-
return options.inverse(this);
|
|
101
|
-
}
|
|
102
|
-
});
|
|
103
|
-
|
|
104
|
-
// register a "get property" helper
|
|
105
|
-
// it gets the named property from the provided context
|
|
106
|
-
hb.registerHelper('property', function (name, context) {
|
|
107
|
-
return context[name] || '';
|
|
108
|
-
});
|
|
109
|
-
|
|
110
|
-
// register an 'includes' helper
|
|
111
|
-
// it checks if value is in array
|
|
112
|
-
hb.registerHelper('includes', function (haystack, needle, options) {
|
|
113
|
-
if (_.contains(haystack, needle)) {
|
|
114
|
-
return options.fn(this);
|
|
115
|
-
}
|
|
116
|
-
});
|
|
117
|
-
}
|
|
10
|
+
Helpers0 = Helpers0 && Object.prototype.hasOwnProperty.call(Helpers0, 'default') ? Helpers0['default'] : Helpers0;
|
|
118
11
|
|
|
119
12
|
if (!Helpers0.__initialized) {
|
|
120
13
|
Helpers0(Handlebars);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
define(['jquery', 'nouislider', 'ui/resourcemgr', 'ui/tooltip', 'lodash', 'i18n', 'core/mimetype', 'ui/mediaEditor/plugins/mediaAlignment/helper', 'ui/mediaEditor/mediaEditorComponent', 'handlebars', 'lib/
|
|
1
|
+
define(['jquery', 'nouislider', 'ui/resourcemgr', 'ui/tooltip', 'lodash', 'i18n', 'core/mimetype', 'ui/mediaEditor/plugins/mediaAlignment/helper', 'ui/mediaEditor/mediaEditorComponent', 'handlebars', 'lib/handlebars/helpers'], function ($$1, nouislider, resourcemgr, tooltip, _, __, mimeType, alignmentHelper, mediaEditorComponent, Handlebars, Helpers0) { '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'] : _;
|
|
@@ -7,7 +7,7 @@ define(['jquery', 'nouislider', 'ui/resourcemgr', 'ui/tooltip', 'lodash', 'i18n'
|
|
|
7
7
|
alignmentHelper = alignmentHelper && Object.prototype.hasOwnProperty.call(alignmentHelper, 'default') ? alignmentHelper['default'] : alignmentHelper;
|
|
8
8
|
mediaEditorComponent = mediaEditorComponent && Object.prototype.hasOwnProperty.call(mediaEditorComponent, 'default') ? mediaEditorComponent['default'] : mediaEditorComponent;
|
|
9
9
|
Handlebars = Handlebars && Object.prototype.hasOwnProperty.call(Handlebars, 'default') ? Handlebars['default'] : Handlebars;
|
|
10
|
-
|
|
10
|
+
Helpers0 = Helpers0 && Object.prototype.hasOwnProperty.call(Helpers0, 'default') ? Helpers0['default'] : Helpers0;
|
|
11
11
|
|
|
12
12
|
/*
|
|
13
13
|
* This program is free software; you can redistribute it and/or
|
|
@@ -328,112 +328,6 @@ define(['jquery', 'nouislider', 'ui/resourcemgr', 'ui/tooltip', 'lodash', 'i18n'
|
|
|
328
328
|
initUpload(widget);
|
|
329
329
|
}
|
|
330
330
|
|
|
331
|
-
/**
|
|
332
|
-
* This program is free software; you can redistribute it and/or
|
|
333
|
-
* modify it under the terms of the GNU General Public License
|
|
334
|
-
* as published by the Free Software Foundation; under version 2
|
|
335
|
-
* of the License (non-upgradable).
|
|
336
|
-
*
|
|
337
|
-
* This program is distributed in the hope that it will be useful,
|
|
338
|
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
339
|
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
340
|
-
* GNU General Public License for more details.
|
|
341
|
-
*
|
|
342
|
-
* You should have received a copy of the GNU General Public License
|
|
343
|
-
* along with this program; if not, write to the Free Software
|
|
344
|
-
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
345
|
-
*
|
|
346
|
-
* Copyright (c) 2013-2019 (original work) Open Assessment Technologies SA (under the project TAO-PRODUCT);
|
|
347
|
-
*
|
|
348
|
-
*
|
|
349
|
-
*/
|
|
350
|
-
function Helpers0 (hb) {
|
|
351
|
-
//register a i18n helper
|
|
352
|
-
hb.registerHelper('__', function (key) {
|
|
353
|
-
return __(key);
|
|
354
|
-
});
|
|
355
|
-
|
|
356
|
-
/**
|
|
357
|
-
* Register dompurify helper
|
|
358
|
-
*
|
|
359
|
-
* https://github.com/cure53/DOMPurify
|
|
360
|
-
* with config SAFE_FOR_TEMPLATES: true
|
|
361
|
-
* to make output safe for template systems
|
|
362
|
-
*/
|
|
363
|
-
hb.registerHelper('dompurify', function (context) {
|
|
364
|
-
return DOMPurify.sanitize(context);
|
|
365
|
-
});
|
|
366
|
-
|
|
367
|
-
/**
|
|
368
|
-
* Register join helper
|
|
369
|
-
*
|
|
370
|
-
* Example :
|
|
371
|
-
* var values = {a:v1, b:v2, c:v3};
|
|
372
|
-
* Using {{{join attributes '=' ' ' '"'}}} will return : a="v1" b="v2" c="v3"
|
|
373
|
-
* Using {{{join values null ' or ' '*'}}} will return : *v1* or *v2* or *v3*
|
|
374
|
-
*/
|
|
375
|
-
hb.registerHelper('join', function (arr, keyValueGlue, fragmentGlue, wrapper) {
|
|
376
|
-
var fragments = [];
|
|
377
|
-
keyValueGlue = typeof keyValueGlue === 'string' ? keyValueGlue : undefined;
|
|
378
|
-
fragmentGlue = typeof fragmentGlue === 'string' ? fragmentGlue : ' ';
|
|
379
|
-
wrapper = typeof wrapper === 'string' ? wrapper : '"';
|
|
380
|
-
_.forIn(arr, function (value, key) {
|
|
381
|
-
var fragment = '';
|
|
382
|
-
if (value !== null || value !== undefined) {
|
|
383
|
-
if (typeof value === 'boolean') {
|
|
384
|
-
value = value ? 'true' : 'false';
|
|
385
|
-
} else if (typeof value === 'object') {
|
|
386
|
-
value = _.values(value).join(' ');
|
|
387
|
-
}
|
|
388
|
-
} else {
|
|
389
|
-
value = '';
|
|
390
|
-
}
|
|
391
|
-
if (keyValueGlue !== undefined) {
|
|
392
|
-
fragment += key + keyValueGlue;
|
|
393
|
-
}
|
|
394
|
-
fragment += wrapper + value + wrapper;
|
|
395
|
-
fragments.push(fragment);
|
|
396
|
-
});
|
|
397
|
-
return fragments.join(fragmentGlue);
|
|
398
|
-
});
|
|
399
|
-
|
|
400
|
-
//register a classic "for loop" helper
|
|
401
|
-
//it also adds a local variable "i" as the index in each iteration loop
|
|
402
|
-
hb.registerHelper('for', function (startIndex, stopIndex, increment, options) {
|
|
403
|
-
var ret = '';
|
|
404
|
-
startIndex = parseInt(startIndex);
|
|
405
|
-
stopIndex = parseInt(stopIndex);
|
|
406
|
-
increment = parseInt(increment);
|
|
407
|
-
for (var i = startIndex; i < stopIndex; i += increment) {
|
|
408
|
-
ret += options.fn(_.extend({}, this, {
|
|
409
|
-
i: i
|
|
410
|
-
}));
|
|
411
|
-
}
|
|
412
|
-
return ret;
|
|
413
|
-
});
|
|
414
|
-
hb.registerHelper('equal', function (var1, var2, options) {
|
|
415
|
-
if (var1 == var2) {
|
|
416
|
-
return options.fn(this);
|
|
417
|
-
} else {
|
|
418
|
-
return options.inverse(this);
|
|
419
|
-
}
|
|
420
|
-
});
|
|
421
|
-
|
|
422
|
-
// register a "get property" helper
|
|
423
|
-
// it gets the named property from the provided context
|
|
424
|
-
hb.registerHelper('property', function (name, context) {
|
|
425
|
-
return context[name] || '';
|
|
426
|
-
});
|
|
427
|
-
|
|
428
|
-
// register an 'includes' helper
|
|
429
|
-
// it checks if value is in array
|
|
430
|
-
hb.registerHelper('includes', function (haystack, needle, options) {
|
|
431
|
-
if (_.contains(haystack, needle)) {
|
|
432
|
-
return options.fn(this);
|
|
433
|
-
}
|
|
434
|
-
});
|
|
435
|
-
}
|
|
436
|
-
|
|
437
331
|
if (!Helpers0.__initialized) {
|
|
438
332
|
Helpers0(Handlebars);
|
|
439
333
|
Helpers0.__initialized = true;
|
|
@@ -552,11 +446,13 @@ define(['jquery', 'nouislider', 'ui/resourcemgr', 'ui/tooltip', 'lodash', 'i18n'
|
|
|
552
446
|
} = _ref2;
|
|
553
447
|
const imageElem = getImageElement(widget);
|
|
554
448
|
const figcaptionElem = getCaptionElement(widget);
|
|
449
|
+
const showFigure = widget.element.attr('showFigure');
|
|
555
450
|
widget.$form.html(formTpl({
|
|
556
451
|
baseUrl: widget.options.baseUrl || '',
|
|
557
452
|
src: imageElem.attr('src'),
|
|
558
453
|
alt: imageElem.attr('alt'),
|
|
559
|
-
figcaption: figcaptionElem ? figcaptionElem.body() : ''
|
|
454
|
+
figcaption: figcaptionElem ? figcaptionElem.body() : '',
|
|
455
|
+
showFigure: showFigure
|
|
560
456
|
}));
|
|
561
457
|
widget.$form.find('textarea#figcaption').on('focus.qti-widget', () => widget.$container.addClass('edit-figcaption')).on('blur.qti-widget', () => widget.$container.removeClass('edit-figcaption'));
|
|
562
458
|
|
|
@@ -574,7 +470,23 @@ define(['jquery', 'nouislider', 'ui/resourcemgr', 'ui/tooltip', 'lodash', 'i18n'
|
|
|
574
470
|
togglePlaceholder
|
|
575
471
|
}));
|
|
576
472
|
};
|
|
577
|
-
|
|
473
|
+
|
|
474
|
+
/**
|
|
475
|
+
* @param {Object} stateFactory
|
|
476
|
+
* @param {Object} ActiveState
|
|
477
|
+
* @param {Object} formTpl
|
|
478
|
+
* @param {Object} formElement
|
|
479
|
+
* @param {Object} inlineHelper
|
|
480
|
+
* @returns
|
|
481
|
+
*/
|
|
482
|
+
function FigureStateActive (_ref3) {
|
|
483
|
+
let {
|
|
484
|
+
stateFactory,
|
|
485
|
+
ActiveState,
|
|
486
|
+
formTpl,
|
|
487
|
+
formElement,
|
|
488
|
+
inlineHelper
|
|
489
|
+
} = _ref3;
|
|
578
490
|
/**
|
|
579
491
|
* media Editor instance if has been initialized
|
|
580
492
|
* @type {null}
|
|
@@ -582,7 +494,7 @@ define(['jquery', 'nouislider', 'ui/resourcemgr', 'ui/tooltip', 'lodash', 'i18n'
|
|
|
582
494
|
let mediaEditor = null;
|
|
583
495
|
let textareaObserver = null;
|
|
584
496
|
let texareaHTMLElem = null;
|
|
585
|
-
const
|
|
497
|
+
const FigureStateActive = stateFactory.extend(ActiveState, function () {
|
|
586
498
|
this.initForm();
|
|
587
499
|
}, function () {
|
|
588
500
|
this.widget.$form.find('textarea#figcaption').off('.qti-widget');
|
|
@@ -591,7 +503,7 @@ define(['jquery', 'nouislider', 'ui/resourcemgr', 'ui/tooltip', 'lodash', 'i18n'
|
|
|
591
503
|
}
|
|
592
504
|
this.widget.$form.empty();
|
|
593
505
|
});
|
|
594
|
-
|
|
506
|
+
FigureStateActive.prototype.initForm = function () {
|
|
595
507
|
initForm({
|
|
596
508
|
widget: this.widget,
|
|
597
509
|
formElement,
|
|
@@ -612,7 +524,7 @@ define(['jquery', 'nouislider', 'ui/resourcemgr', 'ui/tooltip', 'lodash', 'i18n'
|
|
|
612
524
|
}
|
|
613
525
|
}
|
|
614
526
|
};
|
|
615
|
-
return
|
|
527
|
+
return FigureStateActive;
|
|
616
528
|
}
|
|
617
529
|
|
|
618
530
|
return FigureStateActive;
|
package/dist/filter.js
CHANGED
|
@@ -1,117 +1,11 @@
|
|
|
1
|
-
define(['jquery', 'lodash', 'i18n', 'core/eventifier', 'handlebars', 'lib/
|
|
1
|
+
define(['jquery', 'lodash', 'i18n', 'core/eventifier', 'handlebars', 'lib/handlebars/helpers', 'ui/selecter'], function ($$1, _, __, eventifier, Handlebars, Helpers0, selecter) { '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
|
__ = __ && Object.prototype.hasOwnProperty.call(__, 'default') ? __['default'] : __;
|
|
6
6
|
eventifier = eventifier && Object.prototype.hasOwnProperty.call(eventifier, 'default') ? eventifier['default'] : eventifier;
|
|
7
7
|
Handlebars = Handlebars && Object.prototype.hasOwnProperty.call(Handlebars, 'default') ? Handlebars['default'] : Handlebars;
|
|
8
|
-
|
|
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
|
-
}
|
|
8
|
+
Helpers0 = Helpers0 && Object.prototype.hasOwnProperty.call(Helpers0, 'default') ? Helpers0['default'] : Helpers0;
|
|
115
9
|
|
|
116
10
|
if (!Helpers0.__initialized) {
|
|
117
11
|
Helpers0(Handlebars);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
define(['lodash', 'i18n', 'ui/component', 'ui/button', 'ui/form/simpleForm', 'handlebars', 'lib/
|
|
1
|
+
define(['lodash', 'i18n', 'ui/component', 'ui/button', 'ui/form/simpleForm', 'handlebars', 'lib/handlebars/helpers', 'css!ui/form/css/dropdownForm.css'], function (_, __, componentFactory, buttonFactory, formFactory, Handlebars, Helpers0, dropdownForm_css) { 'use strict';
|
|
2
2
|
|
|
3
3
|
_ = _ && Object.prototype.hasOwnProperty.call(_, 'default') ? _['default'] : _;
|
|
4
4
|
__ = __ && Object.prototype.hasOwnProperty.call(__, 'default') ? __['default'] : __;
|
|
@@ -6,113 +6,7 @@ define(['lodash', 'i18n', 'ui/component', 'ui/button', 'ui/form/simpleForm', 'ha
|
|
|
6
6
|
buttonFactory = buttonFactory && Object.prototype.hasOwnProperty.call(buttonFactory, 'default') ? buttonFactory['default'] : buttonFactory;
|
|
7
7
|
formFactory = formFactory && Object.prototype.hasOwnProperty.call(formFactory, 'default') ? formFactory['default'] : formFactory;
|
|
8
8
|
Handlebars = Handlebars && Object.prototype.hasOwnProperty.call(Handlebars, 'default') ? Handlebars['default'] : Handlebars;
|
|
9
|
-
|
|
10
|
-
|
|
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
|
-
}
|
|
9
|
+
Helpers0 = Helpers0 && Object.prototype.hasOwnProperty.call(Helpers0, 'default') ? Helpers0['default'] : Helpers0;
|
|
116
10
|
|
|
117
11
|
if (!Helpers0.__initialized) {
|
|
118
12
|
Helpers0(Handlebars);
|