@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
|
@@ -1,660 +1,655 @@
|
|
|
1
1
|
define(['jquery', 'lodash', 'core/request', 'ui/pagination', 'handlebars', 'i18n', 'lib/dompurify/purify'], function ($$1, _, request, paginationComponent, Handlebars, __, DOMPurify) { 'use strict';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
3
|
+
$$1 = $$1 && Object.prototype.hasOwnProperty.call($$1, 'default') ? $$1['default'] : $$1;
|
|
4
|
+
_ = _ && Object.prototype.hasOwnProperty.call(_, 'default') ? _['default'] : _;
|
|
5
|
+
request = request && Object.prototype.hasOwnProperty.call(request, 'default') ? request['default'] : request;
|
|
6
|
+
paginationComponent = paginationComponent && Object.prototype.hasOwnProperty.call(paginationComponent, 'default') ? paginationComponent['default'] : paginationComponent;
|
|
7
|
+
Handlebars = Handlebars && Object.prototype.hasOwnProperty.call(Handlebars, 'default') ? Handlebars['default'] : Handlebars;
|
|
8
|
+
__ = __ && Object.prototype.hasOwnProperty.call(__, 'default') ? __['default'] : __;
|
|
9
|
+
DOMPurify = DOMPurify && Object.prototype.hasOwnProperty.call(DOMPurify, 'default') ? DOMPurify['default'] : DOMPurify;
|
|
10
|
+
|
|
11
|
+
function _typeof(obj) {
|
|
12
|
+
"@babel/helpers - typeof";
|
|
13
|
+
|
|
14
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
|
|
15
|
+
return typeof obj;
|
|
16
|
+
} : function (obj) {
|
|
17
|
+
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
18
|
+
}, _typeof(obj);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function Helpers0 (hb) {
|
|
22
|
+
//register a i18n helper
|
|
23
|
+
hb.registerHelper('__', function (key) {
|
|
24
|
+
return __(key);
|
|
25
|
+
});
|
|
11
26
|
/**
|
|
12
|
-
*
|
|
13
|
-
* modify it under the terms of the GNU General Public License
|
|
14
|
-
* as published by the Free Software Foundation; under version 2
|
|
15
|
-
* of the License (non-upgradable).
|
|
16
|
-
*
|
|
17
|
-
* This program is distributed in the hope that it will be useful,
|
|
18
|
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
19
|
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
20
|
-
* GNU General Public License for more details.
|
|
21
|
-
*
|
|
22
|
-
* You should have received a copy of the GNU General Public License
|
|
23
|
-
* along with this program; if not, write to the Free Software
|
|
24
|
-
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
25
|
-
*
|
|
26
|
-
* Copyright (c) 2013-2019 (original work) Open Assessment Technologies SA (under the project TAO-PRODUCT);
|
|
27
|
-
*
|
|
27
|
+
* Register dompurify helper
|
|
28
28
|
*
|
|
29
|
+
* https://github.com/cure53/DOMPurify
|
|
30
|
+
* with config SAFE_FOR_TEMPLATES: true
|
|
31
|
+
* to make output safe for template systems
|
|
29
32
|
*/
|
|
30
|
-
function Helpers0 (hb) {
|
|
31
|
-
//register a i18n helper
|
|
32
|
-
hb.registerHelper('__', function (key) {
|
|
33
|
-
return __(key);
|
|
34
|
-
});
|
|
35
|
-
/**
|
|
36
|
-
* Register dompurify helper
|
|
37
|
-
*
|
|
38
|
-
* https://github.com/cure53/DOMPurify
|
|
39
|
-
* with config SAFE_FOR_TEMPLATES: true
|
|
40
|
-
* to make output safe for template systems
|
|
41
|
-
*/
|
|
42
|
-
|
|
43
|
-
hb.registerHelper('dompurify', function (context) {
|
|
44
|
-
return DOMPurify.sanitize(context);
|
|
45
|
-
});
|
|
46
|
-
/**
|
|
47
|
-
* Register join helper
|
|
48
|
-
*
|
|
49
|
-
* Example :
|
|
50
|
-
* var values = {a:v1, b:v2, c:v3};
|
|
51
|
-
* Using {{{join attributes '=' ' ' '"'}}} will return : a="v1" b="v2" c="v3"
|
|
52
|
-
* Using {{{join values null ' or ' '*'}}} will return : *v1* or *v2* or *v3*
|
|
53
|
-
*/
|
|
54
|
-
|
|
55
|
-
hb.registerHelper('join', function (arr, keyValueGlue, fragmentGlue, wrapper) {
|
|
56
|
-
var fragments = [];
|
|
57
|
-
keyValueGlue = typeof keyValueGlue === 'string' ? keyValueGlue : undefined;
|
|
58
|
-
fragmentGlue = typeof fragmentGlue === 'string' ? fragmentGlue : ' ';
|
|
59
|
-
wrapper = typeof wrapper === 'string' ? wrapper : '"';
|
|
60
|
-
|
|
61
|
-
_.forIn(arr, function (value, key) {
|
|
62
|
-
var fragment = '';
|
|
63
|
-
|
|
64
|
-
if (value !== null || value !== undefined) {
|
|
65
|
-
if (typeof value === 'boolean') {
|
|
66
|
-
value = value ? 'true' : 'false';
|
|
67
|
-
} else if (typeof value === 'object') {
|
|
68
|
-
value = _.values(value).join(' ');
|
|
69
|
-
}
|
|
70
|
-
} else {
|
|
71
|
-
value = '';
|
|
72
|
-
}
|
|
73
33
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
34
|
+
hb.registerHelper('dompurify', function (context) {
|
|
35
|
+
return DOMPurify.sanitize(context);
|
|
36
|
+
});
|
|
37
|
+
/**
|
|
38
|
+
* Register join helper
|
|
39
|
+
*
|
|
40
|
+
* Example :
|
|
41
|
+
* var values = {a:v1, b:v2, c:v3};
|
|
42
|
+
* Using {{{join attributes '=' ' ' '"'}}} will return : a="v1" b="v2" c="v3"
|
|
43
|
+
* Using {{{join values null ' or ' '*'}}} will return : *v1* or *v2* or *v3*
|
|
44
|
+
*/
|
|
77
45
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
46
|
+
hb.registerHelper('join', function (arr, keyValueGlue, fragmentGlue, wrapper) {
|
|
47
|
+
var fragments = [];
|
|
48
|
+
keyValueGlue = typeof keyValueGlue === 'string' ? keyValueGlue : undefined;
|
|
49
|
+
fragmentGlue = typeof fragmentGlue === 'string' ? fragmentGlue : ' ';
|
|
50
|
+
wrapper = typeof wrapper === 'string' ? wrapper : '"';
|
|
81
51
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
//it also adds a local variable "i" as the index in each iteration loop
|
|
52
|
+
_.forIn(arr, function (value, key) {
|
|
53
|
+
var fragment = '';
|
|
85
54
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
55
|
+
if (value !== null || value !== undefined) {
|
|
56
|
+
if (typeof value === 'boolean') {
|
|
57
|
+
value = value ? 'true' : 'false';
|
|
58
|
+
} else if (_typeof(value) === 'object') {
|
|
59
|
+
value = _.values(value).join(' ');
|
|
60
|
+
}
|
|
61
|
+
} else {
|
|
62
|
+
value = '';
|
|
63
|
+
}
|
|
91
64
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
i: i
|
|
95
|
-
}));
|
|
65
|
+
if (keyValueGlue !== undefined) {
|
|
66
|
+
fragment += key + keyValueGlue;
|
|
96
67
|
}
|
|
97
68
|
|
|
98
|
-
|
|
69
|
+
fragment += wrapper + value + wrapper;
|
|
70
|
+
fragments.push(fragment);
|
|
99
71
|
});
|
|
100
|
-
hb.registerHelper('equal', function (var1, var2, options) {
|
|
101
|
-
if (var1 == var2) {
|
|
102
|
-
return options.fn(this);
|
|
103
|
-
} else {
|
|
104
|
-
return options.inverse(this);
|
|
105
|
-
}
|
|
106
|
-
}); // register a "get property" helper
|
|
107
|
-
// it gets the named property from the provided context
|
|
108
72
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
// it checks if value is in array
|
|
73
|
+
return fragments.join(fragmentGlue);
|
|
74
|
+
}); //register a classic "for loop" helper
|
|
75
|
+
//it also adds a local variable "i" as the index in each iteration loop
|
|
113
76
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
}
|
|
77
|
+
hb.registerHelper('for', function (startIndex, stopIndex, increment, options) {
|
|
78
|
+
var ret = '';
|
|
79
|
+
startIndex = parseInt(startIndex);
|
|
80
|
+
stopIndex = parseInt(stopIndex);
|
|
81
|
+
increment = parseInt(increment);
|
|
120
82
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
var Template = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) {
|
|
126
|
-
this.compilerInfo = [4,'>= 1.0.0'];
|
|
127
|
-
helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
|
|
128
|
-
var buffer = "", stack1, functionType="function", escapeExpression=this.escapeExpression, self=this;
|
|
129
|
-
|
|
130
|
-
function program1(depth0,data) {
|
|
131
|
-
|
|
132
|
-
var buffer = "", stack1, helper;
|
|
133
|
-
buffer += "\n <li class=\"root\">\n <a\n class=\"root-folder active\"\n href=\"#\"\n data-path=\"";
|
|
134
|
-
if (helper = helpers.path) { stack1 = helper.call(depth0, {hash:{},data:data}); }
|
|
135
|
-
else { helper = (depth0 && depth0.path); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; }
|
|
136
|
-
buffer += escapeExpression(stack1)
|
|
137
|
-
+ "\"\n data-display=\"";
|
|
138
|
-
if (helper = helpers.relPath) { stack1 = helper.call(depth0, {hash:{},data:data}); }
|
|
139
|
-
else { helper = (depth0 && depth0.relPath); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; }
|
|
140
|
-
buffer += escapeExpression(stack1)
|
|
141
|
-
+ "\"\n data-children-limit=\"";
|
|
142
|
-
if (helper = helpers.childrenLimit) { stack1 = helper.call(depth0, {hash:{},data:data}); }
|
|
143
|
-
else { helper = (depth0 && depth0.childrenLimit); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; }
|
|
144
|
-
buffer += escapeExpression(stack1)
|
|
145
|
-
+ "\">\n ";
|
|
146
|
-
if (helper = helpers.label) { stack1 = helper.call(depth0, {hash:{},data:data}); }
|
|
147
|
-
else { helper = (depth0 && depth0.label); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; }
|
|
148
|
-
buffer += escapeExpression(stack1)
|
|
149
|
-
+ "\n </a>\n <ul></ul>\n </li>\n";
|
|
150
|
-
return buffer;
|
|
83
|
+
for (var i = startIndex; i < stopIndex; i += increment) {
|
|
84
|
+
ret += options.fn(_.extend({}, this, {
|
|
85
|
+
i: i
|
|
86
|
+
}));
|
|
151
87
|
}
|
|
152
88
|
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
return (asString || true) ? html : $(html);
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
if (!Helpers0.__initialized) {
|
|
164
|
-
Helpers0(Handlebars);
|
|
165
|
-
Helpers0.__initialized = true;
|
|
166
|
-
}
|
|
167
|
-
var Template$1 = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) {
|
|
168
|
-
this.compilerInfo = [4,'>= 1.0.0'];
|
|
169
|
-
helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
|
|
170
|
-
var buffer = "", stack1, functionType="function", escapeExpression=this.escapeExpression, self=this;
|
|
171
|
-
|
|
172
|
-
function program1(depth0,data) {
|
|
173
|
-
|
|
174
|
-
var buffer = "", stack1, helper;
|
|
175
|
-
buffer += "\n <li>\n <a\n data-path=\"";
|
|
176
|
-
if (helper = helpers.path) { stack1 = helper.call(depth0, {hash:{},data:data}); }
|
|
177
|
-
else { helper = (depth0 && depth0.path); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; }
|
|
178
|
-
buffer += escapeExpression(stack1)
|
|
179
|
-
+ "\"\n data-display=\"";
|
|
180
|
-
if (helper = helpers.relPath) { stack1 = helper.call(depth0, {hash:{},data:data}); }
|
|
181
|
-
else { helper = (depth0 && depth0.relPath); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; }
|
|
182
|
-
buffer += escapeExpression(stack1)
|
|
183
|
-
+ "\"\n data-children-limit=\"";
|
|
184
|
-
if (helper = helpers.childrenLimit) { stack1 = helper.call(depth0, {hash:{},data:data}); }
|
|
185
|
-
else { helper = (depth0 && depth0.childrenLimit); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; }
|
|
186
|
-
buffer += escapeExpression(stack1)
|
|
187
|
-
+ "\"\n href=\"#\">\n ";
|
|
188
|
-
if (helper = helpers.label) { stack1 = helper.call(depth0, {hash:{},data:data}); }
|
|
189
|
-
else { helper = (depth0 && depth0.label); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; }
|
|
190
|
-
buffer += escapeExpression(stack1)
|
|
191
|
-
+ "\n </a>\n </li>\n";
|
|
192
|
-
return buffer;
|
|
89
|
+
return ret;
|
|
90
|
+
});
|
|
91
|
+
hb.registerHelper('equal', function (var1, var2, options) {
|
|
92
|
+
if (var1 == var2) {
|
|
93
|
+
return options.fn(this);
|
|
94
|
+
} else {
|
|
95
|
+
return options.inverse(this);
|
|
193
96
|
}
|
|
97
|
+
}); // register a "get property" helper
|
|
98
|
+
// it gets the named property from the provided context
|
|
194
99
|
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
function
|
|
201
|
-
|
|
202
|
-
|
|
100
|
+
hb.registerHelper('property', function (name, context) {
|
|
101
|
+
return context[name] || '';
|
|
102
|
+
}); // register an 'includes' helper
|
|
103
|
+
// it checks if value is in array
|
|
104
|
+
|
|
105
|
+
hb.registerHelper('includes', function (haystack, needle, options) {
|
|
106
|
+
if (_.contains(haystack, needle)) {
|
|
107
|
+
return options.fn(this);
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
if (!Helpers0.__initialized) {
|
|
113
|
+
Helpers0(Handlebars);
|
|
114
|
+
Helpers0.__initialized = true;
|
|
115
|
+
}
|
|
116
|
+
var Template = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) {
|
|
117
|
+
this.compilerInfo = [4,'>= 1.0.0'];
|
|
118
|
+
helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
|
|
119
|
+
var buffer = "", stack1, functionType="function", escapeExpression=this.escapeExpression, self=this;
|
|
120
|
+
|
|
121
|
+
function program1(depth0,data) {
|
|
122
|
+
|
|
123
|
+
var buffer = "", stack1, helper;
|
|
124
|
+
buffer += "\n <li class=\"root\">\n <a\n class=\"root-folder active\"\n href=\"#\"\n data-path=\"";
|
|
125
|
+
if (helper = helpers.path) { stack1 = helper.call(depth0, {hash:{},data:data}); }
|
|
126
|
+
else { helper = (depth0 && depth0.path); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; }
|
|
127
|
+
buffer += escapeExpression(stack1)
|
|
128
|
+
+ "\"\n data-display=\"";
|
|
129
|
+
if (helper = helpers.relPath) { stack1 = helper.call(depth0, {hash:{},data:data}); }
|
|
130
|
+
else { helper = (depth0 && depth0.relPath); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; }
|
|
131
|
+
buffer += escapeExpression(stack1)
|
|
132
|
+
+ "\"\n data-children-limit=\"";
|
|
133
|
+
if (helper = helpers.childrenLimit) { stack1 = helper.call(depth0, {hash:{},data:data}); }
|
|
134
|
+
else { helper = (depth0 && depth0.childrenLimit); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; }
|
|
135
|
+
buffer += escapeExpression(stack1)
|
|
136
|
+
+ "\">\n ";
|
|
137
|
+
if (helper = helpers.label) { stack1 = helper.call(depth0, {hash:{},data:data}); }
|
|
138
|
+
else { helper = (depth0 && depth0.label); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; }
|
|
139
|
+
buffer += escapeExpression(stack1)
|
|
140
|
+
+ "\n </a>\n <ul></ul>\n </li>\n";
|
|
141
|
+
return buffer;
|
|
203
142
|
}
|
|
204
143
|
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
144
|
+
stack1 = helpers['if'].call(depth0, ((stack1 = (depth0 && depth0.permissions)),stack1 == null || stack1 === false ? stack1 : stack1.read), {hash:{},inverse:self.noop,fn:self.program(1, program1, data),data:data});
|
|
145
|
+
if(stack1 || stack1 === 0) { buffer += stack1; }
|
|
146
|
+
buffer += "\n";
|
|
147
|
+
return buffer;
|
|
148
|
+
});
|
|
149
|
+
function rootFolderTpl(data, options, asString) {
|
|
150
|
+
var html = Template(data, options);
|
|
151
|
+
return (asString || true) ? html : $(html);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
if (!Helpers0.__initialized) {
|
|
155
|
+
Helpers0(Handlebars);
|
|
156
|
+
Helpers0.__initialized = true;
|
|
157
|
+
}
|
|
158
|
+
var Template$1 = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) {
|
|
159
|
+
this.compilerInfo = [4,'>= 1.0.0'];
|
|
160
|
+
helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
|
|
161
|
+
var buffer = "", stack1, functionType="function", escapeExpression=this.escapeExpression, self=this;
|
|
162
|
+
|
|
163
|
+
function program1(depth0,data) {
|
|
164
|
+
|
|
165
|
+
var buffer = "", stack1, helper;
|
|
166
|
+
buffer += "\n <li>\n <a\n data-path=\"";
|
|
167
|
+
if (helper = helpers.path) { stack1 = helper.call(depth0, {hash:{},data:data}); }
|
|
168
|
+
else { helper = (depth0 && depth0.path); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; }
|
|
169
|
+
buffer += escapeExpression(stack1)
|
|
170
|
+
+ "\"\n data-display=\"";
|
|
171
|
+
if (helper = helpers.relPath) { stack1 = helper.call(depth0, {hash:{},data:data}); }
|
|
172
|
+
else { helper = (depth0 && depth0.relPath); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; }
|
|
173
|
+
buffer += escapeExpression(stack1)
|
|
174
|
+
+ "\"\n data-children-limit=\"";
|
|
175
|
+
if (helper = helpers.childrenLimit) { stack1 = helper.call(depth0, {hash:{},data:data}); }
|
|
176
|
+
else { helper = (depth0 && depth0.childrenLimit); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; }
|
|
177
|
+
buffer += escapeExpression(stack1)
|
|
178
|
+
+ "\"\n href=\"#\">\n ";
|
|
179
|
+
if (helper = helpers.label) { stack1 = helper.call(depth0, {hash:{},data:data}); }
|
|
180
|
+
else { helper = (depth0 && depth0.label); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; }
|
|
181
|
+
buffer += escapeExpression(stack1)
|
|
182
|
+
+ "\n </a>\n </li>\n";
|
|
183
|
+
return buffer;
|
|
184
|
+
}
|
|
220
185
|
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
186
|
+
stack1 = helpers['if'].call(depth0, ((stack1 = (depth0 && depth0.permissions)),stack1 == null || stack1 === false ? stack1 : stack1.read), {hash:{},inverse:self.noop,fn:self.program(1, program1, data),data:data});
|
|
187
|
+
if(stack1 || stack1 === 0) { buffer += stack1; }
|
|
188
|
+
buffer += "\n";
|
|
189
|
+
return buffer;
|
|
190
|
+
});
|
|
191
|
+
function folderTpl(data, options, asString) {
|
|
192
|
+
var html = Template$1(data, options);
|
|
193
|
+
return (asString || true) ? html : $(html);
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
* Update the permissions in HTML Tree
|
|
198
|
+
* @param {Object} item - the tree item
|
|
199
|
+
* @return {Object} - item with permissions
|
|
200
|
+
*/
|
|
201
|
+
function updatePermissions(item) {
|
|
202
|
+
var isAssets = (item.uri || item.path || '').includes('mediamanager');
|
|
203
|
+
var permissions = {
|
|
204
|
+
read: true,
|
|
205
|
+
write: true,
|
|
206
|
+
preview: true,
|
|
207
|
+
download: true,
|
|
208
|
+
upload: true,
|
|
209
|
+
delete: true
|
|
210
|
+
};
|
|
211
|
+
|
|
212
|
+
if (item.permissions) {
|
|
213
|
+
if (!item.permissions.includes('READ')) {
|
|
214
|
+
permissions.read = false;
|
|
215
|
+
}
|
|
225
216
|
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
217
|
+
if (!item.permissions.includes('WRITE')) {
|
|
218
|
+
permissions.write = false;
|
|
219
|
+
} // Atomic permissions for Assets
|
|
229
220
|
|
|
230
221
|
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
222
|
+
if (isAssets) {
|
|
223
|
+
if (!item.permissions.includes('PREVIEW')) {
|
|
224
|
+
permissions.preview = false;
|
|
225
|
+
}
|
|
235
226
|
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
227
|
+
if (!item.permissions.includes('DOWNLOAD')) {
|
|
228
|
+
permissions.download = false;
|
|
229
|
+
}
|
|
239
230
|
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
231
|
+
if (!item.permissions.includes('UPLOAD')) {
|
|
232
|
+
permissions.upload = false;
|
|
233
|
+
}
|
|
243
234
|
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
235
|
+
if (!item.permissions.includes('DELETE')) {
|
|
236
|
+
permissions.delete = false;
|
|
237
|
+
} // Generic permissions for item gallery media
|
|
247
238
|
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
239
|
+
} else {
|
|
240
|
+
if (!permissions.read) {
|
|
241
|
+
permissions.preview = false;
|
|
242
|
+
permissions.download = false;
|
|
243
|
+
}
|
|
253
244
|
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
}
|
|
245
|
+
if (!permissions.write) {
|
|
246
|
+
permissions.delete = false;
|
|
247
|
+
permissions.upload = false;
|
|
258
248
|
}
|
|
259
249
|
}
|
|
260
|
-
|
|
261
|
-
item.permissions = permissions;
|
|
262
|
-
return item;
|
|
263
250
|
}
|
|
264
251
|
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
252
|
+
item.permissions = permissions;
|
|
253
|
+
return item;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
/**
|
|
257
|
+
* This program is free software; you can redistribute it and/or
|
|
258
|
+
* modify it under the terms of the GNU General Public License
|
|
259
|
+
* as published by the Free Software Foundation; under version 2
|
|
260
|
+
* of the License (non-upgradable).
|
|
261
|
+
*
|
|
262
|
+
* This program is distributed in the hope that it will be useful,
|
|
263
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
264
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
265
|
+
* GNU General Public License for more details.
|
|
266
|
+
*
|
|
267
|
+
* You should have received a copy of the GNU General Public License
|
|
268
|
+
* along with this program; if not, write to the Free Software
|
|
269
|
+
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
270
|
+
*
|
|
271
|
+
* Copyright (c) 2018-2020 (original work) Open Assessment Technologies SA;
|
|
272
|
+
*/
|
|
273
|
+
var ns = 'resourcemgr';
|
|
274
|
+
function fileBrowser (options) {
|
|
275
|
+
var root = options.root || 'local';
|
|
276
|
+
var rootPath = options.path || '/';
|
|
277
|
+
var $container = options.$target;
|
|
278
|
+
var $fileBrowser = $$1('.file-browser .file-browser-wrapper', $container);
|
|
279
|
+
var $divContainer = $$1(".".concat(root), $fileBrowser);
|
|
280
|
+
var $folderContainer = $$1('.folders', $divContainer);
|
|
281
|
+
var fileTree = {}; // for pagination
|
|
282
|
+
|
|
283
|
+
var selectedClass = {
|
|
284
|
+
path: rootPath,
|
|
285
|
+
childrenLimit: 10,
|
|
286
|
+
total: 0,
|
|
287
|
+
page: 1
|
|
288
|
+
}; //load the content of the ROOT
|
|
289
|
+
|
|
290
|
+
getFolderContent(fileTree, rootPath, function (content) {
|
|
291
|
+
//create the tree node for the ROOT folder by default once the initial content loaded
|
|
292
|
+
$folderContainer.append(rootFolderTpl(content));
|
|
293
|
+
var $rootNode = $$1('.root-folder', $folderContainer); //create an inner list and append found elements
|
|
294
|
+
|
|
295
|
+
var $innerList = $$1('.root ul', $folderContainer);
|
|
296
|
+
|
|
297
|
+
if (content.children) {
|
|
298
|
+
$rootNode.addClass('opened');
|
|
299
|
+
}
|
|
298
300
|
|
|
299
|
-
|
|
300
|
-
//create the tree node for the ROOT folder by default once the initial content loaded
|
|
301
|
-
$folderContainer.append(rootFolderTpl(content));
|
|
302
|
-
const $rootNode = $$1('.root-folder', $folderContainer); //create an inner list and append found elements
|
|
301
|
+
updateFolders(content, $innerList);
|
|
303
302
|
|
|
304
|
-
|
|
303
|
+
if (content.permissions.read && !options.hasAlreadySelected) {
|
|
304
|
+
$$1('.file-browser').find('li.active').removeClass('active');
|
|
305
|
+
updateSelectedClass(content.path, content.total, content.childrenLimit);
|
|
306
|
+
$container.trigger('folderselect.'.concat(ns), [content.label, getPage(content.children), content.path, content]);
|
|
307
|
+
renderPagination();
|
|
305
308
|
|
|
306
|
-
if (
|
|
307
|
-
|
|
309
|
+
if (root !== 'local') {
|
|
310
|
+
options.hasAlreadySelected = true;
|
|
308
311
|
}
|
|
312
|
+
}
|
|
313
|
+
}); // by clicking on the tree (using a live binding because content is not complete yet)
|
|
314
|
+
|
|
315
|
+
$divContainer.off('click', '.folders a').on('click', '.folders a', function (e) {
|
|
316
|
+
e.preventDefault();
|
|
317
|
+
var $selected = $$1(this);
|
|
318
|
+
var $folders = $$1('.folders li', $fileBrowser);
|
|
319
|
+
var fullPath = $selected.data('path');
|
|
320
|
+
var subTree = getByPath(fileTree, fullPath); //get the folder content
|
|
321
|
+
|
|
322
|
+
getFolderContent(subTree, fullPath, function (content) {
|
|
323
|
+
if (content) {
|
|
324
|
+
//either create the inner list of the content is new or just show it
|
|
325
|
+
var $innerList = $selected.siblings('ul');
|
|
326
|
+
|
|
327
|
+
if (!$innerList.length && content.children && _.find(content.children, 'path') && !content.empty) {
|
|
328
|
+
$innerList = $$1('<ul></ul>').insertAfter($selected);
|
|
329
|
+
updateFolders(content, $innerList);
|
|
330
|
+
$selected.addClass('opened');
|
|
331
|
+
} else if ($innerList.length) {
|
|
332
|
+
if ($innerList.css('display') === 'none') {
|
|
333
|
+
$innerList.show();
|
|
334
|
+
$selected.addClass('opened');
|
|
335
|
+
} else if ($selected.parent('li').hasClass('active')) {
|
|
336
|
+
$innerList.hide();
|
|
337
|
+
$selected.removeClass('opened');
|
|
338
|
+
}
|
|
339
|
+
} //toggle active element
|
|
309
340
|
|
|
310
|
-
updateFolders(content, $innerList);
|
|
311
341
|
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
updateSelectedClass(content.path, content.total, content.childrenLimit);
|
|
315
|
-
$container.trigger('folderselect.'.concat(ns), [content.label, getPage(content.children), content.path, content]);
|
|
316
|
-
renderPagination();
|
|
342
|
+
$folders.removeClass('active');
|
|
343
|
+
$selected.parent('li').addClass('active'); //internal event to set the file-selector content
|
|
317
344
|
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
345
|
+
updateSelectedClass(fullPath, subTree.total, $selected.data('children-limit'));
|
|
346
|
+
$container.trigger("folderselect.".concat(ns), [content.label, getPage(content.children), content.path, content]);
|
|
347
|
+
renderPagination();
|
|
321
348
|
}
|
|
322
|
-
}); // by clicking on the tree (using a live binding because content is not complete yet)
|
|
323
|
-
|
|
324
|
-
$divContainer.off('click', '.folders a').on('click', '.folders a', function (e) {
|
|
325
|
-
e.preventDefault();
|
|
326
|
-
const $selected = $$1(this);
|
|
327
|
-
const $folders = $$1('.folders li', $fileBrowser);
|
|
328
|
-
const fullPath = $selected.data('path');
|
|
329
|
-
const subTree = getByPath(fileTree, fullPath); //get the folder content
|
|
330
|
-
|
|
331
|
-
getFolderContent(subTree, fullPath, function (content) {
|
|
332
|
-
if (content) {
|
|
333
|
-
//either create the inner list of the content is new or just show it
|
|
334
|
-
let $innerList = $selected.siblings('ul');
|
|
335
|
-
|
|
336
|
-
if (!$innerList.length && content.children && _.find(content.children, 'path') && !content.empty) {
|
|
337
|
-
$innerList = $$1('<ul></ul>').insertAfter($selected);
|
|
338
|
-
updateFolders(content, $innerList);
|
|
339
|
-
$selected.addClass('opened');
|
|
340
|
-
} else if ($innerList.length) {
|
|
341
|
-
if ($innerList.css('display') === 'none') {
|
|
342
|
-
$innerList.show();
|
|
343
|
-
$selected.addClass('opened');
|
|
344
|
-
} else if ($selected.parent('li').hasClass('active')) {
|
|
345
|
-
$innerList.hide();
|
|
346
|
-
$selected.removeClass('opened');
|
|
347
|
-
}
|
|
348
|
-
} //toggle active element
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
$folders.removeClass('active');
|
|
352
|
-
$selected.parent('li').addClass('active'); //internal event to set the file-selector content
|
|
353
|
-
|
|
354
|
-
updateSelectedClass(fullPath, subTree.total, $selected.data('children-limit'));
|
|
355
|
-
$container.trigger(`folderselect.${ns}`, [content.label, getPage(content.children), content.path, content]);
|
|
356
|
-
renderPagination();
|
|
357
|
-
}
|
|
358
|
-
});
|
|
359
349
|
});
|
|
360
|
-
|
|
361
|
-
|
|
350
|
+
});
|
|
351
|
+
$container.on("filenew.".concat(ns), function (e, file, path) {
|
|
352
|
+
var subTree = getByPath(fileTree, path);
|
|
362
353
|
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
if (root !== 'local' || !_.find(subTree.children, {
|
|
369
|
-
name: file.name
|
|
370
|
-
})) {
|
|
371
|
-
updatePermissions(file);
|
|
354
|
+
if (subTree) {
|
|
355
|
+
if (!subTree.children) {
|
|
356
|
+
subTree.children = [];
|
|
357
|
+
}
|
|
372
358
|
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
}
|
|
359
|
+
if (root !== 'local' || !_.find(subTree.children, {
|
|
360
|
+
name: file.name
|
|
361
|
+
})) {
|
|
362
|
+
updatePermissions(file);
|
|
378
363
|
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
364
|
+
if (subTree.children.length === subTree.total) {
|
|
365
|
+
// all children loaded new file can be pushed to the end of tree
|
|
366
|
+
// if not all, new file will be loaded with next page
|
|
367
|
+
subTree.children.push(file);
|
|
383
368
|
}
|
|
384
|
-
}
|
|
385
|
-
});
|
|
386
|
-
$container.on(`filedelete.${ns}`, function (e, path) {
|
|
387
|
-
if (removeFromPath(fileTree, path)) {
|
|
388
|
-
selectedClass.total--;
|
|
389
|
-
loadPage();
|
|
390
|
-
}
|
|
391
|
-
});
|
|
392
|
-
/**
|
|
393
|
-
* Get files for page
|
|
394
|
-
* @param {Array} children
|
|
395
|
-
* @returns {Array} files for this page
|
|
396
|
-
*/
|
|
397
|
-
|
|
398
|
-
function getPage(children) {
|
|
399
|
-
const files = _.filter(children, function (item) {
|
|
400
|
-
return !!item.uri;
|
|
401
|
-
});
|
|
402
369
|
|
|
403
|
-
|
|
404
|
-
|
|
370
|
+
subTree.total++;
|
|
371
|
+
selectedClass.total++;
|
|
372
|
+
$container.trigger("folderselect.".concat(ns), [subTree.label, getPage(subTree.children), path]);
|
|
373
|
+
renderPagination();
|
|
405
374
|
}
|
|
375
|
+
}
|
|
376
|
+
});
|
|
377
|
+
$container.on("filedelete.".concat(ns), function (e, path) {
|
|
378
|
+
if (removeFromPath(fileTree, path)) {
|
|
379
|
+
selectedClass.total--;
|
|
380
|
+
loadPage();
|
|
381
|
+
}
|
|
382
|
+
});
|
|
383
|
+
/**
|
|
384
|
+
* Get files for page
|
|
385
|
+
* @param {Array} children
|
|
386
|
+
* @returns {Array} files for this page
|
|
387
|
+
*/
|
|
388
|
+
|
|
389
|
+
function getPage(children) {
|
|
390
|
+
var files = _.filter(children, function (item) {
|
|
391
|
+
return !!item.uri;
|
|
392
|
+
});
|
|
406
393
|
|
|
407
|
-
|
|
394
|
+
if (selectedClass.childrenLimit) {
|
|
395
|
+
return files.slice((selectedClass.page - 1) * selectedClass.childrenLimit, selectedClass.page * selectedClass.childrenLimit);
|
|
408
396
|
}
|
|
409
|
-
/**
|
|
410
|
-
* Get the content of a folder, either in the model or load it
|
|
411
|
-
* @param {Object} tree - the tree model
|
|
412
|
-
* @param {String} path - the folder path (relative to the root)
|
|
413
|
-
* @param {Function} cb - called back with the content in 1st parameter
|
|
414
|
-
*/
|
|
415
397
|
|
|
398
|
+
return files;
|
|
399
|
+
}
|
|
400
|
+
/**
|
|
401
|
+
* Get the content of a folder, either in the model or load it
|
|
402
|
+
* @param {Object} tree - the tree model
|
|
403
|
+
* @param {String} path - the folder path (relative to the root)
|
|
404
|
+
* @param {Function} cb - called back with the content in 1st parameter
|
|
405
|
+
*/
|
|
416
406
|
|
|
417
|
-
function getFolderContent(tree, path, cb) {
|
|
418
|
-
let content = getByPath(tree, path);
|
|
419
407
|
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
setToPath(tree, path, data);
|
|
431
|
-
} else {
|
|
408
|
+
function getFolderContent(tree, path, cb) {
|
|
409
|
+
var content = getByPath(tree, path);
|
|
410
|
+
|
|
411
|
+
if (!content || !content.children && !content.empty) {
|
|
412
|
+
loadContent(path).then(function (data) {
|
|
413
|
+
if (!tree.path) {
|
|
414
|
+
tree = _.merge(tree, data);
|
|
415
|
+
} else if (data.children) {
|
|
416
|
+
if (!_.find(data.children, 'path')) {
|
|
417
|
+
// no subfolders inside folder
|
|
432
418
|
tree.empty = true;
|
|
433
419
|
}
|
|
434
420
|
|
|
435
|
-
|
|
436
|
-
});
|
|
437
|
-
} else if (content.children) {
|
|
438
|
-
const files = _.filter(content.children, function (item) {
|
|
439
|
-
return !!item.uri;
|
|
440
|
-
}); // if files less then total and need toload this page
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
if (files.length < selectedClass.total && files.length < selectedClass.page * selectedClass.childrenLimit) {
|
|
444
|
-
loadContent(path).then(function (data) {
|
|
445
|
-
const loadedFiles = _.filter(data.children, function (item) {
|
|
446
|
-
return !!item.uri;
|
|
447
|
-
});
|
|
448
|
-
|
|
449
|
-
setToPath(tree, path, {
|
|
450
|
-
children: loadedFiles
|
|
451
|
-
});
|
|
452
|
-
content = getByPath(tree, path);
|
|
453
|
-
cb(content);
|
|
454
|
-
});
|
|
421
|
+
setToPath(tree, path, data);
|
|
455
422
|
} else {
|
|
456
|
-
|
|
423
|
+
tree.empty = true;
|
|
457
424
|
}
|
|
425
|
+
|
|
426
|
+
cb(data);
|
|
427
|
+
});
|
|
428
|
+
} else if (content.children) {
|
|
429
|
+
var files = _.filter(content.children, function (item) {
|
|
430
|
+
return !!item.uri;
|
|
431
|
+
}); // if files less then total and need toload this page
|
|
432
|
+
|
|
433
|
+
|
|
434
|
+
if (files.length < selectedClass.total && files.length < selectedClass.page * selectedClass.childrenLimit) {
|
|
435
|
+
loadContent(path).then(function (data) {
|
|
436
|
+
var loadedFiles = _.filter(data.children, function (item) {
|
|
437
|
+
return !!item.uri;
|
|
438
|
+
});
|
|
439
|
+
|
|
440
|
+
setToPath(tree, path, {
|
|
441
|
+
children: loadedFiles
|
|
442
|
+
});
|
|
443
|
+
content = getByPath(tree, path);
|
|
444
|
+
cb(content);
|
|
445
|
+
});
|
|
458
446
|
} else {
|
|
459
447
|
cb(content);
|
|
460
448
|
}
|
|
449
|
+
} else {
|
|
450
|
+
cb(content);
|
|
461
451
|
}
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
function getByPath(tree, path) {
|
|
471
|
-
let match;
|
|
472
|
-
|
|
473
|
-
if (tree) {
|
|
474
|
-
if (tree.path && tree.path.indexOf(path) === 0) {
|
|
475
|
-
match = tree;
|
|
476
|
-
} else if (tree.children) {
|
|
477
|
-
_.forEach(tree.children, function (child) {
|
|
478
|
-
match = getByPath(child, path);
|
|
479
|
-
|
|
480
|
-
if (match) {
|
|
481
|
-
return false;
|
|
482
|
-
}
|
|
483
|
-
});
|
|
484
|
-
}
|
|
485
|
-
}
|
|
452
|
+
}
|
|
453
|
+
/**
|
|
454
|
+
* Get a subTree from a path
|
|
455
|
+
* @param {Object} tree - the tree model
|
|
456
|
+
* @param {String} path - the path (relative to the root)
|
|
457
|
+
* @returns {Object} the subtree that matches the path
|
|
458
|
+
*/
|
|
486
459
|
|
|
487
|
-
return match;
|
|
488
|
-
}
|
|
489
|
-
/**
|
|
490
|
-
* Merge data into at into the subtree
|
|
491
|
-
* @param {Object} tree - the tree model
|
|
492
|
-
* @param {String} path - the path (relative to the root)
|
|
493
|
-
* @param {Object} data - the sbutree to merge at path level
|
|
494
|
-
* @returns {Boolean} true if done
|
|
495
|
-
*/
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
function setToPath(tree, path, data) {
|
|
499
|
-
let done = false;
|
|
500
|
-
|
|
501
|
-
if (tree) {
|
|
502
|
-
if (tree.path === path) {
|
|
503
|
-
tree.children = tree.children ? tree.children.concat(data.children) : data.children;
|
|
504
|
-
tree.total = data.total;
|
|
505
|
-
} else if (tree.children) {
|
|
506
|
-
_.forEach(tree.children, function (child) {
|
|
507
|
-
done = setToPath(child, path, data);
|
|
508
|
-
|
|
509
|
-
if (done) {
|
|
510
|
-
return false;
|
|
511
|
-
}
|
|
512
|
-
});
|
|
513
|
-
}
|
|
514
|
-
}
|
|
515
460
|
|
|
516
|
-
|
|
461
|
+
function getByPath(tree, path) {
|
|
462
|
+
var match;
|
|
463
|
+
|
|
464
|
+
if (tree) {
|
|
465
|
+
if (tree.path && tree.path.indexOf(path) === 0) {
|
|
466
|
+
match = tree;
|
|
467
|
+
} else if (tree.children) {
|
|
468
|
+
_.forEach(tree.children, function (child) {
|
|
469
|
+
match = getByPath(child, path);
|
|
470
|
+
|
|
471
|
+
if (match) {
|
|
472
|
+
return false;
|
|
473
|
+
}
|
|
474
|
+
});
|
|
475
|
+
}
|
|
517
476
|
}
|
|
518
|
-
/**
|
|
519
|
-
* Remove file from tree
|
|
520
|
-
* @param {Object} tree - the tree model
|
|
521
|
-
* @param {String} path - the path (relative to the root)
|
|
522
|
-
* @returns {boolean} is file removed
|
|
523
|
-
*/
|
|
524
477
|
|
|
478
|
+
return match;
|
|
479
|
+
}
|
|
480
|
+
/**
|
|
481
|
+
* Merge data into at into the subtree
|
|
482
|
+
* @param {Object} tree - the tree model
|
|
483
|
+
* @param {String} path - the path (relative to the root)
|
|
484
|
+
* @param {Object} data - the sbutree to merge at path level
|
|
485
|
+
* @returns {Boolean} true if done
|
|
486
|
+
*/
|
|
525
487
|
|
|
526
|
-
function removeFromPath(tree, path) {
|
|
527
|
-
let done = false;
|
|
528
|
-
let removed = [];
|
|
529
488
|
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
return child.path === path || child.name && tree.path + child.name === path || child.uri === path;
|
|
533
|
-
});
|
|
534
|
-
done = removed.length > 0;
|
|
535
|
-
tree.total--;
|
|
489
|
+
function setToPath(tree, path, data) {
|
|
490
|
+
var done = false;
|
|
536
491
|
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
492
|
+
if (tree) {
|
|
493
|
+
if (tree.path === path) {
|
|
494
|
+
tree.children = tree.children ? tree.children.concat(data.children) : data.children;
|
|
495
|
+
tree.total = data.total;
|
|
496
|
+
} else if (tree.children) {
|
|
497
|
+
_.forEach(tree.children, function (child) {
|
|
498
|
+
done = setToPath(child, path, data);
|
|
540
499
|
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
}
|
|
500
|
+
if (done) {
|
|
501
|
+
return false;
|
|
502
|
+
}
|
|
503
|
+
});
|
|
546
504
|
}
|
|
547
|
-
|
|
548
|
-
return done;
|
|
549
505
|
}
|
|
550
|
-
/**
|
|
551
|
-
* Get the content of a folder
|
|
552
|
-
* @param {String} path - the folder path
|
|
553
|
-
* @returns {jQuery.Deferred} the defferred object to run done/complete/fail
|
|
554
|
-
*/
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
function loadContent(path) {
|
|
558
|
-
const parameters = {};
|
|
559
|
-
parameters[options.pathParam] = path;
|
|
560
|
-
return request({
|
|
561
|
-
url: options.browseUrl,
|
|
562
|
-
method: 'GET',
|
|
563
|
-
dataType: 'json',
|
|
564
|
-
data: _.merge(parameters, options.params, {
|
|
565
|
-
childrenOffset: (selectedClass.page - 1) * selectedClass.childrenLimit
|
|
566
|
-
}),
|
|
567
|
-
noToken: true
|
|
568
|
-
}).then(response => response.data).then(response => {
|
|
569
|
-
response = updatePermissions(response);
|
|
570
|
-
|
|
571
|
-
if (response.children && response.children.length > 0) {
|
|
572
|
-
response.children.map(responseChildren => updatePermissions(responseChildren));
|
|
573
|
-
}
|
|
574
506
|
|
|
575
|
-
|
|
507
|
+
return done;
|
|
508
|
+
}
|
|
509
|
+
/**
|
|
510
|
+
* Remove file from tree
|
|
511
|
+
* @param {Object} tree - the tree model
|
|
512
|
+
* @param {String} path - the path (relative to the root)
|
|
513
|
+
* @returns {boolean} is file removed
|
|
514
|
+
*/
|
|
515
|
+
|
|
516
|
+
|
|
517
|
+
function removeFromPath(tree, path) {
|
|
518
|
+
var done = false;
|
|
519
|
+
var removed = [];
|
|
520
|
+
|
|
521
|
+
if (tree && tree.children) {
|
|
522
|
+
removed = _.remove(tree.children, function (child) {
|
|
523
|
+
return child.path === path || child.name && tree.path + child.name === path || child.uri === path;
|
|
576
524
|
});
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
* Update the HTML Tree
|
|
580
|
-
* @param {Object} data - the tree data
|
|
581
|
-
* @param {jQueryElement} $parent - the parent node to append the data
|
|
582
|
-
* @param {Boolean} [recurse] - internal recursive condition
|
|
583
|
-
*/
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
function updateFolders(data, $parent, recurse) {
|
|
587
|
-
if (recurse && data && data.path) {
|
|
588
|
-
if (typeof data.relPath === 'undefined') {
|
|
589
|
-
data.relPath = data.path;
|
|
590
|
-
}
|
|
525
|
+
done = removed.length > 0;
|
|
526
|
+
tree.total--;
|
|
591
527
|
|
|
592
|
-
|
|
593
|
-
|
|
528
|
+
if (!done) {
|
|
529
|
+
_.forEach(tree.children, function (child) {
|
|
530
|
+
done = removeFromPath(child, path);
|
|
594
531
|
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
532
|
+
if (done) {
|
|
533
|
+
return false;
|
|
534
|
+
}
|
|
598
535
|
});
|
|
599
536
|
}
|
|
600
537
|
}
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
function
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
if (
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
totalPages
|
|
632
|
-
}).on('prev', function () {
|
|
633
|
-
selectedClass.page--;
|
|
634
|
-
loadPage();
|
|
635
|
-
}).on('next', function () {
|
|
636
|
-
selectedClass.page++;
|
|
637
|
-
loadPage();
|
|
638
|
-
}).render($paginationContainer);
|
|
538
|
+
|
|
539
|
+
return done;
|
|
540
|
+
}
|
|
541
|
+
/**
|
|
542
|
+
* Get the content of a folder
|
|
543
|
+
* @param {String} path - the folder path
|
|
544
|
+
* @returns {jQuery.Deferred} the defferred object to run done/complete/fail
|
|
545
|
+
*/
|
|
546
|
+
|
|
547
|
+
|
|
548
|
+
function loadContent(path) {
|
|
549
|
+
var parameters = {};
|
|
550
|
+
parameters[options.pathParam] = path;
|
|
551
|
+
return request({
|
|
552
|
+
url: options.browseUrl,
|
|
553
|
+
method: 'GET',
|
|
554
|
+
dataType: 'json',
|
|
555
|
+
data: _.merge(parameters, options.params, {
|
|
556
|
+
childrenOffset: (selectedClass.page - 1) * selectedClass.childrenLimit
|
|
557
|
+
}),
|
|
558
|
+
noToken: true
|
|
559
|
+
}).then(function (response) {
|
|
560
|
+
return response.data;
|
|
561
|
+
}).then(function (response) {
|
|
562
|
+
response = updatePermissions(response);
|
|
563
|
+
|
|
564
|
+
if (response.children && response.children.length > 0) {
|
|
565
|
+
response.children.map(function (responseChildren) {
|
|
566
|
+
return updatePermissions(responseChildren);
|
|
567
|
+
});
|
|
639
568
|
}
|
|
640
|
-
}
|
|
641
|
-
/**
|
|
642
|
-
* Load page
|
|
643
|
-
*/
|
|
644
569
|
|
|
570
|
+
return response;
|
|
571
|
+
});
|
|
572
|
+
}
|
|
573
|
+
/**
|
|
574
|
+
* Update the HTML Tree
|
|
575
|
+
* @param {Object} data - the tree data
|
|
576
|
+
* @param {jQueryElement} $parent - the parent node to append the data
|
|
577
|
+
* @param {Boolean} [recurse] - internal recursive condition
|
|
578
|
+
*/
|
|
645
579
|
|
|
646
|
-
function loadPage() {
|
|
647
|
-
const subTree = getByPath(fileTree, selectedClass.path); //get the folder content
|
|
648
580
|
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
581
|
+
function updateFolders(data, $parent, recurse) {
|
|
582
|
+
if (recurse && data && data.path) {
|
|
583
|
+
if (typeof data.relPath === 'undefined') {
|
|
584
|
+
data.relPath = data.path;
|
|
585
|
+
}
|
|
586
|
+
|
|
587
|
+
$parent.append(folderTpl(data));
|
|
588
|
+
}
|
|
589
|
+
|
|
590
|
+
if (data && data.children && _.isArray(data.children) && !data.empty) {
|
|
591
|
+
_.forEach(data.children, function (child) {
|
|
592
|
+
updateFolders(child, $parent, true);
|
|
654
593
|
});
|
|
655
594
|
}
|
|
656
595
|
}
|
|
596
|
+
/**
|
|
597
|
+
* Update the selectedClass
|
|
598
|
+
* @param {String} path - the folder path
|
|
599
|
+
* @param {Number} total - files in class
|
|
600
|
+
* @param {Number} childrenLimit - page size
|
|
601
|
+
*/
|
|
602
|
+
|
|
603
|
+
|
|
604
|
+
function updateSelectedClass(path, total, childrenLimit) {
|
|
605
|
+
selectedClass = {
|
|
606
|
+
path: path,
|
|
607
|
+
total: total,
|
|
608
|
+
childrenLimit: childrenLimit,
|
|
609
|
+
page: 1
|
|
610
|
+
};
|
|
611
|
+
}
|
|
612
|
+
/**
|
|
613
|
+
* Render pagination
|
|
614
|
+
*/
|
|
615
|
+
|
|
616
|
+
|
|
617
|
+
function renderPagination() {
|
|
618
|
+
var $paginationContainer = $$1('.pagination-bottom', $container);
|
|
619
|
+
$paginationContainer.empty();
|
|
620
|
+
var totalPages = Math.ceil(selectedClass.total / selectedClass.childrenLimit);
|
|
621
|
+
|
|
622
|
+
if (selectedClass.total && totalPages > 1) {
|
|
623
|
+
paginationComponent({
|
|
624
|
+
mode: 'simple',
|
|
625
|
+
activePage: selectedClass.page,
|
|
626
|
+
totalPages: totalPages
|
|
627
|
+
}).on('prev', function () {
|
|
628
|
+
selectedClass.page--;
|
|
629
|
+
loadPage();
|
|
630
|
+
}).on('next', function () {
|
|
631
|
+
selectedClass.page++;
|
|
632
|
+
loadPage();
|
|
633
|
+
}).render($paginationContainer);
|
|
634
|
+
}
|
|
635
|
+
}
|
|
636
|
+
/**
|
|
637
|
+
* Load page
|
|
638
|
+
*/
|
|
639
|
+
|
|
640
|
+
|
|
641
|
+
function loadPage() {
|
|
642
|
+
var subTree = getByPath(fileTree, selectedClass.path); //get the folder content
|
|
643
|
+
|
|
644
|
+
getFolderContent(subTree, selectedClass.path, function (content) {
|
|
645
|
+
if (content) {
|
|
646
|
+
//internal event to set the file-selector content
|
|
647
|
+
$container.trigger("folderselect.".concat(ns), [content.label, getPage(content.children), content.path]);
|
|
648
|
+
}
|
|
649
|
+
});
|
|
650
|
+
}
|
|
651
|
+
}
|
|
657
652
|
|
|
658
|
-
|
|
653
|
+
return fileBrowser;
|
|
659
654
|
|
|
660
655
|
});
|