diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2016-08-22 10:10:28 +0200 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2016-08-22 20:25:58 +0200 |
commit | f744131b18c97f84dd8868a1cee1879c5ea5cbb9 (patch) | |
tree | bdd698a6b84ba96c90249f4ba3f1d789f427e4ef /apps/files/js | |
parent | 94992772b27b1f9c87d82a385932d3d93e45c750 (diff) | |
download | nextcloud-server-f744131b18c97f84dd8868a1cee1879c5ea5cbb9.tar.gz nextcloud-server-f744131b18c97f84dd8868a1cee1879c5ea5cbb9.zip |
Do not error on maxUploadChange
The new admin page broke the updating of the max upload size. This is
due to very old code there.
* Now update is done in the background using js
* Added proper route+controller to update
Fixes #994
Diffstat (limited to 'apps/files/js')
-rw-r--r-- | apps/files/js/admin.js | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/apps/files/js/admin.js b/apps/files/js/admin.js index dcfec824cfe..6afd77eb03e 100644 --- a/apps/files/js/admin.js +++ b/apps/files/js/admin.js @@ -8,6 +8,46 @@ * */ +(function() { + if (!OCA.Files) { + /** + * Namespace for the files app + * @namespace OCA.Files + */ + OCA.Files = {}; + } + + /** + * @namespace OCA.Files.Admin + */ + OCA.Files.Admin = { + initialize: function() { + $('#submitMaxUpload').on('click', _.bind(this._onClickSubmitMaxUpload, this)); + }, + + _onClickSubmitMaxUpload: function () { + OC.msg.startSaving('#maxUploadSizeSettingsMsg'); + + var request = $.ajax({ + url: OC.generateUrl('/apps/files/settings/maxUpload'), + type: 'POST', + data: { + maxUploadSize: $('#maxUploadSize').val() + } + }); + + request.done(function (data) { + $('#maxUploadSize').val(data.maxUploadSize); + OC.msg.finishedSuccess('#maxUploadSizeSettingsMsg', 'Saved'); + }); + + request.fail(function () { + OC.msg.finishedError('#maxUploadSizeSettingsMsg', 'Error'); + }); + } + } +})(); + function switchPublicFolder() { var publicEnable = $('#publicEnable').is(':checked'); // find all radiobuttons of that group @@ -19,6 +59,8 @@ function switchPublicFolder() { } $(document).ready(function() { + OCA.Files.Admin.initialize(); + // Execute the function after loading DOM tree switchPublicFolder(); $('#publicEnable').click(function() { |