Skip to content

Commit 48ce0d1

Browse files
committed
4.2.2794
1 parent ddcc6ff commit 48ce0d1

File tree

19 files changed

+928
-362
lines changed

19 files changed

+928
-362
lines changed

Java/androidfsstorage/app/build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ android {
3030
jarJar {
3131
rules = [
3232
'stax-api-1.0.1.jar' : 'javax.xml.** com.ithit.webdav.xml.@1',
33-
'webdav-server-4.1.2715.jar': 'javax.xml.stream.** com.ithit.webdav.xml.stream.@1'
33+
'webdav-server-4.2.2781.jar': 'javax.xml.stream.** com.ithit.webdav.xml.stream.@1'
3434
]
3535
}
3636

@@ -71,11 +71,11 @@ dependencies {
7171
implementation 'commons-io:commons-io:2.4'
7272
implementation 'com.google.code.gson:gson:2.7'
7373
implementation 'com.android.support:appcompat-v7:27.1.1'
74-
implementation('com.ithit.webdav.integration:android-integration:4.1.2715', {
74+
implementation('com.ithit.webdav.integration:android-integration:4.2.2781', {
7575
exclude group: 'org.nanohttpd', module: 'nanohttpd'
7676
})
7777
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
7878
jarJar 'stax:stax-api:1.0.1'
79-
jarJar 'com.ithit.webdav:webdav-server:4.1.2715'
79+
jarJar 'com.ithit.webdav:webdav-server:4.2.2781'
8080
testImplementation 'junit:junit:4.12'
8181
}

Java/deltav/pom.xml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<groupId>com.ithit.webdav.samples</groupId>
88
<artifactId>deltav</artifactId>
9-
<version>4.1.2715</version>
9+
<version>4.2.2794</version>
1010
<packaging>war</packaging>
1111

1212
<properties>
@@ -23,7 +23,7 @@
2323
<dependency>
2424
<groupId>com.ithit.webdav.integration</groupId>
2525
<artifactId>servlet-integration</artifactId>
26-
<version>4.1.2715</version>
26+
<version>4.2.2794</version>
2727
</dependency>
2828
<dependency>
2929
<groupId>commons-dbcp</groupId>
@@ -125,7 +125,7 @@
125125
<dependency>
126126
<groupId>com.ithit.webdav</groupId>
127127
<artifactId>webdav-server</artifactId>
128-
<version>4.1.2715</version>
128+
<version>4.2.2794</version>
129129
</dependency>
130130

131131
<dependency>
@@ -165,7 +165,7 @@
165165
<goal>copy-resources</goal>
166166
</goals>
167167
<configuration>
168-
<outputDirectory>${project.build.directory}/deltav-4.1.2715/META-INF</outputDirectory>
168+
<outputDirectory>${project.build.directory}/deltav-4.2.2794/META-INF</outputDirectory>
169169
<overwrite>true</overwrite>
170170
<resources>
171171
<resource>
@@ -244,7 +244,7 @@
244244
<server>filesystem</server>
245245
<port>11021</port>
246246
<path>/</path>
247-
<warSourceDirectory>target/deltav-4.1.2715</warSourceDirectory>
247+
<warSourceDirectory>target/deltav-4.2.2794</warSourceDirectory>
248248
</configuration>
249249
</plugin>
250250
<plugin>

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

Lines changed: 76 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@
2121
*/
2222
Date: function (oDate) {
2323
return [
24-
('0' + (oDate.getMonth() + 1)).slice(-2),
25-
('0' + oDate.getDate()).slice(-2),
26-
oDate.getFullYear()
27-
].join('/') +
24+
('0' + (oDate.getMonth() + 1)).slice(-2),
25+
('0' + oDate.getDate()).slice(-2),
26+
oDate.getFullYear()
27+
].join('/') +
2828
' ' +
2929
[
3030
('0' + oDate.getHours() % 12 || 12).slice(-2),
@@ -47,7 +47,7 @@
4747
html = html.replace(/<b>/g, safePrefix + '_0').replace(/<\/b>/g, safePrefix + '_1');
4848
html = $('<div />').text(html).text();
4949
html = html.replace(new RegExp(safePrefix + '_0', 'g'), '<b>').
50-
replace(new RegExp(safePrefix + '_1', 'g'), '</b>');
50+
replace(new RegExp(safePrefix + '_1', 'g'), '</b>');
5151
}
5252
return $('<div />').addClass('snippet').html(html);
5353
},
@@ -99,13 +99,13 @@
9999
$('<tr />').html([
100100
$('<td class="d-none d-sm-table-cell" />').text(i + 1),
101101
$('<td />').
102-
html(oItem.IsFolder() ? '<span class="fas fa-folder">' + locked +
103-
'</span>' : locked),
102+
html(oItem.IsFolder() ? '<span class="fas fa-folder">' + locked +
103+
'</span>' : locked),
104104
this._RenderDisplayName(oItem),
105105
$('<td class="d-none d-sm-table-cell" />').text(oItem.IsFolder() ? 'Folder' : ('File ' + Formatters.GetFileExtension(oItem.DisplayName))),
106106
$('<td />').
107-
text(!oItem.IsFolder() ? Formatters.FileSize(oItem.ContentLength) : '').
108-
css('text-align', 'right'),
107+
text(!oItem.IsFolder() ? Formatters.FileSize(oItem.ContentLength) : '').
108+
css('text-align', 'right'),
109109
$('<td class="d-none d-sm-table-cell" />').text(Formatters.Date(oItem.LastModified)),
110110
$('<td class="column-action" />').html(this._RenderActions(oItem))
111111
]),
@@ -118,8 +118,8 @@
118118
},
119119

120120
/**
121-
* @param {ITHit.WebDAV.Client.HierarchyItem} oItem
122-
**/
121+
* @param {ITHit.WebDAV.Client.HierarchyItem} oItem
122+
**/
123123
_RenderDisplayName: function (oItem) {
124124
var oElement = oItem.IsFolder() ?
125125
$('<td class="ellipsis" />').html($('<a />').text(oItem.DisplayName).attr('href', oItem.Href)) :
@@ -151,18 +151,18 @@
151151

152152
if (oItem.IsFolder()) {
153153
actions.push($('<button class="btn btn-transparent browse-lnk" type="button"/>').
154-
html('<span class="fas fa-hdd"></span> <span class="d-none d-md-inline">Browse</span>').
155-
attr('title', 'Open this folder in Operating System file manager.').
156-
on('click', function () {
157-
oWebDAV.OpenFolderInOsFileManager(oItem.Href);
158-
}).prop("disabled", !isDavProtocolSupported));
154+
html('<span class="fas fa-hdd"></span> <span class="d-none d-md-inline">Browse</span>').
155+
attr('title', 'Open this folder in Operating System file manager.').
156+
on('click', function () {
157+
oWebDAV.OpenFolderInOsFileManager(oItem.Href);
158+
}).prop("disabled", !isDavProtocolSupported));
159159
} else {
160160
actions.push($('<button class="btn btn-transparent"/>').
161-
html('<span class="fas fa-edit"></span> <span class="d-none d-md-inline">Edit</span>').
162-
attr('title', 'Edit document in associated application.').
163-
on('click', function () {
164-
oWebDAV.EditDoc(oItem.Href);
165-
}).prop("disabled", !isDavProtocolSupported && !isMicrosoftOfficeDocument));
161+
html('<span class="fas fa-edit"></span> <span class="d-none d-md-inline">Edit</span>').
162+
attr('title', 'Edit document in associated application.').
163+
on('click', function () {
164+
oWebDAV.EditDoc(oItem.Href);
165+
}).prop("disabled", !isDavProtocolSupported && !isMicrosoftOfficeDocument));
166166
actions.push($('<button class="btn btn-transparent"/>')
167167
.html('<span class="fas fa-window-maximize"></span>')
168168
.attr('title', 'Select application to open this file with.')
@@ -209,8 +209,8 @@
209209
SetDisabled: function (bIsDisabled) {
210210
this.$el.find('button').prop('disabled', bIsDisabled);
211211
this.$el.find('input').
212-
prop('disabled', bIsDisabled).
213-
attr('placeholder', !bIsDisabled ? '' : 'The server does not support search');
212+
prop('disabled', bIsDisabled).
213+
attr('placeholder', !bIsDisabled ? '' : 'The server does not support search');
214214
},
215215

216216
GetValue: function () {
@@ -406,7 +406,7 @@
406406
var className = 'ascending'
407407
if ($(this).hasClass('ascending')) {
408408
className = 'descending';
409-
}
409+
}
410410

411411
oWebDAV.Sort($(this).data('sort-column'), className == 'ascending');
412412
})
@@ -447,7 +447,10 @@
447447
},
448448

449449
_OnPopState: function (oEvent) {
450-
if (!oWebDAV.GetHashValue('search')) {
450+
if (oWebDAV.GetHashValue('search')) {
451+
oSearchForm.LoadFromHash();
452+
}
453+
else {
451454
var sUrl = oEvent.state && oEvent.state.Url || window.location.href.split("#")[0];
452455
oWebDAV.NavigateFolder(sUrl);
453456
}
@@ -569,6 +572,11 @@
569572
sPath = this.CurrentFolder.Href;
570573
}
571574

575+
//set upload url for uploader control
576+
if (typeof WebDAVUploaderGridView !== 'undefined') {
577+
WebDAVUploaderGridView.SetUploadUrl(sPath);
578+
}
579+
572580
if (sortColumn) {
573581
this.CurrentSortColumn = sortColumn;
574582
this.CurrentSortAscending = sortAscending;
@@ -634,7 +642,7 @@
634642
},
635643

636644
NavigateSearch: function (sPhrase, bIsDynamic, pageNumber, updateUrlHash, fCallback) {
637-
var pageSize = this.PageSize, currentPageNumber = 1;
645+
var pageSize = this.PageSize, currentPageNumber = 1;
638646

639647
if (!this.CurrentFolder) {
640648
fCallback && fCallback({ Items: [], TotalItems: 0 });
@@ -669,24 +677,39 @@
669677
// If ‘%’, ‘_’ or ‘\’ characters are used in search phrase they are escaped as ‘\%’, ‘\_’ and ‘\\’.
670678
var searchQuery = new ITHit.WebDAV.Client.SearchQuery();
671679
searchQuery.Phrase = sPhrase.replace(/\\/g, '\\\\').
672-
replace(/\%/g, '\\%').
673-
replace(/\_/g, '\\_').
674-
replace(/\*/g, '%').
675-
replace(/\?/g, '_') + '%';
680+
replace(/\%/g, '\\%').
681+
replace(/\_/g, '\\_').
682+
replace(/\*/g, '%').
683+
replace(/\?/g, '_') + '%';
676684
searchQuery.EnableContains = !bIsDynamic; //Enable/disable search in file content.
677685

678686
// Get following additional properties from server in search results: snippet - text around search phrase.
679687
searchQuery.SelectProperties = [
680688
this.SnippetPropertyName
681689
];
682690

683-
this.CurrentFolder.GetSearchPageByQueryAsync(searchQuery, (currentPageNumber - 1) * pageSize, pageSize, function (oResult) {
684-
/** @type {ITHit.WebDAV.Client.AsyncResult} oResult */
691+
function _getSearchPageByQuery() {
692+
oWebDAV.CurrentFolder.GetSearchPageByQueryAsync(searchQuery, (currentPageNumber - 1) * pageSize, pageSize, function (oResult) {
693+
/** @type {ITHit.WebDAV.Client.AsyncResult} oResult */
685694

686-
/** @type {ITHit.WebDAV.Client.HierarchyItem[]} aItems */
695+
/** @type {ITHit.WebDAV.Client.HierarchyItem[]} aItems */
687696

688-
fCallback && fCallback(oResult);
689-
});
697+
fCallback && fCallback(oResult);
698+
});
699+
}
700+
701+
if (window.location.href.split("#")[0] != this.CurrentFolder.Href) {
702+
this.WebDavSession.OpenFolderAsync(window.location.href.split("#")[0], [], function (oResponse) {
703+
oWebDAV.CurrentFolder = oResponse.Result;
704+
oBreadcrumbs.SetHierarchyItem(oWebDAV.CurrentFolder);
705+
_getSearchPageByQuery();
706+
});
707+
}
708+
else {
709+
_getSearchPageByQuery();
710+
}
711+
712+
690713
},
691714

692715
Sort: function (columnName, sortAscending) {
@@ -708,18 +731,18 @@
708731
},
709732

710733
/**
711-
* Opens document with.
712-
* @param {string} sDocumentUrl Must be full path including domain name: https://webdavserver.com/path/file.ext
713-
*/
734+
* Opens document with.
735+
* @param {string} sDocumentUrl Must be full path including domain name: https://webdavserver.com/path/file.ext
736+
*/
714737
OpenDocWith: function (sDocumentUrl) {
715738
ITHit.WebDAV.Client.DocManager.DavProtocolEditDocument(sDocumentUrl, this.GetMountUrl(), this._ProtocolInstallMessage.bind(this), null, webDavSettings.EditDocAuth.SearchIn,
716739
webDavSettings.EditDocAuth.CookieNames, webDavSettings.EditDocAuth.LoginUrl, 'OpenWith');
717740
},
718741

719742
/**
720-
* Deletes document.
721-
* @param {string} sDocumentUrl Must be full path including domain name: https://webdavserver.com/path/file.ext
722-
*/
743+
* Deletes document.
744+
* @param {string} sDocumentUrl Must be full path including domain name: https://webdavserver.com/path/file.ext
745+
*/
723746
DeleteHierarchyItem: function (oItem) {
724747
oConfirmModal.Confirm('Are you sure want to delete ' + oItem.DisplayName + '?', function () {
725748
oItem.DeleteAsync(null);
@@ -749,12 +772,12 @@
749772
// Web Folders on Windows XP require port, even if it is a default port 80 or 443.
750773
var port = window.location.port || (window.location.protocol == 'http:' ? 80 : 443);
751774

752-
return window.location.protocol + '//' + window.location.hostname + ':' + port + webDavSettings.ApplicationPath;
775+
return window.location.protocol + '//' + window.location.hostname + ':' + port + webDavSettings.ApplicationPath + '/';
753776
},
754777

755778
/**
756-
* Creates new folder in current folder.
757-
*/
779+
* Creates new folder in current folder.
780+
*/
758781
CreateFolder: function (sFolderName, fCallback) {
759782
this.CurrentFolder.CreateFolderAsync(sFolderName, null, null, function (oAsyncResult) {
760783
fCallback(oAsyncResult);
@@ -772,7 +795,7 @@
772795
},
773796

774797
/**
775-
* Sets values to hash
798+
* Sets values to hash
776799
*/
777800
SetHashValues: function (arrayValues) {
778801
var hashValue = '';
@@ -799,7 +822,7 @@
799822
},
800823

801824
/**
802-
* Sets value to hash
825+
* Sets value to hash
803826
*/
804827
SetHashValue: function (name, value) {
805828
this.SetHashValues([{ Name: name, Value: value }]);
@@ -810,7 +833,7 @@
810833
* @return {Array}
811834
*/
812835
_addParameterToArray: function (name, value, arrayParams) {
813-
var nameExist = false;
836+
var nameExist = false;
814837

815838
for (var key in arrayParams) {
816839
if (arrayParams.hasOwnProperty(key)) {
@@ -862,13 +885,13 @@
862885
(ITHit.DetectBrowser.Browser ? ('#' + ITHit.DetectBrowser.Browser.toLowerCase()) : '') +
863886
'">How to check that the web browser extension is enabled.</a><br/><br/>' +
864887
'Select OK to download the protocol installer.', function () {
865-
// IT Hit WebDAV Ajax Library protocol installers path.
866-
// Used to open non-MS Office documents or if MS Office is
867-
// not installed as well as to open OS File Manager.
888+
// IT Hit WebDAV Ajax Library protocol installers path.
889+
// Used to open non-MS Office documents or if MS Office is
890+
// not installed as well as to open OS File Manager.
868891

869-
var installerFilePath = webDavSettings.ApplicationProtocolsPath + ITHit.WebDAV.Client.DocManager.GetInstallFileName();
870-
window.open(installerFilePath);
871-
}, { size: 'lg' });
892+
var installerFilePath = webDavSettings.ApplicationProtocolsPath + ITHit.WebDAV.Client.DocManager.GetInstallFileName();
893+
window.open(installerFilePath);
894+
}, { size: 'lg' });
872895
}
873896
}
874897
};

0 commit comments

Comments
 (0)