aboutsummaryrefslogtreecommitdiffstats
path: root/files/js
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@owncloud.com>2012-03-19 11:56:02 +0100
committerArthur Schiwon <blizzz@owncloud.com>2012-03-19 11:56:02 +0100
commitb13ab2b17eb485aec13c7fb1e88e25e1c9901d72 (patch)
tree58259ba29b5833107b62bf08688eaefefe46cdb9 /files/js
parent194211500b601d8582fa1e8396fb4c8e4970224d (diff)
downloadnextcloud-server-b13ab2b17eb485aec13c7fb1e88e25e1c9901d72.tar.gz
nextcloud-server-b13ab2b17eb485aec13c7fb1e88e25e1c9901d72.zip
enable admin to turn off ZIP downloads
user interface offers multi-file/folder downloads only if available make function name more clear
Diffstat (limited to 'files/js')
-rw-r--r--files/js/admin.js28
-rw-r--r--files/js/fileactions.js15
2 files changed, 29 insertions, 14 deletions
diff --git a/files/js/admin.js b/files/js/admin.js
index 5cbb2b9f5ac..bfa96670635 100644
--- a/files/js/admin.js
+++ b/files/js/admin.js
@@ -1,15 +1,23 @@
-function switchPublicFolder()
+function switchPublicFolder()
{
- var publicEnable = $('#publicEnable').is(':checked');
- var sharingaimGroup = $('input:radio[name=sharingaim]'); //find all radiobuttons of that group
- $.each(sharingaimGroup, function(index, sharingaimItem) {
- sharingaimItem.disabled = !publicEnable; //set all buttons to the correct state
- });
+ var publicEnable = $('#publicEnable').is(':checked');
+ var sharingaimGroup = $('input:radio[name=sharingaim]'); //find all radiobuttons of that group
+ $.each(sharingaimGroup, function(index, sharingaimItem) {
+ sharingaimItem.disabled = !publicEnable; //set all buttons to the correct state
+ });
}
$(document).ready(function(){
- switchPublicFolder(); // Execute the function after loading DOM tree
- $('#publicEnable').click(function(){
- switchPublicFolder(); // To get rid of onClick()
- });
+ switchPublicFolder(); // Execute the function after loading DOM tree
+ $('#publicEnable').click(function(){
+ switchPublicFolder(); // To get rid of onClick()
+ });
+
+ $('#allowZipDownload').bind('change', function() {
+ if($('#allowZipDownload').attr('checked')) {
+ $('#maxZipInputSize').removeAttr('disabled');
+ } else {
+ $('#maxZipInputSize').attr('disabled', 'disabled');
+ }
+ });
});
diff --git a/files/js/fileactions.js b/files/js/fileactions.js
index b5dd3982803..b33be280ad5 100644
--- a/files/js/fileactions.js
+++ b/files/js/fileactions.js
@@ -106,7 +106,7 @@ FileActions={
element.hide();
parent.parent().children().last().append(element);
}
- $('#fileList .action').css('-o-transition-property','none');//temporarly disable
+ $('#fileList .action').css('-o-transition-property','none');//temporarly disable
$('#fileList .action').fadeIn(200,function(){
$('#fileList .action').css('-o-transition-property','opacity');
});
@@ -128,8 +128,15 @@ FileActions={
}
}
-FileActions.register('all','Download',function(){return OC.imagePath('core','actions/download')},function(filename){
- window.location='ajax/download.php?files='+encodeURIComponent(filename)+'&dir='+encodeURIComponent($('#dir').val());
+$(document).ready(function(){
+ if($('#allowZipDownload').val() == 1){
+ var downloadScope = 'all';
+ } else {
+ var downloadScope = 'file';
+ }
+ FileActions.register(downloadScope,'Download',function(){return OC.imagePath('core','actions/download')},function(filename){
+ window.location='ajax/download.php?files='+encodeURIComponent(filename)+'&dir='+encodeURIComponent($('#dir').val());
+ });
});
FileActions.register('all','Delete',function(){return OC.imagePath('core','actions/delete')},function(filename){
@@ -144,4 +151,4 @@ FileActions.register('dir','Open','',function(filename){
window.location='index.php?dir='+encodeURIComponent($('#dir').val()).replace(/%2F/g, '/')+'/'+encodeURIComponent(filename);
});
-FileActions.setDefault('dir','Open');
+FileActions.setDefault('dir','Open');