Skip to content

Commit 54fc81b

Browse files
committed
5.1.5314
1 parent a521c69 commit 54fc81b

File tree

34 files changed

+284
-107
lines changed

34 files changed

+284
-107
lines changed

Java/androidfsstorage/app/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@ jarJar {
3636

3737
node {
3838
// Version of node to use.
39-
version = '4.6.0'
39+
version = '12.22.7'
4040

4141
// Version of npm to use.
42-
npmVersion = '2.15.9'
42+
npmVersion = '6.14.0'
4343

4444
// Base URL for fetching node distributions (change if you have a mirror).
4545
distBaseUrl = 'https://nodejs.org/dist'

Java/deltav/pom.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,8 @@
284284
</goals>
285285
<configuration>
286286
<installDirectory>${java.io.tmpdir}</installDirectory>
287-
<nodeVersion>v4.6.0</nodeVersion>
287+
<nodeVersion>v12.22.7</nodeVersion>
288+
<npmVersion>6.14.0</npmVersion>
288289
</configuration>
289290
</execution>
290291
<execution>

Java/deltav/src/main/webapp/WEB-INF/wwwroot/js/package-lock.json

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"dependencies": {
3-
"webdav.client" : "latest"
3+
"webdav.client": "latest"
44
}
55
}

Java/filesystemstorage/pom.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,8 @@
243243
</goals>
244244
<configuration>
245245
<installDirectory>${java.io.tmpdir}</installDirectory>
246-
<nodeVersion>v4.6.0</nodeVersion>
246+
<nodeVersion>v12.22.7</nodeVersion>
247+
<npmVersion>6.14.0</npmVersion>
247248
</configuration>
248249
</execution>
249250
<execution>

Java/filesystemstorage/src/main/webapp/WEB-INF/wwwroot/css/webdav-layout.css

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -414,6 +414,16 @@ header .versions {
414414
color: white;
415415
text-decoration: underline;
416416
}
417+
418+
.header-content .flex-column {
419+
position: relative;
420+
padding-bottom: 48px;
421+
}
422+
423+
.header-content .flex-column .btn {
424+
position: absolute;
425+
bottom: 10px;
426+
}
417427
/*End Header styles*/
418428

419429
/*Start Main layout styles*/

Java/filesystemstorage/src/main/webapp/WEB-INF/wwwroot/js/package-lock.json

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"dependencies": {
3-
"webdav.client" : "latest"
3+
"webdav.client": "latest"
44
}
55
}

Java/filesystemstorage/src/main/webapp/WEB-INF/wwwroot/js/webdav-gridview.js

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
this.$el.find('tbody').html(
6262
aItems.map(function (oItem) {
6363
var locked = oItem.ActiveLocks.length > 0
64-
? ('<span class="ithit-grid-icon-locked"></span>' +
64+
? ('<span class="ithit-grid-icon-locked" title="' + self._RenderLokedIconTooltip(oItem) + '"></span>' +
6565
(oItem.ActiveLocks[0].LockScope === 'Shared' ? ('<span class="badge badge-pill badge-dark">' + oItem.ActiveLocks.length + '</span>') : ''))
6666
: '';
6767
/** @type {ITHit.WebDAV.Client.HierarchyItem} oItem */
@@ -109,6 +109,22 @@
109109
);
110110
},
111111

112+
/**
113+
* @param {ITHit.WebDAV.Client.HierarchyItem} oItem
114+
**/
115+
_RenderLokedIconTooltip(oItem) {
116+
var tooltipTitle = 'Exclusive lock: ' + oItem.ActiveLocks[0].Owner;
117+
if (oItem.ActiveLocks[0].LockScope === 'Shared') {
118+
var userNames = [];
119+
tooltipTitle = 'Shared lock' + (oItem.ActiveLocks.length > 1 ? '(s)':'') + ': ';
120+
for (var i = 0; i < oItem.ActiveLocks.length; i++) {
121+
userNames.push(oItem.ActiveLocks[i].Owner);
122+
}
123+
tooltipTitle += userNames.join(', ');
124+
}
125+
return tooltipTitle;
126+
},
127+
112128
/**
113129
* @param {ITHit.WebDAV.Client.HierarchyItem} oItem
114130
**/
@@ -154,7 +170,9 @@
154170
} else {
155171
var $btnGroup = $('<div class="btn-group"></div>');
156172
var displayRadioBtns = (isMicrosoftOfficeDocument && isGSuiteDocument);
157-
$('<button type="button" class="btn btn-primary btn-sm btn-labeled btn-default-edit" title="' + (displayRadioBtns ? self._GetActionGroupBtnTooltipText() : 'Edit document with desktop associated application.') + '"><span class="btn-label"><i class="' +
173+
var isExclusiveLocked = oItem.ActiveLocks.length > 0 && oItem.ActiveLocks[0].LockScope === 'Exclusive';
174+
$('<button type="button" class="btn btn-primary btn-sm btn-labeled btn-default-edit" title="' + (displayRadioBtns ? self._GetActionGroupBtnTooltipText() : 'Edit document with desktop associated application.') +
175+
'"' + self._GetDisabledGroupBtnAttribute(isExclusiveLocked) + '><span class="btn-label"><i class="' +
158176
(displayRadioBtns ? self._GetActionGroupBtnCssClass() : 'icon-edit') + '"></i></span><span class="d-none d-lg-inline-block btn-edit-label">Edit</span></button>')
159177
.appendTo($btnGroup).on('click', function () {
160178
var $radio = $(this).parent().find('input[type=radio]:checked');
@@ -169,7 +187,7 @@
169187
var $dropdownToggle = $('<button type="button" class="btn btn-primary dropdown-toggle dropdown-toggle-split btn-sm" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><span class="sr-only">Toggle Dropdown</span></button>')
170188
.appendTo($btnGroup).prop("disabled", !isDavProtocolSupported && !isMicrosoftOfficeDocument);
171189

172-
this._RenderContextMenu(oItem, $btnGroup, isMicrosoftOfficeDocument, isGSuiteDocument, isDavProtocolSupported);
190+
this._RenderContextMenu(oItem, $btnGroup, isMicrosoftOfficeDocument, isGSuiteDocument, isDavProtocolSupported, isExclusiveLocked);
173191

174192
$btnGroup.on('shown.bs.dropdown', function () {
175193
self.ContextMenuID = oItem.Href;
@@ -203,6 +221,14 @@
203221
return tooltipText;
204222
},
205223

224+
_GetDisabledGroupBtnAttribute: function (isExclusiveLocked) {
225+
var attribute = '';
226+
if (this._defaultEditor == 'GSuiteEditor' && isExclusiveLocked) {
227+
attribute = ' disabled="disabled"';
228+
}
229+
return attribute;
230+
},
231+
206232
_GetActionGroupBtnCssClass: function () {
207233
var cssClassName = 'icon-edit';
208234
switch (this._defaultEditor) {
@@ -217,7 +243,7 @@
217243
return cssClassName;
218244
},
219245

220-
_RenderContextMenu: function (oItem, $btnGroup, isMicrosoftOfficeDocument, isGSuiteDocument, isDavProtocolSupported) {
246+
_RenderContextMenu: function (oItem, $btnGroup, isMicrosoftOfficeDocument, isGSuiteDocument, isDavProtocolSupported, isExclusiveLocked) {
221247
var self = this;
222248
var supportGSuiteFeature = oWebDAV.OptionsInfo.Features & ITHit.WebDAV.Client.Features.GSuite;
223249
var displayRadioBtns = (isMicrosoftOfficeDocument && isGSuiteDocument);
Lines changed: 35 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,53 @@
1-
if (location.protocol === "https:") {
1+
if (location.protocol === "https:") {
22
var socketSource = new WebSocket("wss://" + location.host + webDavSettings.WebSocketPath);
3-
} else {
3+
} else {
44
var socketSource = new WebSocket("ws://" + location.host + webDavSettings.WebSocketPath);
5-
}
5+
}
66

77

8-
socketSource.addEventListener('message', function (e) {
9-
var notifyObject = JSON.parse(e.data);
8+
socketSource.addEventListener('message', function (e) {
9+
var notifyObject = JSON.parse(e.data);
1010

11-
// Removing domain and trailing slash.
11+
// Removing domain and trailing slash.
1212
var regExp = new RegExp("^\/" + webDavSettings.WebSocketPath + "|\/$", "g");
1313
var currentLocation = location.pathname.replace(regExp, '');
14-
// Checking message type after receiving.
14+
// Checking message type after receiving.
1515
if (notifyObject.eventType === "updated" || notifyObject.eventType === "created" || notifyObject.eventType === "locked" ||
1616
notifyObject.eventType === "unlocked") {
17-
// Refresh folder structure if any item in this folder is updated or new item is created.
17+
// Refresh folder structure if any item in this folder is updated or new item is created.
1818
if (notifyObject.itemPath.substring(0, notifyObject.itemPath.lastIndexOf('/')).toUpperCase() === currentLocation.toUpperCase()) {
19-
WebDAVController.Reload();
20-
}
19+
WebDAVController.Reload();
20+
}
2121
} else if (notifyObject.eventType === "moved") {
22-
// Refresh folder structure if file or folder is moved.
22+
// Refresh folder structure if file or folder is moved.
2323
if (notifyObject.itemPath.substring(0, notifyObject.itemPath.lastIndexOf('/')).toUpperCase() === currentLocation.toUpperCase() ||
2424
notifyObject.targetPath.substring(0, notifyObject.targetPath.lastIndexOf('/')).toUpperCase() === currentLocation.toUpperCase()) {
25-
WebDAVController.Reload();
26-
}
25+
WebDAVController.Reload();
26+
}
2727

2828
} else if (notifyObject.eventType === "deleted") {
2929
if (notifyObject.itemPath.substring(0, notifyObject.itemPath.lastIndexOf('/')).toUpperCase() === currentLocation.toUpperCase()) {
30-
// Refresh folder structure if any item in this folder is deleted.
31-
WebDAVController.Reload();
30+
// Refresh folder structure if any item in this folder is deleted.
31+
WebDAVController.Reload();
3232
} else if (currentLocation.toUpperCase().indexOf(notifyObject.itemPath.toUpperCase()) === 0) {
33-
// Redirect client to the root folder if current path is being deleted.
34-
var originPath = location.origin + "/";
35-
history.pushState({ Url: originPath }, '', originPath);
36-
WebDAVController.NavigateFolder(originPath);
33+
// Redirect client to the root folder if current path is being deleted.
34+
var originPath = location.origin + "/";
35+
history.pushState({ Url: originPath }, '', originPath);
36+
WebDAVController.NavigateFolder(originPath);
37+
}
3738
}
38-
}
39-
}, false);
39+
}, false);
40+
41+
socketSource.addEventListener('error', function (err) {
42+
console.error('Socket encountered error: ', err.message, 'Closing socket');
43+
socketSource.close();
44+
});
45+
46+
socketSource.addEventListener('close', function (e) {
47+
console.log('Socket is closed. Reconnect will be attempted in 5 seconds.', e.reason);
48+
setTimeout(function () {
49+
WebSocketConnect();
50+
}, 5000);
51+
});
52+
}
53+
WebSocketConnect();

0 commit comments

Comments
 (0)