From b13ab2b17eb485aec13c7fb1e88e25e1c9901d72 Mon Sep 17 00:00:00 2001 From: Arthur Schiwon Date: Mon, 19 Mar 2012 11:56:02 +0100 Subject: enable admin to turn off ZIP downloads user interface offers multi-file/folder downloads only if available make function name more clear --- files/js/fileactions.js | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'files/js/fileactions.js') 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'); -- cgit v1.2.3 From 31df4c00eca8ac3de3f72ae01252147a289f15cd Mon Sep 17 00:00:00 2001 From: Jan-Christoph Borchardt Date: Fri, 13 Apr 2012 17:22:23 +0200 Subject: adding tipsy tooltips for file actions --- core/css/styles.css | 2 +- core/js/js.js | 4 +++- files/js/fileactions.js | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) (limited to 'files/js/fileactions.js') diff --git a/core/css/styles.css b/core/css/styles.css index 9d9f6d98303..5c970191d62 100644 --- a/core/css/styles.css +++ b/core/css/styles.css @@ -106,7 +106,7 @@ label.infield { cursor: text !important; } #notification { z-index:101; cursor:pointer; background-color:#fc4; border:0; padding:0 .7em .3em; display:none; position:fixed; left:50%; top:0; -moz-border-radius-bottomleft:1em; -webkit-border-bottom-left-radius:1em; border-bottom-left-radius:1em; -moz-border-radius-bottomright:1em; -webkit-border-bottom-right-radius:1em; border-bottom-right-radius:1em; } -.action, .selectedActions a, #logout { opacity:.3; -webkit-transition:opacity 500ms; -moz-transition:opacity 500ms; -o-transition:opacity 500ms; transition:opacity 500ms; } +.action, .selectedActions a, #logout { opacity:.5; -webkit-transition:opacity 500ms; -moz-transition:opacity 500ms; -o-transition:opacity 500ms; transition:opacity 500ms; } .action { width: 16px; height: 16px; } .action:hover, .selectedActions a:hover, #logout:hover { opacity:1; } diff --git a/core/js/js.js b/core/js/js.js index 44b4f503b8c..2927299b03f 100644 --- a/core/js/js.js +++ b/core/js/js.js @@ -413,8 +413,10 @@ $(document).ready(function(){ $('.jp-controls .jp-previous').tipsy({gravity:'nw', fade:true, live:true}); $('.jp-controls .jp-next').tipsy({gravity:'n', fade:true, live:true}); $('.password .action').tipsy({gravity:'se', fade:true, live:true}); - $('.file_upload_button_wrapper').tipsy({gravity:'w', fade:true}); + $('.file_upload_button_wrapper').tipsy({gravity:'w', fade:true}); $('.selectedActions a.delete').tipsy({gravity: 'se', fade:true, live:true}); + $('a.action').tipsy({gravity:'s', fade:true, live:true}); + $('a.delete').tipsy({gravity: 'se', fade:true, live:true}); $('.selectedActions a').tipsy({gravity:'s', fade:true, live:true}); $('#headerSize').tipsy({gravity:'s', fade:true, live:true}); $('td.filesize').tipsy({gravity:'s', fade:true, live:true}); diff --git a/files/js/fileactions.js b/files/js/fileactions.js index b33be280ad5..60c4fadedd0 100644 --- a/files/js/fileactions.js +++ b/files/js/fileactions.js @@ -66,7 +66,7 @@ FileActions={ if(img.call){ img=img(file); } - var html=''; var element=$(html); - if(img){ - element.append($('')); - } element.data('action',name); element.click(function(event){ event.stopPropagation(); -- cgit v1.2.3