2014-01-30 13:41:04 +04:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2014
|
|
|
|
*
|
|
|
|
* This file is licensed under the Affero General Public License version 3
|
|
|
|
* or later.
|
|
|
|
*
|
|
|
|
* See the COPYING-README file.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2016-08-22 11:10:28 +03:00
|
|
|
(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');
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})();
|
|
|
|
|
2014-02-26 13:16:54 +04:00
|
|
|
function switchPublicFolder() {
|
2012-03-19 14:56:02 +04:00
|
|
|
var publicEnable = $('#publicEnable').is(':checked');
|
2014-02-26 13:16:54 +04:00
|
|
|
// find all radiobuttons of that group
|
|
|
|
var sharingaimGroup = $('input:radio[name=sharingaim]');
|
2012-03-19 14:56:02 +04:00
|
|
|
$.each(sharingaimGroup, function(index, sharingaimItem) {
|
2014-02-26 13:16:54 +04:00
|
|
|
// set all buttons to the correct state
|
|
|
|
sharingaimItem.disabled = !publicEnable;
|
2012-03-19 14:56:02 +04:00
|
|
|
});
|
2011-07-09 23:44:50 +04:00
|
|
|
}
|
|
|
|
|
2014-02-26 13:16:54 +04:00
|
|
|
$(document).ready(function() {
|
2016-08-22 11:10:28 +03:00
|
|
|
OCA.Files.Admin.initialize();
|
|
|
|
|
2014-02-26 13:16:54 +04:00
|
|
|
// Execute the function after loading DOM tree
|
|
|
|
switchPublicFolder();
|
|
|
|
$('#publicEnable').click(function() {
|
|
|
|
// To get rid of onClick()
|
|
|
|
switchPublicFolder();
|
2012-03-19 14:56:02 +04:00
|
|
|
});
|
2011-07-09 23:44:50 +04:00
|
|
|
});
|