diff options
Diffstat (limited to 'apps/files/js/files.js')
-rw-r--r-- | apps/files/js/files.js | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/apps/files/js/files.js b/apps/files/js/files.js index 153307fec52..5e34f664a6c 100644 --- a/apps/files/js/files.js +++ b/apps/files/js/files.js @@ -32,6 +32,23 @@ Files.updateQuota(response); }); }, + // update quota + updateStorageQuotas: function(currentDir) { + var state = Files.updateStorageStatistics; + if (state.dir){ + if (state.dir === currentDir) { + return; + } + // cancel previous call, as it was for another dir + state.call.abort(); + } + state.dir = currentDir; + state.call = $.getJSON(OC.filePath('files','ajax','getstoragestats.php') + '?dir=' + encodeURIComponent(currentDir),function(response) { + state.dir = null; + state.call = null; + Files.updateQuota(response); + }); + }, /** * Update storage statistics such as free space, max upload, * etc based on the given directory. @@ -128,6 +145,8 @@ throw t('files', '"{name}" is an invalid file name.', {name: name}); } else if (trimmedName.length === 0) { throw t('files', 'File name cannot be empty.'); + } else if (trimmedName.indexOf('/') !== -1) { + throw t('files', '"/" is not allowed inside a file name.'); } else if (OC.fileIsBlacklisted(trimmedName)) { throw t('files', '"{name}" is not an allowed filetype', {name: name}); } |