@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/resourcemgr.js
CHANGED
|
@@ -1,349 +1,331 @@
|
|
|
1
1
|
define(['jquery', 'lodash', 'core/pluginifier', 'ui/resourcemgr/fileBrowser', 'ui/resourcemgr/filePreview', 'ui/resourcemgr/fileSelector', 'handlebars', 'i18n', 'lib/dompurify/purify', 'ui/modal', 'css!ui/resourcemgr/css/resourcemgr.css'], function ($$1, _, Pluginifier, fileBrowser, filePreview, fileSelector, Handlebars, __, DOMPurify, modal, resourcemgr_css) { 'use strict';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
3
|
+
$$1 = $$1 && Object.prototype.hasOwnProperty.call($$1, 'default') ? $$1['default'] : $$1;
|
|
4
|
+
_ = _ && Object.prototype.hasOwnProperty.call(_, 'default') ? _['default'] : _;
|
|
5
|
+
Pluginifier = Pluginifier && Object.prototype.hasOwnProperty.call(Pluginifier, 'default') ? Pluginifier['default'] : Pluginifier;
|
|
6
|
+
fileBrowser = fileBrowser && Object.prototype.hasOwnProperty.call(fileBrowser, 'default') ? fileBrowser['default'] : fileBrowser;
|
|
7
|
+
filePreview = filePreview && Object.prototype.hasOwnProperty.call(filePreview, 'default') ? filePreview['default'] : filePreview;
|
|
8
|
+
fileSelector = fileSelector && Object.prototype.hasOwnProperty.call(fileSelector, 'default') ? fileSelector['default'] : fileSelector;
|
|
9
|
+
Handlebars = Handlebars && Object.prototype.hasOwnProperty.call(Handlebars, 'default') ? Handlebars['default'] : Handlebars;
|
|
10
|
+
__ = __ && Object.prototype.hasOwnProperty.call(__, 'default') ? __['default'] : __;
|
|
11
|
+
DOMPurify = DOMPurify && Object.prototype.hasOwnProperty.call(DOMPurify, 'default') ? DOMPurify['default'] : DOMPurify;
|
|
12
|
+
|
|
13
|
+
function _typeof(obj) {
|
|
14
|
+
"@babel/helpers - typeof";
|
|
15
|
+
|
|
16
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
|
|
17
|
+
return typeof obj;
|
|
18
|
+
} : function (obj) {
|
|
19
|
+
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
20
|
+
}, _typeof(obj);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function Helpers0 (hb) {
|
|
24
|
+
//register a i18n helper
|
|
25
|
+
hb.registerHelper('__', function (key) {
|
|
26
|
+
return __(key);
|
|
27
|
+
});
|
|
13
28
|
/**
|
|
14
|
-
*
|
|
15
|
-
* modify it under the terms of the GNU General Public License
|
|
16
|
-
* as published by the Free Software Foundation; under version 2
|
|
17
|
-
* of the License (non-upgradable).
|
|
18
|
-
*
|
|
19
|
-
* This program is distributed in the hope that it will be useful,
|
|
20
|
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
21
|
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
22
|
-
* GNU General Public License for more details.
|
|
23
|
-
*
|
|
24
|
-
* You should have received a copy of the GNU General Public License
|
|
25
|
-
* along with this program; if not, write to the Free Software
|
|
26
|
-
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
27
|
-
*
|
|
28
|
-
* Copyright (c) 2013-2019 (original work) Open Assessment Technologies SA (under the project TAO-PRODUCT);
|
|
29
|
-
*
|
|
29
|
+
* Register dompurify helper
|
|
30
30
|
*
|
|
31
|
+
* https://github.com/cure53/DOMPurify
|
|
32
|
+
* with config SAFE_FOR_TEMPLATES: true
|
|
33
|
+
* to make output safe for template systems
|
|
31
34
|
*/
|
|
32
|
-
function Helpers0 (hb) {
|
|
33
|
-
//register a i18n helper
|
|
34
|
-
hb.registerHelper('__', function (key) {
|
|
35
|
-
return __(key);
|
|
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
|
-
|
|
45
|
-
hb.registerHelper('dompurify', function (context) {
|
|
46
|
-
return DOMPurify.sanitize(context);
|
|
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
|
-
|
|
57
|
-
hb.registerHelper('join', function (arr, keyValueGlue, fragmentGlue, wrapper) {
|
|
58
|
-
var fragments = [];
|
|
59
|
-
keyValueGlue = typeof keyValueGlue === 'string' ? keyValueGlue : undefined;
|
|
60
|
-
fragmentGlue = typeof fragmentGlue === 'string' ? fragmentGlue : ' ';
|
|
61
|
-
wrapper = typeof wrapper === 'string' ? wrapper : '"';
|
|
62
|
-
|
|
63
|
-
_.forIn(arr, function (value, key) {
|
|
64
|
-
var fragment = '';
|
|
65
|
-
|
|
66
|
-
if (value !== null || value !== undefined) {
|
|
67
|
-
if (typeof value === 'boolean') {
|
|
68
|
-
value = value ? 'true' : 'false';
|
|
69
|
-
} else if (typeof value === 'object') {
|
|
70
|
-
value = _.values(value).join(' ');
|
|
71
|
-
}
|
|
72
|
-
} else {
|
|
73
|
-
value = '';
|
|
74
|
-
}
|
|
75
35
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
36
|
+
hb.registerHelper('dompurify', function (context) {
|
|
37
|
+
return DOMPurify.sanitize(context);
|
|
38
|
+
});
|
|
39
|
+
/**
|
|
40
|
+
* Register join helper
|
|
41
|
+
*
|
|
42
|
+
* Example :
|
|
43
|
+
* var values = {a:v1, b:v2, c:v3};
|
|
44
|
+
* Using {{{join attributes '=' ' ' '"'}}} will return : a="v1" b="v2" c="v3"
|
|
45
|
+
* Using {{{join values null ' or ' '*'}}} will return : *v1* or *v2* or *v3*
|
|
46
|
+
*/
|
|
79
47
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
48
|
+
hb.registerHelper('join', function (arr, keyValueGlue, fragmentGlue, wrapper) {
|
|
49
|
+
var fragments = [];
|
|
50
|
+
keyValueGlue = typeof keyValueGlue === 'string' ? keyValueGlue : undefined;
|
|
51
|
+
fragmentGlue = typeof fragmentGlue === 'string' ? fragmentGlue : ' ';
|
|
52
|
+
wrapper = typeof wrapper === 'string' ? wrapper : '"';
|
|
83
53
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
//it also adds a local variable "i" as the index in each iteration loop
|
|
54
|
+
_.forIn(arr, function (value, key) {
|
|
55
|
+
var fragment = '';
|
|
87
56
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
57
|
+
if (value !== null || value !== undefined) {
|
|
58
|
+
if (typeof value === 'boolean') {
|
|
59
|
+
value = value ? 'true' : 'false';
|
|
60
|
+
} else if (_typeof(value) === 'object') {
|
|
61
|
+
value = _.values(value).join(' ');
|
|
62
|
+
}
|
|
63
|
+
} else {
|
|
64
|
+
value = '';
|
|
65
|
+
}
|
|
93
66
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
i: i
|
|
97
|
-
}));
|
|
67
|
+
if (keyValueGlue !== undefined) {
|
|
68
|
+
fragment += key + keyValueGlue;
|
|
98
69
|
}
|
|
99
70
|
|
|
100
|
-
|
|
71
|
+
fragment += wrapper + value + wrapper;
|
|
72
|
+
fragments.push(fragment);
|
|
101
73
|
});
|
|
102
|
-
hb.registerHelper('equal', function (var1, var2, options) {
|
|
103
|
-
if (var1 == var2) {
|
|
104
|
-
return options.fn(this);
|
|
105
|
-
} else {
|
|
106
|
-
return options.inverse(this);
|
|
107
|
-
}
|
|
108
|
-
}); // register a "get property" helper
|
|
109
|
-
// it gets the named property from the provided context
|
|
110
74
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
// it checks if value is in array
|
|
75
|
+
return fragments.join(fragmentGlue);
|
|
76
|
+
}); //register a classic "for loop" helper
|
|
77
|
+
//it also adds a local variable "i" as the index in each iteration loop
|
|
115
78
|
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
}
|
|
79
|
+
hb.registerHelper('for', function (startIndex, stopIndex, increment, options) {
|
|
80
|
+
var ret = '';
|
|
81
|
+
startIndex = parseInt(startIndex);
|
|
82
|
+
stopIndex = parseInt(stopIndex);
|
|
83
|
+
increment = parseInt(increment);
|
|
122
84
|
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
+ escapeExpression((helper = helpers.__ || (depth0 && depth0.__),options={hash:{},data:data},helper ? helper.call(depth0, "No files", options) : helperMissing.call(depth0, "__", "No files", options)))
|
|
145
|
-
+ "\n </div>\n\n <ul class=\"files\"></ul>\n\n <div class=\"file-upload-container\"></div>\n\n <div class=\"pagination-bottom\"></div>\n\n </section>\n\n <section class=\"file-preview\">\n\n <h1>"
|
|
146
|
-
+ escapeExpression((helper = helpers.__ || (depth0 && depth0.__),options={hash:{},data:data},helper ? helper.call(depth0, "Preview", options) : helperMissing.call(depth0, "__", "Preview", options)))
|
|
147
|
-
+ "</h1>\n\n <div class=\"previewer\">\n <p class=\"nopreview\"></p>\n </div>\n\n <h2 class=\"toggler\" data-toggle=\"~ .file-properties\">"
|
|
148
|
-
+ escapeExpression((helper = helpers.__ || (depth0 && depth0.__),options={hash:{},data:data},helper ? helper.call(depth0, "File Properties", options) : helperMissing.call(depth0, "__", "File Properties", options)))
|
|
149
|
-
+ "</h2>\n\n <div class=\"file-properties\">\n\n <div class=\"grid-row\">\n <div class=\"col-2\">\n "
|
|
150
|
-
+ escapeExpression((helper = helpers.__ || (depth0 && depth0.__),options={hash:{},data:data},helper ? helper.call(depth0, "Type", options) : helperMissing.call(depth0, "__", "Type", options)))
|
|
151
|
-
+ "\n </div>\n <div class=\"col-10 prop-type\"></div>\n </div>\n\n <div class=\"grid-row\">\n <div class=\"col-2\">\n "
|
|
152
|
-
+ escapeExpression((helper = helpers.__ || (depth0 && depth0.__),options={hash:{},data:data},helper ? helper.call(depth0, "Size", options) : helperMissing.call(depth0, "__", "Size", options)))
|
|
153
|
-
+ "\n </div>\n <div class=\"col-10 prop-size\"></div>\n </div>\n\n <div class=\"grid-row prop-url\">\n <div class=\"actions\">\n <a href=\"#\" download=\"\" target=\"_blank\" class=\"tlb-button-off download hidden\" title=\""
|
|
154
|
-
+ escapeExpression((helper = helpers.__ || (depth0 && depth0.__),options={hash:{},data:data},helper ? helper.call(depth0, "Download this file", options) : helperMissing.call(depth0, "__", "Download this file", options)))
|
|
155
|
-
+ "\">\n <button class=\"btn-info small\">\n <span class=\"icon-download\"></span>"
|
|
156
|
-
+ escapeExpression((helper = helpers.__ || (depth0 && depth0.__),options={hash:{},data:data},helper ? helper.call(depth0, "Download this file", options) : helperMissing.call(depth0, "__", "Download this file", options)))
|
|
157
|
-
+ "\n </button>\n </a>\n </div>\n </div>\n </div>\n\n <h2 class=\"toggler\" data-toggle=\"~ .actions\">"
|
|
158
|
-
+ escapeExpression((helper = helpers.__ || (depth0 && depth0.__),options={hash:{},data:data},helper ? helper.call(depth0, "Actions", options) : helperMissing.call(depth0, "__", "Actions", options)))
|
|
159
|
-
+ "</h2>\n\n <div class=\"actions\">\n <button class=\"btn-success select-action small\" disabled>\n <span class=\"icon-move-item\"></span>"
|
|
160
|
-
+ escapeExpression((helper = helpers.__ || (depth0 && depth0.__),options={hash:{},data:data},helper ? helper.call(depth0, "Select", options) : helperMissing.call(depth0, "__", "Select", options)))
|
|
161
|
-
+ "\n </button>\n </div>\n\n </section>\n\n </div>\n</div>\n";
|
|
162
|
-
return buffer;
|
|
163
|
-
});
|
|
164
|
-
function layout(data, options, asString) {
|
|
165
|
-
var html = Template(data, options);
|
|
166
|
-
return (asString || true) ? html : $(html);
|
|
167
|
-
}
|
|
85
|
+
for (var i = startIndex; i < stopIndex; i += increment) {
|
|
86
|
+
ret += options.fn(_.extend({}, this, {
|
|
87
|
+
i: i
|
|
88
|
+
}));
|
|
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
|
+
}); // register a "get property" helper
|
|
100
|
+
// it gets the named property from the provided context
|
|
101
|
+
|
|
102
|
+
hb.registerHelper('property', function (name, context) {
|
|
103
|
+
return context[name] || '';
|
|
104
|
+
}); // register an 'includes' helper
|
|
105
|
+
// it checks if value is in array
|
|
168
106
|
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
107
|
+
hb.registerHelper('includes', function (haystack, needle, options) {
|
|
108
|
+
if (_.contains(haystack, needle)) {
|
|
109
|
+
return options.fn(this);
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
if (!Helpers0.__initialized) {
|
|
115
|
+
Helpers0(Handlebars);
|
|
116
|
+
Helpers0.__initialized = true;
|
|
117
|
+
}
|
|
118
|
+
var Template = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) {
|
|
119
|
+
this.compilerInfo = [4,'>= 1.0.0'];
|
|
120
|
+
helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
|
|
121
|
+
var buffer = "", stack1, helper, options, functionType="function", escapeExpression=this.escapeExpression, helperMissing=helpers.helperMissing;
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
buffer += "<div class=\"resourcemgr modal\">\n\n <h2>";
|
|
125
|
+
if (helper = helpers.title) { stack1 = helper.call(depth0, {hash:{},data:data}); }
|
|
126
|
+
else { helper = (depth0 && depth0.title); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; }
|
|
127
|
+
buffer += escapeExpression(stack1)
|
|
128
|
+
+ "</h2>\n\n <div class=\"file-wrapper\">\n\n <!-- left section: items selection -->\n <section class=\"file-browser\">\n <h1>"
|
|
129
|
+
+ escapeExpression((helper = helpers.__ || (depth0 && depth0.__),options={hash:{},data:data},helper ? helper.call(depth0, "Browse resources", options) : helperMissing.call(depth0, "__", "Browse resources", options)))
|
|
130
|
+
+ "</h1>\n <div class=\"file-browser-wrapper\"></div>\n </section>\n\n <!-- test editor -->\n <section class=\"file-selector\">\n\n <h1>\n <div class=\"title lft\"></div>\n <div class=\"upload-switcher rgt\">\n <a href=\"#\" class=\"btn-info small upload hidden\"><span class=\"icon-add\"></span>"
|
|
131
|
+
+ escapeExpression((helper = helpers.__ || (depth0 && depth0.__),options={hash:{},data:data},helper ? helper.call(depth0, "Add file(s)", options) : helperMissing.call(depth0, "__", "Add file(s)", options)))
|
|
132
|
+
+ "</a>\n <a href=\"#\" class=\"btn-info small listing\"><span class=\"icon-undo\"></span>"
|
|
133
|
+
+ escapeExpression((helper = helpers.__ || (depth0 && depth0.__),options={hash:{},data:data},helper ? helper.call(depth0, "Back to listing", options) : helperMissing.call(depth0, "__", "Back to listing", options)))
|
|
134
|
+
+ "</a>\n </div>\n </h1>\n\n <div class=\"empty\">\n "
|
|
135
|
+
+ escapeExpression((helper = helpers.__ || (depth0 && depth0.__),options={hash:{},data:data},helper ? helper.call(depth0, "No files", options) : helperMissing.call(depth0, "__", "No files", options)))
|
|
136
|
+
+ "\n </div>\n\n <ul class=\"files\"></ul>\n\n <div class=\"file-upload-container\"></div>\n\n <div class=\"pagination-bottom\"></div>\n\n </section>\n\n <section class=\"file-preview\">\n\n <h1>"
|
|
137
|
+
+ escapeExpression((helper = helpers.__ || (depth0 && depth0.__),options={hash:{},data:data},helper ? helper.call(depth0, "Preview", options) : helperMissing.call(depth0, "__", "Preview", options)))
|
|
138
|
+
+ "</h1>\n\n <div class=\"previewer\">\n <p class=\"nopreview\"></p>\n </div>\n\n <h2 class=\"toggler\" data-toggle=\"~ .file-properties\">"
|
|
139
|
+
+ escapeExpression((helper = helpers.__ || (depth0 && depth0.__),options={hash:{},data:data},helper ? helper.call(depth0, "File Properties", options) : helperMissing.call(depth0, "__", "File Properties", options)))
|
|
140
|
+
+ "</h2>\n\n <div class=\"file-properties\">\n\n <div class=\"grid-row\">\n <div class=\"col-2\">\n "
|
|
141
|
+
+ escapeExpression((helper = helpers.__ || (depth0 && depth0.__),options={hash:{},data:data},helper ? helper.call(depth0, "Type", options) : helperMissing.call(depth0, "__", "Type", options)))
|
|
142
|
+
+ "\n </div>\n <div class=\"col-10 prop-type\"></div>\n </div>\n\n <div class=\"grid-row\">\n <div class=\"col-2\">\n "
|
|
143
|
+
+ escapeExpression((helper = helpers.__ || (depth0 && depth0.__),options={hash:{},data:data},helper ? helper.call(depth0, "Size", options) : helperMissing.call(depth0, "__", "Size", options)))
|
|
144
|
+
+ "\n </div>\n <div class=\"col-10 prop-size\"></div>\n </div>\n\n <div class=\"grid-row prop-url\">\n <div class=\"actions\">\n <a href=\"#\" download=\"\" target=\"_blank\" class=\"tlb-button-off download hidden\" title=\""
|
|
145
|
+
+ escapeExpression((helper = helpers.__ || (depth0 && depth0.__),options={hash:{},data:data},helper ? helper.call(depth0, "Download this file", options) : helperMissing.call(depth0, "__", "Download this file", options)))
|
|
146
|
+
+ "\">\n <button class=\"btn-info small\">\n <span class=\"icon-download\"></span>"
|
|
147
|
+
+ escapeExpression((helper = helpers.__ || (depth0 && depth0.__),options={hash:{},data:data},helper ? helper.call(depth0, "Download this file", options) : helperMissing.call(depth0, "__", "Download this file", options)))
|
|
148
|
+
+ "\n </button>\n </a>\n </div>\n </div>\n </div>\n\n <h2 class=\"toggler\" data-toggle=\"~ .actions\">"
|
|
149
|
+
+ escapeExpression((helper = helpers.__ || (depth0 && depth0.__),options={hash:{},data:data},helper ? helper.call(depth0, "Actions", options) : helperMissing.call(depth0, "__", "Actions", options)))
|
|
150
|
+
+ "</h2>\n\n <div class=\"actions\">\n <button class=\"btn-success select-action small\" disabled>\n <span class=\"icon-move-item\"></span>"
|
|
151
|
+
+ escapeExpression((helper = helpers.__ || (depth0 && depth0.__),options={hash:{},data:data},helper ? helper.call(depth0, "Select", options) : helperMissing.call(depth0, "__", "Select", options)))
|
|
152
|
+
+ "\n </button>\n </div>\n\n </section>\n\n </div>\n</div>\n";
|
|
153
|
+
return buffer;
|
|
154
|
+
});
|
|
155
|
+
function layout(data, options, asString) {
|
|
156
|
+
var html = Template(data, options);
|
|
157
|
+
return (asString || true) ? html : $(html);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
var ns = 'resourcemgr';
|
|
161
|
+
var dataNs = 'ui.' + ns;
|
|
162
|
+
var defaults = {
|
|
163
|
+
mediaSources: [{
|
|
164
|
+
root: 'local',
|
|
165
|
+
path: '/'
|
|
166
|
+
}],
|
|
167
|
+
open: true,
|
|
168
|
+
appendContainer: '.tao-scope:first',
|
|
169
|
+
title: ''
|
|
170
|
+
};
|
|
171
|
+
/**
|
|
172
|
+
* The ResourceMgr component helps you to browse and select external resources.
|
|
173
|
+
* @exports ui/resourcemgr
|
|
174
|
+
*/
|
|
175
|
+
|
|
176
|
+
var resourceMgr = {
|
|
180
177
|
/**
|
|
181
|
-
*
|
|
182
|
-
*
|
|
178
|
+
* Initialize the plugin.
|
|
179
|
+
*
|
|
180
|
+
* Called the jQuery way once registered by the Pluginifier.
|
|
181
|
+
* @example $('selector').resourcemgr({
|
|
182
|
+
*
|
|
183
|
+
* });
|
|
184
|
+
*
|
|
185
|
+
* @constructor
|
|
186
|
+
* @param {Object} options - the plugin options
|
|
187
|
+
* @param {Sring|Boolean} [options.bindEvent = 'click'] - the event that trigger the toggling
|
|
188
|
+
* @param {String} options.url - the URL of the service used to retrieve the resources.
|
|
189
|
+
* @fires ResourceMgr#create.resourcemgr
|
|
190
|
+
* @returns {jQueryElement} for chaining
|
|
183
191
|
*/
|
|
192
|
+
init: function init(options) {
|
|
193
|
+
var self = resourceMgr; //get options using default
|
|
184
194
|
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
* Called the jQuery way once registered by the Pluginifier.
|
|
190
|
-
* @example $('selector').resourcemgr({
|
|
191
|
-
*
|
|
192
|
-
* });
|
|
193
|
-
*
|
|
194
|
-
* @constructor
|
|
195
|
-
* @param {Object} options - the plugin options
|
|
196
|
-
* @param {Sring|Boolean} [options.bindEvent = 'click'] - the event that trigger the toggling
|
|
197
|
-
* @param {String} options.url - the URL of the service used to retrieve the resources.
|
|
198
|
-
* @fires ResourceMgr#create.resourcemgr
|
|
199
|
-
* @returns {jQueryElement} for chaining
|
|
200
|
-
*/
|
|
201
|
-
init: function (options) {
|
|
202
|
-
var self = resourceMgr; //get options using default
|
|
203
|
-
|
|
204
|
-
options = _.defaults(options, defaults);
|
|
205
|
-
return this.each(function () {
|
|
206
|
-
var $elt = $$1(this);
|
|
207
|
-
var $target;
|
|
208
|
-
|
|
209
|
-
if (!$elt.data(dataNs)) {
|
|
210
|
-
//add data to the element
|
|
211
|
-
$elt.data(dataNs, options); //auto bind events configured in options
|
|
212
|
-
|
|
213
|
-
_.functions(options).forEach(function (eventName) {
|
|
214
|
-
$elt.on(eventName + '.' + ns, function () {
|
|
215
|
-
options[eventName].apply($elt, arguments);
|
|
216
|
-
});
|
|
217
|
-
});
|
|
218
|
-
|
|
219
|
-
$target = options.$target || self._createTarget($elt);
|
|
220
|
-
$target.modal({
|
|
221
|
-
startClosed: true,
|
|
222
|
-
minWidth: 'responsive'
|
|
223
|
-
}); //rethrow some events
|
|
195
|
+
options = _.defaults(options, defaults);
|
|
196
|
+
return this.each(function () {
|
|
197
|
+
var $elt = $$1(this);
|
|
198
|
+
var $target;
|
|
224
199
|
|
|
225
|
-
|
|
226
|
-
|
|
200
|
+
if (!$elt.data(dataNs)) {
|
|
201
|
+
//add data to the element
|
|
202
|
+
$elt.data(dataNs, options); //auto bind events configured in options
|
|
227
203
|
|
|
228
|
-
|
|
204
|
+
_.functions(options).forEach(function (eventName) {
|
|
205
|
+
$elt.on(eventName + '.' + ns, function () {
|
|
206
|
+
options[eventName].apply($elt, arguments);
|
|
229
207
|
});
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
208
|
+
});
|
|
209
|
+
|
|
210
|
+
$target = options.$target || self._createTarget($elt);
|
|
211
|
+
$target.modal({
|
|
212
|
+
startClosed: true,
|
|
213
|
+
minWidth: 'responsive'
|
|
214
|
+
}); //rethrow some events
|
|
215
|
+
|
|
216
|
+
$target.on('select.' + ns, function (e, files) {
|
|
217
|
+
self._close($elt);
|
|
218
|
+
|
|
219
|
+
$elt.trigger(e, [files]);
|
|
220
|
+
});
|
|
221
|
+
$target.on('closed.modal', function () {
|
|
222
|
+
$elt.trigger('close.' + ns);
|
|
223
|
+
}); //initialize the components
|
|
224
|
+
|
|
225
|
+
var $fileBrowser = $$1('.file-browser .file-browser-wrapper', $target);
|
|
226
|
+
|
|
227
|
+
if (options.mediaSourcesUrl) {
|
|
228
|
+
$$1.getJSON(options.mediaSourcesUrl).done(function (data) {
|
|
229
|
+
var mediaSources = data || defaults.mediaSources;
|
|
230
|
+
|
|
231
|
+
for (var i = 0; i < mediaSources.length; i++) {
|
|
232
|
+
options.root = mediaSources[i].root;
|
|
233
|
+
options.path = mediaSources[i].path;
|
|
234
|
+
$fileBrowser.append('<div class="' + options.root + '"><ul class="folders"></ul></div>');
|
|
235
|
+
fileBrowser(options);
|
|
236
|
+
}
|
|
237
|
+
}).fail(function () {
|
|
238
|
+
for (var i = 0; i < defaults.mediaSources.length; i++) {
|
|
239
|
+
options.root = defaults.mediaSources[i].root;
|
|
240
|
+
options.path = defaults.mediaSources[i].path;
|
|
241
|
+
$fileBrowser.append('<div class="' + options.root + '"><ul class="folders"></ul></div>');
|
|
242
|
+
fileBrowser(options);
|
|
243
|
+
}
|
|
244
|
+
});
|
|
245
|
+
} else if (options.path && options.root) {
|
|
246
|
+
$fileBrowser.append('<div class="' + options.root + '"><ul class="folders"></ul></div>');
|
|
247
|
+
fileBrowser(options);
|
|
248
|
+
}
|
|
266
249
|
|
|
267
|
-
|
|
250
|
+
$fileBrowser.find('li.root:last').addClass('active');
|
|
251
|
+
fileSelector(options);
|
|
252
|
+
filePreview(options);
|
|
253
|
+
/**
|
|
254
|
+
* The plugin have been created.
|
|
255
|
+
* @event ResourceMgr#create.resourcemgr
|
|
256
|
+
*/
|
|
268
257
|
|
|
269
|
-
|
|
270
|
-
self._open($elt);
|
|
271
|
-
}
|
|
272
|
-
} else {
|
|
273
|
-
options = $elt.data(dataNs);
|
|
258
|
+
$elt.trigger('create.' + ns, [$target[0]]);
|
|
274
259
|
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
}
|
|
260
|
+
if (options.open) {
|
|
261
|
+
self._open($elt);
|
|
278
262
|
}
|
|
279
|
-
}
|
|
280
|
-
|
|
281
|
-
_createTarget: function ($elt) {
|
|
282
|
-
var options = $elt.data(dataNs);
|
|
283
|
-
|
|
284
|
-
if (options) {
|
|
285
|
-
//create an identifier to the target content
|
|
286
|
-
options.targetId = 'resourcemgr-' + $$1(document).find('.resourcemgr').length; //generate
|
|
263
|
+
} else {
|
|
264
|
+
options = $elt.data(dataNs);
|
|
287
265
|
|
|
288
|
-
options
|
|
289
|
-
|
|
290
|
-
}
|
|
291
|
-
options.$target.attr('id', options.targetId).css('display', 'none').appendTo(options.appendContainer);
|
|
292
|
-
$elt.data(dataNs, options);
|
|
266
|
+
if (options.open) {
|
|
267
|
+
self._open($elt);
|
|
268
|
+
}
|
|
293
269
|
}
|
|
270
|
+
});
|
|
271
|
+
},
|
|
272
|
+
_createTarget: function _createTarget($elt) {
|
|
273
|
+
var options = $elt.data(dataNs);
|
|
274
|
+
|
|
275
|
+
if (options) {
|
|
276
|
+
//create an identifier to the target content
|
|
277
|
+
options.targetId = 'resourcemgr-' + $$1(document).find('.resourcemgr').length; //generate
|
|
278
|
+
|
|
279
|
+
options.$target = $$1(layout({
|
|
280
|
+
title: options.title || ''
|
|
281
|
+
}));
|
|
282
|
+
options.$target.attr('id', options.targetId).css('display', 'none').appendTo(options.appendContainer);
|
|
283
|
+
$elt.data(dataNs, options);
|
|
284
|
+
}
|
|
294
285
|
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
286
|
+
return options.$target;
|
|
287
|
+
},
|
|
288
|
+
_open: function _open($elt) {
|
|
289
|
+
var options = $elt.data(dataNs);
|
|
299
290
|
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
291
|
+
if (options && options.$target) {
|
|
292
|
+
options.$target.modal('open');
|
|
293
|
+
/**
|
|
294
|
+
* Open the resource manager.
|
|
295
|
+
* @event ResourceMgr#open.resourcemgr
|
|
296
|
+
*/
|
|
306
297
|
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
298
|
+
$elt.trigger('open.' + ns);
|
|
299
|
+
}
|
|
300
|
+
},
|
|
301
|
+
_close: function _close($elt) {
|
|
302
|
+
var options = $elt.data(dataNs);
|
|
303
|
+
|
|
304
|
+
if (options && options.$target) {
|
|
305
|
+
options.$target.modal('close');
|
|
306
|
+
}
|
|
307
|
+
},
|
|
308
|
+
|
|
309
|
+
/**
|
|
310
|
+
* Destroy completely the plugin.
|
|
311
|
+
*
|
|
312
|
+
* Called the jQuery way once registered by the Pluginifier.
|
|
313
|
+
* @example $('selector').resourcemgr('destroy');
|
|
314
|
+
* @public
|
|
315
|
+
*/
|
|
316
|
+
destroy: function destroy() {
|
|
317
|
+
this.each(function () {
|
|
318
|
+
var $elt = $$1(this);
|
|
311
319
|
var options = $elt.data(dataNs);
|
|
320
|
+
$elt.data(dataNs, null);
|
|
312
321
|
|
|
313
|
-
if (options && options
|
|
314
|
-
options
|
|
322
|
+
if (options.bindEvent !== undefined && options.bindEvent !== false) {
|
|
323
|
+
$elt.off(options.bindEvent);
|
|
315
324
|
}
|
|
316
|
-
},
|
|
317
|
-
|
|
318
|
-
/**
|
|
319
|
-
* Destroy completely the plugin.
|
|
320
|
-
*
|
|
321
|
-
* Called the jQuery way once registered by the Pluginifier.
|
|
322
|
-
* @example $('selector').resourcemgr('destroy');
|
|
323
|
-
* @public
|
|
324
|
-
*/
|
|
325
|
-
destroy: function () {
|
|
326
|
-
this.each(function () {
|
|
327
|
-
var $elt = $$1(this);
|
|
328
|
-
var options = $elt.data(dataNs);
|
|
329
|
-
$elt.data(dataNs, null);
|
|
330
|
-
|
|
331
|
-
if (options.bindEvent !== undefined && options.bindEvent !== false) {
|
|
332
|
-
$elt.off(options.bindEvent);
|
|
333
|
-
}
|
|
334
325
|
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
$$1(window).off('resize.resourcemgr');
|
|
339
|
-
/**
|
|
340
|
-
* The plugin have been destroyed.
|
|
341
|
-
* @event ResourceMgr#destroy.resourcemgr
|
|
342
|
-
*/
|
|
343
|
-
|
|
344
|
-
$elt.trigger('destroy.' + ns);
|
|
345
|
-
}).modal('close');
|
|
346
|
-
} else {
|
|
326
|
+
if (options.targetId) {
|
|
327
|
+
options.$target.on('closed.modal', function () {
|
|
328
|
+
$$1('#' + options.targetId).remove();
|
|
347
329
|
$$1(window).off('resize.resourcemgr');
|
|
348
330
|
/**
|
|
349
331
|
* The plugin have been destroyed.
|
|
@@ -351,11 +333,20 @@ define(['jquery', 'lodash', 'core/pluginifier', 'ui/resourcemgr/fileBrowser', 'u
|
|
|
351
333
|
*/
|
|
352
334
|
|
|
353
335
|
$elt.trigger('destroy.' + ns);
|
|
354
|
-
}
|
|
355
|
-
}
|
|
356
|
-
|
|
357
|
-
|
|
336
|
+
}).modal('close');
|
|
337
|
+
} else {
|
|
338
|
+
$$1(window).off('resize.resourcemgr');
|
|
339
|
+
/**
|
|
340
|
+
* The plugin have been destroyed.
|
|
341
|
+
* @event ResourceMgr#destroy.resourcemgr
|
|
342
|
+
*/
|
|
343
|
+
|
|
344
|
+
$elt.trigger('destroy.' + ns);
|
|
345
|
+
}
|
|
346
|
+
});
|
|
347
|
+
}
|
|
348
|
+
}; //Register the resourcemgr to behave as a jQuery plugin.
|
|
358
349
|
|
|
359
|
-
|
|
350
|
+
Pluginifier.register(ns, resourceMgr);
|
|
360
351
|
|
|
361
352
|
});
|