aboutsummaryrefslogtreecommitdiffstats
path: root/files/js/fileactions.js
diff options
context:
space:
mode:
authorSimon Birnbach <simon@simon-birnbach.de>2012-04-15 15:59:57 +0200
committerSimon Birnbach <simon@simon-birnbach.de>2012-04-15 15:59:57 +0200
commita384fcb99fc3a12d7dac937398bf827c79e86098 (patch)
tree55a631751578cd1f642e5fa0f88fd2290509b126 /files/js/fileactions.js
parent4e89a0faf652f2f100cca47cca54a3b35e720aad (diff)
parent38cb716a572a8af136f6260089bc486413c6ca9f (diff)
downloadnextcloud-server-a384fcb99fc3a12d7dac937398bf827c79e86098.tar.gz
nextcloud-server-a384fcb99fc3a12d7dac937398bf827c79e86098.zip
Merge git://gitorious.org/owncloud/owncloud
Conflicts: files/css/files.css files/js/files.js
Diffstat (limited to 'files/js/fileactions.js')
-rw-r--r--files/js/fileactions.js29
1 files changed, 18 insertions, 11 deletions
diff --git a/files/js/fileactions.js b/files/js/fileactions.js
index 384ffc92cf2..07838261b87 100644
--- a/files/js/fileactions.js
+++ b/files/js/fileactions.js
@@ -59,6 +59,7 @@ FileActions={
if($('tr').filterAttr('data-file',file).data('renaming')){
return;
}
+ parent.children('a.name').append('<span class="fileactions" />');
var defaultAction=FileActions.getDefault(FileActions.getCurrentMimeType(),FileActions.getCurrentType());
for(name in actions){
if((name=='Download' || actions[name]!=defaultAction) && name!='Delete'){
@@ -66,11 +67,10 @@ FileActions={
if(img.call){
img=img(file);
}
- var html='<a href="#" title="'+name+'" class="action" style="display:none" />';
+ var html='<a href="#" class="action" style="display:none">';
+ if(img) { html+='<img src="'+img+'"/> '; }
+ html += name+'</a>';
var element=$(html);
- if(img){
- element.append($('<img src="'+img+'"/>'));
- }
element.data('action',name);
element.click(function(event){
event.stopPropagation();
@@ -81,7 +81,7 @@ FileActions={
action(currentFile);
});
element.hide();
- parent.children('a.name').append(element);
+ parent.find('a.name>span.fileactions').append(element);
}
}
if(actions['Delete']){
@@ -89,7 +89,7 @@ FileActions={
if(img.call){
img=img(file);
}
- var html='<a href="#" title="Delete" class="action" style="display:none" />';
+ var html='<a href="#" original-title="Delete" class="action delete" style="display:none" />';
var element=$(html);
if(img){
element.append($('<img src="'+img+'"/>'));
@@ -106,14 +106,14 @@ 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');
});
return false;
},
hide:function(){
- $('#fileList .action').fadeOut(200,function(){
+ $('#fileList span.fileactions').fadeOut(200,function(){
$(this).remove();
});
},
@@ -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){
@@ -157,4 +164,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');