@oat-sa/tao-core-ui 1.58.1 → 1.58.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/actionbar.js +386 -395
- package/dist/adder.js +21 -19
- package/dist/animable/absorbable/absorbable.js +204 -213
- package/dist/animable/absorbable/css/absorb.css +1 -0
- package/dist/animable/absorbable/css/absorb.css.map +1 -1
- package/dist/animable/pulsable/pulsable.js +168 -177
- package/dist/autocomplete/css/autocomplete.css +1 -0
- package/dist/autocomplete/css/autocomplete.css.map +1 -1
- package/dist/autocomplete.js +68 -66
- package/dist/badge/badge.js +188 -197
- package/dist/badge/css/badge.css +1 -0
- package/dist/badge/css/badge.css.map +1 -1
- package/dist/breadcrumbs.js +275 -284
- package/dist/btngrouper.js +5 -5
- package/dist/bulkActionPopup.js +490 -495
- package/dist/button.js +283 -291
- package/dist/cascadingComboBox.js +249 -258
- package/dist/ckeditor/ckConfigurator.js +26 -19
- package/dist/ckeditor/dtdHandler.js +11 -9
- package/dist/class/selector.js +441 -450
- package/dist/component/resizable.js +1 -1
- package/dist/component/windowed.js +285 -294
- package/dist/component.js +419 -428
- package/dist/contextualPopup.js +417 -426
- package/dist/dashboard.js +300 -309
- package/dist/datalist.js +753 -762
- package/dist/datatable/filterStrategy/multiple.js +1 -1
- package/dist/datatable/filterStrategy/single.js +1 -1
- package/dist/datatable.js +1527 -1550
- package/dist/dateRange/dateRange.js +393 -402
- package/dist/datetime/picker.js +665 -672
- package/dist/deleter.js +368 -377
- package/dist/destination/selector.js +286 -295
- package/dist/dialog/alert.js +3 -3
- package/dist/dialog/confirm.js +1 -1
- package/dist/dialog/confirmDelete.js +216 -225
- package/dist/dialog.js +650 -654
- package/dist/disabler.js +8 -8
- package/dist/documentViewer/providers/pdfViewer/fallback/viewer.js +166 -175
- package/dist/documentViewer/providers/pdfViewer/pdfjs/findBar.js +518 -527
- package/dist/documentViewer/providers/pdfViewer/pdfjs/pageView.js +380 -389
- package/dist/documentViewer/providers/pdfViewer/pdfjs/searchEngine.js +539 -548
- package/dist/documentViewer/providers/pdfViewer/pdfjs/viewer.js +369 -378
- package/dist/documentViewer/providers/pdfViewer.js +184 -193
- package/dist/documentViewer.js +292 -301
- package/dist/dropdown.js +383 -392
- package/dist/durationer.js +5 -5
- package/dist/dynamicComponent.js +597 -598
- package/dist/feedback.js +356 -362
- package/dist/figure/FigureStateActive.js +117 -108
- package/dist/filesender.js +2 -2
- package/dist/filter.js +230 -239
- package/dist/form/dropdownForm.js +355 -357
- package/dist/form/form.js +919 -690
- package/dist/form/simpleForm.js +1 -1
- package/dist/form/validator/renderer.js +233 -235
- package/dist/form/validator/validator.js +257 -189
- package/dist/form/widget/definitions.js +1 -1
- package/dist/form/widget/providers/checkBox.js +254 -259
- package/dist/form/widget/providers/comboBox.js +187 -192
- package/dist/form/widget/providers/default.js +8 -9
- package/dist/form/widget/providers/hidden.js +170 -179
- package/dist/form/widget/providers/hiddenBox.js +262 -267
- package/dist/form/widget/providers/radioBox.js +216 -225
- package/dist/form/widget/providers/textArea.js +187 -196
- package/dist/form/widget/providers/textBox.js +2 -3
- package/dist/form/widget/widget.js +473 -475
- package/dist/formValidator/formValidator.js +1 -1
- package/dist/formValidator/highlighters/message.js +1 -1
- package/dist/generis/form/form.js +314 -323
- package/dist/generis/validator/validator.js +209 -218
- package/dist/generis/widget/checkBox/checkBox.js +218 -227
- package/dist/generis/widget/comboBox/comboBox.js +179 -188
- package/dist/generis/widget/hiddenBox/hiddenBox.js +220 -229
- package/dist/generis/widget/textBox/textBox.js +169 -178
- package/dist/generis/widget/widget.js +246 -255
- package/dist/groupedComboBox.js +222 -231
- package/dist/groupvalidator.js +2 -2
- package/dist/highlighter.js +967 -958
- package/dist/image/ImgStateActive/helper.js +7 -5
- package/dist/image/ImgStateActive/initHelper.js +49 -43
- package/dist/image/ImgStateActive/initMediaEditor.js +24 -20
- package/dist/image/ImgStateActive/mediaSizer.js +14 -12
- package/dist/image/ImgStateActive.js +72 -70
- package/dist/incrementer.js +6 -6
- package/dist/inplacer.js +6 -6
- package/dist/itemButtonList/css/item-button-list.css +1 -0
- package/dist/itemButtonList/css/item-button-list.css.map +1 -1
- package/dist/itemButtonList.js +439 -435
- package/dist/keyNavigation/navigableDomElement.js +51 -38
- package/dist/keyNavigation/navigator.js +85 -70
- package/dist/listbox.js +460 -469
- package/dist/liststyler.js +8 -8
- package/dist/loadingButton/loadingButton.js +209 -218
- package/dist/lock.js +476 -485
- package/dist/login/login.js +475 -484
- package/dist/maths/calculator/basicCalculator.js +235 -244
- package/dist/maths/calculator/calculatorComponent.js +3 -3
- package/dist/maths/calculator/core/board.js +772 -781
- package/dist/maths/calculator/core/expression.js +476 -485
- package/dist/maths/calculator/core/labels.js +228 -237
- package/dist/maths/calculator/core/tokenizer.js +1 -1
- package/dist/maths/calculator/core/tokens.js +163 -170
- package/dist/maths/calculator/plugins/keyboard/templateKeyboard/templateKeyboard.js +244 -253
- package/dist/maths/calculator/plugins/screen/simpleScreen/simpleScreen.js +279 -288
- package/dist/maths/calculator/scientificCalculator.js +327 -336
- package/dist/mediaEditor/mediaEditorComponent.js +238 -245
- package/dist/mediaEditor/plugins/mediaAlignment/helper.js +7 -7
- package/dist/mediaEditor/plugins/mediaAlignment/mediaAlignmentComponent.js +229 -235
- package/dist/mediaEditor/plugins/mediaDimension/mediaDimensionComponent.js +580 -589
- package/dist/mediaplayer/players/html5.js +666 -675
- package/dist/mediaplayer/players/youtube.js +419 -424
- package/dist/mediaplayer/support.js +11 -10
- package/dist/mediaplayer/utils/reminder.js +14 -13
- package/dist/mediaplayer/utils/timeObserver.js +10 -11
- package/dist/mediaplayer/youtubeManager.js +164 -145
- package/dist/mediaplayer.js +1565 -1520
- package/dist/mediasizer.js +669 -678
- package/dist/modal.js +10 -17
- package/dist/pageSizeSelector.js +219 -228
- package/dist/pagination/providers/pages.js +280 -289
- package/dist/pagination/providers/simple.js +192 -201
- package/dist/previewer.js +30 -30
- package/dist/progressbar.js +4 -4
- package/dist/report.js +347 -356
- package/dist/resource/filters.js +271 -280
- package/dist/resource/list.js +1264 -1273
- package/dist/resource/selector.js +865 -874
- package/dist/resource/tree.js +1483 -1492
- package/dist/resourcemgr/fileBrowser.js +564 -569
- package/dist/resourcemgr/filePreview.js +16 -16
- package/dist/resourcemgr/fileSelector.js +515 -524
- package/dist/resourcemgr/util/updatePermissions.js +2 -2
- package/dist/resourcemgr.js +306 -315
- package/dist/searchModal/advancedSearch.js +796 -767
- package/dist/searchModal.js +114 -91
- package/dist/switch/switch.js +298 -307
- package/dist/tabs.js +598 -575
- package/dist/taskQueue/status.js +312 -321
- package/dist/taskQueue/table.js +375 -384
- package/dist/taskQueue/taskQueueModel.js +488 -472
- package/dist/taskQueueButton/taskable.js +264 -273
- package/dist/taskQueueButton/treeButton.js +189 -198
- package/dist/themeLoader.js +24 -23
- package/dist/themes.js +1 -1
- package/dist/toggler.js +3 -3
- package/dist/tooltip.js +295 -304
- package/dist/transformer.js +2 -2
- package/dist/tristateCheckboxGroup.js +311 -320
- package/dist/uploader.js +687 -696
- package/dist/validator/Report.js +1 -1
- package/dist/validator/Validator.js +3 -3
- package/dist/validator/validators.js +9 -9
- package/dist/validator.js +240 -230
- package/dist/waitForMedia.js +1 -1
- package/package.json +3 -3
- package/src/animable/absorbable/css/absorb.css +1 -0
- package/src/animable/absorbable/css/absorb.css.map +1 -1
- package/src/autocomplete/css/autocomplete.css +1 -0
- package/src/autocomplete/css/autocomplete.css.map +1 -1
- package/src/badge/css/badge.css +1 -0
- package/src/badge/css/badge.css.map +1 -1
- package/src/ckeditor/ckConfigurator.js +4 -0
- package/src/itemButtonList/css/item-button-list.css +1 -0
- package/src/itemButtonList/css/item-button-list.css.map +1 -1
- package/src/.DS_Store +0 -0
- package/src/css/basic.css +0 -7826
- package/src/css/basic.css.map +0 -1
- package/src/css/ckeditor/skins/tao/css/dialog.css +0 -950
- package/src/css/ckeditor/skins/tao/css/dialog.css.map +0 -1
- package/src/css/ckeditor/skins/tao/css/editor.css +0 -1850
- package/src/css/ckeditor/skins/tao/css/editor.css.map +0 -1
- package/src/scss/.DS_Store +0 -0
- package/src/scss/basic.scss +0 -16
- package/src/scss/ckeditor/skins/tao/scss/dialog.scss +0 -763
- package/src/scss/ckeditor/skins/tao/scss/editor.scss +0 -111
- package/src/scss/ckeditor/skins/tao/scss/inc/_ck-icons.scss +0 -59
- package/src/scss/ckeditor/skins/tao/scss/inc/_colorpanel.scss +0 -118
- package/src/scss/ckeditor/skins/tao/scss/inc/_elementspath.scss +0 -69
- package/src/scss/ckeditor/skins/tao/scss/inc/_mainui.scss +0 -194
- package/src/scss/ckeditor/skins/tao/scss/inc/_menu.scss +0 -181
- package/src/scss/ckeditor/skins/tao/scss/inc/_panel.scss +0 -200
- package/src/scss/ckeditor/skins/tao/scss/inc/_presets.scss +0 -32
- package/src/scss/ckeditor/skins/tao/scss/inc/_reset.scss +0 -101
- package/src/scss/ckeditor/skins/tao/scss/inc/_richcombo.scss +0 -213
- package/src/scss/ckeditor/skins/tao/scss/inc/_tao.scss +0 -59
- package/src/scss/ckeditor/skins/tao/scss/inc/_toolbar.scss +0 -301
- package/src/scss/font/source-sans-pro/source-sans-pro-italic.eot +0 -0
- package/src/scss/font/source-sans-pro/source-sans-pro-italic.eot.b64 +0 -1
- package/src/scss/font/source-sans-pro/source-sans-pro-italic.woff +0 -0
- package/src/scss/font/source-sans-pro/source-sans-pro-italic.woff.b64 +0 -1
- package/src/scss/font/source-sans-pro/source-sans-pro-regular.eot +0 -0
- package/src/scss/font/source-sans-pro/source-sans-pro-regular.eot.b64 +0 -1
- package/src/scss/font/source-sans-pro/source-sans-pro-regular.woff +0 -0
- package/src/scss/font/source-sans-pro/source-sans-pro-regular.woff.b64 +0 -1
- package/src/scss/font/source-sans-pro/source-sans-pro-semibold-italic.eot +0 -0
- package/src/scss/font/source-sans-pro/source-sans-pro-semibold-italic.eot.b64 +0 -1
- package/src/scss/font/source-sans-pro/source-sans-pro-semibold-italic.woff +0 -0
- package/src/scss/font/source-sans-pro/source-sans-pro-semibold-italic.woff.b64 +0 -1
- package/src/scss/font/source-sans-pro/source-sans-pro-semibold.eot +0 -0
- package/src/scss/font/source-sans-pro/source-sans-pro-semibold.eot.b64 +0 -1
- package/src/scss/font/source-sans-pro/source-sans-pro-semibold.woff +0 -0
- package/src/scss/font/source-sans-pro/source-sans-pro-semibold.woff.b64 +0 -1
- package/src/scss/font/tao/tao.eot +0 -0
- package/src/scss/font/tao/tao.svg +0 -235
- package/src/scss/font/tao/tao.ttf +0 -0
- package/src/scss/font/tao/tao.woff +0 -0
- package/src/scss/inc/_base.scss +0 -496
- package/src/scss/inc/_bootstrap.scss +0 -6
- package/src/scss/inc/_buttons.scss +0 -114
- package/src/scss/inc/_colors.scss +0 -88
- package/src/scss/inc/_feedback.scss +0 -150
- package/src/scss/inc/_flex-grid.scss +0 -15
- package/src/scss/inc/_fonts.scss +0 -4
- package/src/scss/inc/_forms.scss +0 -827
- package/src/scss/inc/_functions.scss +0 -283
- package/src/scss/inc/_grid.scss +0 -66
- package/src/scss/inc/_jquery.nouislider.scss +0 -254
- package/src/scss/inc/_normalize.scss +0 -528
- package/src/scss/inc/_report.scss +0 -68
- package/src/scss/inc/_secondary-properties.scss +0 -89
- package/src/scss/inc/_select2.scss +0 -634
- package/src/scss/inc/_toolbars.scss +0 -155
- package/src/scss/inc/_tooltip.scss +0 -312
- package/src/scss/inc/_variables.scss +0 -21
- package/src/scss/inc/base/_highlight.scss +0 -5
- package/src/scss/inc/base/_list-style.scss +0 -59
- package/src/scss/inc/base/_svg.scss +0 -3
- package/src/scss/inc/base/_table.scss +0 -63
- package/src/scss/inc/fonts/_source-sans-pro.scss +0 -29
- package/src/scss/inc/fonts/_tao-icon-classes.scss +0 -226
- package/src/scss/inc/fonts/_tao-icon-def.scss +0 -12
- package/src/scss/inc/fonts/_tao-icon-vars.scss +0 -240
package/dist/bulkActionPopup.js
CHANGED
|
@@ -1,547 +1,542 @@
|
|
|
1
1
|
define(['jquery', 'lodash', 'i18n', 'handlebars', 'lib/dompurify/purify', 'ui/component', 'ui/keyNavigation/navigator', 'ui/keyNavigation/navigableDomElement', 'util/shortcut/registry', 'util/shortcut', 'util/namespace', 'ui/modal', 'select2', 'css!ui/bulkActionPopup/css/bulkActionPopup.css'], function ($$1, _, __, Handlebars, DOMPurify, component, keyNavigator, navigableDomElement, shortcutRegistry, globalShortcut, namespaceHelper, modal, select2, bulkActionPopup_css) { 'use strict';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
3
|
+
$$1 = $$1 && Object.prototype.hasOwnProperty.call($$1, 'default') ? $$1['default'] : $$1;
|
|
4
|
+
_ = _ && Object.prototype.hasOwnProperty.call(_, 'default') ? _['default'] : _;
|
|
5
|
+
__ = __ && Object.prototype.hasOwnProperty.call(__, 'default') ? __['default'] : __;
|
|
6
|
+
Handlebars = Handlebars && Object.prototype.hasOwnProperty.call(Handlebars, 'default') ? Handlebars['default'] : Handlebars;
|
|
7
|
+
DOMPurify = DOMPurify && Object.prototype.hasOwnProperty.call(DOMPurify, 'default') ? DOMPurify['default'] : DOMPurify;
|
|
8
|
+
component = component && Object.prototype.hasOwnProperty.call(component, 'default') ? component['default'] : component;
|
|
9
|
+
keyNavigator = keyNavigator && Object.prototype.hasOwnProperty.call(keyNavigator, 'default') ? keyNavigator['default'] : keyNavigator;
|
|
10
|
+
navigableDomElement = navigableDomElement && Object.prototype.hasOwnProperty.call(navigableDomElement, 'default') ? navigableDomElement['default'] : navigableDomElement;
|
|
11
|
+
shortcutRegistry = shortcutRegistry && Object.prototype.hasOwnProperty.call(shortcutRegistry, 'default') ? shortcutRegistry['default'] : shortcutRegistry;
|
|
12
|
+
globalShortcut = globalShortcut && Object.prototype.hasOwnProperty.call(globalShortcut, 'default') ? globalShortcut['default'] : globalShortcut;
|
|
13
|
+
namespaceHelper = namespaceHelper && Object.prototype.hasOwnProperty.call(namespaceHelper, 'default') ? namespaceHelper['default'] : namespaceHelper;
|
|
14
|
+
|
|
15
|
+
function _typeof(obj) {
|
|
16
|
+
"@babel/helpers - typeof";
|
|
17
|
+
|
|
18
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
|
|
19
|
+
return typeof obj;
|
|
20
|
+
} : function (obj) {
|
|
21
|
+
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
22
|
+
}, _typeof(obj);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function Helpers0 (hb) {
|
|
26
|
+
//register a i18n helper
|
|
27
|
+
hb.registerHelper('__', function (key) {
|
|
28
|
+
return __(key);
|
|
29
|
+
});
|
|
15
30
|
/**
|
|
16
|
-
*
|
|
17
|
-
* modify it under the terms of the GNU General Public License
|
|
18
|
-
* as published by the Free Software Foundation; under version 2
|
|
19
|
-
* of the License (non-upgradable).
|
|
20
|
-
*
|
|
21
|
-
* This program is distributed in the hope that it will be useful,
|
|
22
|
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
23
|
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
24
|
-
* GNU General Public License for more details.
|
|
25
|
-
*
|
|
26
|
-
* You should have received a copy of the GNU General Public License
|
|
27
|
-
* along with this program; if not, write to the Free Software
|
|
28
|
-
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
29
|
-
*
|
|
30
|
-
* Copyright (c) 2013-2019 (original work) Open Assessment Technologies SA (under the project TAO-PRODUCT);
|
|
31
|
+
* Register dompurify helper
|
|
31
32
|
*
|
|
33
|
+
* https://github.com/cure53/DOMPurify
|
|
34
|
+
* with config SAFE_FOR_TEMPLATES: true
|
|
35
|
+
* to make output safe for template systems
|
|
36
|
+
*/
|
|
37
|
+
|
|
38
|
+
hb.registerHelper('dompurify', function (context) {
|
|
39
|
+
return DOMPurify.sanitize(context);
|
|
40
|
+
});
|
|
41
|
+
/**
|
|
42
|
+
* Register join helper
|
|
32
43
|
*
|
|
44
|
+
* Example :
|
|
45
|
+
* var values = {a:v1, b:v2, c:v3};
|
|
46
|
+
* Using {{{join attributes '=' ' ' '"'}}} will return : a="v1" b="v2" c="v3"
|
|
47
|
+
* Using {{{join values null ' or ' '*'}}} will return : *v1* or *v2* or *v3*
|
|
33
48
|
*/
|
|
34
|
-
function Helpers0 (hb) {
|
|
35
|
-
//register a i18n helper
|
|
36
|
-
hb.registerHelper('__', function (key) {
|
|
37
|
-
return __(key);
|
|
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
49
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
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
|
-
*/
|
|
50
|
+
hb.registerHelper('join', function (arr, keyValueGlue, fragmentGlue, wrapper) {
|
|
51
|
+
var fragments = [];
|
|
52
|
+
keyValueGlue = typeof keyValueGlue === 'string' ? keyValueGlue : undefined;
|
|
53
|
+
fragmentGlue = typeof fragmentGlue === 'string' ? fragmentGlue : ' ';
|
|
54
|
+
wrapper = typeof wrapper === 'string' ? wrapper : '"';
|
|
58
55
|
|
|
59
|
-
|
|
60
|
-
var
|
|
61
|
-
keyValueGlue = typeof keyValueGlue === 'string' ? keyValueGlue : undefined;
|
|
62
|
-
fragmentGlue = typeof fragmentGlue === 'string' ? fragmentGlue : ' ';
|
|
63
|
-
wrapper = typeof wrapper === 'string' ? wrapper : '"';
|
|
64
|
-
|
|
65
|
-
_.forIn(arr, function (value, key) {
|
|
66
|
-
var fragment = '';
|
|
67
|
-
|
|
68
|
-
if (value !== null || value !== undefined) {
|
|
69
|
-
if (typeof value === 'boolean') {
|
|
70
|
-
value = value ? 'true' : 'false';
|
|
71
|
-
} else if (typeof value === 'object') {
|
|
72
|
-
value = _.values(value).join(' ');
|
|
73
|
-
}
|
|
74
|
-
} else {
|
|
75
|
-
value = '';
|
|
76
|
-
}
|
|
56
|
+
_.forIn(arr, function (value, key) {
|
|
57
|
+
var fragment = '';
|
|
77
58
|
|
|
78
|
-
|
|
79
|
-
|
|
59
|
+
if (value !== null || value !== undefined) {
|
|
60
|
+
if (typeof value === 'boolean') {
|
|
61
|
+
value = value ? 'true' : 'false';
|
|
62
|
+
} else if (_typeof(value) === 'object') {
|
|
63
|
+
value = _.values(value).join(' ');
|
|
80
64
|
}
|
|
65
|
+
} else {
|
|
66
|
+
value = '';
|
|
67
|
+
}
|
|
81
68
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
});
|
|
85
|
-
|
|
86
|
-
return fragments.join(fragmentGlue);
|
|
87
|
-
}); //register a classic "for loop" helper
|
|
88
|
-
//it also adds a local variable "i" as the index in each iteration loop
|
|
89
|
-
|
|
90
|
-
hb.registerHelper('for', function (startIndex, stopIndex, increment, options) {
|
|
91
|
-
var ret = '';
|
|
92
|
-
startIndex = parseInt(startIndex);
|
|
93
|
-
stopIndex = parseInt(stopIndex);
|
|
94
|
-
increment = parseInt(increment);
|
|
95
|
-
|
|
96
|
-
for (var i = startIndex; i < stopIndex; i += increment) {
|
|
97
|
-
ret += options.fn(_.extend({}, this, {
|
|
98
|
-
i: i
|
|
99
|
-
}));
|
|
69
|
+
if (keyValueGlue !== undefined) {
|
|
70
|
+
fragment += key + keyValueGlue;
|
|
100
71
|
}
|
|
101
72
|
|
|
102
|
-
|
|
73
|
+
fragment += wrapper + value + wrapper;
|
|
74
|
+
fragments.push(fragment);
|
|
103
75
|
});
|
|
104
|
-
hb.registerHelper('equal', function (var1, var2, options) {
|
|
105
|
-
if (var1 == var2) {
|
|
106
|
-
return options.fn(this);
|
|
107
|
-
} else {
|
|
108
|
-
return options.inverse(this);
|
|
109
|
-
}
|
|
110
|
-
}); // register a "get property" helper
|
|
111
|
-
// it gets the named property from the provided context
|
|
112
76
|
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
// it checks if value is in array
|
|
77
|
+
return fragments.join(fragmentGlue);
|
|
78
|
+
}); //register a classic "for loop" helper
|
|
79
|
+
//it also adds a local variable "i" as the index in each iteration loop
|
|
117
80
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
}
|
|
81
|
+
hb.registerHelper('for', function (startIndex, stopIndex, increment, options) {
|
|
82
|
+
var ret = '';
|
|
83
|
+
startIndex = parseInt(startIndex);
|
|
84
|
+
stopIndex = parseInt(stopIndex);
|
|
85
|
+
increment = parseInt(increment);
|
|
124
86
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
var Template = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) {
|
|
130
|
-
this.compilerInfo = [4,'>= 1.0.0'];
|
|
131
|
-
helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
|
|
132
|
-
var buffer = "", stack1, helper, options, functionType="function", escapeExpression=this.escapeExpression, helperMissing=helpers.helperMissing, self=this;
|
|
133
|
-
|
|
134
|
-
function program1(depth0,data) {
|
|
135
|
-
|
|
136
|
-
var buffer = "", stack1;
|
|
137
|
-
buffer += "\n ";
|
|
138
|
-
stack1 = helpers['if'].call(depth0, (depth0 && depth0.single), {hash:{},inverse:self.program(4, program4, data),fn:self.program(2, program2, data),data:data});
|
|
139
|
-
if(stack1 || stack1 === 0) { buffer += stack1; }
|
|
140
|
-
buffer += "\n ";
|
|
141
|
-
return buffer;
|
|
142
|
-
}
|
|
143
|
-
function program2(depth0,data) {
|
|
144
|
-
|
|
145
|
-
var buffer = "", stack1, helper, options;
|
|
146
|
-
buffer += "\n <div class=\"single\" data-resource=\""
|
|
147
|
-
+ escapeExpression(((stack1 = ((stack1 = ((stack1 = (depth0 && depth0.allowedResources)),stack1 == null || stack1 === false ? stack1 : stack1[0])),stack1 == null || stack1 === false ? stack1 : stack1.id)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))
|
|
148
|
-
+ "\">\n <p>\n "
|
|
149
|
-
+ escapeExpression((helper = helpers.__ || (depth0 && depth0.__),options={hash:{},data:data},helper ? helper.call(depth0, "The action will be applied to", options) : helperMissing.call(depth0, "__", "The action will be applied to", options)))
|
|
150
|
-
+ " ";
|
|
151
|
-
if (helper = helpers.resourceType) { stack1 = helper.call(depth0, {hash:{},data:data}); }
|
|
152
|
-
else { helper = (depth0 && depth0.resourceType); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; }
|
|
153
|
-
buffer += escapeExpression(stack1)
|
|
154
|
-
+ " <span class=\"resource-label\">"
|
|
155
|
-
+ escapeExpression(((stack1 = ((stack1 = ((stack1 = (depth0 && depth0.allowedResources)),stack1 == null || stack1 === false ? stack1 : stack1[0])),stack1 == null || stack1 === false ? stack1 : stack1.label)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))
|
|
156
|
-
+ "</span>\n </p>\n </div>\n ";
|
|
157
|
-
return buffer;
|
|
87
|
+
for (var i = startIndex; i < stopIndex; i += increment) {
|
|
88
|
+
ret += options.fn(_.extend({}, this, {
|
|
89
|
+
i: i
|
|
90
|
+
}));
|
|
158
91
|
}
|
|
159
92
|
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
else { helper = (depth0 && depth0.resourceCount); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; }
|
|
168
|
-
buffer += escapeExpression(stack1)
|
|
169
|
-
+ "</span> ";
|
|
170
|
-
if (helper = helpers.resourceTypes) { stack1 = helper.call(depth0, {hash:{},data:data}); }
|
|
171
|
-
else { helper = (depth0 && depth0.resourceTypes); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; }
|
|
172
|
-
buffer += escapeExpression(stack1)
|
|
173
|
-
+ ":\n </p>\n <ul class=\"plain applicables\">\n ";
|
|
174
|
-
stack1 = helpers.each.call(depth0, (depth0 && depth0.allowedResources), {hash:{},inverse:self.noop,fn:self.program(5, program5, data),data:data});
|
|
175
|
-
if(stack1 || stack1 === 0) { buffer += stack1; }
|
|
176
|
-
buffer += "\n </ul>\n </div>\n ";
|
|
177
|
-
return buffer;
|
|
178
|
-
}
|
|
179
|
-
function program5(depth0,data) {
|
|
180
|
-
|
|
181
|
-
var buffer = "", stack1, helper;
|
|
182
|
-
buffer += "\n <li data-resource=\"";
|
|
183
|
-
if (helper = helpers.id) { stack1 = helper.call(depth0, {hash:{},data:data}); }
|
|
184
|
-
else { helper = (depth0 && depth0.id); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; }
|
|
185
|
-
buffer += escapeExpression(stack1)
|
|
186
|
-
+ "\">\n <span class=\"resource-label\">";
|
|
187
|
-
if (helper = helpers.label) { stack1 = helper.call(depth0, {hash:{},data:data}); }
|
|
188
|
-
else { helper = (depth0 && depth0.label); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; }
|
|
189
|
-
buffer += escapeExpression(stack1)
|
|
190
|
-
+ "</span>\n </li>\n ";
|
|
191
|
-
return buffer;
|
|
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);
|
|
192
100
|
}
|
|
101
|
+
}); // register a "get property" helper
|
|
102
|
+
// it gets the named property from the provided context
|
|
193
103
|
|
|
194
|
-
function
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
stack1 = helpers['if'].call(depth0, (depth0 && depth0.singleDenied), {hash:{},inverse:self.program(10, program10, data),fn:self.program(8, program8, data),data:data});
|
|
199
|
-
if(stack1 || stack1 === 0) { buffer += stack1; }
|
|
200
|
-
buffer += "\n ";
|
|
201
|
-
return buffer;
|
|
202
|
-
}
|
|
203
|
-
function program8(depth0,data) {
|
|
204
|
-
|
|
205
|
-
var buffer = "", stack1, helper, options;
|
|
206
|
-
buffer += "\n <div class=\"single\" data-resource=\""
|
|
207
|
-
+ escapeExpression(((stack1 = ((stack1 = ((stack1 = (depth0 && depth0.deniedResources)),stack1 == null || stack1 === false ? stack1 : stack1[0])),stack1 == null || stack1 === false ? stack1 : stack1.id)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))
|
|
208
|
-
+ "\">\n <p>\n "
|
|
209
|
-
+ escapeExpression((helper = helpers.__ || (depth0 && depth0.__),options={hash:{},data:data},helper ? helper.call(depth0, "The action will not be applied to ", options) : helperMissing.call(depth0, "__", "The action will not be applied to ", options)))
|
|
210
|
-
+ " ";
|
|
211
|
-
if (helper = helpers.resourceType) { stack1 = helper.call(depth0, {hash:{},data:data}); }
|
|
212
|
-
else { helper = (depth0 && depth0.resourceType); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; }
|
|
213
|
-
buffer += escapeExpression(stack1)
|
|
214
|
-
+ "\n <span class=\"resource-label\">"
|
|
215
|
-
+ escapeExpression(((stack1 = ((stack1 = ((stack1 = (depth0 && depth0.deniedResources)),stack1 == null || stack1 === false ? stack1 : stack1[0])),stack1 == null || stack1 === false ? stack1 : stack1.label)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))
|
|
216
|
-
+ "</span>\n <span class=\"reason\">("
|
|
217
|
-
+ escapeExpression(((stack1 = ((stack1 = ((stack1 = (depth0 && depth0.deniedResources)),stack1 == null || stack1 === false ? stack1 : stack1[0])),stack1 == null || stack1 === false ? stack1 : stack1.reason)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))
|
|
218
|
-
+ ")</span>\n </p>\n </div>\n ";
|
|
219
|
-
return buffer;
|
|
220
|
-
}
|
|
104
|
+
hb.registerHelper('property', function (name, context) {
|
|
105
|
+
return context[name] || '';
|
|
106
|
+
}); // register an 'includes' helper
|
|
107
|
+
// it checks if value is in array
|
|
221
108
|
|
|
222
|
-
function
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
buffer += "\n <p>\n "
|
|
226
|
-
+ escapeExpression((helper = helpers.__ || (depth0 && depth0.__),options={hash:{},data:data},helper ? helper.call(depth0, "The action will not be applied to the following", options) : helperMissing.call(depth0, "__", "The action will not be applied to the following", options)))
|
|
227
|
-
+ " ";
|
|
228
|
-
if (helper = helpers.resourceTypes) { stack1 = helper.call(depth0, {hash:{},data:data}); }
|
|
229
|
-
else { helper = (depth0 && depth0.resourceTypes); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; }
|
|
230
|
-
buffer += escapeExpression(stack1)
|
|
231
|
-
+ ":\n </p>\n <ul class=\"plain no-applicables\">\n ";
|
|
232
|
-
stack1 = helpers.each.call(depth0, (depth0 && depth0.deniedResources), {hash:{},inverse:self.noop,fn:self.program(11, program11, data),data:data});
|
|
233
|
-
if(stack1 || stack1 === 0) { buffer += stack1; }
|
|
234
|
-
buffer += "\n </ul>\n ";
|
|
235
|
-
return buffer;
|
|
236
|
-
}
|
|
237
|
-
function program11(depth0,data) {
|
|
238
|
-
|
|
239
|
-
var buffer = "", stack1, helper;
|
|
240
|
-
buffer += "\n <li data-resource=\"";
|
|
241
|
-
if (helper = helpers.id) { stack1 = helper.call(depth0, {hash:{},data:data}); }
|
|
242
|
-
else { helper = (depth0 && depth0.id); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; }
|
|
243
|
-
buffer += escapeExpression(stack1)
|
|
244
|
-
+ "\">\n <span class=\"resource-label\">";
|
|
245
|
-
if (helper = helpers.label) { stack1 = helper.call(depth0, {hash:{},data:data}); }
|
|
246
|
-
else { helper = (depth0 && depth0.label); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; }
|
|
247
|
-
buffer += escapeExpression(stack1)
|
|
248
|
-
+ "</span>\n <span class=\"reason\">(";
|
|
249
|
-
if (helper = helpers.reason) { stack1 = helper.call(depth0, {hash:{},data:data}); }
|
|
250
|
-
else { helper = (depth0 && depth0.reason); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; }
|
|
251
|
-
buffer += escapeExpression(stack1)
|
|
252
|
-
+ ")</span>\n </li>\n ";
|
|
253
|
-
return buffer;
|
|
109
|
+
hb.registerHelper('includes', function (haystack, needle, options) {
|
|
110
|
+
if (_.contains(haystack, needle)) {
|
|
111
|
+
return options.fn(this);
|
|
254
112
|
}
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
if (!Helpers0.__initialized) {
|
|
117
|
+
Helpers0(Handlebars);
|
|
118
|
+
Helpers0.__initialized = true;
|
|
119
|
+
}
|
|
120
|
+
var Template = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) {
|
|
121
|
+
this.compilerInfo = [4,'>= 1.0.0'];
|
|
122
|
+
helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
|
|
123
|
+
var buffer = "", stack1, helper, options, functionType="function", escapeExpression=this.escapeExpression, helperMissing=helpers.helperMissing, self=this;
|
|
124
|
+
|
|
125
|
+
function program1(depth0,data) {
|
|
126
|
+
|
|
127
|
+
var buffer = "", stack1;
|
|
128
|
+
buffer += "\n ";
|
|
129
|
+
stack1 = helpers['if'].call(depth0, (depth0 && depth0.single), {hash:{},inverse:self.program(4, program4, data),fn:self.program(2, program2, data),data:data});
|
|
130
|
+
if(stack1 || stack1 === 0) { buffer += stack1; }
|
|
131
|
+
buffer += "\n ";
|
|
132
|
+
return buffer;
|
|
133
|
+
}
|
|
134
|
+
function program2(depth0,data) {
|
|
135
|
+
|
|
136
|
+
var buffer = "", stack1, helper, options;
|
|
137
|
+
buffer += "\n <div class=\"single\" data-resource=\""
|
|
138
|
+
+ escapeExpression(((stack1 = ((stack1 = ((stack1 = (depth0 && depth0.allowedResources)),stack1 == null || stack1 === false ? stack1 : stack1[0])),stack1 == null || stack1 === false ? stack1 : stack1.id)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))
|
|
139
|
+
+ "\">\n <p>\n "
|
|
140
|
+
+ escapeExpression((helper = helpers.__ || (depth0 && depth0.__),options={hash:{},data:data},helper ? helper.call(depth0, "The action will be applied to", options) : helperMissing.call(depth0, "__", "The action will be applied to", options)))
|
|
141
|
+
+ " ";
|
|
142
|
+
if (helper = helpers.resourceType) { stack1 = helper.call(depth0, {hash:{},data:data}); }
|
|
143
|
+
else { helper = (depth0 && depth0.resourceType); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; }
|
|
144
|
+
buffer += escapeExpression(stack1)
|
|
145
|
+
+ " <span class=\"resource-label\">"
|
|
146
|
+
+ escapeExpression(((stack1 = ((stack1 = ((stack1 = (depth0 && depth0.allowedResources)),stack1 == null || stack1 === false ? stack1 : stack1[0])),stack1 == null || stack1 === false ? stack1 : stack1.label)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))
|
|
147
|
+
+ "</span>\n </p>\n </div>\n ";
|
|
148
|
+
return buffer;
|
|
149
|
+
}
|
|
255
150
|
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
151
|
+
function program4(depth0,data) {
|
|
152
|
+
|
|
153
|
+
var buffer = "", stack1, helper, options;
|
|
154
|
+
buffer += "\n <div class=\"multiple\">\n <p>\n "
|
|
155
|
+
+ escapeExpression((helper = helpers.__ || (depth0 && depth0.__),options={hash:{},data:data},helper ? helper.call(depth0, "The action will be applied to the following", options) : helperMissing.call(depth0, "__", "The action will be applied to the following", options)))
|
|
156
|
+
+ " <span class=\"resource-count\">";
|
|
157
|
+
if (helper = helpers.resourceCount) { stack1 = helper.call(depth0, {hash:{},data:data}); }
|
|
158
|
+
else { helper = (depth0 && depth0.resourceCount); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; }
|
|
159
|
+
buffer += escapeExpression(stack1)
|
|
160
|
+
+ "</span> ";
|
|
161
|
+
if (helper = helpers.resourceTypes) { stack1 = helper.call(depth0, {hash:{},data:data}); }
|
|
162
|
+
else { helper = (depth0 && depth0.resourceTypes); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; }
|
|
163
|
+
buffer += escapeExpression(stack1)
|
|
164
|
+
+ ":\n </p>\n <ul class=\"plain applicables\">\n ";
|
|
165
|
+
stack1 = helpers.each.call(depth0, (depth0 && depth0.allowedResources), {hash:{},inverse:self.noop,fn:self.program(5, program5, data),data:data});
|
|
166
|
+
if(stack1 || stack1 === 0) { buffer += stack1; }
|
|
167
|
+
buffer += "\n </ul>\n </div>\n ";
|
|
168
|
+
return buffer;
|
|
169
|
+
}
|
|
170
|
+
function program5(depth0,data) {
|
|
171
|
+
|
|
172
|
+
var buffer = "", stack1, helper;
|
|
173
|
+
buffer += "\n <li data-resource=\"";
|
|
174
|
+
if (helper = helpers.id) { stack1 = helper.call(depth0, {hash:{},data:data}); }
|
|
175
|
+
else { helper = (depth0 && depth0.id); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; }
|
|
176
|
+
buffer += escapeExpression(stack1)
|
|
177
|
+
+ "\">\n <span class=\"resource-label\">";
|
|
178
|
+
if (helper = helpers.label) { stack1 = helper.call(depth0, {hash:{},data:data}); }
|
|
179
|
+
else { helper = (depth0 && depth0.label); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; }
|
|
180
|
+
buffer += escapeExpression(stack1)
|
|
181
|
+
+ "</span>\n </li>\n ";
|
|
182
|
+
return buffer;
|
|
183
|
+
}
|
|
266
184
|
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
185
|
+
function program7(depth0,data) {
|
|
186
|
+
|
|
187
|
+
var buffer = "", stack1;
|
|
188
|
+
buffer += "\n ";
|
|
189
|
+
stack1 = helpers['if'].call(depth0, (depth0 && depth0.singleDenied), {hash:{},inverse:self.program(10, program10, data),fn:self.program(8, program8, data),data:data});
|
|
190
|
+
if(stack1 || stack1 === 0) { buffer += stack1; }
|
|
191
|
+
buffer += "\n ";
|
|
192
|
+
return buffer;
|
|
193
|
+
}
|
|
194
|
+
function program8(depth0,data) {
|
|
195
|
+
|
|
196
|
+
var buffer = "", stack1, helper, options;
|
|
197
|
+
buffer += "\n <div class=\"single\" data-resource=\""
|
|
198
|
+
+ escapeExpression(((stack1 = ((stack1 = ((stack1 = (depth0 && depth0.deniedResources)),stack1 == null || stack1 === false ? stack1 : stack1[0])),stack1 == null || stack1 === false ? stack1 : stack1.id)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))
|
|
199
|
+
+ "\">\n <p>\n "
|
|
200
|
+
+ escapeExpression((helper = helpers.__ || (depth0 && depth0.__),options={hash:{},data:data},helper ? helper.call(depth0, "The action will not be applied to ", options) : helperMissing.call(depth0, "__", "The action will not be applied to ", options)))
|
|
201
|
+
+ " ";
|
|
202
|
+
if (helper = helpers.resourceType) { stack1 = helper.call(depth0, {hash:{},data:data}); }
|
|
203
|
+
else { helper = (depth0 && depth0.resourceType); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; }
|
|
204
|
+
buffer += escapeExpression(stack1)
|
|
205
|
+
+ "\n <span class=\"resource-label\">"
|
|
206
|
+
+ escapeExpression(((stack1 = ((stack1 = ((stack1 = (depth0 && depth0.deniedResources)),stack1 == null || stack1 === false ? stack1 : stack1[0])),stack1 == null || stack1 === false ? stack1 : stack1.label)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))
|
|
207
|
+
+ "</span>\n <span class=\"reason\">("
|
|
208
|
+
+ escapeExpression(((stack1 = ((stack1 = ((stack1 = (depth0 && depth0.deniedResources)),stack1 == null || stack1 === false ? stack1 : stack1[0])),stack1 == null || stack1 === false ? stack1 : stack1.reason)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))
|
|
209
|
+
+ ")</span>\n </p>\n </div>\n ";
|
|
210
|
+
return buffer;
|
|
211
|
+
}
|
|
290
212
|
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
213
|
+
function program10(depth0,data) {
|
|
214
|
+
|
|
215
|
+
var buffer = "", stack1, helper, options;
|
|
216
|
+
buffer += "\n <p>\n "
|
|
217
|
+
+ escapeExpression((helper = helpers.__ || (depth0 && depth0.__),options={hash:{},data:data},helper ? helper.call(depth0, "The action will not be applied to the following", options) : helperMissing.call(depth0, "__", "The action will not be applied to the following", options)))
|
|
218
|
+
+ " ";
|
|
219
|
+
if (helper = helpers.resourceTypes) { stack1 = helper.call(depth0, {hash:{},data:data}); }
|
|
220
|
+
else { helper = (depth0 && depth0.resourceTypes); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; }
|
|
221
|
+
buffer += escapeExpression(stack1)
|
|
222
|
+
+ ":\n </p>\n <ul class=\"plain no-applicables\">\n ";
|
|
223
|
+
stack1 = helpers.each.call(depth0, (depth0 && depth0.deniedResources), {hash:{},inverse:self.noop,fn:self.program(11, program11, data),data:data});
|
|
224
|
+
if(stack1 || stack1 === 0) { buffer += stack1; }
|
|
225
|
+
buffer += "\n </ul>\n ";
|
|
226
|
+
return buffer;
|
|
227
|
+
}
|
|
228
|
+
function program11(depth0,data) {
|
|
229
|
+
|
|
230
|
+
var buffer = "", stack1, helper;
|
|
231
|
+
buffer += "\n <li data-resource=\"";
|
|
232
|
+
if (helper = helpers.id) { stack1 = helper.call(depth0, {hash:{},data:data}); }
|
|
233
|
+
else { helper = (depth0 && depth0.id); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; }
|
|
234
|
+
buffer += escapeExpression(stack1)
|
|
235
|
+
+ "\">\n <span class=\"resource-label\">";
|
|
236
|
+
if (helper = helpers.label) { stack1 = helper.call(depth0, {hash:{},data:data}); }
|
|
237
|
+
else { helper = (depth0 && depth0.label); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; }
|
|
238
|
+
buffer += escapeExpression(stack1)
|
|
239
|
+
+ "</span>\n <span class=\"reason\">(";
|
|
240
|
+
if (helper = helpers.reason) { stack1 = helper.call(depth0, {hash:{},data:data}); }
|
|
241
|
+
else { helper = (depth0 && depth0.reason); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; }
|
|
242
|
+
buffer += escapeExpression(stack1)
|
|
243
|
+
+ ")</span>\n </li>\n ";
|
|
244
|
+
return buffer;
|
|
321
245
|
}
|
|
322
246
|
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
*
|
|
334
|
-
* You should have received a copy of the GNU General Public License
|
|
335
|
-
* along with this program; if not, write to the Free Software
|
|
336
|
-
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
337
|
-
*
|
|
338
|
-
* Copyright (c) 2015-2019 Open Assessment Technologies SA;
|
|
339
|
-
*/
|
|
340
|
-
/**
|
|
341
|
-
* Namespace used in events and shortcuts
|
|
342
|
-
* @type {String}
|
|
343
|
-
* @private
|
|
344
|
-
*/
|
|
247
|
+
function program13(depth0,data) {
|
|
248
|
+
|
|
249
|
+
var buffer = "", helper, options;
|
|
250
|
+
buffer += "\n <div class=\"reason\">\n <p>\n "
|
|
251
|
+
+ escapeExpression((helper = helpers.__ || (depth0 && depth0.__),options={hash:{},data:data},helper ? helper.call(depth0, "Please provide a reason", options) : helperMissing.call(depth0, "__", "Please provide a reason", options)))
|
|
252
|
+
+ ":\n </p>\n <div class=\"categories\"></div>\n <div class=\"comment\">\n <textarea placeholder=\""
|
|
253
|
+
+ escapeExpression((helper = helpers.__ || (depth0 && depth0.__),options={hash:{},data:data},helper ? helper.call(depth0, "comment...", options) : helperMissing.call(depth0, "__", "comment...", options)))
|
|
254
|
+
+ "\"></textarea>\n </div>\n </div>\n ";
|
|
255
|
+
return buffer;
|
|
256
|
+
}
|
|
345
257
|
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
258
|
+
function program15(depth0,data) {
|
|
259
|
+
|
|
260
|
+
var buffer = "", stack1, helper;
|
|
261
|
+
buffer += "\n <div class=\"message\">\n ";
|
|
262
|
+
stack1 = helpers['if'].call(depth0, (depth0 && depth0.icon), {hash:{},inverse:self.noop,fn:self.program(16, program16, data),data:data});
|
|
263
|
+
if(stack1 || stack1 === 0) { buffer += stack1; }
|
|
264
|
+
buffer += "\n ";
|
|
265
|
+
if (helper = helpers.message) { stack1 = helper.call(depth0, {hash:{},data:data}); }
|
|
266
|
+
else { helper = (depth0 && depth0.message); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; }
|
|
267
|
+
buffer += escapeExpression(stack1)
|
|
268
|
+
+ "\n </div>\n ";
|
|
269
|
+
return buffer;
|
|
270
|
+
}
|
|
271
|
+
function program16(depth0,data) {
|
|
272
|
+
|
|
273
|
+
var buffer = "", stack1, helper;
|
|
274
|
+
buffer += "\n <span class=\"icon icon-";
|
|
275
|
+
if (helper = helpers.icon) { stack1 = helper.call(depth0, {hash:{},data:data}); }
|
|
276
|
+
else { helper = (depth0 && depth0.icon); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; }
|
|
277
|
+
buffer += escapeExpression(stack1)
|
|
278
|
+
+ "\"></span>\n ";
|
|
279
|
+
return buffer;
|
|
280
|
+
}
|
|
364
281
|
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
282
|
+
buffer += "<div class=\"bulk-action-popup\">\n <h2 class=\"title\">"
|
|
283
|
+
+ escapeExpression((helper = helpers.__ || (depth0 && depth0.__),options={hash:{},data:data},helper ? helper.call(depth0, "Action", options) : helperMissing.call(depth0, "__", "Action", options)))
|
|
284
|
+
+ ": ";
|
|
285
|
+
if (helper = helpers.actionName) { stack1 = helper.call(depth0, {hash:{},data:data}); }
|
|
286
|
+
else { helper = (depth0 && depth0.actionName); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; }
|
|
287
|
+
buffer += escapeExpression(stack1)
|
|
288
|
+
+ "</h2>\n\n ";
|
|
289
|
+
stack1 = helpers['if'].call(depth0, (depth0 && depth0.resourceCount), {hash:{},inverse:self.noop,fn:self.program(1, program1, data),data:data});
|
|
290
|
+
if(stack1 || stack1 === 0) { buffer += stack1; }
|
|
291
|
+
buffer += "\n\n ";
|
|
292
|
+
stack1 = helpers['if'].call(depth0, ((stack1 = (depth0 && depth0.deniedResources)),stack1 == null || stack1 === false ? stack1 : stack1.length), {hash:{},inverse:self.noop,fn:self.program(7, program7, data),data:data});
|
|
293
|
+
if(stack1 || stack1 === 0) { buffer += stack1; }
|
|
294
|
+
buffer += "\n\n ";
|
|
295
|
+
stack1 = helpers['if'].call(depth0, (depth0 && depth0.reason), {hash:{},inverse:self.noop,fn:self.program(13, program13, data),data:data});
|
|
296
|
+
if(stack1 || stack1 === 0) { buffer += stack1; }
|
|
297
|
+
buffer += "\n\n ";
|
|
298
|
+
stack1 = helpers['if'].call(depth0, (depth0 && depth0.message), {hash:{},inverse:self.noop,fn:self.program(15, program15, data),data:data});
|
|
299
|
+
if(stack1 || stack1 === 0) { buffer += stack1; }
|
|
300
|
+
buffer += "\n\n <div class=\"actions\">\n <button class=\"btn btn-info small done\">"
|
|
301
|
+
+ escapeExpression((helper = helpers.__ || (depth0 && depth0.__),options={hash:{},data:data},helper ? helper.call(depth0, "OK", options) : helperMissing.call(depth0, "__", "OK", options)))
|
|
302
|
+
+ "</button>\n <a href=\"#\" class=\"btn cancel\" title=\""
|
|
303
|
+
+ escapeExpression((helper = helpers.__ || (depth0 && depth0.__),options={hash:{},data:data},helper ? helper.call(depth0, "cancel the action", options) : helperMissing.call(depth0, "__", "cancel the action", options)))
|
|
304
|
+
+ "\">"
|
|
305
|
+
+ escapeExpression((helper = helpers.__ || (depth0 && depth0.__),options={hash:{},data:data},helper ? helper.call(depth0, "cancel", options) : helperMissing.call(depth0, "__", "cancel", options)))
|
|
306
|
+
+ "</a>\n </div>\n\n</div>";
|
|
307
|
+
return buffer;
|
|
308
|
+
});
|
|
309
|
+
function layoutTpl(data, options, asString) {
|
|
310
|
+
var html = Template(data, options);
|
|
311
|
+
return (asString || true) ? html : $(html);
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
/**
|
|
315
|
+
* This program is free software; you can redistribute it and/or
|
|
316
|
+
* modify it under the terms of the GNU General Public License
|
|
317
|
+
* as published by the Free Software Foundation; under version 2
|
|
318
|
+
* of the License (non-upgradable).
|
|
319
|
+
*
|
|
320
|
+
* This program is distributed in the hope that it will be useful,
|
|
321
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
322
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
323
|
+
* GNU General Public License for more details.
|
|
324
|
+
*
|
|
325
|
+
* You should have received a copy of the GNU General Public License
|
|
326
|
+
* along with this program; if not, write to the Free Software
|
|
327
|
+
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
328
|
+
*
|
|
329
|
+
* Copyright (c) 2015-2019 Open Assessment Technologies SA;
|
|
330
|
+
*/
|
|
331
|
+
/**
|
|
332
|
+
* Namespace used in events and shortcuts
|
|
333
|
+
* @type {String}
|
|
334
|
+
* @private
|
|
335
|
+
*/
|
|
336
|
+
|
|
337
|
+
var _ns = 'bulk-action-popup';
|
|
338
|
+
/**
|
|
339
|
+
* Builds an instance of the bulkActionPopup component
|
|
340
|
+
*
|
|
341
|
+
* @param {Object} config
|
|
342
|
+
* @param {jQuery} config.renderTo - the jQuery container it should be rendered to
|
|
343
|
+
* @param {String} config.actionName - the action name (use in the title text)
|
|
344
|
+
* @param {String} config.resourceType - the name of the resource type (use in the text)
|
|
345
|
+
* @param {Boolean} [config.allowShortcuts] - allow keyboard shortcuts (Esc to cancel, Enter to validate)
|
|
346
|
+
* @param {String} [config.resourceTypes] - the name of the resource type in plural (use in the text)
|
|
347
|
+
* @param {Boolean} [config.reason] - defines if the reason section should be displayed or not
|
|
348
|
+
* @param {Function} [config.categoriesSelector] - callback renderer for categories
|
|
349
|
+
* @param {Array} config.allowedResources - list of allowed resources to be displayed
|
|
350
|
+
* @param {Array} [config.deniedResources] - list of denied resources to be displayed
|
|
351
|
+
* @param {String} config.message - message or warning (will be shown at the bottom of the popup)
|
|
352
|
+
* @param {String} config.icon - icon from the TAO font (will be shown before the message)
|
|
353
|
+
* @returns {bulkActionPopup}
|
|
354
|
+
*/
|
|
355
|
+
|
|
356
|
+
function bulkActionPopupFactory(config) {
|
|
357
|
+
//private object to hold the state of edition
|
|
358
|
+
var state = {
|
|
359
|
+
reasons: null,
|
|
360
|
+
comment: ''
|
|
361
|
+
};
|
|
362
|
+
var instance = component({
|
|
363
|
+
/**
|
|
364
|
+
* Validates the dialog, and closes it (action performed when hitting the Ok button)
|
|
365
|
+
* @returns {Boolean} Returns `true` if the dialog has been successively validated (and closed)
|
|
366
|
+
*/
|
|
367
|
+
validate: function validate() {
|
|
368
|
+
var $element = this.getElement();
|
|
388
369
|
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
cancel() {
|
|
398
|
-
this.trigger('cancel');
|
|
399
|
-
this.destroy();
|
|
370
|
+
if ($element) {
|
|
371
|
+
$$1('.feedback-error', $element).remove();
|
|
372
|
+
|
|
373
|
+
if (!checkRequiredFields($element)) {
|
|
374
|
+
var $error = $$1('<div class="feedback-error small"></div>').text(__('All fields are required'));
|
|
375
|
+
$element.find('.actions').prepend($error);
|
|
376
|
+
return false;
|
|
377
|
+
}
|
|
400
378
|
}
|
|
401
379
|
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
380
|
+
this.trigger('ok', state);
|
|
381
|
+
this.destroy();
|
|
382
|
+
return true;
|
|
383
|
+
},
|
|
406
384
|
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
385
|
+
/**
|
|
386
|
+
* Cancels and closes the dialog
|
|
387
|
+
*/
|
|
388
|
+
cancel: function cancel() {
|
|
389
|
+
this.trigger('cancel');
|
|
390
|
+
this.destroy();
|
|
391
|
+
}
|
|
392
|
+
}).setTemplate(layoutTpl) // uninstalls the component
|
|
393
|
+
.on('destroy', function () {
|
|
394
|
+
// allows all registered shortcuts to be triggered and disables the dialog shortcuts
|
|
395
|
+
globalShortcut.enable();
|
|
396
|
+
|
|
397
|
+
if (this.dialogShortcut) {
|
|
398
|
+
this.dialogShortcut.disable();
|
|
399
|
+
this.dialogShortcut.clear();
|
|
400
|
+
this.dialogShortcut = null;
|
|
401
|
+
}
|
|
412
402
|
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
403
|
+
if (this.navigator) {
|
|
404
|
+
this.navigator.destroy();
|
|
405
|
+
this.navigator = null;
|
|
406
|
+
}
|
|
417
407
|
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
408
|
+
this.getElement().removeClass('modal').modal('destroy');
|
|
409
|
+
}) // event triggered when the OK button has been clicked or the related shortcut has been used
|
|
410
|
+
.on('action-ok', function () {
|
|
411
|
+
this.validate();
|
|
412
|
+
}) // event triggered when the Cancel button has been clicked or the related shortcut has been used
|
|
413
|
+
.on('action-cancel', function () {
|
|
414
|
+
this.cancel();
|
|
415
|
+
}) // renders the component
|
|
416
|
+
.on('render', function () {
|
|
417
|
+
var _this = this;
|
|
418
|
+
|
|
419
|
+
var $element = this.getElement();
|
|
420
|
+
initModal({
|
|
421
|
+
disableEscape: true,
|
|
422
|
+
width: this.config.single && !this.config.deniedResources.length && !this.config.reason ? 600 : 800
|
|
423
|
+
});
|
|
424
|
+
|
|
425
|
+
if (_.isObject(this.config.categoriesSelector)) {
|
|
426
|
+
var $reason = $element.find('.reason').children('.categories');
|
|
427
|
+
this.config.categoriesSelector.render($reason);
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
$element.on(namespaceHelper.namespaceAll('selected.cascading-combobox', _ns), function (e, reasons) {
|
|
431
|
+
state.reasons = reasons;
|
|
432
432
|
|
|
433
|
-
if (
|
|
434
|
-
|
|
435
|
-
|
|
433
|
+
if (_this.config.allowShortcuts) {
|
|
434
|
+
// ensure the keyboard navigation is taking care of the possible new fields
|
|
435
|
+
initNavigator();
|
|
436
436
|
}
|
|
437
437
|
|
|
438
|
-
|
|
439
|
-
|
|
438
|
+
_this.trigger('change', state);
|
|
439
|
+
}).on(namespaceHelper.namespaceAll('change', _ns), 'textarea', function (e) {
|
|
440
|
+
state.comment = $$1(e.currentTarget).val();
|
|
440
441
|
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
}
|
|
442
|
+
_this.trigger('change', state);
|
|
443
|
+
}).on(namespaceHelper.namespaceAll('click', _ns), '.actions .done', function (e) {
|
|
444
|
+
e.preventDefault();
|
|
445
445
|
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
this.trigger('change', state);
|
|
450
|
-
}).on(namespaceHelper.namespaceAll('click', _ns), '.actions .done', e => {
|
|
451
|
-
e.preventDefault();
|
|
452
|
-
this.trigger('action-ok');
|
|
453
|
-
}).on(namespaceHelper.namespaceAll('click', _ns), '.actions .cancel', e => {
|
|
454
|
-
e.preventDefault();
|
|
455
|
-
this.trigger('action-cancel');
|
|
456
|
-
});
|
|
446
|
+
_this.trigger('action-ok');
|
|
447
|
+
}).on(namespaceHelper.namespaceAll('click', _ns), '.actions .cancel', function (e) {
|
|
448
|
+
e.preventDefault();
|
|
457
449
|
|
|
458
|
-
|
|
459
|
-
// install the keyboard navigation
|
|
460
|
-
initNavigator(); // prevents all registered shortcuts to be triggered and activate the dialog shortcuts
|
|
461
|
-
|
|
462
|
-
globalShortcut.disable();
|
|
463
|
-
this.dialogShortcut = shortcutRegistry($$1('body'), {
|
|
464
|
-
avoidInput: true,
|
|
465
|
-
propagate: false,
|
|
466
|
-
prevent: true
|
|
467
|
-
}) // prevents the TAB key to be used to move outside the dialog box, but handles navigation
|
|
468
|
-
.add(namespaceHelper.namespaceAll('Tab', _ns, true), () => {
|
|
469
|
-
this.navigator.next();
|
|
470
|
-
}, {
|
|
471
|
-
avoidInput: false
|
|
472
|
-
}).add(namespaceHelper.namespaceAll('Shift+Tab', _ns, true), () => {
|
|
473
|
-
this.navigator.previous();
|
|
474
|
-
}, {
|
|
475
|
-
avoidInput: false
|
|
476
|
-
}) // handles the dialog's shortcuts: just fire the action using the event loop
|
|
477
|
-
.add(namespaceHelper.namespaceAll('esc', _ns, true), function (e, shortcut) {
|
|
478
|
-
instance.trigger('action-cancel', shortcut);
|
|
479
|
-
}).add(namespaceHelper.namespaceAll('enter', _ns, true), function (e, shortcut) {
|
|
480
|
-
instance.trigger('action-ok', shortcut);
|
|
481
|
-
});
|
|
482
|
-
}
|
|
450
|
+
_this.trigger('action-cancel');
|
|
483
451
|
});
|
|
484
|
-
/**
|
|
485
|
-
* Validates that all required fields have been filled
|
|
486
|
-
* @param {jQuery} $container
|
|
487
|
-
* @returns {Boolean}
|
|
488
|
-
*/
|
|
489
452
|
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
453
|
+
if (this.config.allowShortcuts) {
|
|
454
|
+
// install the keyboard navigation
|
|
455
|
+
initNavigator(); // prevents all registered shortcuts to be triggered and activate the dialog shortcuts
|
|
456
|
+
|
|
457
|
+
globalShortcut.disable();
|
|
458
|
+
this.dialogShortcut = shortcutRegistry($$1('body'), {
|
|
459
|
+
avoidInput: true,
|
|
460
|
+
propagate: false,
|
|
461
|
+
prevent: true
|
|
462
|
+
}) // prevents the TAB key to be used to move outside the dialog box, but handles navigation
|
|
463
|
+
.add(namespaceHelper.namespaceAll('Tab', _ns, true), function () {
|
|
464
|
+
_this.navigator.next();
|
|
465
|
+
}, {
|
|
466
|
+
avoidInput: false
|
|
467
|
+
}).add(namespaceHelper.namespaceAll('Shift+Tab', _ns, true), function () {
|
|
468
|
+
_this.navigator.previous();
|
|
469
|
+
}, {
|
|
470
|
+
avoidInput: false
|
|
471
|
+
}) // handles the dialog's shortcuts: just fire the action using the event loop
|
|
472
|
+
.add(namespaceHelper.namespaceAll('esc', _ns, true), function (e, shortcut) {
|
|
473
|
+
instance.trigger('action-cancel', shortcut);
|
|
474
|
+
}).add(namespaceHelper.namespaceAll('enter', _ns, true), function (e, shortcut) {
|
|
475
|
+
instance.trigger('action-ok', shortcut);
|
|
476
|
+
});
|
|
494
477
|
}
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
478
|
+
});
|
|
479
|
+
/**
|
|
480
|
+
* Validates that all required fields have been filled
|
|
481
|
+
* @param {jQuery} $container
|
|
482
|
+
* @returns {Boolean}
|
|
483
|
+
*/
|
|
500
484
|
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
485
|
+
function checkRequiredFields($container) {
|
|
486
|
+
return $$1('select, textarea', $container).filter(function () {
|
|
487
|
+
return $$1.trim($$1(this).val()).length === 0;
|
|
488
|
+
}).length === 0;
|
|
489
|
+
}
|
|
490
|
+
/**
|
|
491
|
+
* Adds the form into a popup and displays it
|
|
492
|
+
* @param {Object} modalConfig
|
|
493
|
+
*/
|
|
510
494
|
|
|
511
495
|
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
group: $element,
|
|
518
|
-
// the dialog is always set as first component, so ensure to start on the first field
|
|
519
|
-
defaultPosition: 1,
|
|
520
|
-
// take all input fields and the dialog as navigable components
|
|
521
|
-
// but ignore buttons and select2 hidden fields
|
|
522
|
-
elements: navigableDomElement.createFromDoms($element.find(':input:not(button,select.select2-offscreen)').add($element))
|
|
523
|
-
}).on('activate', function (cursor, target) {
|
|
524
|
-
if ($$1(target).is($element)) {
|
|
525
|
-
instance.validate();
|
|
526
|
-
}
|
|
527
|
-
}) // put the focus on the keyboard navigation, to ensure the first field is selected
|
|
528
|
-
// otherwise the user will have to hit twice the tab key before selecting it
|
|
529
|
-
.focus();
|
|
530
|
-
} //compute extra config data (essentially for the template)
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
return instance.init(_.defaults(config, {
|
|
534
|
-
deniedResources: [],
|
|
535
|
-
reason: false,
|
|
536
|
-
allowShortcuts: true,
|
|
537
|
-
reasonRequired: false,
|
|
538
|
-
resourceCount: config.allowedResources.length,
|
|
539
|
-
single: config.allowedResources.length === 1,
|
|
540
|
-
singleDenied: config.deniedResources && config.deniedResources.length === 1,
|
|
541
|
-
resourceTypes: `${config.resourceType}s`
|
|
542
|
-
}));
|
|
496
|
+
function initModal(modalConfig) {
|
|
497
|
+
instance.getElement().addClass('modal').on('closed.modal', function () {
|
|
498
|
+
// always destroy the widget when closing
|
|
499
|
+
instance.destroy();
|
|
500
|
+
}).modal(modalConfig).focus();
|
|
543
501
|
}
|
|
502
|
+
/**
|
|
503
|
+
* Sets a keyboard navigator on the dialog to take care of TAB navigation
|
|
504
|
+
*/
|
|
544
505
|
|
|
545
|
-
|
|
506
|
+
|
|
507
|
+
function initNavigator() {
|
|
508
|
+
var $element = instance.getElement();
|
|
509
|
+
instance.navigator = keyNavigator({
|
|
510
|
+
id: _ns,
|
|
511
|
+
loop: true,
|
|
512
|
+
group: $element,
|
|
513
|
+
// the dialog is always set as first component, so ensure to start on the first field
|
|
514
|
+
defaultPosition: 1,
|
|
515
|
+
// take all input fields and the dialog as navigable components
|
|
516
|
+
// but ignore buttons and select2 hidden fields
|
|
517
|
+
elements: navigableDomElement.createFromDoms($element.find(':input:not(button,select.select2-offscreen)').add($element))
|
|
518
|
+
}).on('activate', function (cursor, target) {
|
|
519
|
+
if ($$1(target).is($element)) {
|
|
520
|
+
instance.validate();
|
|
521
|
+
}
|
|
522
|
+
}) // put the focus on the keyboard navigation, to ensure the first field is selected
|
|
523
|
+
// otherwise the user will have to hit twice the tab key before selecting it
|
|
524
|
+
.focus();
|
|
525
|
+
} //compute extra config data (essentially for the template)
|
|
526
|
+
|
|
527
|
+
|
|
528
|
+
return instance.init(_.defaults(config, {
|
|
529
|
+
deniedResources: [],
|
|
530
|
+
reason: false,
|
|
531
|
+
allowShortcuts: true,
|
|
532
|
+
reasonRequired: false,
|
|
533
|
+
resourceCount: config.allowedResources.length,
|
|
534
|
+
single: config.allowedResources.length === 1,
|
|
535
|
+
singleDenied: config.deniedResources && config.deniedResources.length === 1,
|
|
536
|
+
resourceTypes: "".concat(config.resourceType, "s")
|
|
537
|
+
}));
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
return bulkActionPopupFactory;
|
|
546
541
|
|
|
547
542
|
});
|