aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files/js/files.js
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2012-12-20 17:16:01 +0100
committerThomas Müller <thomas.mueller@tmit.eu>2012-12-20 17:16:53 +0100
commit39d874cd902a4e3d4f7ae313ec5e15bafe35df13 (patch)
tree5ff19b3755fc02f6f9eecd64996094e2bed388dd /apps/files/js/files.js
parentbdc8d0098adfb0225bc4a67ab72344a203448e34 (diff)
downloadnextcloud-server-39d874cd902a4e3d4f7ae313ec5e15bafe35df13.tar.gz
nextcloud-server-39d874cd902a4e3d4f7ae313ec5e15bafe35df13.zip
the maximum upload size is now part of the response of the upload and delete operation.
the maximum upload size is updated within the browser once an upload or delete operation has been finished
Diffstat (limited to 'apps/files/js/files.js')
-rw-r--r--apps/files/js/files.js26
1 files changed, 24 insertions, 2 deletions
diff --git a/apps/files/js/files.js b/apps/files/js/files.js
index 6a37d9e7f53..e35dbe673d9 100644
--- a/apps/files/js/files.js
+++ b/apps/files/js/files.js
@@ -26,6 +26,23 @@ Files={
});
procesSelection();
},
+ updateMaxUploadFilesize:function(response) {
+ if(response == undefined) {
+ return;
+ }
+ if(response.data !== undefined && response.data.uploadMaxFilesize !== undefined) {
+ $('#max_upload').val(response.data.uploadMaxFilesize);
+ $('#data-upload-form a').attr('original-title', response.data.maxHumanFilesize);
+ }
+ if(response[0] == undefined) {
+ return;
+ }
+ if(response[0].uploadMaxFilesize !== undefined) {
+ $('#max_upload').val(response[0].uploadMaxFilesize);
+ $('#data-upload-form a').attr('original-title', response[0].maxHumanFilesize);
+ }
+
+ },
containsInvalidCharacters:function (name) {
var invalid_characters = ['\\', '/', '<', '>', ':', '"', '|', '?', '*'];
for (var i = 0; i < invalid_characters.length; i++) {
@@ -304,6 +321,7 @@ $(document).ready(function() {
$('#notification').text(t('files', response.data.message));
$('#notification').fadeIn();
}
+ Files.updateMaxUploadFilesize(response);
var file=response[0];
// TODO: this doesn't work if the file name has been changed server side
delete uploadingFiles[dirName][file.name];
@@ -354,7 +372,9 @@ $(document).ready(function() {
.success(function(result, textStatus, jqXHR) {
var response;
response=jQuery.parseJSON(result);
- if(response[0] != undefined && response[0].status == 'success') {
+ Files.updateMaxUploadFilesize(response);
+
+ if(response[0] != undefined && response[0].status == 'success') {
var file=response[0];
delete uploadingFiles[file.name];
$('tr').filterAttr('data-file',file.name).data('mime',file.mime).data('id',file.id);
@@ -384,7 +404,8 @@ $(document).ready(function() {
data.submit().success(function(data, status) {
// in safari data is a string
response = jQuery.parseJSON(typeof data === 'string' ? data : data[0].body.innerText);
- if(response[0] != undefined && response[0].status == 'success') {
+ Files.updateMaxUploadFilesize(response);
+ if(response[0] != undefined && response[0].status == 'success') {
var file=response[0];
delete uploadingFiles[file.name];
$('tr').filterAttr('data-file',file.name).data('mime',file.mime).data('id',file.id);
@@ -712,6 +733,7 @@ scanFiles.scanning=false;
function boolOperationFinished(data, callback) {
result = jQuery.parseJSON(data.responseText);
+ Files.updateMaxUploadFilesize(result);
if(result.status == 'success'){
callback.call();
} else {