summaryrefslogtreecommitdiffstats
path: root/apps/files/js
diff options
context:
space:
mode:
authorTomasz Grobelny <tomasz@grobelny.net>2019-01-29 21:26:44 +0100
committerTomasz Grobelny <tomasz@grobelny.net>2019-01-29 21:26:44 +0100
commit08919eb19335825dc1f2cd950f9529a2b9caf29b (patch)
treeb8b0feecbac68789b0f89526c19f1c64523e2544 /apps/files/js
parent04d326f95feacd640dc5d6fecff1ec0ef0970265 (diff)
parentdeb7d2364f38ce24bee62cd490fccfd6e4d3f059 (diff)
downloadnextcloud-server-08919eb19335825dc1f2cd950f9529a2b9caf29b.tar.gz
nextcloud-server-08919eb19335825dc1f2cd950f9529a2b9caf29b.zip
Merge branch 'master' into operation_progress_improvements3
Signed-off-by: Tomasz Grobelny <tomasz@grobelny.net>
Diffstat (limited to 'apps/files/js')
-rw-r--r--apps/files/js/app.js5
-rw-r--r--apps/files/js/file-upload.js13
-rw-r--r--apps/files/js/fileactions.js7
-rw-r--r--apps/files/js/filelist.js12
-rw-r--r--apps/files/js/files.js4
-rw-r--r--apps/files/js/navigation.js7
6 files changed, 35 insertions, 13 deletions
diff --git a/apps/files/js/app.js b/apps/files/js/app.js
index 3630ed7587d..c7393b871b8 100644
--- a/apps/files/js/app.js
+++ b/apps/files/js/app.js
@@ -133,7 +133,10 @@
this._debouncedPersistShowHiddenFilesState = _.debounce(this._persistShowHiddenFilesState, 1200);
- OCP.WhatsNew.query(); // for Nextcloud server
+ if (sessionStorage.getItem('WhatsNewServerCheck') < (Date.now() - 3600*1000)) {
+ OCP.WhatsNew.query(); // for Nextcloud server
+ sessionStorage.setItem('WhatsNewServerCheck', Date.now());
+ }
},
/**
diff --git a/apps/files/js/file-upload.js b/apps/files/js/file-upload.js
index 741a6517af9..e0b274cdc76 100644
--- a/apps/files/js/file-upload.js
+++ b/apps/files/js/file-upload.js
@@ -194,7 +194,7 @@ OC.FileUpload.prototype = {
var data = this.data;
var file = this.getFile();
- // it was a folder upload, so make sure the parent directory exists alrady
+ // it was a folder upload, so make sure the parent directory exists already
var folderPromise;
if (file.relativePath) {
folderPromise = this.uploader.ensureFolderExists(this.getFullPath());
@@ -528,7 +528,9 @@ OC.Uploader.prototype = _.extend({
self.filesClient.createDirectory(fullPath).always(function(status) {
// 405 is expected if the folder already exists
if ((status >= 200 && status < 300) || status === 405) {
- self.trigger('createdfolder', fullPath);
+ if (status !== 405) {
+ self.trigger('createdfolder', fullPath);
+ }
deferred.resolve();
return;
}
@@ -660,7 +662,7 @@ OC.Uploader.prototype = _.extend({
// when only replacement selected -> overwrite
self.onReplace(conflict.data('data'));
} else {
- // when only original seleted -> skip
+ // when only original selected -> skip
// when none selected -> skip
self.onSkip(conflict.data('data'));
}
@@ -857,7 +859,8 @@ OC.Uploader.prototype = _.extend({
type: 'PUT',
dropZone: options.dropZone, // restrict dropZone to content div
autoUpload: false,
- sequentialUploads: true,
+ sequentialUploads: false,
+ limitConcurrentUploads: 10,
//singleFileUploads is on by default, so the data.files array will always have length 1
/**
* on first add of every selection
@@ -1036,7 +1039,7 @@ OC.Uploader.prototype = _.extend({
// target folder does not exist any more
OC.Notification.show(t('files', 'Target folder "{dir}" does not exist any more', {dir: upload.getFullPath()} ), {type: 'error'});
self.cancelUploads();
- } else if (status === 507) {
+ } else if (data.textStatus === 'notenoughspace') {
// not enough space
OC.Notification.show(t('files', 'Not enough free space'), {type: 'error'});
self.cancelUploads();
diff --git a/apps/files/js/fileactions.js b/apps/files/js/fileactions.js
index 2981fb64c11..ef29551c591 100644
--- a/apps/files/js/fileactions.js
+++ b/apps/files/js/fileactions.js
@@ -648,6 +648,10 @@
if (permissions & OC.PERMISSION_UPDATE) {
actions = OC.dialogs.FILEPICKER_TYPE_COPY_MOVE;
}
+ var dialogDir = context.dir;
+ if (typeof context.fileList.dirInfo.dirLastCopiedTo !== 'undefined') {
+ dialogDir = context.fileList.dirInfo.dirLastCopiedTo;
+ }
OC.dialogs.filepicker(t('files', 'Choose target folder'), function(targetPath, type) {
if (type === OC.dialogs.FILEPICKER_TYPE_COPY) {
context.fileList.copy(filename, targetPath, false, context.dir);
@@ -655,7 +659,8 @@
if (type === OC.dialogs.FILEPICKER_TYPE_MOVE) {
context.fileList.move(filename, targetPath, false, context.dir);
}
- }, false, "httpd/unix-directory", true, actions);
+ context.fileList.dirInfo.dirLastCopiedTo = targetPath;
+ }, false, "httpd/unix-directory", true, actions, dialogDir);
}
});
diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js
index 7fc460017bb..abfbaaad916 100644
--- a/apps/files/js/filelist.js
+++ b/apps/files/js/filelist.js
@@ -923,6 +923,10 @@
};
var actions = this.isSelectedMovable() ? OC.dialogs.FILEPICKER_TYPE_COPY_MOVE : OC.dialogs.FILEPICKER_TYPE_COPY;
+ var dialogDir = self.getCurrentDirectory();
+ if (typeof self.dirInfo.dirLastCopiedTo !== 'undefined') {
+ dialogDir = self.dirInfo.dirLastCopiedTo;
+ }
OC.dialogs.filepicker(t('files', 'Choose target folder'), function(targetPath, type) {
self.fileMultiSelectMenu.toggleLoading('copyMove', true);
if (type === OC.dialogs.FILEPICKER_TYPE_COPY) {
@@ -931,7 +935,8 @@
if (type === OC.dialogs.FILEPICKER_TYPE_MOVE) {
self.move(files, targetPath, disableLoadingState);
}
- }, false, "httpd/unix-directory", true, actions);
+ self.dirInfo.dirLastCopiedTo = targetPath;
+ }, false, "httpd/unix-directory", true, actions, dialogDir);
event.preventDefault();
},
@@ -1674,7 +1679,7 @@
c: fileData.etag
};
var previewUrl = this.generatePreviewUrl(urlSpec);
- previewUrl = previewUrl.replace('(', '%28').replace(')', '%29');
+ previewUrl = previewUrl.replace(/\(/g, '%28').replace(/\)/g, '%29');
iconDiv.css('background-image', 'url("' + previewUrl + '")');
}
}
@@ -2058,8 +2063,7 @@
}
previewURL = self.generatePreviewUrl(urlSpec);
- previewURL = previewURL.replace('(', '%28');
- previewURL = previewURL.replace(')', '%29');
+ previewURL = previewURL.replace(/\(/g, '%28').replace(/\)/g, '%29');
// preload image to prevent delay
// this will make the browser cache the image
diff --git a/apps/files/js/files.js b/apps/files/js/files.js
index 016aef05a96..a785a44ddd6 100644
--- a/apps/files/js/files.js
+++ b/apps/files/js/files.js
@@ -33,6 +33,9 @@
},
// update quota
updateStorageQuotas: function() {
+ Files._updateStorageQuotasThrottled();
+ },
+ _updateStorageQuotas: function() {
var state = Files.updateStorageQuotas;
state.call = $.getJSON(OC.filePath('files','ajax','getstoragestats.php'),function(response) {
Files.updateQuota(response);
@@ -356,6 +359,7 @@
};
Files._updateStorageStatisticsDebounced = _.debounce(Files._updateStorageStatistics, 250);
+ Files._updateStorageQuotasThrottled = _.throttle(Files._updateStorageQuotas, 30000);
OCA.Files.Files = Files;
})();
diff --git a/apps/files/js/navigation.js b/apps/files/js/navigation.js
index 02a0af2b369..acfda3b6ce8 100644
--- a/apps/files/js/navigation.js
+++ b/apps/files/js/navigation.js
@@ -283,8 +283,11 @@
* This method allows easy swapping of elements.
*/
swap: function (list, j, i) {
- list[i].before(list[j]);
- list[j].before(list[i]);
+ var before = function(node, insertNode) {
+ node.parentNode.insertBefore(insertNode, node);
+ }
+ before(list[i], list[j]);
+ before(list[j], list[i]);
}
};