rubyfox-server 2.17.3.1 → 2.19.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rubyfox/server/data/config/admin/descriptors/config_room.txt +10 -1
- data/lib/rubyfox/server/data/config/admin/descriptors/config_server.txt +90 -20
- data/lib/rubyfox/server/data/config/admin/descriptors/config_zone.txt +9 -0
- data/lib/rubyfox/server/data/config/admin/descriptors/runtime_room.txt +11 -0
- data/lib/rubyfox/server/data/config/admin/descriptors/runtime_user.txt +3 -3
- data/lib/rubyfox/server/data/config/core.xml +4 -4
- data/lib/rubyfox/server/data/config/default.words.txt +11 -0
- data/lib/rubyfox/server/data/config/log4j.properties +1 -2
- data/lib/rubyfox/server/data/config/server.xml +1 -1
- data/lib/rubyfox/server/data/data/GeoLite2-Country.mmdb +0 -0
- data/lib/rubyfox/server/data/data/bannedusers/users.bin +0 -0
- data/lib/rubyfox/server/data/lib/apache-tomcat/bin/bootstrap.jar +0 -0
- data/lib/rubyfox/server/data/lib/apache-tomcat/bin/catalina-tasks.xml +39 -39
- data/lib/rubyfox/server/data/lib/apache-tomcat/bin/catalina.sh +0 -0
- data/lib/rubyfox/server/data/lib/apache-tomcat/bin/ciphers.sh +0 -0
- data/lib/rubyfox/server/data/lib/apache-tomcat/bin/commons-daemon-native.tar.gz +0 -0
- data/lib/rubyfox/server/data/lib/apache-tomcat/bin/commons-daemon.jar +0 -0
- data/lib/rubyfox/server/data/lib/apache-tomcat/bin/configtest.sh +0 -0
- data/lib/rubyfox/server/data/lib/apache-tomcat/bin/daemon.sh +0 -0
- data/lib/rubyfox/server/data/lib/apache-tomcat/bin/digest.sh +0 -0
- data/lib/rubyfox/server/data/lib/apache-tomcat/bin/makebase.sh +0 -0
- data/lib/rubyfox/server/data/lib/apache-tomcat/bin/setclasspath.sh +0 -0
- data/lib/rubyfox/server/data/lib/apache-tomcat/bin/shutdown.sh +0 -0
- data/lib/rubyfox/server/data/lib/apache-tomcat/bin/startup.sh +0 -0
- data/lib/rubyfox/server/data/lib/apache-tomcat/bin/tomcat-juli.jar +0 -0
- data/lib/rubyfox/server/data/lib/apache-tomcat/bin/tomcat-native.tar.gz +0 -0
- data/lib/rubyfox/server/data/lib/apache-tomcat/bin/tool-wrapper.sh +0 -0
- data/lib/rubyfox/server/data/lib/apache-tomcat/bin/version.sh +0 -0
- data/lib/rubyfox/server/data/lib/apache-tomcat/conf/Catalina/localhost/rewrite.config +1 -1
- data/lib/rubyfox/server/data/lib/apache-tomcat/conf/catalina.policy +263 -264
- data/lib/rubyfox/server/data/lib/apache-tomcat/conf/catalina.properties +209 -207
- data/lib/rubyfox/server/data/lib/apache-tomcat/conf/context.xml +31 -31
- data/lib/rubyfox/server/data/lib/apache-tomcat/conf/jaspic-providers.xml +23 -23
- data/lib/rubyfox/server/data/lib/apache-tomcat/conf/jaspic-providers.xsd +52 -52
- data/lib/rubyfox/server/data/lib/apache-tomcat/conf/keystore.jks +0 -0
- data/lib/rubyfox/server/data/lib/apache-tomcat/conf/server.xml +177 -161
- data/lib/rubyfox/server/data/lib/apache-tomcat/conf/tomcat-users.xml +18 -7
- data/lib/rubyfox/server/data/lib/apache-tomcat/conf/tomcat-users.xsd +59 -59
- data/lib/rubyfox/server/data/lib/apache-tomcat/conf/web.xml +4740 -4737
- data/lib/rubyfox/server/data/lib/apache-tomcat/lib/annotations-api.jar +0 -0
- data/lib/rubyfox/server/data/lib/apache-tomcat/lib/catalina-ant.jar +0 -0
- data/lib/rubyfox/server/data/lib/apache-tomcat/lib/catalina-ha.jar +0 -0
- data/lib/rubyfox/server/data/lib/apache-tomcat/lib/catalina-ssi.jar +0 -0
- data/lib/rubyfox/server/data/lib/apache-tomcat/lib/catalina-storeconfig.jar +0 -0
- data/lib/rubyfox/server/data/lib/apache-tomcat/lib/catalina-tribes.jar +0 -0
- data/lib/rubyfox/server/data/lib/apache-tomcat/lib/catalina.jar +0 -0
- data/lib/rubyfox/server/data/lib/apache-tomcat/lib/el-api.jar +0 -0
- data/lib/rubyfox/server/data/lib/apache-tomcat/lib/jasper-el.jar +0 -0
- data/lib/rubyfox/server/data/lib/apache-tomcat/lib/jasper.jar +0 -0
- data/lib/rubyfox/server/data/lib/apache-tomcat/lib/jaspic-api.jar +0 -0
- data/lib/rubyfox/server/data/lib/apache-tomcat/lib/jsp-api.jar +0 -0
- data/lib/rubyfox/server/data/lib/apache-tomcat/lib/servlet-api.jar +0 -0
- data/lib/rubyfox/server/data/lib/apache-tomcat/lib/sfs2x-ws-helper.jar +0 -0
- data/lib/rubyfox/server/data/lib/apache-tomcat/lib/tomcat-api.jar +0 -0
- data/lib/rubyfox/server/data/lib/apache-tomcat/lib/tomcat-coyote.jar +0 -0
- data/lib/rubyfox/server/data/lib/apache-tomcat/lib/tomcat-dbcp.jar +0 -0
- data/lib/rubyfox/server/data/lib/apache-tomcat/lib/tomcat-i18n-cs.jar +0 -0
- data/lib/rubyfox/server/data/lib/apache-tomcat/lib/tomcat-i18n-de.jar +0 -0
- data/lib/rubyfox/server/data/lib/apache-tomcat/lib/tomcat-i18n-es.jar +0 -0
- data/lib/rubyfox/server/data/lib/apache-tomcat/lib/tomcat-i18n-fr.jar +0 -0
- data/lib/rubyfox/server/data/lib/apache-tomcat/lib/tomcat-i18n-ja.jar +0 -0
- data/lib/rubyfox/server/data/lib/apache-tomcat/lib/tomcat-i18n-ko.jar +0 -0
- data/lib/rubyfox/server/data/lib/apache-tomcat/lib/tomcat-i18n-pt-BR.jar +0 -0
- data/lib/rubyfox/server/data/lib/apache-tomcat/lib/tomcat-i18n-ru.jar +0 -0
- data/lib/rubyfox/server/data/lib/apache-tomcat/lib/tomcat-i18n-zh-CN.jar +0 -0
- data/lib/rubyfox/server/data/lib/apache-tomcat/lib/tomcat-jdbc.jar +0 -0
- data/lib/rubyfox/server/data/lib/apache-tomcat/lib/tomcat-jni.jar +0 -0
- data/lib/rubyfox/server/data/lib/apache-tomcat/lib/tomcat-util-scan.jar +0 -0
- data/lib/rubyfox/server/data/lib/apache-tomcat/lib/tomcat-util.jar +0 -0
- data/lib/rubyfox/server/data/lib/apache-tomcat/lib/tomcat-websocket.jar +0 -0
- data/lib/rubyfox/server/data/lib/apache-tomcat/lib/websocket-api.jar +0 -0
- data/lib/rubyfox/server/data/lib/javax.activation-1.2.0.jar +0 -0
- data/lib/rubyfox/server/data/lib/javax.mail.jar +0 -0
- data/lib/rubyfox/server/data/lib/js/JSApi.js +2 -1
- data/lib/rubyfox/server/data/lib/js/LibApi.js +181 -48
- data/lib/rubyfox/server/data/lib/sfs2x-admin.jar +0 -0
- data/lib/rubyfox/server/data/lib/sfs2x-cluster.jar +0 -0
- data/lib/rubyfox/server/data/lib/sfs2x-core.jar +0 -0
- data/lib/rubyfox/server/data/lib/sfs2x.jar +0 -0
- data/lib/rubyfox/server/data/sfs2x-service +26 -30
- data/lib/rubyfox/server/data/www/BlueBox.war +0 -0
- data/lib/rubyfox/server/data/www/HelloServlet/WEB-INF/web.xml +1 -3
- data/lib/rubyfox/server/data/www/ROOT/_css_/default.css +14 -6
- data/lib/rubyfox/server/data/www/ROOT/admin/assets/css/style.css +44 -2
- data/lib/rubyfox/server/data/www/ROOT/admin/assets/js/core/application.bundle.js +98 -61
- data/lib/rubyfox/server/data/www/ROOT/admin/assets/js/core/modules/endors~mod-0~mod-1~mod-11~mod-12~mod-17~mod-6~mod-7~mod-8~mod-9.bundle.js +17357 -0
- data/lib/rubyfox/server/data/www/ROOT/admin/assets/js/core/modules/module-0.bundle.js +4 -4
- data/lib/rubyfox/server/data/www/ROOT/admin/assets/js/core/modules/module-1.bundle.js +3 -3
- data/lib/rubyfox/server/data/www/ROOT/admin/assets/js/core/modules/module-10.bundle.js +101 -66
- data/lib/rubyfox/server/data/www/ROOT/admin/assets/js/core/modules/module-11.bundle.js +544 -8
- data/lib/rubyfox/server/data/www/ROOT/admin/assets/js/core/modules/module-12.bundle.js +915 -1480
- data/lib/rubyfox/server/data/www/ROOT/admin/assets/js/core/modules/module-12~module-15~module-16~module-4.bundle.js +2665 -0
- data/lib/rubyfox/server/data/www/ROOT/admin/assets/js/core/modules/module-13.bundle.js +606 -3093
- data/lib/rubyfox/server/data/www/ROOT/admin/assets/js/core/modules/module-13~module-16~module-17~module-4.bundle.js +2665 -0
- data/lib/rubyfox/server/data/www/ROOT/admin/assets/js/core/modules/module-14.bundle.js +764 -0
- data/lib/rubyfox/server/data/www/ROOT/admin/assets/js/core/modules/module-15.bundle.js +71 -0
- data/lib/rubyfox/server/data/www/ROOT/admin/assets/js/core/modules/module-16.bundle.js +1787 -0
- data/lib/rubyfox/server/data/www/ROOT/admin/assets/js/core/modules/module-17.bundle.js +3383 -0
- data/lib/rubyfox/server/data/www/ROOT/admin/assets/js/core/modules/module-4.bundle.js +121 -1009
- data/lib/rubyfox/server/data/www/ROOT/admin/assets/js/core/modules/module-5.bundle.js +1214 -1744
- data/lib/rubyfox/server/data/www/ROOT/admin/assets/js/core/modules/module-6.bundle.js +398 -666
- data/lib/rubyfox/server/data/www/ROOT/admin/assets/js/core/modules/module-7.bundle.js +717 -192
- data/lib/rubyfox/server/data/www/ROOT/admin/assets/js/core/modules/module-8.bundle.js +2117 -665
- data/lib/rubyfox/server/data/www/ROOT/admin/assets/js/core/modules/module-9.bundle.js +613 -690
- data/lib/rubyfox/server/data/www/ROOT/admin/assets/js/core/modules/vendors~mod-0~mod-1~mod-10~mod-11~mod-16~mod-5~mod-6~mod-7~mod-8.bundle.js +17357 -0
- data/lib/rubyfox/server/data/www/ROOT/admin/assets/js/core/modules/vendors~mod-0~mod-1~mod-11~mod-12~mod-17~mod-5~mod-6~mod-7~mod-8~mod-9.bundle.js +17357 -0
- data/lib/rubyfox/server/data/www/ROOT/admin/assets/js/core/modules/{vendors~module-0~module-1~module-13~module-4~module-5~module-7~module-8.bundle.js → vendors~mod-0~mod-1~mod-11~mod-12~mod-17~mod-5~mod-7~mod-8~mod-9.bundle.js} +2 -2
- data/lib/rubyfox/server/data/www/ROOT/admin/assets/js/core/modules/vendors~module-12.bundle.js +807 -0
- data/lib/rubyfox/server/data/www/ROOT/admin/assets/js/core/modules/vendors~module-13.bundle.js +807 -0
- data/lib/rubyfox/server/data/www/ROOT/admin/modules/cluster-configurator.html +32 -0
- data/lib/rubyfox/server/data/www/ROOT/admin/modules/cluster-monitor.html +185 -0
- data/lib/rubyfox/server/data/www/ROOT/admin/modules/cluster-updater.html +47 -0
- data/lib/rubyfox/server/data/www/ROOT/admin/modules/extension-deployer.html +84 -0
- data/lib/rubyfox/server/data/www/ROOT/admin/modules/zone-monitor.html +15 -8
- data/lib/rubyfox/server/data/www/ROOT/index.html +13 -23
- data/lib/rubyfox/server/data/www/host-manager/META-INF/context.xml +2 -2
- data/lib/rubyfox/server/data/www/host-manager/WEB-INF/jsp/404.jsp +2 -2
- data/lib/rubyfox/server/data/www/host-manager/{manager.xml → WEB-INF/manager.xml} +5 -1
- data/lib/rubyfox/server/data/www/host-manager/WEB-INF/web.xml +17 -0
- data/lib/rubyfox/server/data/www/host-manager/css/manager.css +141 -0
- data/lib/rubyfox/server/data/www/host-manager/images/tomcat.svg +967 -0
- data/lib/rubyfox/server/data/www/manager/META-INF/context.xml +2 -0
- data/lib/rubyfox/server/data/www/manager/WEB-INF/jsp/connectorCerts.jsp +1 -1
- data/lib/rubyfox/server/data/www/manager/WEB-INF/jsp/connectorCiphers.jsp +1 -1
- data/lib/rubyfox/server/data/www/manager/WEB-INF/jsp/connectorTrustedCerts.jsp +1 -1
- data/lib/rubyfox/server/data/www/manager/WEB-INF/jsp/sessionDetail.jsp +3 -3
- data/lib/rubyfox/server/data/www/manager/WEB-INF/jsp/sessionsList.jsp +1 -1
- data/lib/rubyfox/server/data/www/manager/WEB-INF/web.xml +17 -0
- data/lib/rubyfox/server/data/www/manager/css/manager.css +141 -0
- data/lib/rubyfox/server/data/www/manager/images/tomcat.svg +967 -0
- data/lib/rubyfox/server/data/www/manager/xform.xsl +74 -59
- data/lib/rubyfox/server/version.rb +1 -1
- metadata +30 -31
- data/lib/rubyfox/server/data/config/admin/icons/Analytics.png +0 -0
- data/lib/rubyfox/server/data/config/admin/icons/BanManager.png +0 -0
- data/lib/rubyfox/server/data/config/admin/icons/BlueBoxMonitor.png +0 -0
- data/lib/rubyfox/server/data/config/admin/icons/Console.png +0 -0
- data/lib/rubyfox/server/data/config/admin/icons/Dashboard.png +0 -0
- data/lib/rubyfox/server/data/config/admin/icons/ExtensionManager.png +0 -0
- data/lib/rubyfox/server/data/config/admin/icons/LicenseManager.png +0 -0
- data/lib/rubyfox/server/data/config/admin/icons/LogViewer.png +0 -0
- data/lib/rubyfox/server/data/config/admin/icons/ServerConfigurator.png +0 -0
- data/lib/rubyfox/server/data/config/admin/icons/ServletManager.png +0 -0
- data/lib/rubyfox/server/data/config/admin/icons/ZoneConfigurator.png +0 -0
- data/lib/rubyfox/server/data/config/admin/icons/ZoneMonitor.png +0 -0
- data/lib/rubyfox/server/data/lib/BlueBox.war +0 -0
- data/lib/rubyfox/server/data/lib/apache-tomcat/LICENSE +0 -1061
- data/lib/rubyfox/server/data/lib/apache-tomcat/NOTICE +0 -68
- data/lib/rubyfox/server/data/lib/apache-tomcat/README.md +0 -81
- data/lib/rubyfox/server/data/lib/apache-tomcat/RELEASE-NOTES +0 -174
- data/lib/rubyfox/server/data/lib/imap.jar +0 -0
- data/lib/rubyfox/server/data/lib/mailapi.jar +0 -0
- data/lib/rubyfox/server/data/lib/pop3.jar +0 -0
- data/lib/rubyfox/server/data/lib/smtp.jar +0 -0
- data/lib/rubyfox/server/data/www/ROOT/admin/assets/js/core/modules/module-12~module-13~module-9.bundle.js +0 -2634
- data/lib/rubyfox/server/data/www/ROOT/admin/assets/js/core/modules/vendors~module-9.bundle.js +0 -807
- data/lib/rubyfox/server/data/www/host-manager/images/tomcat.gif +0 -0
- data/lib/rubyfox/server/data/www/manager/images/tomcat.gif +0 -0
- /data/lib/rubyfox/server/data/data/buddylists/{BasicExamples/.keep → .keep} +0 -0
@@ -0,0 +1,1787 @@
|
|
1
|
+
/*! (c) gotoAndPlay | All rights reserved */
|
2
|
+
(window["webpackJsonpapplication"] = window["webpackJsonpapplication"] || []).push([["module-16"],{
|
3
|
+
|
4
|
+
/***/ "./src/components/module-specific/words-files-manager.js":
|
5
|
+
/*!***************************************************************!*\
|
6
|
+
!*** ./src/components/module-specific/words-files-manager.js ***!
|
7
|
+
\***************************************************************/
|
8
|
+
/*! exports provided: WordsFilesManager */
|
9
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
10
|
+
|
11
|
+
"use strict";
|
12
|
+
__webpack_require__.r(__webpack_exports__);
|
13
|
+
/* WEBPACK VAR INJECTION */(function($) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WordsFilesManager", function() { return WordsFilesManager; });
|
14
|
+
/* harmony import */ var _utils_utilities__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../utils/utilities */ "./src/utils/utilities.js");
|
15
|
+
|
16
|
+
|
17
|
+
class WordsFilesManager extends HTMLElement
|
18
|
+
{
|
19
|
+
constructor()
|
20
|
+
{
|
21
|
+
super();
|
22
|
+
|
23
|
+
this.REFRESH_WORDS_FILES_CLICK_EVENT = 'refreshWordsFilesClick';
|
24
|
+
this.EDIT_WORDS_FILE_CLICK_EVENT = 'editWordsFileClick';
|
25
|
+
this.SAVE_WORDS_FILE_CLICK_EVENT = 'saveWordsFileClick';
|
26
|
+
this.REMOVE_WORDS_FILE_CLICK_EVENT = 'removeWordsFileClick';
|
27
|
+
this.ASSIGN_WORDS_FILE_CLICK_EVENT = 'assingWordsFileClick';
|
28
|
+
|
29
|
+
this.CONFIG_FOLDER = 'config/';
|
30
|
+
this.WORDS_FILE_EXT = '.words.txt';
|
31
|
+
|
32
|
+
this._modalHtml = `
|
33
|
+
<div class="modal" id="editModal" tabindex="-1" role="dialog" aria-labelledby="editModalTitle" aria-hidden="true">
|
34
|
+
<div class="modal-dialog modal-dialog-centered" role="document">
|
35
|
+
<div class="modal-content">
|
36
|
+
<div class="modal-header">
|
37
|
+
<h5 class="modal-title text-primary" id="editModalTitle">Word File Editor</h5>
|
38
|
+
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
39
|
+
<span aria-hidden="true">×</span>
|
40
|
+
</button>
|
41
|
+
</div>
|
42
|
+
<div class="modal-body in-flow-invalid-msg">
|
43
|
+
<fieldset id="editFieldset">
|
44
|
+
<div class="form-group">
|
45
|
+
<div class="col-form-label form-label-container">
|
46
|
+
<label for="filename" class="form-label">Filename <i class="fas fa-question-circle text-muted help" title="Name of the words file. The file will be saved in server's <em>config</em> folder."></i></label>
|
47
|
+
</div>
|
48
|
+
<div class="inner-widget">
|
49
|
+
<div class="input-group">
|
50
|
+
<input type="text" id="filename" name="filename" class="form-control k-textbox" autocomplete="off" required data-required-msg="Required" aria-describedby="extension" />
|
51
|
+
<div class="input-group-append">
|
52
|
+
<span class="input-group-text" id="extension">.words.txt</span>
|
53
|
+
</div>
|
54
|
+
</div>
|
55
|
+
<span class="k-invalid-msg position-static" data-for="filename"></span>
|
56
|
+
</div>
|
57
|
+
</div>
|
58
|
+
<div class="form-group">
|
59
|
+
<div class="col-form-label form-label-container">
|
60
|
+
<label for="content" class="form-label">Content <i class="fas fa-question-circle text-muted help" title="Enter a word or a valid regular expression per line. See configuration's <em>Words file</em> field description for additional information."></i></label>
|
61
|
+
</div>
|
62
|
+
<div class="inner-widget">
|
63
|
+
<textarea id="content" name="content" class="form-control k-textarea w-100" rows="10"></textarea>
|
64
|
+
<span class="k-invalid-msg position-static" data-for="content"></span>
|
65
|
+
</div>
|
66
|
+
</div>
|
67
|
+
</fieldset>
|
68
|
+
</div>
|
69
|
+
<div class="modal-footer flex-column">
|
70
|
+
<div class="d-flex w-100">
|
71
|
+
<div class="flex-grow-1 text-left">
|
72
|
+
<button id="saveWordFileButton" type="button" class="k-button k-primary"><i class="fas fa-save mr-1"></i>Save word file</button>
|
73
|
+
<i id="saveSpinner" class="fas fa-circle-notch fa-spin text-primary align-middle ml-1"></i>
|
74
|
+
</div>
|
75
|
+
<div class="flex-grow-1 text-right">
|
76
|
+
<button type="button" class="k-button k-secondary" data-dismiss="modal">Cancel</button>
|
77
|
+
</div>
|
78
|
+
</div>
|
79
|
+
</div>
|
80
|
+
</div>
|
81
|
+
</div>
|
82
|
+
</div>
|
83
|
+
`;
|
84
|
+
|
85
|
+
//-------------------------------------------
|
86
|
+
|
87
|
+
$(this).append(`
|
88
|
+
<div class="col-sm-5 col-lg-4 col-form-label form-label-container">
|
89
|
+
<label class="form-label">Available words files <i class="fas fa-question-circle text-muted help" title="The list of words files found in server's <em>config</em> folder. Click on the Assign button to set the <strong>Words file</strong> field to the selected file. Configuration submission is then required to save the new value."></i></label>
|
90
|
+
</div>
|
91
|
+
<div class="inner-widget align-self-center col-sm">
|
92
|
+
<div>
|
93
|
+
<div id="wordsFiles" class="limited-height"></div>
|
94
|
+
<div id="actionButtons" class="mt-2 text-right" disabled>
|
95
|
+
<i id="actionSpinner" class="fas fa-circle-notch fa-spin text-primary align-middle"></i>
|
96
|
+
<button id="refreshButton" type="button" class="k-button k-secondary ml-2" title="Refresh"><i class="fas fa-redo-alt"></i></button>
|
97
|
+
<button id="addButton" type="button" class="k-button k-secondary ml-2" title="Add"><i class="fas fa-plus"></i></button>
|
98
|
+
<button id="editButton" type="button" class="k-button k-secondary ml-2" title="Edit" disabled><i class="fas fa-pen"></i></button>
|
99
|
+
<button id="removeButton" type="button" class="k-button k-secondary ml-2" title="Remove" disabled><i class="fas fa-times"></i></button>
|
100
|
+
<button id="assignButton" type="button" class="k-button k-secondary ml-2" title="Assign" disabled><i class="fas fa-compress-arrows-alt"></i></button>
|
101
|
+
</div>
|
102
|
+
</div>
|
103
|
+
</div>
|
104
|
+
`);
|
105
|
+
|
106
|
+
//-------------------------------------------
|
107
|
+
|
108
|
+
// Initialize grid
|
109
|
+
this._wordsFilesGrid = $('#wordsFiles', $(this)).kendoGrid({
|
110
|
+
resizable: true,
|
111
|
+
selectable: 'row',
|
112
|
+
change: $.proxy(this._onWordsFilesGridSelectionChange, this),
|
113
|
+
columns: [
|
114
|
+
{
|
115
|
+
field: 'name',
|
116
|
+
title: 'Filename',
|
117
|
+
width: 120
|
118
|
+
},
|
119
|
+
{
|
120
|
+
field: 'date',
|
121
|
+
title: 'Date',
|
122
|
+
width: 80
|
123
|
+
},
|
124
|
+
{
|
125
|
+
field: 'size',
|
126
|
+
title: 'Size',
|
127
|
+
width: 80
|
128
|
+
}
|
129
|
+
],
|
130
|
+
noRecords: {
|
131
|
+
template: 'No files.'
|
132
|
+
}
|
133
|
+
}).data('kendoGrid');
|
134
|
+
|
135
|
+
// Add listeners to button clicks
|
136
|
+
$('#refreshButton', $(this)).on('click', $.proxy(this._onReloadClick, this));
|
137
|
+
$('#addButton', $(this)).on('click', $.proxy(this._onAddClick, this));
|
138
|
+
$('#editButton', $(this)).on('click', $.proxy(this._onEditClick, this));
|
139
|
+
$('#removeButton', $(this)).on('click', $.proxy(this._onRemoveClick, this));
|
140
|
+
$('#assignButton', $(this)).on('click', $.proxy(this._onAssignClick, this));
|
141
|
+
}
|
142
|
+
|
143
|
+
destroy()
|
144
|
+
{
|
145
|
+
// Destroy grid
|
146
|
+
this._wordsFilesGrid.destroy();
|
147
|
+
|
148
|
+
// Remove event listeners
|
149
|
+
$('#refreshButton', $(this)).off('click');
|
150
|
+
$('#addButton', $(this)).off('click');
|
151
|
+
$('#editButton', $(this)).off('click');
|
152
|
+
$('#removeButton', $(this)).off('click');
|
153
|
+
$('#assignButton', $(this)).off('click');
|
154
|
+
|
155
|
+
// Hide modal (which in turn destroys it)
|
156
|
+
let modalElement = $('#editModal', $(this));
|
157
|
+
|
158
|
+
if (modalElement)
|
159
|
+
modalElement.modal('hide');
|
160
|
+
}
|
161
|
+
|
162
|
+
get enabled()
|
163
|
+
{
|
164
|
+
return this._isEnabled;
|
165
|
+
}
|
166
|
+
|
167
|
+
set enabled(value)
|
168
|
+
{
|
169
|
+
this._isEnabled = value;
|
170
|
+
|
171
|
+
// Enable/disable buttons
|
172
|
+
$('#actionButtons', this).attr('disabled', !value);
|
173
|
+
|
174
|
+
// Hide spinner
|
175
|
+
if (value)
|
176
|
+
this.actionSpinnerVisible = false;
|
177
|
+
|
178
|
+
// Enable/disable modal
|
179
|
+
let modalElement = $('#editModal', $(this));
|
180
|
+
|
181
|
+
if (modalElement)
|
182
|
+
{
|
183
|
+
// Disable modal close buttons
|
184
|
+
$('button[data-dismiss="modal"]', modalElement).attr('disabled', !value);
|
185
|
+
|
186
|
+
// Disable save button
|
187
|
+
$('#saveWordFileButton', modalElement).attr('disabled', !value);
|
188
|
+
|
189
|
+
// Disable fieldset
|
190
|
+
$('#editFieldset', modalElement).attr('disabled', !value);
|
191
|
+
|
192
|
+
// Hide spinner
|
193
|
+
if (value)
|
194
|
+
this.saveSpinnerVisible = false;
|
195
|
+
}
|
196
|
+
}
|
197
|
+
|
198
|
+
set actionSpinnerVisible(value)
|
199
|
+
{
|
200
|
+
if (value)
|
201
|
+
$('#actionSpinner', $(this)).show();
|
202
|
+
else
|
203
|
+
$('#actionSpinner', $(this)).hide();
|
204
|
+
}
|
205
|
+
|
206
|
+
set saveSpinnerVisible(value)
|
207
|
+
{
|
208
|
+
let modalElement = $('#editModal', $(this));
|
209
|
+
|
210
|
+
if (modalElement)
|
211
|
+
{
|
212
|
+
if (value)
|
213
|
+
$('#saveSpinner', modalElement).show();
|
214
|
+
else
|
215
|
+
$('#saveSpinner', modalElement).hide();
|
216
|
+
}
|
217
|
+
}
|
218
|
+
|
219
|
+
refreshWordsFilesList(wordsFilesList, hideEditModal)
|
220
|
+
{
|
221
|
+
if (hideEditModal)
|
222
|
+
{
|
223
|
+
let modalElement = $('#editModal', $(this));
|
224
|
+
|
225
|
+
if (modalElement)
|
226
|
+
modalElement.modal('hide');
|
227
|
+
}
|
228
|
+
|
229
|
+
let files = [];
|
230
|
+
this._existingFilenames = [];
|
231
|
+
|
232
|
+
for (let f = 0; f < wordsFilesList.size(); f++)
|
233
|
+
{
|
234
|
+
const file = wordsFilesList.getSFSObject(f);
|
235
|
+
|
236
|
+
const fileObj = {};
|
237
|
+
fileObj.name = file.getUtfString('name');
|
238
|
+
fileObj.date = file.getUtfString('date') + ' ' + file.getUtfString('time');
|
239
|
+
fileObj.size = Object(_utils_utilities__WEBPACK_IMPORTED_MODULE_0__["bytesToSize"])(file.getLong('size'), 2);
|
240
|
+
|
241
|
+
// Populate files list
|
242
|
+
files.push(fileObj);
|
243
|
+
|
244
|
+
// Save ref to existing filenames, to check them when a new file is created
|
245
|
+
this._existingFilenames.push(fileObj.name);
|
246
|
+
}
|
247
|
+
|
248
|
+
// Assign data source to grid
|
249
|
+
this._setWordsFilesGridDataSource(files);
|
250
|
+
this._onWordsFilesGridSelectionChange();
|
251
|
+
|
252
|
+
// Enable
|
253
|
+
this.enabled = true;
|
254
|
+
}
|
255
|
+
|
256
|
+
getSelectedWordsFileName()
|
257
|
+
{
|
258
|
+
if (this._wordsFilesGrid.select() != null)
|
259
|
+
{
|
260
|
+
let selectedIndex = this._wordsFilesGrid.select().index();
|
261
|
+
return this._wordsFilesGrid.dataSource.at(selectedIndex).name;
|
262
|
+
}
|
263
|
+
else
|
264
|
+
return null;
|
265
|
+
}
|
266
|
+
|
267
|
+
editWordsFile(filename, content)
|
268
|
+
{
|
269
|
+
this._isNewFile = false;
|
270
|
+
|
271
|
+
this.enabled = true;
|
272
|
+
|
273
|
+
// Show modal
|
274
|
+
this._showModal();
|
275
|
+
|
276
|
+
// Remove default extension from filename
|
277
|
+
filename = filename.substring(0, filename.lastIndexOf(this.WORDS_FILE_EXT));
|
278
|
+
|
279
|
+
// Enter content filename and content in modal form
|
280
|
+
$('#editModal #filename', $(this)).val(filename);
|
281
|
+
$('#editModal #content', $(this)).val(content);
|
282
|
+
|
283
|
+
// Set filename field as not editable and hide note
|
284
|
+
$('#editModal #filename', $(this)).attr('disabled', true);
|
285
|
+
$('#editModal #filenameNote', $(this)).hide();
|
286
|
+
}
|
287
|
+
|
288
|
+
getExistingFilenames()
|
289
|
+
{
|
290
|
+
return this._existingFilenames;
|
291
|
+
}
|
292
|
+
|
293
|
+
_setWordsFilesGridDataSource(ds)
|
294
|
+
{
|
295
|
+
// Read current horizontal scroll value
|
296
|
+
const scrollLeft = $('#wordsFiles .k-grid-content', this._wordsFilesGrid.wrapper).scrollLeft();
|
297
|
+
|
298
|
+
// Assign data source to grid
|
299
|
+
this._wordsFilesGrid.setDataSource(ds);
|
300
|
+
|
301
|
+
// Set horizontal scroll
|
302
|
+
$('#wordsFiles .k-grid-content', this._wordsFilesGrid.wrapper).scrollLeft(scrollLeft);
|
303
|
+
}
|
304
|
+
|
305
|
+
_onWordsFilesGridSelectionChange()
|
306
|
+
{
|
307
|
+
// Enable/disable buttons
|
308
|
+
const selectedRows = this._wordsFilesGrid.select();
|
309
|
+
$('#editButton').attr('disabled', selectedRows.length == 0);
|
310
|
+
$('#removeButton').attr('disabled', selectedRows.length == 0);
|
311
|
+
$('#assignButton').attr('disabled', selectedRows.length == 0);
|
312
|
+
}
|
313
|
+
|
314
|
+
_onReloadClick()
|
315
|
+
{
|
316
|
+
// Fire event to request file content to server
|
317
|
+
let evt = new CustomEvent(this.REFRESH_WORDS_FILES_CLICK_EVENT, {
|
318
|
+
detail: null,
|
319
|
+
bubbles: false,
|
320
|
+
cancelable: false
|
321
|
+
});
|
322
|
+
|
323
|
+
this.dispatchEvent(evt);
|
324
|
+
}
|
325
|
+
|
326
|
+
_onAddClick()
|
327
|
+
{
|
328
|
+
this._isNewFile = true;
|
329
|
+
|
330
|
+
// Show modal
|
331
|
+
this._showModal();
|
332
|
+
}
|
333
|
+
|
334
|
+
_onEditClick()
|
335
|
+
{
|
336
|
+
// Disable buttons
|
337
|
+
this.enabled = false;
|
338
|
+
this.actionSpinnerVisible = true;
|
339
|
+
|
340
|
+
// Fire event to request file content to server
|
341
|
+
let evt = new CustomEvent(this.EDIT_WORDS_FILE_CLICK_EVENT, {
|
342
|
+
detail: this.getSelectedWordsFileName(),
|
343
|
+
bubbles: false,
|
344
|
+
cancelable: false
|
345
|
+
});
|
346
|
+
|
347
|
+
this.dispatchEvent(evt);
|
348
|
+
}
|
349
|
+
|
350
|
+
_onRemoveClick()
|
351
|
+
{
|
352
|
+
// Fire event to request file removal to server
|
353
|
+
let evt = new CustomEvent(this.REMOVE_WORDS_FILE_CLICK_EVENT, {
|
354
|
+
detail: this.getSelectedWordsFileName(),
|
355
|
+
bubbles: false,
|
356
|
+
cancelable: false
|
357
|
+
});
|
358
|
+
|
359
|
+
this.dispatchEvent(evt);
|
360
|
+
}
|
361
|
+
|
362
|
+
_onAssignClick()
|
363
|
+
{
|
364
|
+
// Fire event to substitute path in configuration
|
365
|
+
let evt = new CustomEvent(this.ASSIGN_WORDS_FILE_CLICK_EVENT, {
|
366
|
+
detail: this.CONFIG_FOLDER + this.getSelectedWordsFileName(),
|
367
|
+
bubbles: false,
|
368
|
+
cancelable: false
|
369
|
+
});
|
370
|
+
|
371
|
+
this.dispatchEvent(evt);
|
372
|
+
}
|
373
|
+
|
374
|
+
_onSaveWordFileClick()
|
375
|
+
{
|
376
|
+
if (this._validator.validate())
|
377
|
+
{
|
378
|
+
// Show spinner
|
379
|
+
$('#editModal #saveSpinner', $(this)).show();
|
380
|
+
|
381
|
+
// Fire event to request file to be saved by server
|
382
|
+
let evt = new CustomEvent(this.SAVE_WORDS_FILE_CLICK_EVENT, {
|
383
|
+
detail: {
|
384
|
+
filename: $('#editModal #filename', $(this)).val() + this.WORDS_FILE_EXT,
|
385
|
+
isNew: this._isNewFile,
|
386
|
+
content: $('#editModal #content', $(this)).val()
|
387
|
+
},
|
388
|
+
bubbles: false,
|
389
|
+
cancelable: false
|
390
|
+
});
|
391
|
+
|
392
|
+
this.dispatchEvent(evt);
|
393
|
+
}
|
394
|
+
}
|
395
|
+
|
396
|
+
_showModal()
|
397
|
+
{
|
398
|
+
// Append modal html
|
399
|
+
$(this).append(this._modalHtml);
|
400
|
+
|
401
|
+
let modalElement = $('#editModal', $(this));
|
402
|
+
|
403
|
+
// Initialize kendo validation
|
404
|
+
this._validator = modalElement.find('#editFieldset').kendoValidator({
|
405
|
+
validateOnBlur: true,
|
406
|
+
rules: {
|
407
|
+
requiredFilename: $.proxy(function(input) {
|
408
|
+
let valid = true;
|
409
|
+
if (input.is('[name=filename]'))
|
410
|
+
valid = input.val() !== '';
|
411
|
+
return valid;
|
412
|
+
}, this),
|
413
|
+
validFilename: $.proxy(function(input) {
|
414
|
+
let valid = true;
|
415
|
+
if (input.is('[name=filename]'))
|
416
|
+
valid = (!input.val().includes('\\') && !input.val().includes('/'));
|
417
|
+
return valid;
|
418
|
+
}, this)
|
419
|
+
},
|
420
|
+
messages: {
|
421
|
+
requiredFilename: 'Required',
|
422
|
+
validFilename: 'Contains invalid characters (slash, backslash)'
|
423
|
+
}
|
424
|
+
}).data('kendoValidator');
|
425
|
+
|
426
|
+
// Hide save spinner
|
427
|
+
$('#saveSpinner', modalElement).hide();
|
428
|
+
|
429
|
+
// Add listener to Save button click
|
430
|
+
$('#saveWordFileButton', modalElement).on('click', $.proxy(this._onSaveWordFileClick, this));
|
431
|
+
|
432
|
+
// Add listener to modal hide event
|
433
|
+
modalElement.on('hidden.bs.modal', $.proxy(this._destroyModal, this));
|
434
|
+
|
435
|
+
// Initialize bootstrap modal
|
436
|
+
modalElement.modal({
|
437
|
+
backdrop: 'static',
|
438
|
+
keyboard: false,
|
439
|
+
});
|
440
|
+
}
|
441
|
+
|
442
|
+
_destroyModal()
|
443
|
+
{
|
444
|
+
let modalElement = $('#editModal', $(this));
|
445
|
+
|
446
|
+
if (modalElement)
|
447
|
+
{
|
448
|
+
// Remove listeners
|
449
|
+
$('#saveWordFileButton', modalElement).off('click');
|
450
|
+
modalElement.off('hidden.bs.modal');
|
451
|
+
|
452
|
+
// Destroy everything Kendo
|
453
|
+
kendo.destroy(modalElement);
|
454
|
+
|
455
|
+
// Dispose modal
|
456
|
+
modalElement.modal('dispose');
|
457
|
+
|
458
|
+
// Remove html
|
459
|
+
modalElement.remove();
|
460
|
+
modalElement = null;
|
461
|
+
}
|
462
|
+
}
|
463
|
+
}
|
464
|
+
|
465
|
+
// DEFINE COMPONENT
|
466
|
+
if (!window.customElements.get('words-files-manager'))
|
467
|
+
window.customElements.define('words-files-manager', WordsFilesManager);
|
468
|
+
|
469
|
+
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! jquery */ "jquery")))
|
470
|
+
|
471
|
+
/***/ }),
|
472
|
+
|
473
|
+
/***/ "./src/components/sidebar-layout.js":
|
474
|
+
/*!******************************************!*\
|
475
|
+
!*** ./src/components/sidebar-layout.js ***!
|
476
|
+
\******************************************/
|
477
|
+
/*! exports provided: SidebarLayout */
|
478
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
479
|
+
|
480
|
+
"use strict";
|
481
|
+
__webpack_require__.r(__webpack_exports__);
|
482
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SidebarLayout", function() { return SidebarLayout; });
|
483
|
+
class SidebarLayout extends HTMLElement
|
484
|
+
{
|
485
|
+
constructor()
|
486
|
+
{
|
487
|
+
super();
|
488
|
+
|
489
|
+
// Attach a shadow root
|
490
|
+
const shadowRoot = this.attachShadow({mode: 'open'});
|
491
|
+
shadowRoot.innerHTML = `
|
492
|
+
<style>
|
493
|
+
:host {
|
494
|
+
display: flex;
|
495
|
+
flex-direction: row;
|
496
|
+
}
|
497
|
+
|
498
|
+
@media (max-width: 575.98px) {
|
499
|
+
:host(.split-xs) ::slotted(:not([aria-selected="true"])) {
|
500
|
+
display: none !important;
|
501
|
+
}
|
502
|
+
|
503
|
+
:host(.split-xs) ::slotted([aria-selected="true"]) {
|
504
|
+
flex-grow: 1;
|
505
|
+
}
|
506
|
+
}
|
507
|
+
|
508
|
+
@media (max-width: 767.98px) {
|
509
|
+
:host(.split-sm) ::slotted(:not([aria-selected="true"])) {
|
510
|
+
display: none !important;
|
511
|
+
}
|
512
|
+
|
513
|
+
:host(.split-sm) ::slotted([aria-selected="true"]) {
|
514
|
+
flex-grow: 1;
|
515
|
+
}
|
516
|
+
}
|
517
|
+
|
518
|
+
@media (max-width: 991.98px) {
|
519
|
+
:host(.split-md) ::slotted(:not([aria-selected="true"])) {
|
520
|
+
display: none !important;
|
521
|
+
}
|
522
|
+
|
523
|
+
:host(.split-md) ::slotted([aria-selected="true"]) {
|
524
|
+
flex-grow: 1;
|
525
|
+
}
|
526
|
+
}
|
527
|
+
|
528
|
+
@media (max-width: 1199.98px) {
|
529
|
+
:host(.split-lg) ::slotted(:not([aria-selected="true"])) {
|
530
|
+
display: none !important;
|
531
|
+
}
|
532
|
+
|
533
|
+
:host(.split-lg) ::slotted([aria-selected="true"]) {
|
534
|
+
flex-grow: 1;
|
535
|
+
}
|
536
|
+
}
|
537
|
+
|
538
|
+
.side-col::slotted(*) {
|
539
|
+
}
|
540
|
+
|
541
|
+
.main-col::slotted(*) {
|
542
|
+
flex-grow: 1;
|
543
|
+
}
|
544
|
+
</style>
|
545
|
+
|
546
|
+
<slot class="side-col" name="side-column"></slot>
|
547
|
+
<slot class="main-col" name="main-column"></slot>
|
548
|
+
`;
|
549
|
+
|
550
|
+
// Set initial selection
|
551
|
+
this.selectedIndex = 0;
|
552
|
+
}
|
553
|
+
|
554
|
+
get selectedPanel()
|
555
|
+
{
|
556
|
+
return this._selectedPanel;
|
557
|
+
}
|
558
|
+
|
559
|
+
set selectedPanel(element) // 'side' or 'main'
|
560
|
+
{
|
561
|
+
if (element != null && element.parentNode == this)
|
562
|
+
{
|
563
|
+
this._selectedPanel = element;
|
564
|
+
|
565
|
+
for (let element of this.children)
|
566
|
+
{
|
567
|
+
if (element == this._selectedPanel)
|
568
|
+
element.setAttribute('aria-selected', 'true');
|
569
|
+
else
|
570
|
+
element.removeAttribute('aria-selected');
|
571
|
+
}
|
572
|
+
}
|
573
|
+
else
|
574
|
+
{
|
575
|
+
console.error('Element is not a child of SidebarLayout');
|
576
|
+
}
|
577
|
+
}
|
578
|
+
|
579
|
+
get selectedIndex()
|
580
|
+
{
|
581
|
+
return Array.from(this.children).indexOf(this._selectedPanel);
|
582
|
+
}
|
583
|
+
|
584
|
+
set selectedIndex(index)
|
585
|
+
{
|
586
|
+
if (this.children.length > 0)
|
587
|
+
{
|
588
|
+
if (this.children[index] == null)
|
589
|
+
{
|
590
|
+
console.error('Invalid SidebarLayout index');
|
591
|
+
return;
|
592
|
+
}
|
593
|
+
|
594
|
+
let element = this.children[index];
|
595
|
+
this.selectedPanel = element;
|
596
|
+
}
|
597
|
+
}
|
598
|
+
}
|
599
|
+
|
600
|
+
// DEFINE COMPONENT
|
601
|
+
if (!window.customElements.get('sidebar-layout'))
|
602
|
+
window.customElements.define('sidebar-layout', SidebarLayout);
|
603
|
+
|
604
|
+
|
605
|
+
/***/ }),
|
606
|
+
|
607
|
+
/***/ "./src/modules/zone-configurator.js":
|
608
|
+
/*!******************************************!*\
|
609
|
+
!*** ./src/modules/zone-configurator.js ***!
|
610
|
+
\******************************************/
|
611
|
+
/*! exports provided: default */
|
612
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
613
|
+
|
614
|
+
"use strict";
|
615
|
+
__webpack_require__.r(__webpack_exports__);
|
616
|
+
/* WEBPACK VAR INJECTION */(function($) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ZoneConfigurator; });
|
617
|
+
/* harmony import */ var _base_module__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./base-module */ "./src/modules/base-module.js");
|
618
|
+
/* harmony import */ var _components_view_stack__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../components/view-stack */ "./src/components/view-stack.js");
|
619
|
+
/* harmony import */ var _components_sidebar_layout__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../components/sidebar-layout */ "./src/components/sidebar-layout.js");
|
620
|
+
/* harmony import */ var _utils_uibuilder_config_interface_builder__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils/uibuilder/config-interface-builder */ "./src/utils/uibuilder/config-interface-builder.js");
|
621
|
+
/* harmony import */ var _utils_utilities__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../utils/utilities */ "./src/utils/utilities.js");
|
622
|
+
/* harmony import */ var _components_module_specific_words_files_manager__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../components/module-specific/words-files-manager */ "./src/components/module-specific/words-files-manager.js");
|
623
|
+
|
624
|
+
|
625
|
+
|
626
|
+
|
627
|
+
|
628
|
+
|
629
|
+
|
630
|
+
class ZoneConfigurator extends _base_module__WEBPACK_IMPORTED_MODULE_0__["BaseModule"]
|
631
|
+
{
|
632
|
+
constructor()
|
633
|
+
{
|
634
|
+
super('zoneConfig');
|
635
|
+
|
636
|
+
this.ITEM_TYPE_ZONE = 'zone';
|
637
|
+
this.ITEM_TYPE_ROOM = 'room';
|
638
|
+
|
639
|
+
// Outgoing requests
|
640
|
+
this.REQ_GET_ZONES = 'getZones';
|
641
|
+
|
642
|
+
this.REQ_GET_ZONE_CONFIG = 'getZoneConfig';
|
643
|
+
this.REQ_SAVE_ZONE_CONFIG = 'saveZoneConfig';
|
644
|
+
this.REQ_NEW_ZONE_CONFIG = 'newZoneConfig';
|
645
|
+
this.REQ_DELETE_ZONE_CONFIG = 'delZoneConfig';
|
646
|
+
this.REQ_ACTIVATE_ZONE = 'actZone';
|
647
|
+
|
648
|
+
this.REQ_GET_ROOM_CONFIG = 'getRoomConfig';
|
649
|
+
this.REQ_SAVE_ROOM_CONFIG = 'saveRoomConfig';
|
650
|
+
this.REQ_NEW_ROOM_CONFIG = 'newRoomConfig';
|
651
|
+
this.REQ_DELETE_ROOM_CONFIG = 'delRoomConfig';
|
652
|
+
|
653
|
+
this.REQ_REFRESH_WORDS_FILE = 'refreshWordsFiles';
|
654
|
+
this.REQ_EDIT_WORDS_FILE = 'editWordsFile';
|
655
|
+
this.REQ_SAVE_WORDS_FILE = 'saveWordsFile';
|
656
|
+
this.REQ_DELETE_WORDS_FILE = 'delWordsFile';
|
657
|
+
|
658
|
+
// Incoming responses
|
659
|
+
this.RESP_ZONES = 'zones';
|
660
|
+
|
661
|
+
this.RESP_ZONE_CONFIG = 'zoneConfig';
|
662
|
+
this.RESP_ZONE_CONFIG_UPDATE_CONFIRM = 'zoneCfgUpd';
|
663
|
+
this.RESP_ZONE_ADDED = 'zoneAdded';
|
664
|
+
this.RESP_ZONE_REFUSED = 'zoneRefused';
|
665
|
+
this.RESP_ZONE_DELETED = 'zoneDel';
|
666
|
+
this.RESP_ZONE_ACTIVATED = 'zoneAct';
|
667
|
+
this.RESP_ZONE_ACTIVATION_ERROR = 'zoneActErr';
|
668
|
+
|
669
|
+
this.RESP_ROOM_CONFIG = 'roomConfig';
|
670
|
+
this.RESP_ROOM_CONFIG_UPDATE_CONFIRM = 'roomCfgUpd';
|
671
|
+
this.RESP_ROOM_ADDED = 'roomAdded';
|
672
|
+
this.RESP_ROOM_REFUSED = 'roomRefused';
|
673
|
+
this.RESP_ROOM_DELETED = 'roomDel';
|
674
|
+
|
675
|
+
this.RESP_REFRESH_WORDS_FILES = 'refreshWordsFiles';
|
676
|
+
this.RESP_WORDS_FILE_CONTENT = 'wordsFile';
|
677
|
+
this.RESP_WORDS_FILE_ERROR = 'wordsFileErr';
|
678
|
+
}
|
679
|
+
|
680
|
+
//------------------------------------
|
681
|
+
// COMMON MODULE INTERFACE METHODS
|
682
|
+
// This members are used by the main controller
|
683
|
+
// to communicate with the module's controller.
|
684
|
+
// This methods override those in BaseModule class.
|
685
|
+
//------------------------------------
|
686
|
+
|
687
|
+
initialize(idData, shellController)
|
688
|
+
{
|
689
|
+
// Call super method
|
690
|
+
super.initialize(idData, shellController);
|
691
|
+
|
692
|
+
// Create interface builder instance
|
693
|
+
this._interfaceBuilder = new _utils_uibuilder_config_interface_builder__WEBPACK_IMPORTED_MODULE_3__["ConfigInterfaceBuilder"]();
|
694
|
+
|
695
|
+
// Set listener for custom actions triggered by configuration interface
|
696
|
+
$('#znc-tabNavigator').on('value-set', $.proxy(this._onConfigValueSet, this));
|
697
|
+
|
698
|
+
// Initialize Zones/Rooms treeview
|
699
|
+
this._treeview = $('#znc-treeView').kendoTreeView({
|
700
|
+
loadOnDemand: false,
|
701
|
+
dataTextField: 'name',
|
702
|
+
template: kendo.template('<span class="# if (!item.active) { # inactive-list-item # } #">#: item.name #</span>'),
|
703
|
+
change: $.proxy(this._onZoneRoomChange, this),
|
704
|
+
}).data('kendoTreeView');
|
705
|
+
|
706
|
+
// Listen to treeview double-click event
|
707
|
+
$('#znc-treeView').on('dblclick', $.proxy(this._onTreeItemDoubleClick, this));
|
708
|
+
|
709
|
+
// Request zones & rooms list to server instance
|
710
|
+
this.sendExtensionRequest(this.REQ_GET_ZONES);
|
711
|
+
|
712
|
+
// Initialize progress bar
|
713
|
+
$('#znc-progressBar').kendoProgressBar({
|
714
|
+
min: 0,
|
715
|
+
max: 100,
|
716
|
+
value: false,
|
717
|
+
type: 'value',
|
718
|
+
animation: {
|
719
|
+
duration: 400
|
720
|
+
}
|
721
|
+
});
|
722
|
+
|
723
|
+
// Add listeners to utility buttons
|
724
|
+
$('#znc-addZoneButton').on('click', $.proxy(this._onAddZoneClick, this));
|
725
|
+
$('#znc-addRoomButton').on('click', $.proxy(this._onAddRoomClick, this));
|
726
|
+
$('#znc-editButton').on('click', $.proxy(this._onEditClick, this));
|
727
|
+
$('#znc-removeButton').on('click', $.proxy(this._onRemoveClick, this));
|
728
|
+
$('#znc-activateButton').on('click', $.proxy(this._onActivateClick, this));
|
729
|
+
|
730
|
+
// Add listener to interface buttons
|
731
|
+
$('#znc-cancelButton').on('click', $.proxy(this._onCancelClick, this));
|
732
|
+
$('#znc-reloadButton').on('click', $.proxy(this._onReloadClick, this));
|
733
|
+
$('#znc-submitButton').on('click', $.proxy(this._onSubmitClick, this));
|
734
|
+
|
735
|
+
// Save ref to words files manager and add custom event listeners
|
736
|
+
this._wordsFilesManager = document.getElementById('znc-wordsFilesManager');
|
737
|
+
$(this._wordsFilesManager).on(this._wordsFilesManager.REFRESH_WORDS_FILES_CLICK_EVENT, $.proxy(this._onWordsFileReloadClick, this));
|
738
|
+
$(this._wordsFilesManager).on(this._wordsFilesManager.EDIT_WORDS_FILE_CLICK_EVENT, $.proxy(this._onWordsFileEditClick, this));
|
739
|
+
$(this._wordsFilesManager).on(this._wordsFilesManager.SAVE_WORDS_FILE_CLICK_EVENT, $.proxy(this._onWordsFileSaveClick, this));
|
740
|
+
$(this._wordsFilesManager).on(this._wordsFilesManager.REMOVE_WORDS_FILE_CLICK_EVENT, $.proxy(this._onWordsFileRemoveClick, this));
|
741
|
+
$(this._wordsFilesManager).on(this._wordsFilesManager.ASSIGN_WORDS_FILE_CLICK_EVENT, $.proxy(this._onWordsFileAssignClick, this));
|
742
|
+
}
|
743
|
+
|
744
|
+
destroy()
|
745
|
+
{
|
746
|
+
// Call super method
|
747
|
+
super.destroy();
|
748
|
+
|
749
|
+
// Remove tree view doubleclick listener
|
750
|
+
$('#znc-treeView').off('dblclick');
|
751
|
+
|
752
|
+
// Remove listener for custom actions triggered by configuration interface
|
753
|
+
$('#znc-tabNavigator').off('value-set');
|
754
|
+
|
755
|
+
// Remove listener for zone/room activation event
|
756
|
+
$('#znc-addZoneButton').off('click');
|
757
|
+
$('#znc-addRoomButton').off('click');
|
758
|
+
$('#znc-editButton').off('click');
|
759
|
+
$('#znc-removeButton').off('click');
|
760
|
+
$('#znc-activateButton').off('click');
|
761
|
+
|
762
|
+
// Remove interface buttons click listeners
|
763
|
+
$('#znc-cancelButton').off('click');
|
764
|
+
$('#znc-reloadButton').off('click');
|
765
|
+
$('#znc-submitButton').off('click');
|
766
|
+
|
767
|
+
// Remove listeners to words files manager
|
768
|
+
$(this._wordsFilesManager).off(this._wordsFilesManager.REFRESH_WORDS_FILES_CLICK_EVENT);
|
769
|
+
$(this._wordsFilesManager).off(this._wordsFilesManager.EDIT_WORDS_FILE_CLICK_EVENT);
|
770
|
+
$(this._wordsFilesManager).off(this._wordsFilesManager.SAVE_WORDS_FILE_CLICK_EVENT);
|
771
|
+
$(this._wordsFilesManager).off(this._wordsFilesManager.REMOVE_WORDS_FILE_CLICK_EVENT);
|
772
|
+
$(this._wordsFilesManager).off(this._wordsFilesManager.ASSIGN_WORDS_FILE_CLICK_EVENT);
|
773
|
+
|
774
|
+
// Clear tabs container
|
775
|
+
this._clearTabs();
|
776
|
+
}
|
777
|
+
|
778
|
+
onExtensionCommand(command, data)
|
779
|
+
{
|
780
|
+
const username = data.getUtfString('user');
|
781
|
+
|
782
|
+
/****** ZONES & ROOMS ******/
|
783
|
+
|
784
|
+
// Zones & rooms list received
|
785
|
+
if (command == this.RESP_ZONES)
|
786
|
+
this._populateTree(data);
|
787
|
+
|
788
|
+
// Zone or room configuration data received
|
789
|
+
else if (command == this.RESP_ZONE_CONFIG || command == this.RESP_ROOM_CONFIG)
|
790
|
+
{
|
791
|
+
// Build user interface based on received data
|
792
|
+
this._interfaceBuilder.buildInterface(data.getSFSArray('settings'), 'znc-tabNavigator', false);
|
793
|
+
|
794
|
+
// Enable scrolling tabs (if needed)
|
795
|
+
if (this._reinitTabs)
|
796
|
+
{
|
797
|
+
$('#znc-tabNavigator #tabs').scrollingTabs({
|
798
|
+
bootstrapVersion: 4,
|
799
|
+
scrollToTabEdge: true,
|
800
|
+
enableSwiping: true,
|
801
|
+
disableScrollArrowsOnFullyScrolled: true,
|
802
|
+
cssClassLeftArrow: 'fa fa-chevron-left',
|
803
|
+
cssClassRightArrow: 'fa fa-chevron-right'
|
804
|
+
});
|
805
|
+
}
|
806
|
+
|
807
|
+
// Enable interface
|
808
|
+
this._enableConfigInterface(true);
|
809
|
+
}
|
810
|
+
|
811
|
+
/****** ZONES ******/
|
812
|
+
|
813
|
+
// Zone configuration update confirmation
|
814
|
+
else if (command == this.RESP_ZONE_CONFIG_UPDATE_CONFIRM)
|
815
|
+
{
|
816
|
+
// If a 'name' parameter is received, it means the zone name changed, and we have to update the zones list
|
817
|
+
if (data.getUtfString('zName') != null)
|
818
|
+
this._updateZoneNameInList(data.getInt('zId'), data.getUtfString('zName'));
|
819
|
+
|
820
|
+
// If the current user is the updater, show a notification; otherwise, show a dialog box suggesting to reload
|
821
|
+
if (username == this.smartFox.mySelf.name)
|
822
|
+
{
|
823
|
+
// Enable interface
|
824
|
+
this._enableConfigInterface(true);
|
825
|
+
|
826
|
+
// Display notification
|
827
|
+
this.shellCtrl.showNotification('Zone modified', `Zone settings updated successfully; changes will be applied on next <strong>server restart</strong>`);
|
828
|
+
|
829
|
+
// Reset the 'modified' flag
|
830
|
+
this._interfaceBuilder.resetIsModified();
|
831
|
+
}
|
832
|
+
else
|
833
|
+
{
|
834
|
+
// An alert box is displayed if the user is currently editing the same zone
|
835
|
+
if (data.getInt('zId') == this._editedZoneId)
|
836
|
+
{
|
837
|
+
// Show alert
|
838
|
+
this.shellCtrl.showSimpleAlert(`Administrator ${username} has modified the Zone you are currently editing; please reload to update your view.`);
|
839
|
+
|
840
|
+
// Disable submit button
|
841
|
+
$('#znc-submitButton').attr('disabled', true);
|
842
|
+
}
|
843
|
+
else
|
844
|
+
{
|
845
|
+
// Display notification
|
846
|
+
if (data.getUtfString('zName') != null)
|
847
|
+
this.shellCtrl.showNotification('Zone renamed', `Administrator ${username} has changed the name on one of the Zones`);
|
848
|
+
}
|
849
|
+
}
|
850
|
+
}
|
851
|
+
|
852
|
+
// New zone added
|
853
|
+
else if (command == this.RESP_ZONE_ADDED)
|
854
|
+
{
|
855
|
+
const zoneName = data.getSFSObject('zone').getUtfString('name');
|
856
|
+
|
857
|
+
// If the current user is the updater, reset the interface; otherwise, just show a notification
|
858
|
+
if (username == this.smartFox.mySelf.name)
|
859
|
+
{
|
860
|
+
// Reset interface
|
861
|
+
this._onCancelClick();
|
862
|
+
|
863
|
+
// Display notification
|
864
|
+
this.shellCtrl.showNotification('Zone added', `Zone '${zoneName}' created successfully`);
|
865
|
+
}
|
866
|
+
else
|
867
|
+
{
|
868
|
+
// Display notification
|
869
|
+
this.shellCtrl.showNotification('Zone added', `Administrator ${username} created Zone '${zoneName}'`);
|
870
|
+
}
|
871
|
+
|
872
|
+
// Add new zone to tree
|
873
|
+
let zonesDS = this._treeview.dataSource;
|
874
|
+
zonesDS.add(this._createZoneObject(data.getSFSObject('zone')));
|
875
|
+
zonesDS.sync();
|
876
|
+
}
|
877
|
+
|
878
|
+
// New zone creation refused due to invalid zone name
|
879
|
+
else if (command == this.RESP_ZONE_REFUSED)
|
880
|
+
{
|
881
|
+
// Re-enable interface
|
882
|
+
this._enableConfigInterface(true);
|
883
|
+
|
884
|
+
// Show warning
|
885
|
+
this.shellCtrl.showSimpleAlert('Zone configuration can\'t be saved because another Zone with the same name already exists.', true);
|
886
|
+
}
|
887
|
+
|
888
|
+
// Existing zone deleted
|
889
|
+
else if (command == this.RESP_ZONE_DELETED)
|
890
|
+
{
|
891
|
+
// If the current user is the deleter, reset the interface; otherwise, just show a notification
|
892
|
+
if (username == this.smartFox.mySelf.name)
|
893
|
+
{
|
894
|
+
// Re-enable interface
|
895
|
+
this._enableListInterface(true);
|
896
|
+
|
897
|
+
// Display notification
|
898
|
+
this.shellCtrl.showNotification('Zone removed', `Zone '${data.getUtfString('zName')}' deleted successfully`);
|
899
|
+
}
|
900
|
+
else
|
901
|
+
{
|
902
|
+
// An alert box is displayed if the user is currently editing the same zone
|
903
|
+
if (data.getInt('zId') == this._editedZoneId)
|
904
|
+
{
|
905
|
+
// Show alert
|
906
|
+
this.shellCtrl.showSimpleAlert(`Administrator ${username} has deleted the Zone you are currently modifying; you have to cancel your editing.`);
|
907
|
+
|
908
|
+
// Disable submit and reload buttons
|
909
|
+
$('#znc-reloadButton').attr('disabled', true);
|
910
|
+
$('#znc-submitButton').attr('disabled', true);
|
911
|
+
}
|
912
|
+
else
|
913
|
+
{
|
914
|
+
// Display notification
|
915
|
+
this.shellCtrl.showNotification('Zone removed', `Administrator ${username} deleted Zone '${data.getUtfString('zName')}'`);
|
916
|
+
}
|
917
|
+
}
|
918
|
+
|
919
|
+
// Reset selection if the currently selected item or its parent is being removed
|
920
|
+
let selectedNode = this._treeview.select();
|
921
|
+
let selectedDataItem = this._treeview.dataItem(selectedNode);
|
922
|
+
if (selectedDataItem)
|
923
|
+
{
|
924
|
+
if (selectedDataItem.type == this.ITEM_TYPE_ZONE && selectedDataItem.id == data.getInt('zId'))
|
925
|
+
this._deselectTreeItem();
|
926
|
+
|
927
|
+
if (selectedDataItem.type == this.ITEM_TYPE_ROOM)
|
928
|
+
{
|
929
|
+
let parentDataItem = this._treeview.dataItem(this._treeview.parent(selectedNode));
|
930
|
+
|
931
|
+
if (parentDataItem.id == data.getInt('zId'))
|
932
|
+
this._deselectTreeItem();
|
933
|
+
}
|
934
|
+
}
|
935
|
+
|
936
|
+
// Remove zone from tree
|
937
|
+
let dataItem = this._getZoneDataItemById(data.getInt('zId'));
|
938
|
+
let zonesDS = this._treeview.dataSource;
|
939
|
+
zonesDS.remove(dataItem);
|
940
|
+
zonesDS.sync();
|
941
|
+
}
|
942
|
+
|
943
|
+
// Zone activated
|
944
|
+
else if (command == this.RESP_ZONE_ACTIVATED)
|
945
|
+
{
|
946
|
+
// Set zone activation status
|
947
|
+
const zoneName = this._setZoneActivationStatus(data.getInt('zId'), data.getUtfString('actRooms'), true);
|
948
|
+
|
949
|
+
// Display notification
|
950
|
+
if (username == this.smartFox.mySelf.name)
|
951
|
+
this.shellCtrl.showNotification('Zone activated', `Zone '${zoneName}' activated successfully`);
|
952
|
+
else
|
953
|
+
this.shellCtrl.showNotification('Zone activated', `Administrator ${username} activated Zone '${zoneName}'`);
|
954
|
+
}
|
955
|
+
|
956
|
+
// Zone activation error
|
957
|
+
else if (command == this.RESP_ZONE_ACTIVATION_ERROR)
|
958
|
+
{
|
959
|
+
// Set zone activation status
|
960
|
+
this._setZoneActivationStatus(data.getInt('zId'), '', false);
|
961
|
+
|
962
|
+
// Show alert
|
963
|
+
this.shellCtrl.showSimpleAlert(data.getUtfString('error'), true);
|
964
|
+
}
|
965
|
+
|
966
|
+
/****** ROOMS ******/
|
967
|
+
|
968
|
+
// Room configuration update confirmation
|
969
|
+
else if (command == this.RESP_ROOM_CONFIG_UPDATE_CONFIRM)
|
970
|
+
{
|
971
|
+
if (data.getUtfString('rName') != null)
|
972
|
+
this._updateRoomNameInList(data.getInt('zId'), data.getInt('rId'), data.getUtfString('rName'));
|
973
|
+
|
974
|
+
// If the current user is the updater, show a notification; otherwise, show a dialog box suggesting to reload
|
975
|
+
if (username == this.smartFox.mySelf.name)
|
976
|
+
{
|
977
|
+
// Enable interface
|
978
|
+
this._enableConfigInterface(true);
|
979
|
+
|
980
|
+
// Display notification
|
981
|
+
this.shellCtrl.showNotification('Room modified', `Room settings updated successfully; changes will be applied on next <strong>server restart</strong>`);
|
982
|
+
|
983
|
+
// Reset the 'modified' flag
|
984
|
+
this._interfaceBuilder.resetIsModified();
|
985
|
+
}
|
986
|
+
else
|
987
|
+
{
|
988
|
+
// An alert box is displayed if the user is currently editing the same room
|
989
|
+
if (data.getInt('rId') == this._editedRoomId)
|
990
|
+
{
|
991
|
+
// Show alert
|
992
|
+
this.shellCtrl.showSimpleAlert(`Administrator ${username} has modified the Room you are currently editing; please reload to update your view.`);
|
993
|
+
|
994
|
+
// Disable submit button
|
995
|
+
$('#znc-submitButton').attr('disabled', true);
|
996
|
+
}
|
997
|
+
else
|
998
|
+
{
|
999
|
+
// Display notification
|
1000
|
+
if (data.getUtfString('rName') != null)
|
1001
|
+
this.shellCtrl.showNotification('Room renamed', `Administrator ${username} has changed the name on one of the Rooms`);
|
1002
|
+
}
|
1003
|
+
}
|
1004
|
+
}
|
1005
|
+
|
1006
|
+
// New room added
|
1007
|
+
else if (command == this.RESP_ROOM_ADDED)
|
1008
|
+
{
|
1009
|
+
const roomData = data.getSFSObject('room');
|
1010
|
+
const zoneId = data.getInt('zId');
|
1011
|
+
|
1012
|
+
let zonesDS = this._treeview.dataSource;
|
1013
|
+
let zoneItem = zonesDS.get(zoneId);
|
1014
|
+
|
1015
|
+
// If the current user is the updater, reset the interface; otherwise, just show a notification
|
1016
|
+
if (username == this.smartFox.mySelf.name)
|
1017
|
+
{
|
1018
|
+
// Reset interface
|
1019
|
+
this._onCancelClick();
|
1020
|
+
|
1021
|
+
// Display notification
|
1022
|
+
this.shellCtrl.showNotification('Room added', `Room '${roomData.getUtfString('name')}' created successfully`);
|
1023
|
+
}
|
1024
|
+
else
|
1025
|
+
{
|
1026
|
+
// Display notification
|
1027
|
+
this.shellCtrl.showNotification('Room added', `Administrator ${username} created Room '${roomData.getUtfString('name')}' in Zone '${zoneItem.name}'`);
|
1028
|
+
}
|
1029
|
+
|
1030
|
+
// Add new room to tree
|
1031
|
+
zoneItem.append(this._createRoomObject(roomData, zoneId));
|
1032
|
+
zonesDS.sync();
|
1033
|
+
|
1034
|
+
// Expand zone node where room was added
|
1035
|
+
this._treeview.expand(this._treeview.select());
|
1036
|
+
}
|
1037
|
+
|
1038
|
+
// New room creation refused due to invalid room name
|
1039
|
+
else if (command == this.RESP_ROOM_REFUSED)
|
1040
|
+
{
|
1041
|
+
// Re-enable interface
|
1042
|
+
this._enableConfigInterface(true);
|
1043
|
+
|
1044
|
+
// Show warning
|
1045
|
+
this.shellCtrl.showSimpleAlert('Room configuration can\'t be saved because another Room with the same name already exists.', true);
|
1046
|
+
}
|
1047
|
+
|
1048
|
+
// Existing room deleted
|
1049
|
+
else if (command == this.RESP_ROOM_DELETED)
|
1050
|
+
{
|
1051
|
+
let zoneItem = this._getZoneDataItemById(data.getInt('zId'));
|
1052
|
+
let roomItem = this._getRoomDataItemById(data.getInt('zId'), data.getInt('rId'));
|
1053
|
+
|
1054
|
+
// If the current user is the deleter, reset the interface; otherwise, just show a notification
|
1055
|
+
if (username == this.smartFox.mySelf.name)
|
1056
|
+
{
|
1057
|
+
// Re-enable interface
|
1058
|
+
this._enableListInterface(true);
|
1059
|
+
|
1060
|
+
// Display notification
|
1061
|
+
this.shellCtrl.showNotification('Room removed', `Room '${roomItem.name}' deleted successfully`);
|
1062
|
+
}
|
1063
|
+
else
|
1064
|
+
{
|
1065
|
+
// An alert box is displayed if the user is currently editing the same room
|
1066
|
+
if (data.getInt('rId') == this._editedRoomId)
|
1067
|
+
{
|
1068
|
+
// Show alert
|
1069
|
+
this.shellCtrl.showSimpleAlert(`Administrator ${username} has deleted the Room you are currently modifying; you have to cancel your editing.`);
|
1070
|
+
|
1071
|
+
// Disable submit and reload buttons
|
1072
|
+
$('#znc-reloadButton').attr('disabled', true);
|
1073
|
+
$('#znc-submitButton').attr('disabled', true);
|
1074
|
+
}
|
1075
|
+
else
|
1076
|
+
{
|
1077
|
+
// Display notification
|
1078
|
+
this.shellCtrl.showNotification('Room removed', `Administrator ${username} deleted Room '${roomItem.name}' from Zone '${zoneItem.name}'`);
|
1079
|
+
}
|
1080
|
+
}
|
1081
|
+
|
1082
|
+
// Reset selection if the currently selected item or its parent is being removed
|
1083
|
+
let selectedNode = this._treeview.select();
|
1084
|
+
let selectedDataItem = this._treeview.dataItem(selectedNode);
|
1085
|
+
if (selectedDataItem)
|
1086
|
+
{
|
1087
|
+
if (selectedDataItem.type == this.ITEM_TYPE_ROOM && selectedDataItem.id == data.getInt('rId'))
|
1088
|
+
this._deselectTreeItem();
|
1089
|
+
}
|
1090
|
+
|
1091
|
+
// Remove room from tree
|
1092
|
+
zoneItem.children.remove(roomItem);
|
1093
|
+
this._treeview.dataSource.sync();
|
1094
|
+
}
|
1095
|
+
|
1096
|
+
/****** WORDS FILES ******/
|
1097
|
+
|
1098
|
+
// Words files list received
|
1099
|
+
else if (command == this.RESP_REFRESH_WORDS_FILES)
|
1100
|
+
{
|
1101
|
+
this._wordsFilesManager.refreshWordsFilesList(data.getSFSArray('wf'), username == this.smartFox.mySelf.name);
|
1102
|
+
|
1103
|
+
// If another user caused a refresh (for example deleting a file, or adding a new one) show a notification
|
1104
|
+
if (username != null && username != this.smartFox.mySelf.name && this._editedZoneId > -1)
|
1105
|
+
this.shellCtrl.showNotification('Words files modified', `Administrator ${username} has added, modified or deleted a words file.`);
|
1106
|
+
}
|
1107
|
+
|
1108
|
+
// Words file content received
|
1109
|
+
else if (command == this.RESP_WORDS_FILE_CONTENT)
|
1110
|
+
{
|
1111
|
+
this._wordsFilesManager.editWordsFile(data.getUtfString('filename'), data.getText('content'));
|
1112
|
+
}
|
1113
|
+
|
1114
|
+
// Words file error (edit/save)
|
1115
|
+
else if (command == this.RESP_WORDS_FILE_ERROR)
|
1116
|
+
{
|
1117
|
+
// Enable buttons
|
1118
|
+
this._wordsFilesManager.enabled = true;
|
1119
|
+
|
1120
|
+
// Show alert
|
1121
|
+
this.shellCtrl.showSimpleAlert(data.getUtfString('error'), true);
|
1122
|
+
}
|
1123
|
+
|
1124
|
+
// else if ()
|
1125
|
+
}
|
1126
|
+
|
1127
|
+
//---------------------------------
|
1128
|
+
// UI EVENT LISTENERS
|
1129
|
+
//---------------------------------
|
1130
|
+
|
1131
|
+
_onTreeItemDoubleClick(e)
|
1132
|
+
{
|
1133
|
+
// Get event target's closest tree node
|
1134
|
+
let treeNode = $(e.target).closest('.k-item[role=treeitem]');
|
1135
|
+
|
1136
|
+
// Get associated data item
|
1137
|
+
let dataItem = this._treeview.dataItem(treeNode);
|
1138
|
+
|
1139
|
+
// Load configuration
|
1140
|
+
this._loadConfiguration(dataItem.type);
|
1141
|
+
}
|
1142
|
+
|
1143
|
+
_onZoneRoomChange()
|
1144
|
+
{
|
1145
|
+
// Reset utility buttons
|
1146
|
+
this._setUtilityButtonsState(this._selectedItem);
|
1147
|
+
}
|
1148
|
+
|
1149
|
+
// Utility buttons listeners
|
1150
|
+
|
1151
|
+
_onAddZoneClick()
|
1152
|
+
{
|
1153
|
+
// Deselect list item
|
1154
|
+
this._deselectTreeItem();
|
1155
|
+
|
1156
|
+
// Load configuration
|
1157
|
+
this._loadConfiguration(this.ITEM_TYPE_ZONE);
|
1158
|
+
}
|
1159
|
+
|
1160
|
+
_onAddRoomClick()
|
1161
|
+
{
|
1162
|
+
// Select parent list item
|
1163
|
+
this._selectParentTreeItem();
|
1164
|
+
|
1165
|
+
// Load configuration
|
1166
|
+
this._loadConfiguration(this.ITEM_TYPE_ROOM);
|
1167
|
+
}
|
1168
|
+
|
1169
|
+
_onEditClick()
|
1170
|
+
{
|
1171
|
+
// Load configuration
|
1172
|
+
this._loadConfiguration(this._selectedItem.type);
|
1173
|
+
}
|
1174
|
+
|
1175
|
+
_onRemoveClick()
|
1176
|
+
{
|
1177
|
+
this.shellCtrl.showConfirmWarning(`Are you sure you want to delete the selected ${this._selectedItem.type == this.ITEM_TYPE_ZONE ? 'Zone' : 'Room'} configuration?`, $.proxy(this._onRemoveConfirm, this));
|
1178
|
+
}
|
1179
|
+
|
1180
|
+
_onRemoveConfirm()
|
1181
|
+
{
|
1182
|
+
// Disable zone/room selection list
|
1183
|
+
this._enableListInterface(false);
|
1184
|
+
|
1185
|
+
let params = new SFS2X.SFSObject();
|
1186
|
+
|
1187
|
+
// Request zone removal
|
1188
|
+
if (this._selectedItem.type == this.ITEM_TYPE_ZONE)
|
1189
|
+
{
|
1190
|
+
params.putInt('zId', this._selectedItem.id);
|
1191
|
+
this.sendExtensionRequest(this.REQ_DELETE_ZONE_CONFIG, params);
|
1192
|
+
}
|
1193
|
+
else
|
1194
|
+
{
|
1195
|
+
params.putInt('zId', this._selectedItemParent.id);
|
1196
|
+
params.putInt('rId', this._selectedItem.id);
|
1197
|
+
this.sendExtensionRequest(this.REQ_DELETE_ROOM_CONFIG, params);
|
1198
|
+
}
|
1199
|
+
}
|
1200
|
+
|
1201
|
+
_onActivateClick()
|
1202
|
+
{
|
1203
|
+
// Get selected data item
|
1204
|
+
if (this._selectedItem.type == this.ITEM_TYPE_ZONE)
|
1205
|
+
{
|
1206
|
+
let params = new SFS2X.SFSObject();
|
1207
|
+
params.putInt('zId', this._selectedItem.id);
|
1208
|
+
|
1209
|
+
this.sendExtensionRequest(this.REQ_ACTIVATE_ZONE, params);
|
1210
|
+
}
|
1211
|
+
}
|
1212
|
+
|
1213
|
+
// Configuration buttons listeners
|
1214
|
+
|
1215
|
+
_onCancelClick()
|
1216
|
+
{
|
1217
|
+
// Enable zone/room selection lists
|
1218
|
+
this._enableListInterface(true);
|
1219
|
+
|
1220
|
+
// Disable configuration interface
|
1221
|
+
this._enableConfigInterface(false);
|
1222
|
+
|
1223
|
+
// Clear main container
|
1224
|
+
this._resetTabsContainer(false, true);
|
1225
|
+
|
1226
|
+
// Set isEditing flag
|
1227
|
+
this._isEditing = false;
|
1228
|
+
this._editedItemType = '';
|
1229
|
+
|
1230
|
+
// Switch panel
|
1231
|
+
this._switchPanel('znc-sidebarPanel');
|
1232
|
+
}
|
1233
|
+
|
1234
|
+
_onReloadClick()
|
1235
|
+
{
|
1236
|
+
// Hide validation messages
|
1237
|
+
this._interfaceBuilder.resetValidation();
|
1238
|
+
|
1239
|
+
// Reload configuration
|
1240
|
+
this._loadConfiguration(this._editedItemType, false);
|
1241
|
+
}
|
1242
|
+
|
1243
|
+
_onSubmitClick()
|
1244
|
+
{
|
1245
|
+
// Check validity
|
1246
|
+
if (this._interfaceBuilder.checkIsValid())
|
1247
|
+
{
|
1248
|
+
let changes = this._interfaceBuilder.getChangedData();
|
1249
|
+
|
1250
|
+
if (changes.size() > 0)
|
1251
|
+
{
|
1252
|
+
//console.log(changes.getDump())
|
1253
|
+
//return;
|
1254
|
+
|
1255
|
+
// In case the zone/room name changed, check it against the list (duplicate names not allowed!)
|
1256
|
+
if (this._validateName(changes))
|
1257
|
+
{
|
1258
|
+
// Disable configuration interface
|
1259
|
+
this._enableConfigInterface(false);
|
1260
|
+
|
1261
|
+
// Send settings to server instance
|
1262
|
+
let params = new SFS2X.SFSObject();
|
1263
|
+
params.putSFSArray('settings', changes);
|
1264
|
+
params.putBool('backup', $('#znc-backupCheck').prop('checked'));
|
1265
|
+
params.putInt('zId', this._editedZoneId);
|
1266
|
+
params.putInt('rId', this._editedRoomId);
|
1267
|
+
|
1268
|
+
if (this._editedItemType == this.ITEM_TYPE_ZONE)
|
1269
|
+
{
|
1270
|
+
// Submit zone settings
|
1271
|
+
if (this._editedZoneId > -1)
|
1272
|
+
this.sendExtensionRequest(this.REQ_SAVE_ZONE_CONFIG, params);
|
1273
|
+
else
|
1274
|
+
this.sendExtensionRequest(this.REQ_NEW_ZONE_CONFIG, params);
|
1275
|
+
}
|
1276
|
+
else
|
1277
|
+
{
|
1278
|
+
// Submit room settings
|
1279
|
+
if (this._editedRoomId > -1)
|
1280
|
+
this.sendExtensionRequest(this.REQ_SAVE_ROOM_CONFIG, params);
|
1281
|
+
else
|
1282
|
+
this.sendExtensionRequest(this.REQ_NEW_ROOM_CONFIG, params);
|
1283
|
+
}
|
1284
|
+
}
|
1285
|
+
else
|
1286
|
+
{
|
1287
|
+
// Show alert
|
1288
|
+
this.shellCtrl.showSimpleAlert(`Unable to submit configuration because the ${Object(_utils_utilities__WEBPACK_IMPORTED_MODULE_4__["capitalizeFirst"])(this._editedItemType)} name already exists; duplicate names are not allowed.`, true);
|
1289
|
+
}
|
1290
|
+
}
|
1291
|
+
}
|
1292
|
+
else
|
1293
|
+
{
|
1294
|
+
// Show alert
|
1295
|
+
this.shellCtrl.showSimpleAlert('Unable to submit configuration changes due to an invalid value; please verify the highlighted form fields in all tabs.', true);
|
1296
|
+
}
|
1297
|
+
}
|
1298
|
+
|
1299
|
+
_onConfigValueSet(e) // SAME METHOD DUPLICATED IN zone-monitor.js
|
1300
|
+
{
|
1301
|
+
const configParam = e.target.data;
|
1302
|
+
|
1303
|
+
// Handle extension name/type dropdowns update and update the main class dropdown datasource accordingly
|
1304
|
+
if (configParam.name == 'extension.name' || configParam.name == 'extension.type' || configParam.name == 'extension.filterClass')
|
1305
|
+
{
|
1306
|
+
// All involved ConfigFormItems must be available and initialized to proceed
|
1307
|
+
const nameFormItem = this._interfaceBuilder.getConfigFormItem('extension.name');
|
1308
|
+
const typeFormItem = this._interfaceBuilder.getConfigFormItem('extension.type');
|
1309
|
+
const classFormItem = this._interfaceBuilder.getConfigFormItem('extension.file');
|
1310
|
+
const filterFormItem = this._interfaceBuilder.getConfigFormItem('extension.filterClass');
|
1311
|
+
|
1312
|
+
if (nameFormItem != null && typeFormItem != null && classFormItem != null && filterFormItem != null)
|
1313
|
+
{
|
1314
|
+
const source = nameFormItem.data;
|
1315
|
+
let classesList = [];
|
1316
|
+
|
1317
|
+
let data = source.triggerData;
|
1318
|
+
for (let i = 0; i < data.size(); i++)
|
1319
|
+
{
|
1320
|
+
let ext = data.getSFSObject(i);
|
1321
|
+
|
1322
|
+
if (ext.getUtfString('name') == nameFormItem.data.value && ext.getUtfString('type') == typeFormItem.data.value)
|
1323
|
+
{
|
1324
|
+
let classes = ext.get('classesString').split(','); // We don't use "getUTfString" because the type is Text in case a very large list of classes is returned
|
1325
|
+
|
1326
|
+
if (filterFormItem.data.value == true)
|
1327
|
+
{
|
1328
|
+
let filteredClasses = classes.filter(_utils_utilities__WEBPACK_IMPORTED_MODULE_4__["filterClassName"]);
|
1329
|
+
classes = filteredClasses;
|
1330
|
+
}
|
1331
|
+
|
1332
|
+
classesList = classesList.concat(classes);
|
1333
|
+
}
|
1334
|
+
}
|
1335
|
+
|
1336
|
+
let currentClass = classFormItem.data.value;
|
1337
|
+
|
1338
|
+
// If the classes list doesn't contain the current value, create an empty entry and reset the value
|
1339
|
+
if (classesList.indexOf(currentClass) < 0)
|
1340
|
+
{
|
1341
|
+
if (classesList.length == 0)
|
1342
|
+
{
|
1343
|
+
classesList.push('');
|
1344
|
+
currentClass = '';
|
1345
|
+
}
|
1346
|
+
else
|
1347
|
+
currentClass = classesList[0];
|
1348
|
+
}
|
1349
|
+
|
1350
|
+
let mainClassDropDown = classFormItem._innerWidget;
|
1351
|
+
mainClassDropDown.setDataSource(classesList);
|
1352
|
+
|
1353
|
+
classFormItem.data.value = currentClass;
|
1354
|
+
classFormItem._setWidgetValue();
|
1355
|
+
}
|
1356
|
+
}
|
1357
|
+
}
|
1358
|
+
|
1359
|
+
_onWordsFileReloadClick(evt)
|
1360
|
+
{
|
1361
|
+
// Send request to server
|
1362
|
+
this.sendExtensionRequest(this.REQ_REFRESH_WORDS_FILE);
|
1363
|
+
}
|
1364
|
+
|
1365
|
+
_onWordsFileEditClick(evt)
|
1366
|
+
{
|
1367
|
+
// Send request to server
|
1368
|
+
let params = new SFS2X.SFSObject();
|
1369
|
+
params.putUtfString('filename', evt.detail);
|
1370
|
+
this.sendExtensionRequest(this.REQ_EDIT_WORDS_FILE, params);
|
1371
|
+
}
|
1372
|
+
|
1373
|
+
_onWordsFileSaveClick(evt)
|
1374
|
+
{
|
1375
|
+
this._tempWordsFileData = evt.detail;
|
1376
|
+
|
1377
|
+
// Check if a new file is being created
|
1378
|
+
if (this._tempWordsFileData.isNew)
|
1379
|
+
{
|
1380
|
+
// If yes, check if name already exists
|
1381
|
+
if (this._wordsFilesManager.getExistingFilenames().includes(this._tempWordsFileData.filename))
|
1382
|
+
{
|
1383
|
+
// Show confirm dialog
|
1384
|
+
this.shellCtrl.showConfirmWarning('A words file with the entered name already exists; do you want to proceed anyway? The existing file will be overwritten.', $.proxy(this._onWordsFileSaveConfirm, this));
|
1385
|
+
return;
|
1386
|
+
}
|
1387
|
+
}
|
1388
|
+
|
1389
|
+
// Proceed
|
1390
|
+
this._onWordsFileSaveConfirm();
|
1391
|
+
}
|
1392
|
+
|
1393
|
+
_onWordsFileSaveConfirm()
|
1394
|
+
{
|
1395
|
+
// Disable words files manager buttons
|
1396
|
+
this._wordsFilesManager.enabled = false;
|
1397
|
+
this._wordsFilesManager.saveSpinnerVisible = true;
|
1398
|
+
|
1399
|
+
// Send request to server
|
1400
|
+
let params = new SFS2X.SFSObject();
|
1401
|
+
params.putUtfString('filename', this._tempWordsFileData.filename);
|
1402
|
+
params.putText('content', this._tempWordsFileData.content);
|
1403
|
+
this.sendExtensionRequest(this.REQ_SAVE_WORDS_FILE, params);
|
1404
|
+
}
|
1405
|
+
|
1406
|
+
_onWordsFileRemoveClick(evt)
|
1407
|
+
{
|
1408
|
+
this.shellCtrl.showConfirmWarning('Are you sure you want to delete the selected words file?', $.proxy(this._onWordsFileRemoveConfirm, this));
|
1409
|
+
}
|
1410
|
+
|
1411
|
+
_onWordsFileRemoveConfirm()
|
1412
|
+
{
|
1413
|
+
let wordsFile = this._wordsFilesManager.getSelectedWordsFileName();
|
1414
|
+
|
1415
|
+
if (wordsFile != null)
|
1416
|
+
{
|
1417
|
+
// Disable words files manager buttons
|
1418
|
+
this._wordsFilesManager.enabled = false;
|
1419
|
+
this._wordsFilesManager.actionSpinnerVisible = true;
|
1420
|
+
|
1421
|
+
// Send request to server
|
1422
|
+
let params = new SFS2X.SFSObject();
|
1423
|
+
params.putUtfString('filename', wordsFile);
|
1424
|
+
this.sendExtensionRequest(this.REQ_DELETE_WORDS_FILE, params);
|
1425
|
+
}
|
1426
|
+
}
|
1427
|
+
|
1428
|
+
_onWordsFileAssignClick(evt)
|
1429
|
+
{
|
1430
|
+
let path = evt.detail;
|
1431
|
+
|
1432
|
+
// Write path of the selected words file in "wordsFilter.wordsFile" dynamically created field
|
1433
|
+
const wordsFileFormItem = this._interfaceBuilder.getConfigFormItem('wordsFilter.wordsFile');
|
1434
|
+
wordsFileFormItem.data.value = path;
|
1435
|
+
wordsFileFormItem._setWidgetValue();
|
1436
|
+
}
|
1437
|
+
|
1438
|
+
//---------------------------------
|
1439
|
+
// PRIVATE METHODS
|
1440
|
+
//---------------------------------
|
1441
|
+
|
1442
|
+
_enableListInterface(enabled)
|
1443
|
+
{
|
1444
|
+
$('#znc-utilButtons').attr('disabled', !enabled);
|
1445
|
+
$('#znc-treeView').attr('disabled', !enabled);
|
1446
|
+
}
|
1447
|
+
|
1448
|
+
_setUtilityButtonsState(dataItem = null)
|
1449
|
+
{
|
1450
|
+
let disable = true;
|
1451
|
+
|
1452
|
+
if (dataItem)
|
1453
|
+
{
|
1454
|
+
// Enable 'activate zone' button if zone is inactive
|
1455
|
+
$('#znc-activateButton').attr('disabled', (dataItem.type != this.ITEM_TYPE_ZONE || dataItem.active));
|
1456
|
+
|
1457
|
+
disable = false;
|
1458
|
+
}
|
1459
|
+
else
|
1460
|
+
{
|
1461
|
+
// Disable 'activate zone' button
|
1462
|
+
$('#znc-activateButton').attr('disabled', true);
|
1463
|
+
}
|
1464
|
+
|
1465
|
+
// Enable/disable other utility buttons
|
1466
|
+
$('#znc-addZoneButton').attr('disabled', false); // Always enabled
|
1467
|
+
$('#znc-addRoomButton').attr('disabled', disable);
|
1468
|
+
$('#znc-editButton').attr('disabled', disable);
|
1469
|
+
$('#znc-removeButton').attr('disabled', disable);
|
1470
|
+
}
|
1471
|
+
|
1472
|
+
_enableConfigInterface(enabled)
|
1473
|
+
{
|
1474
|
+
$('#znc-cancelButton').attr('disabled', !enabled);
|
1475
|
+
$('#znc-reloadButton').attr('disabled', !enabled);
|
1476
|
+
$('#znc-submitButton').attr('disabled', !enabled);
|
1477
|
+
$('#znc-backupCheck').attr('disabled', !enabled);
|
1478
|
+
|
1479
|
+
this._interfaceBuilder.disableInterface(!enabled);
|
1480
|
+
|
1481
|
+
// Also switch view when enabled
|
1482
|
+
if (enabled)
|
1483
|
+
this._switchView('znc-main');
|
1484
|
+
}
|
1485
|
+
|
1486
|
+
_switchView(viewId)
|
1487
|
+
{
|
1488
|
+
document.getElementById('znc-viewstack').selectedElement = document.getElementById(viewId);
|
1489
|
+
}
|
1490
|
+
|
1491
|
+
_clearTabs()
|
1492
|
+
{
|
1493
|
+
// Destroy scrolling tabs
|
1494
|
+
$('#znc-tabNavigator #tabs').scrollingTabs('destroy');
|
1495
|
+
|
1496
|
+
// Remove all tab navigator content
|
1497
|
+
this._interfaceBuilder.destroyInterface();
|
1498
|
+
|
1499
|
+
// Set flag to re-initialize tabs if needed
|
1500
|
+
this._reinitTabs = true;
|
1501
|
+
}
|
1502
|
+
|
1503
|
+
_populateTree(data)
|
1504
|
+
{
|
1505
|
+
let zData = data.getSFSArray('zones');
|
1506
|
+
|
1507
|
+
let zonesArr = [];
|
1508
|
+
for (let z = 0; z < zData.size(); z++)
|
1509
|
+
zonesArr.push( this._createZoneObject(zData.getSFSObject(z)) );
|
1510
|
+
|
1511
|
+
// Create datasource
|
1512
|
+
let zones = new kendo.data.HierarchicalDataSource({
|
1513
|
+
data: zonesArr,
|
1514
|
+
sort: {
|
1515
|
+
field: 'name',
|
1516
|
+
dir: 'asc'
|
1517
|
+
},
|
1518
|
+
schema: {
|
1519
|
+
model: {
|
1520
|
+
id: 'id',
|
1521
|
+
children: {
|
1522
|
+
schema: {
|
1523
|
+
data: 'rooms',
|
1524
|
+
sort: {
|
1525
|
+
field: 'name',
|
1526
|
+
dir: 'asc'
|
1527
|
+
}
|
1528
|
+
}
|
1529
|
+
}
|
1530
|
+
}
|
1531
|
+
}
|
1532
|
+
});
|
1533
|
+
|
1534
|
+
// Set tree view dataprovider
|
1535
|
+
this._treeview.setDataSource(zones);
|
1536
|
+
|
1537
|
+
// Set utility buttons state (add, remove, edit, etc)
|
1538
|
+
this._setUtilityButtonsState();
|
1539
|
+
}
|
1540
|
+
|
1541
|
+
_createZoneObject(zoneData)
|
1542
|
+
{
|
1543
|
+
let zone = {
|
1544
|
+
type: this.ITEM_TYPE_ZONE,
|
1545
|
+
name: zoneData.getUtfString('name'),
|
1546
|
+
id: zoneData.getInt('id'),
|
1547
|
+
active: zoneData.getBool('act')
|
1548
|
+
}
|
1549
|
+
|
1550
|
+
// Create rooms list dataprovider
|
1551
|
+
let rData = zoneData.getSFSArray('rooms');
|
1552
|
+
|
1553
|
+
let roomsArr = [];
|
1554
|
+
for (let r = 0; r < rData.size(); r++)
|
1555
|
+
roomsArr.push( this._createRoomObject(rData.getSFSObject(r), zoneData.getInt('id')) );
|
1556
|
+
|
1557
|
+
zone.rooms = roomsArr;
|
1558
|
+
|
1559
|
+
return zone;
|
1560
|
+
}
|
1561
|
+
|
1562
|
+
_createRoomObject(roomData, zoneId)
|
1563
|
+
{
|
1564
|
+
let room = {
|
1565
|
+
type: this.ITEM_TYPE_ROOM,
|
1566
|
+
name: roomData.getUtfString('name'),
|
1567
|
+
id: roomData.getInt('id'),
|
1568
|
+
active: roomData.getBool('act'),
|
1569
|
+
parentId: zoneId,
|
1570
|
+
spriteCssClass: this._getRoomListIconCssClass(roomData.getBool('act'))
|
1571
|
+
};
|
1572
|
+
|
1573
|
+
return room;
|
1574
|
+
}
|
1575
|
+
|
1576
|
+
_getRoomListIconCssClass(isActive)
|
1577
|
+
{
|
1578
|
+
return isActive ? 'fas fa-door-open' : 'fas fa-door-closed inactive-list-item';
|
1579
|
+
}
|
1580
|
+
|
1581
|
+
_setZoneActivationStatus(zoneId, activeRooms, isActive)
|
1582
|
+
{
|
1583
|
+
let zoneDI = this._getZoneDataItemById(zoneId);
|
1584
|
+
|
1585
|
+
zoneDI.active = isActive;
|
1586
|
+
|
1587
|
+
let activeRoomsArr = activeRooms.split(',');
|
1588
|
+
|
1589
|
+
if (zoneDI.hasChildren)
|
1590
|
+
{
|
1591
|
+
for (let i = 0; i < zoneDI.children.data().length; i++)
|
1592
|
+
{
|
1593
|
+
let room = zoneDI.children.data()[i];
|
1594
|
+
room.active = (isActive && activeRoomsArr.indexOf(room.name) > -1);
|
1595
|
+
room.spriteCssClass = this._getRoomListIconCssClass(room.active)
|
1596
|
+
}
|
1597
|
+
}
|
1598
|
+
|
1599
|
+
// Refresh list
|
1600
|
+
this._treeview.dataSource.sync();
|
1601
|
+
|
1602
|
+
// Return zone name
|
1603
|
+
return zoneDI.name;
|
1604
|
+
}
|
1605
|
+
|
1606
|
+
_deselectTreeItem()
|
1607
|
+
{
|
1608
|
+
this._treeview.select($());
|
1609
|
+
}
|
1610
|
+
|
1611
|
+
_selectParentTreeItem()
|
1612
|
+
{
|
1613
|
+
let selectedNode = this._treeview.select();
|
1614
|
+
let selectedDataItem = this._treeview.dataItem(selectedNode);
|
1615
|
+
|
1616
|
+
if (selectedDataItem.type == this.ITEM_TYPE_ROOM)
|
1617
|
+
{
|
1618
|
+
let parentNode = this._treeview.parent(selectedNode);
|
1619
|
+
this._treeview.select(parentNode);
|
1620
|
+
}
|
1621
|
+
}
|
1622
|
+
|
1623
|
+
_loadConfiguration(type, resetTabs = true)
|
1624
|
+
{
|
1625
|
+
// Disable zone/room selection list
|
1626
|
+
this._enableListInterface(false);
|
1627
|
+
|
1628
|
+
// Disable configuration interface
|
1629
|
+
this._enableConfigInterface(false);
|
1630
|
+
|
1631
|
+
// Clear main container
|
1632
|
+
this._resetTabsContainer(true, resetTabs);
|
1633
|
+
|
1634
|
+
// Set isEditing flag
|
1635
|
+
this._isEditing = true;
|
1636
|
+
this._editedItemType = type;
|
1637
|
+
|
1638
|
+
// Request zone or room configuration data to server instance
|
1639
|
+
let params = new SFS2X.SFSObject();
|
1640
|
+
params.putInt('zId', this._editedZoneId);
|
1641
|
+
params.putInt('rId', this._editedRoomId);
|
1642
|
+
|
1643
|
+
// If no room is selected, then we are editing a zone
|
1644
|
+
if (this._editedItemType == this.ITEM_TYPE_ZONE)
|
1645
|
+
this.sendExtensionRequest(this.REQ_GET_ZONE_CONFIG, params);
|
1646
|
+
else
|
1647
|
+
this.sendExtensionRequest(this.REQ_GET_ROOM_CONFIG, params);
|
1648
|
+
|
1649
|
+
// Switch panel
|
1650
|
+
this._switchPanel('znc-mainPanel');
|
1651
|
+
}
|
1652
|
+
|
1653
|
+
_resetTabsContainer(isLoading, resetTabs)
|
1654
|
+
{
|
1655
|
+
if (resetTabs)
|
1656
|
+
this._clearTabs();
|
1657
|
+
else
|
1658
|
+
this._reinitTabs = false;
|
1659
|
+
|
1660
|
+
if (!isLoading)
|
1661
|
+
this._switchView('znc-select');
|
1662
|
+
else
|
1663
|
+
this._switchView('znc-loading');
|
1664
|
+
}
|
1665
|
+
|
1666
|
+
_switchPanel(panelId)
|
1667
|
+
{
|
1668
|
+
document.getElementById('znc-view').selectedPanel = document.getElementById(panelId);
|
1669
|
+
}
|
1670
|
+
|
1671
|
+
_getZoneDataItemById(zoneId)
|
1672
|
+
{
|
1673
|
+
let zonesDS = this._treeview.dataSource;
|
1674
|
+
return zonesDS.get(zoneId);
|
1675
|
+
}
|
1676
|
+
|
1677
|
+
_getRoomDataItemById(zoneId, roomId)
|
1678
|
+
{
|
1679
|
+
let zoneDI = this._getZoneDataItemById(zoneId);
|
1680
|
+
|
1681
|
+
if (zoneDI.hasChildren)
|
1682
|
+
return zoneDI.children.get(roomId);
|
1683
|
+
|
1684
|
+
return null;
|
1685
|
+
}
|
1686
|
+
|
1687
|
+
_updateZoneNameInList(zoneId, zoneName)
|
1688
|
+
{
|
1689
|
+
this._getZoneDataItemById(zoneId).name = zoneName;
|
1690
|
+
this._treeview.dataSource.sync();
|
1691
|
+
}
|
1692
|
+
|
1693
|
+
_updateRoomNameInList(zoneId, roomId, roomName)
|
1694
|
+
{
|
1695
|
+
this._getRoomDataItemById(zoneId, roomId).name = roomName;
|
1696
|
+
this._treeview.dataSource.sync();
|
1697
|
+
}
|
1698
|
+
|
1699
|
+
_validateName(changes)
|
1700
|
+
{
|
1701
|
+
const zoneId = this._editedZoneId;
|
1702
|
+
|
1703
|
+
for (let i = 0; i < changes.size(); i++)
|
1704
|
+
{
|
1705
|
+
const setting = changes.getSFSObject(i);
|
1706
|
+
|
1707
|
+
if (setting.containsKey('name') && setting.getUtfString('name') == 'name')
|
1708
|
+
{
|
1709
|
+
// Get name value
|
1710
|
+
const name = setting.getText('value');
|
1711
|
+
|
1712
|
+
// Get data source
|
1713
|
+
let ds = [];
|
1714
|
+
|
1715
|
+
if (this._editedItemType == this.ITEM_TYPE_ZONE)
|
1716
|
+
ds = this._treeview.dataSource.data();
|
1717
|
+
else
|
1718
|
+
{
|
1719
|
+
if (this._getZoneDataItemById(zoneId).hasChildren)
|
1720
|
+
ds = this._getZoneDataItemById(zoneId).children.data();
|
1721
|
+
}
|
1722
|
+
|
1723
|
+
|
1724
|
+
// Check if name exists in data source
|
1725
|
+
for (let j = 0; j < ds.length; j++)
|
1726
|
+
{
|
1727
|
+
if (ds[j].name == name)
|
1728
|
+
{
|
1729
|
+
return false;
|
1730
|
+
}
|
1731
|
+
}
|
1732
|
+
|
1733
|
+
break;
|
1734
|
+
}
|
1735
|
+
}
|
1736
|
+
|
1737
|
+
return true;
|
1738
|
+
}
|
1739
|
+
|
1740
|
+
//---------------------------------
|
1741
|
+
// PRIVATE GETTERS
|
1742
|
+
//---------------------------------
|
1743
|
+
|
1744
|
+
get _selectedItem()
|
1745
|
+
{
|
1746
|
+
return this._treeview.dataItem(this._treeview.select());
|
1747
|
+
}
|
1748
|
+
|
1749
|
+
get _selectedItemParent()
|
1750
|
+
{
|
1751
|
+
let selectedNode = this._treeview.select();
|
1752
|
+
let parentNode = this._treeview.parent(selectedNode);
|
1753
|
+
|
1754
|
+
return this._treeview.dataItem(parentNode);
|
1755
|
+
}
|
1756
|
+
|
1757
|
+
get _editedZoneId()
|
1758
|
+
{
|
1759
|
+
if (this._isEditing && this._selectedItem)
|
1760
|
+
{
|
1761
|
+
if (this._selectedItem.type == this.ITEM_TYPE_ZONE)
|
1762
|
+
return this._selectedItem.id;
|
1763
|
+
else
|
1764
|
+
return this._selectedItemParent.id;
|
1765
|
+
}
|
1766
|
+
|
1767
|
+
return -1;
|
1768
|
+
}
|
1769
|
+
|
1770
|
+
get _editedRoomId()
|
1771
|
+
{
|
1772
|
+
if (this._isEditing && this._selectedItem)
|
1773
|
+
{
|
1774
|
+
if (this._selectedItem.type == this.ITEM_TYPE_ROOM)
|
1775
|
+
return this._selectedItem.id;
|
1776
|
+
}
|
1777
|
+
|
1778
|
+
return -1;
|
1779
|
+
}
|
1780
|
+
}
|
1781
|
+
|
1782
|
+
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! jquery */ "jquery")))
|
1783
|
+
|
1784
|
+
/***/ })
|
1785
|
+
|
1786
|
+
}]);
|
1787
|
+
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXNzZXRzL2pzL2NvcmUvbW9kdWxlcy9tb2R1bGUtMTYuYnVuZGxlLmpzIiwic291cmNlcyI6WyJ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