Skip to content

Commit 6e73886

Browse files
committed
1.1.196
1 parent 08e10c4 commit 6e73886

File tree

4 files changed

+60
-21
lines changed

4 files changed

+60
-21
lines changed

FileSystem/MyCustomHandlerPage.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!DOCTYPE html>
1+
<!DOCTYPE html>
22
<html lang="en">
33
<head>
44
<title>IT Hit WebDAV Server Engine</title>
@@ -188,7 +188,7 @@ <h3>Client Version</h3>
188188
EditDocAuth: {
189189
Authentication: 'anonymous', // Authentication to use when opening documents for editing: 'anonymous', 'challenge', 'ms-ofba', 'cookies'
190190
CookieNames: null, // Coma separated list of cookie names to search for.
191-
SearchIn: null, // Web browsers to search and copy permanent cookies from: 'current', 'none', 'all'.
191+
SearchIn: null, // Web browsers to search and copy permanent cookies from: 'current', 'none'.
192192
LoginUrl: null // Login URL to redirect to in case any cookies specified in CookieNames parameter are not found.
193193
}
194194
}

FileSystem/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ithit.webdav.server.filesystem",
3-
"version": "1.1.195",
3+
"version": "1.1.196",
44
"description": "A cross-platform WebDAV Node.js server that runs on Windows, Mac OS X and Linux. This example is a fully-functional WebDAV server that can be used to open, edit and save Microsoft Office documents directly to server, without download/upload steps.",
55
"author": "IT Hit, Ltd",
66
"license": "IT Hit LTD.",

FileSystem/wwwroot/js/webdav-gridview.js

Lines changed: 50 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-

1+

22
(function () {
33
var Formatters = {
44

@@ -407,7 +407,7 @@
407407
var className = 'ascending'
408408
if ($(this).hasClass('ascending')) {
409409
className = 'descending';
410-
}
410+
}
411411

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

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

576+
//set upload url for uploader control
577+
if (typeof WebDAVUploaderGridView !== 'undefined') {
578+
WebDAVUploaderGridView.SetUploadUrl(sPath);
579+
}
580+
573581
if (sortColumn) {
574582
this.CurrentSortColumn = sortColumn;
575583
this.CurrentSortAscending = sortAscending;
@@ -681,13 +689,28 @@
681689
this.SnippetPropertyName
682690
];
683691

684-
this.CurrentFolder.GetSearchPageByQueryAsync(searchQuery, (currentPageNumber - 1) * pageSize, pageSize, function (oResult) {
685-
/** @type {ITHit.WebDAV.Client.AsyncResult} oResult */
692+
function _getSearchPageByQuery() {
693+
oWebDAV.CurrentFolder.GetSearchPageByQueryAsync(searchQuery, (currentPageNumber - 1) * pageSize, pageSize, function (oResult) {
694+
/** @type {ITHit.WebDAV.Client.AsyncResult} oResult */
695+
696+
/** @type {ITHit.WebDAV.Client.HierarchyItem[]} aItems */
697+
698+
fCallback && fCallback(oResult);
699+
});
700+
}
701+
702+
if (window.location.href.split("#")[0] != this.CurrentFolder.Href) {
703+
this.WebDavSession.OpenFolderAsync(window.location.href.split("#")[0], [], function (oResponse) {
704+
oWebDAV.CurrentFolder = oResponse.Result;
705+
oBreadcrumbs.SetHierarchyItem(oWebDAV.CurrentFolder);
706+
_getSearchPageByQuery();
707+
});
708+
}
709+
else {
710+
_getSearchPageByQuery();
711+
}
686712

687-
/** @type {ITHit.WebDAV.Client.HierarchyItem[]} aItems */
688713

689-
fCallback && fCallback(oResult);
690-
});
691714
},
692715

693716
Sort: function (columnName, sortAscending) {
@@ -776,6 +799,7 @@
776799
* Sets values to hash
777800
*/
778801
SetHashValues: function (arrayValues) {
802+
var hashValue = '';
779803
var params = [];
780804
var hashConfig = this._parseUrlHash();
781805

@@ -787,7 +811,11 @@
787811
params.push(key + '=' + hashConfig[key]);
788812
}
789813

790-
location.hash = params.length > 0 ? ('#' + params.join('&')) : '';
814+
hashValue = params.length > 0 ? ('#' + params.join('&')) : '';
815+
816+
if (hashValue != location.hash) {
817+
location.hash = hashValue;
818+
}
791819

792820
if (location.href[location.href.length - 1] == '#') {
793821
oHistoryApi.PushState();
@@ -801,12 +829,19 @@
801829
this.SetHashValues([{ Name: name, Value: value }]);
802830
},
803831

832+
/**
833+
* Returns url of app installer
834+
*/
835+
GetInstallerFileUrl: function () {
836+
return webDavSettings.ApplicationProtocolsPath + ITHit.WebDAV.Client.DocManager.GetInstallFileName();
837+
},
838+
804839
/**
805840
* Adds name and value to array
806841
* @return {Array}
807842
*/
808843
_addParameterToArray: function (name, value, arrayParams) {
809-
var nameExist = false;
844+
var nameExist = false;
810845

811846
for (var key in arrayParams) {
812847
if (arrayParams.hasOwnProperty(key)) {
@@ -851,6 +886,8 @@
851886
* @private
852887
*/
853888
_ProtocolInstallMessage: function () {
889+
var installerFilePath = this.GetInstallerFileUrl();
890+
854891
if (ITHit.WebDAV.Client.DocManager.IsDavProtocolSupported()) {
855892
oConfirmModal.Confirm('This action requires a protocol installation. <br/><br/>' +
856893
'Make sure a web browser extension is enabled after protocol installation.<br/>' +
@@ -860,9 +897,9 @@
860897
'Select OK to download the protocol installer.', function () {
861898
// IT Hit WebDAV Ajax Library protocol installers path.
862899
// Used to open non-MS Office documents or if MS Office is
863-
// not installed as well as to open OS File Manager.
900+
// not installed as well as to open OS File Manager.
901+
864902

865-
var installerFilePath = webDavSettings.ApplicationProtocolsPath + ITHit.WebDAV.Client.DocManager.GetInstallFileName();
866903
window.open(installerFilePath);
867904
}, { size: 'lg' });
868905
}
@@ -888,7 +925,7 @@
888925
oWebDAV.NavigateFolder(window.location.href.split("#")[0]);
889926
}
890927

891-
// Set Ajax lib version
928+
// Set Ajax lib version
892929
if (ITHit.WebDAV.Client.DocManager.IsDavProtocolSupported()) {
893930
var $installerLink = $('<a></a>')
894931
.attr('href', webDavSettings.ApplicationProtocolsPath + ITHit.WebDAV.Client.DocManager.GetInstallFileName())
@@ -897,8 +934,6 @@
897934
} else {
898935
$('.ithit-version-value').text('v' + ITHit.WebDAV.Client.WebDavSession.Version + ' (Protocol v' + ITHit.WebDAV.Client.WebDavSession.ProtocolVersion + ')');
899936
}
900-
901-
902937
$('.ithit-current-folder-value').text(oWebDAV.GetMountUrl());
903938

904939
})();

FileSystem/wwwroot/js/webdav-uploader.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-

1+

22
(function () {
33
///////////////////
44
// Confirm Bootstrap Modal
@@ -85,7 +85,7 @@
8585
$(input.HtmlElement).trigger('click');
8686
});
8787

88-
this.Uploader.SetUploadUrl(ITHit.WebDAV.Client.Encoder.Decode(window.location.href.split("#")[0]));
88+
this.SetUploadUrl(ITHit.WebDAV.Client.Encoder.Decode(window.location.href.split("#")[0]));
8989
this.Uploader.Queue.AddListener('OnQueueChanged', '_QueueChange', this);
9090
this.Uploader.Queue.OnUploadItemsCreatedCallback = this._OnUploadItemsCreatedCallback.bind(this);
9191
var $table = this.$table = $(sSelector);
@@ -105,6 +105,10 @@
105105
});
106106
};
107107

108+
UploaderGridView.prototype.SetUploadUrl = function (url) {
109+
this.Uploader.SetUploadUrl(url);
110+
};
111+
108112
UploaderGridView.prototype._OnUploadItemsCreatedCallback = function (oUploadItemsCreated) {
109113
this._GetExistsAsync(oUploadItemsCreated.Items, function (oAsyncResult) {
110114
if (oAsyncResult.IsSuccess && oAsyncResult.Result.length) {
@@ -463,5 +467,5 @@
463467
};
464468

465469
var oConfirmModal = new ConfirmModal('#ConfirmModal');
466-
var oUploaderGrid = new UploaderGridView('.ithit-grid-uploads');
470+
window.WebDAVUploaderGridView = new UploaderGridView('.ithit-grid-uploads');
467471
})();

0 commit comments

Comments
 (0)