@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', 'util/namespace', 'ui/maths/calculator/core/plugin', 'ui/maths/calculator/core/labels', 'handlebars', 'i18n', 'lib/dompurify/purify'], function ($$1, _, nsHelper, pluginFactory, labels, Handlebars, __, DOMPurify) { 'use strict';
1
+ define(['jquery', 'lodash', 'util/namespace', 'ui/maths/calculator/core/plugin', 'ui/maths/calculator/core/labels', 'handlebars', 'lib/handlebars/helpers'], function ($$1, _, nsHelper, pluginFactory, labels, 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'] : _;
@@ -6,114 +6,7 @@ define(['jquery', 'lodash', 'util/namespace', 'ui/maths/calculator/core/plugin',
6
6
  pluginFactory = pluginFactory && Object.prototype.hasOwnProperty.call(pluginFactory, 'default') ? pluginFactory['default'] : pluginFactory;
7
7
  labels = labels && Object.prototype.hasOwnProperty.call(labels, 'default') ? labels['default'] : labels;
8
8
  Handlebars = Handlebars && Object.prototype.hasOwnProperty.call(Handlebars, 'default') ? Handlebars['default'] : Handlebars;
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
- }
9
+ Helpers0 = Helpers0 && Object.prototype.hasOwnProperty.call(Helpers0, 'default') ? Helpers0['default'] : Helpers0;
117
10
 
118
11
  if (!Helpers0.__initialized) {
119
12
  Helpers0(Handlebars);
@@ -1,4 +1,4 @@
1
- define(['jquery', 'lodash', 'util/namespace', 'ui/scroller', 'ui/maths/calculator/core/terms', 'ui/maths/calculator/core/expression', 'ui/maths/calculator/core/plugin', 'handlebars', 'i18n', 'lib/dompurify/purify'], function ($$1, _, nsHelper, scrollHelper, registeredTerms, expressionHelper, pluginFactory, Handlebars, __, DOMPurify) { 'use strict';
1
+ define(['jquery', 'lodash', 'util/namespace', 'ui/scroller', 'ui/maths/calculator/core/terms', 'ui/maths/calculator/core/expression', 'ui/maths/calculator/core/plugin', 'handlebars', 'lib/handlebars/helpers'], function ($$1, _, nsHelper, scrollHelper, registeredTerms, expressionHelper, pluginFactory, 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'] : _;
@@ -8,114 +8,7 @@ define(['jquery', 'lodash', 'util/namespace', 'ui/scroller', 'ui/maths/calculato
8
8
  expressionHelper = expressionHelper && Object.prototype.hasOwnProperty.call(expressionHelper, 'default') ? expressionHelper['default'] : expressionHelper;
9
9
  pluginFactory = pluginFactory && Object.prototype.hasOwnProperty.call(pluginFactory, 'default') ? pluginFactory['default'] : pluginFactory;
10
10
  Handlebars = Handlebars && Object.prototype.hasOwnProperty.call(Handlebars, 'default') ? Handlebars['default'] : Handlebars;
11
- __ = __ && Object.prototype.hasOwnProperty.call(__, 'default') ? __['default'] : __;
12
- DOMPurify = DOMPurify && Object.prototype.hasOwnProperty.call(DOMPurify, 'default') ? DOMPurify['default'] : DOMPurify;
13
-
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
- }
11
+ Helpers0 = Helpers0 && Object.prototype.hasOwnProperty.call(Helpers0, 'default') ? Helpers0['default'] : Helpers0;
119
12
 
120
13
  if (!Helpers0.__initialized) {
121
14
  Helpers0(Handlebars);
@@ -1,4 +1,4 @@
1
- define(['lodash', 'i18n', 'ui/maths/calculator/defaultCalculator', 'ui/maths/calculator/plugins/modifiers/sign', 'ui/maths/calculator/plugins/modifiers/pow10', 'handlebars', 'lib/dompurify/purify'], function (_, __, defaultCalculatorFactory, pluginSign, pluginPow10, Handlebars, DOMPurify) { 'use strict';
1
+ define(['lodash', 'i18n', 'ui/maths/calculator/defaultCalculator', 'ui/maths/calculator/plugins/modifiers/sign', 'ui/maths/calculator/plugins/modifiers/pow10', 'handlebars', 'lib/handlebars/helpers'], function (_, __, defaultCalculatorFactory, pluginSign, pluginPow10, Handlebars, Helpers0) { '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/maths/calculator/defaultCalculator', 'ui/maths/cal
6
6
  pluginSign = pluginSign && Object.prototype.hasOwnProperty.call(pluginSign, 'default') ? pluginSign['default'] : pluginSign;
7
7
  pluginPow10 = pluginPow10 && Object.prototype.hasOwnProperty.call(pluginPow10, 'default') ? pluginPow10['default'] : pluginPow10;
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);
@@ -1,4 +1,4 @@
1
- define(['jquery', 'lodash', 'ui/component', 'ui/mediaEditor/plugins/mediaDimension/mediaDimensionComponent', 'ui/mediaEditor/plugins/mediaAlignment/mediaAlignmentComponent', 'handlebars', 'i18n', 'lib/dompurify/purify'], function ($$1, _, component, mediaDimensionComponent, mediaAlignmentComponent, Handlebars, __, DOMPurify) { 'use strict';
1
+ define(['jquery', 'lodash', 'ui/component', 'ui/mediaEditor/plugins/mediaDimension/mediaDimensionComponent', 'ui/mediaEditor/plugins/mediaAlignment/mediaAlignmentComponent', 'handlebars', 'lib/handlebars/helpers'], function ($$1, _, component, mediaDimensionComponent, mediaAlignmentComponent, 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'] : _;
@@ -6,114 +6,7 @@ define(['jquery', 'lodash', 'ui/component', 'ui/mediaEditor/plugins/mediaDimensi
6
6
  mediaDimensionComponent = mediaDimensionComponent && Object.prototype.hasOwnProperty.call(mediaDimensionComponent, 'default') ? mediaDimensionComponent['default'] : mediaDimensionComponent;
7
7
  mediaAlignmentComponent = mediaAlignmentComponent && Object.prototype.hasOwnProperty.call(mediaAlignmentComponent, 'default') ? mediaAlignmentComponent['default'] : mediaAlignmentComponent;
8
8
  Handlebars = Handlebars && Object.prototype.hasOwnProperty.call(Handlebars, 'default') ? Handlebars['default'] : Handlebars;
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
- }
9
+ Helpers0 = Helpers0 && Object.prototype.hasOwnProperty.call(Helpers0, 'default') ? Helpers0['default'] : Helpers0;
117
10
 
118
11
  if (!Helpers0.__initialized) {
119
12
  Helpers0(Handlebars);
@@ -1,117 +1,10 @@
1
- define(['jquery', 'lodash', 'ui/component', 'handlebars', 'i18n', 'lib/dompurify/purify', 'css!ui/mediaEditor/plugins/mediaAlignment/style.css'], function ($$1, _, component, Handlebars, __, DOMPurify, style_css) { 'use strict';
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
- __ = __ && Object.prototype.hasOwnProperty.call(__, 'default') ? __['default'] : __;
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);