@oat-sa/tao-core-ui 1.63.1 → 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.
Files changed (101) hide show
  1. package/dist/actionbar.js +2 -109
  2. package/dist/animable/absorbable/absorbable.js +2 -109
  3. package/dist/animable/pulsable/pulsable.js +2 -109
  4. package/dist/badge/badge.js +2 -109
  5. package/dist/breadcrumbs.js +2 -109
  6. package/dist/bulkActionPopup.js +2 -108
  7. package/dist/button.js +2 -110
  8. package/dist/cascadingComboBox.js +2 -108
  9. package/dist/class/selector.js +2 -108
  10. package/dist/component/windowed.js +2 -108
  11. package/dist/component.js +2 -109
  12. package/dist/contextualPopup.js +2 -109
  13. package/dist/dashboard.js +2 -108
  14. package/dist/datalist.js +2 -108
  15. package/dist/datatable.js +3 -108
  16. package/dist/dateRange/dateRange.js +2 -108
  17. package/dist/datetime/picker.js +2 -108
  18. package/dist/deleter.js +2 -108
  19. package/dist/destination/selector.js +2 -108
  20. package/dist/dialog/confirmDelete.js +2 -108
  21. package/dist/dialog.js +2 -108
  22. package/dist/documentViewer/providers/pdfViewer/fallback/viewer.js +2 -110
  23. package/dist/documentViewer/providers/pdfViewer/pdfjs/findBar.js +2 -109
  24. package/dist/documentViewer/providers/pdfViewer/pdfjs/pageView.js +2 -110
  25. package/dist/documentViewer/providers/pdfViewer/pdfjs/searchEngine.js +2 -109
  26. package/dist/documentViewer/providers/pdfViewer/pdfjs/viewer.js +2 -109
  27. package/dist/documentViewer/providers/pdfViewer.js +2 -109
  28. package/dist/documentViewer.js +2 -109
  29. package/dist/dropdown.js +2 -109
  30. package/dist/dynamicComponent.js +2 -109
  31. package/dist/feedback.js +2 -109
  32. package/dist/figure/FigureStateActive.js +2 -108
  33. package/dist/filter.js +2 -108
  34. package/dist/form/dropdownForm.js +2 -108
  35. package/dist/form/form.js +2 -109
  36. package/dist/form/validator/renderer.js +2 -109
  37. package/dist/form/widget/providers/checkBox.js +2 -108
  38. package/dist/form/widget/providers/comboBox.js +2 -110
  39. package/dist/form/widget/providers/hidden.js +2 -110
  40. package/dist/form/widget/providers/hiddenBox.js +2 -108
  41. package/dist/form/widget/providers/radioBox.js +2 -110
  42. package/dist/form/widget/providers/textArea.js +2 -110
  43. package/dist/form/widget/widget.js +2 -108
  44. package/dist/generis/form/form.js +2 -108
  45. package/dist/generis/validator/validator.js +2 -109
  46. package/dist/generis/widget/checkBox/checkBox.js +2 -108
  47. package/dist/generis/widget/comboBox/comboBox.js +2 -109
  48. package/dist/generis/widget/hiddenBox/hiddenBox.js +2 -109
  49. package/dist/generis/widget/textBox/textBox.js +2 -109
  50. package/dist/generis/widget/widget.js +2 -108
  51. package/dist/groupedComboBox.js +2 -108
  52. package/dist/itemButtonList.js +2 -110
  53. package/dist/listbox.js +2 -108
  54. package/dist/loadingButton/loadingButton.js +2 -109
  55. package/dist/lock.js +2 -108
  56. package/dist/login/login.js +2 -108
  57. package/dist/maths/calculator/basicCalculator.js +2 -109
  58. package/dist/maths/calculator/core/board.js +2 -108
  59. package/dist/maths/calculator/core/expression.js +2 -109
  60. package/dist/maths/calculator/core/labels.js +2 -109
  61. package/dist/maths/calculator/plugins/keyboard/templateKeyboard/templateKeyboard.js +2 -109
  62. package/dist/maths/calculator/plugins/screen/simpleScreen/simpleScreen.js +2 -109
  63. package/dist/maths/calculator/scientificCalculator.js +2 -108
  64. package/dist/mediaEditor/mediaEditorComponent.js +2 -109
  65. package/dist/mediaEditor/plugins/mediaAlignment/mediaAlignmentComponent.js +2 -109
  66. package/dist/mediaEditor/plugins/mediaDimension/mediaDimensionComponent.js +2 -109
  67. package/dist/mediaplayer/players/html5.js +2 -110
  68. package/dist/mediaplayer/players/youtube.js +2 -110
  69. package/dist/mediaplayer.js +2 -109
  70. package/dist/mediasizer.js +2 -109
  71. package/dist/pageSizeSelector.js +2 -109
  72. package/dist/pagination/providers/pages.js +2 -109
  73. package/dist/pagination/providers/simple.js +2 -110
  74. package/dist/propertySelector/propertySelector.js +2 -110
  75. package/dist/report.js +2 -109
  76. package/dist/resource/filters.js +2 -108
  77. package/dist/resource/list.js +29 -119
  78. package/dist/resource/selector.js +2 -108
  79. package/dist/resource/tree.js +29 -119
  80. package/dist/resourcemgr/fileBrowser.js +478 -585
  81. package/dist/resourcemgr/fileSelector.js +2 -108
  82. package/dist/resourcemgr.js +2 -109
  83. package/dist/searchModal/advancedSearch.js +2 -109
  84. package/dist/searchModal.js +16 -107
  85. package/dist/switch/switch.js +2 -108
  86. package/dist/tabs.js +2 -109
  87. package/dist/taskQueue/status.js +2 -108
  88. package/dist/taskQueue/table.js +2 -108
  89. package/dist/taskQueueButton/taskable.js +2 -108
  90. package/dist/taskQueueButton/treeButton.js +2 -109
  91. package/dist/tooltip.js +2 -109
  92. package/dist/tristateCheckboxGroup.js +2 -108
  93. package/dist/uploader.js +2 -108
  94. package/package.json +2 -2
  95. package/scss/.DS_Store +0 -0
  96. package/scss/ckeditor/.DS_Store +0 -0
  97. package/scss/ckeditor/skins/.DS_Store +0 -0
  98. package/scss/ckeditor/skins/tao/.DS_Store +0 -0
  99. package/scss/ckeditor/skins/tao/scss/.DS_Store +0 -0
  100. package/scss/font/.DS_Store +0 -0
  101. package/scss/inc/.DS_Store +0 -0
@@ -1,4 +1,4 @@
1
- define(['jquery', 'lodash', 'async', 'i18n', 'core/mimetype', 'handlebars', 'lib/dompurify/purify', 'ui/feedback', 'context', 'ui/uploader'], function ($$1, _, async, __, mimeType, Handlebars, DOMPurify, feedback, context, uploader) { 'use strict';
1
+ define(['jquery', 'lodash', 'async', 'i18n', 'core/mimetype', 'handlebars', 'lib/handlebars/helpers', 'ui/feedback', 'context', 'ui/uploader'], function ($$1, _, async, __, mimeType, Handlebars, Helpers0, feedback, context, uploader) { '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'] : _;
@@ -6,116 +6,10 @@ define(['jquery', 'lodash', 'async', 'i18n', 'core/mimetype', 'handlebars', 'lib
6
6
  __ = __ && Object.prototype.hasOwnProperty.call(__, 'default') ? __['default'] : __;
7
7
  mimeType = mimeType && Object.prototype.hasOwnProperty.call(mimeType, 'default') ? mimeType['default'] : mimeType;
8
8
  Handlebars = Handlebars && Object.prototype.hasOwnProperty.call(Handlebars, 'default') ? Handlebars['default'] : Handlebars;
9
- DOMPurify = DOMPurify && Object.prototype.hasOwnProperty.call(DOMPurify, 'default') ? DOMPurify['default'] : DOMPurify;
9
+ Helpers0 = Helpers0 && Object.prototype.hasOwnProperty.call(Helpers0, 'default') ? Helpers0['default'] : Helpers0;
10
10
  feedback = feedback && Object.prototype.hasOwnProperty.call(feedback, 'default') ? feedback['default'] : feedback;
11
11
  context = context && Object.prototype.hasOwnProperty.call(context, 'default') ? context['default'] : context;
12
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
- }
118
-
119
13
  if (!Helpers0.__initialized) {
120
14
  Helpers0(Handlebars);
121
15
  Helpers0.__initialized = true;
@@ -1,4 +1,4 @@
1
- define(['jquery', 'lodash', 'core/pluginifier', 'ui/resourcemgr/fileBrowser', 'ui/resourcemgr/filePreview', 'ui/resourcemgr/fileSelector', 'handlebars', 'i18n', 'lib/dompurify/purify', 'ui/modal', 'css!ui/resourcemgr/css/resourcemgr.css'], function ($$1, _, Pluginifier, fileBrowser, filePreview, fileSelector, Handlebars, __, DOMPurify, modal, resourcemgr_css) { 'use strict';
1
+ define(['jquery', 'lodash', 'core/pluginifier', 'ui/resourcemgr/fileBrowser', 'ui/resourcemgr/filePreview', 'ui/resourcemgr/fileSelector', 'handlebars', 'lib/handlebars/helpers', 'ui/modal', 'css!ui/resourcemgr/css/resourcemgr.css'], function ($$1, _, Pluginifier, fileBrowser, filePreview, fileSelector, Handlebars, Helpers0, modal, resourcemgr_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'] : _;
@@ -7,114 +7,7 @@ define(['jquery', 'lodash', 'core/pluginifier', 'ui/resourcemgr/fileBrowser', 'u
7
7
  filePreview = filePreview && Object.prototype.hasOwnProperty.call(filePreview, 'default') ? filePreview['default'] : filePreview;
8
8
  fileSelector = fileSelector && Object.prototype.hasOwnProperty.call(fileSelector, 'default') ? fileSelector['default'] : fileSelector;
9
9
  Handlebars = Handlebars && Object.prototype.hasOwnProperty.call(Handlebars, 'default') ? Handlebars['default'] : Handlebars;
10
- __ = __ && Object.prototype.hasOwnProperty.call(__, 'default') ? __['default'] : __;
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,119 +1,12 @@
1
- define(['jquery', 'lodash', 'handlebars', 'i18n', 'lib/dompurify/purify', 'css!ui/searchModal/css/advancedSearch.css', 'ui/component', 'ui/modal', 'ui/datatable', 'select2', 'core/dataProvider/request'], function ($$1, _, Handlebars, __, DOMPurify, advancedSearch_css, component, modal, datatable, select2, request) { 'use strict';
1
+ define(['jquery', 'lodash', 'handlebars', 'lib/handlebars/helpers', 'css!ui/searchModal/css/advancedSearch.css', 'ui/component', 'ui/modal', 'ui/datatable', 'select2', 'core/dataProvider/request'], function ($$1, _, Handlebars, Helpers0, advancedSearch_css, component, modal, datatable, select2, request) { '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
  Handlebars = Handlebars && Object.prototype.hasOwnProperty.call(Handlebars, 'default') ? Handlebars['default'] : Handlebars;
6
- __ = __ && Object.prototype.hasOwnProperty.call(__, 'default') ? __['default'] : __;
7
- DOMPurify = DOMPurify && Object.prototype.hasOwnProperty.call(DOMPurify, 'default') ? DOMPurify['default'] : DOMPurify;
6
+ Helpers0 = Helpers0 && Object.prototype.hasOwnProperty.call(Helpers0, 'default') ? Helpers0['default'] : Helpers0;
8
7
  component = component && Object.prototype.hasOwnProperty.call(component, 'default') ? component['default'] : component;
9
8
  request = request && Object.prototype.hasOwnProperty.call(request, 'default') ? request['default'] : request;
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,11 +1,11 @@
1
- define(['jquery', 'lodash', 'i18n', 'context', 'handlebars', 'lib/dompurify/purify', 'css!ui/searchModal/css/searchModal.css', 'ui/component', 'ui/modal', 'ui/datatable', 'core/store', 'ui/resource/selector', 'ui/propertySelector/propertySelector', 'ui/searchModal/advancedSearch', 'core/dataProvider/request', 'util/url', 'select2', 'util/shortcut/registry'], function ($$1, _, __, context, Handlebars, DOMPurify, searchModal_css, component, modal, datatable, store, resourceSelectorFactory, propertySelectorFactory, advancedSearchFactory, request, urlUtil, select2, shortcutRegistry) { 'use strict';
1
+ define(['jquery', 'lodash', 'i18n', 'context', 'handlebars', 'lib/handlebars/helpers', 'css!ui/searchModal/css/searchModal.css', 'ui/component', 'ui/modal', 'ui/datatable', 'core/store', 'ui/resource/selector', 'ui/propertySelector/propertySelector', 'ui/searchModal/advancedSearch', 'core/dataProvider/request', 'util/url', 'select2', 'util/shortcut/registry'], function ($$1, _, __, context, Handlebars, Helpers0, searchModal_css, component, modal, datatable, store, resourceSelectorFactory, propertySelectorFactory, advancedSearchFactory, request, urlUtil, select2, shortcutRegistry) { '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
  context = context && Object.prototype.hasOwnProperty.call(context, 'default') ? context['default'] : context;
7
7
  Handlebars = Handlebars && Object.prototype.hasOwnProperty.call(Handlebars, 'default') ? Handlebars['default'] : Handlebars;
8
- DOMPurify = DOMPurify && Object.prototype.hasOwnProperty.call(DOMPurify, 'default') ? DOMPurify['default'] : DOMPurify;
8
+ Helpers0 = Helpers0 && Object.prototype.hasOwnProperty.call(Helpers0, 'default') ? Helpers0['default'] : Helpers0;
9
9
  component = component && Object.prototype.hasOwnProperty.call(component, 'default') ? component['default'] : component;
10
10
  store = store && Object.prototype.hasOwnProperty.call(store, 'default') ? store['default'] : store;
11
11
  resourceSelectorFactory = resourceSelectorFactory && Object.prototype.hasOwnProperty.call(resourceSelectorFactory, 'default') ? resourceSelectorFactory['default'] : resourceSelectorFactory;
@@ -37,6 +37,7 @@ define(['jquery', 'lodash', 'i18n', 'context', 'handlebars', 'lib/dompurify/puri
37
37
  return target;
38
38
  }
39
39
  function _defineProperty(obj, key, value) {
40
+ key = _toPropertyKey(key);
40
41
  if (key in obj) {
41
42
  Object.defineProperty(obj, key, {
42
43
  value: value,
@@ -49,111 +50,19 @@ define(['jquery', 'lodash', 'i18n', 'context', 'handlebars', 'lib/dompurify/puri
49
50
  }
50
51
  return obj;
51
52
  }
52
-
53
- /**
54
- * This program is free software; you can redistribute it and/or
55
- * modify it under the terms of the GNU General Public License
56
- * as published by the Free Software Foundation; under version 2
57
- * of the License (non-upgradable).
58
- *
59
- * This program is distributed in the hope that it will be useful,
60
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
61
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
62
- * GNU General Public License for more details.
63
- *
64
- * You should have received a copy of the GNU General Public License
65
- * along with this program; if not, write to the Free Software
66
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
67
- *
68
- * Copyright (c) 2013-2019 (original work) Open Assessment Technologies SA (under the project TAO-PRODUCT);
69
- *
70
- *
71
- */
72
- function Helpers0 (hb) {
73
- //register a i18n helper
74
- hb.registerHelper('__', function (key) {
75
- return __(key);
76
- });
77
-
78
- /**
79
- * Register dompurify helper
80
- *
81
- * https://github.com/cure53/DOMPurify
82
- * with config SAFE_FOR_TEMPLATES: true
83
- * to make output safe for template systems
84
- */
85
- hb.registerHelper('dompurify', function (context) {
86
- return DOMPurify.sanitize(context);
87
- });
88
-
89
- /**
90
- * Register join helper
91
- *
92
- * Example :
93
- * var values = {a:v1, b:v2, c:v3};
94
- * Using {{{join attributes '=' ' ' '"'}}} will return : a="v1" b="v2" c="v3"
95
- * Using {{{join values null ' or ' '*'}}} will return : *v1* or *v2* or *v3*
96
- */
97
- hb.registerHelper('join', function (arr, keyValueGlue, fragmentGlue, wrapper) {
98
- var fragments = [];
99
- keyValueGlue = typeof keyValueGlue === 'string' ? keyValueGlue : undefined;
100
- fragmentGlue = typeof fragmentGlue === 'string' ? fragmentGlue : ' ';
101
- wrapper = typeof wrapper === 'string' ? wrapper : '"';
102
- _.forIn(arr, function (value, key) {
103
- var fragment = '';
104
- if (value !== null || value !== undefined) {
105
- if (typeof value === 'boolean') {
106
- value = value ? 'true' : 'false';
107
- } else if (typeof value === 'object') {
108
- value = _.values(value).join(' ');
109
- }
110
- } else {
111
- value = '';
112
- }
113
- if (keyValueGlue !== undefined) {
114
- fragment += key + keyValueGlue;
115
- }
116
- fragment += wrapper + value + wrapper;
117
- fragments.push(fragment);
118
- });
119
- return fragments.join(fragmentGlue);
120
- });
121
-
122
- //register a classic "for loop" helper
123
- //it also adds a local variable "i" as the index in each iteration loop
124
- hb.registerHelper('for', function (startIndex, stopIndex, increment, options) {
125
- var ret = '';
126
- startIndex = parseInt(startIndex);
127
- stopIndex = parseInt(stopIndex);
128
- increment = parseInt(increment);
129
- for (var i = startIndex; i < stopIndex; i += increment) {
130
- ret += options.fn(_.extend({}, this, {
131
- i: i
132
- }));
133
- }
134
- return ret;
135
- });
136
- hb.registerHelper('equal', function (var1, var2, options) {
137
- if (var1 == var2) {
138
- return options.fn(this);
139
- } else {
140
- return options.inverse(this);
141
- }
142
- });
143
-
144
- // register a "get property" helper
145
- // it gets the named property from the provided context
146
- hb.registerHelper('property', function (name, context) {
147
- return context[name] || '';
148
- });
149
-
150
- // register an 'includes' helper
151
- // it checks if value is in array
152
- hb.registerHelper('includes', function (haystack, needle, options) {
153
- if (_.contains(haystack, needle)) {
154
- return options.fn(this);
155
- }
156
- });
53
+ function _toPrimitive(input, hint) {
54
+ if (typeof input !== "object" || input === null) return input;
55
+ var prim = input[Symbol.toPrimitive];
56
+ if (prim !== undefined) {
57
+ var res = prim.call(input, hint || "default");
58
+ if (typeof res !== "object") return res;
59
+ throw new TypeError("@@toPrimitive must return a primitive value.");
60
+ }
61
+ return (hint === "string" ? String : Number)(input);
62
+ }
63
+ function _toPropertyKey(arg) {
64
+ var key = _toPrimitive(arg, "string");
65
+ return typeof key === "symbol" ? key : String(key);
157
66
  }
158
67
 
159
68
  if (!Helpers0.__initialized) {
@@ -1,4 +1,4 @@
1
- define(['jquery', 'lodash', 'i18n', 'ui/component', 'lib/uuid', 'handlebars', 'lib/dompurify/purify', 'css!ui/switch/css/switch.css'], function ($$1, _, __, component, uuid, Handlebars, DOMPurify, switch_css) { 'use strict';
1
+ define(['jquery', 'lodash', 'i18n', 'ui/component', 'lib/uuid', 'handlebars', 'lib/handlebars/helpers', 'css!ui/switch/css/switch.css'], function ($$1, _, __, component, uuid, Handlebars, Helpers0, switch_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'] : _;
@@ -6,113 +6,7 @@ define(['jquery', 'lodash', 'i18n', 'ui/component', 'lib/uuid', 'handlebars', 'l
6
6
  component = component && Object.prototype.hasOwnProperty.call(component, 'default') ? component['default'] : component;
7
7
  uuid = uuid && Object.prototype.hasOwnProperty.call(uuid, 'default') ? uuid['default'] : uuid;
8
8
  Handlebars = Handlebars && Object.prototype.hasOwnProperty.call(Handlebars, 'default') ? Handlebars['default'] : Handlebars;
9
- DOMPurify = DOMPurify && Object.prototype.hasOwnProperty.call(DOMPurify, 'default') ? DOMPurify['default'] : DOMPurify;
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);