diff options
author | Tom Needham <needham.thomas@gmail.com> | 2012-01-01 01:18:02 +0000 |
---|---|---|
committer | Tom Needham <needham.thomas@gmail.com> | 2012-01-01 01:18:02 +0000 |
commit | cbb2db8622dbcff2314204bc548ebdd3005bd0fc (patch) | |
tree | bbe14faf0201b4131b8ca9c9d4eac59edb7da5e8 /files/js | |
parent | e7de25434206a4849a7c7315d4d9926325c7b730 (diff) | |
parent | eb4cd869107d4afa1c259751e765ca39defb9279 (diff) | |
download | nextcloud-server-cbb2db8622dbcff2314204bc548ebdd3005bd0fc.tar.gz nextcloud-server-cbb2db8622dbcff2314204bc548ebdd3005bd0fc.zip |
Fix merge conflicts
Diffstat (limited to 'files/js')
-rw-r--r-- | files/js/fileactions.js | 2 | ||||
-rw-r--r-- | files/js/filelist.js | 15 |
2 files changed, 9 insertions, 8 deletions
diff --git a/files/js/fileactions.js b/files/js/fileactions.js index 9e2688e82c1..6f0729e43b6 100644 --- a/files/js/fileactions.js +++ b/files/js/fileactions.js @@ -137,7 +137,7 @@ FileActions.register('all','Rename',function(){return OC.imagePath('core','actio }); FileActions.register('dir','Open','',function(filename){ - window.location='index.php?dir='+$('#dir').val()+'/'+filename; + window.location='index.php?dir='+encodeURIComponent($('#dir').val()).replace(/%2F/g, '/')+'/'+encodeURIComponent(filename); }); FileActions.setDefault('dir','Open'); diff --git a/files/js/filelist.js b/files/js/filelist.js index 5740ece9716..35847e06dfe 100644 --- a/files/js/filelist.js +++ b/files/js/filelist.js @@ -40,7 +40,7 @@ FileList={ html = $('<tr></tr>').attr({ "data-type": "dir", "data-size": size, "data-file": name}); td = $('<td></td>').attr({"class": "filename", "style": 'background-image:url('+OC.imagePath('core', 'filetypes/folder.png')+')' }); td.append('<input type="checkbox" />'); - var link_elem = $('<a></a>').attr({ "class": "name", "href": "index.php?dir="+ encodeURIComponent($('#dir').val()+'/'+name) }); + var link_elem = $('<a></a>').attr({ "class": "name", "href": "index.php?dir="+ encodeURIComponent($('#dir').val()+'/'+name).replace(/%2F/g, '/') }); link_elem.append($('<span></span>').addClass('nametext').text(name)); td.append(link_elem); html.append(td); @@ -125,7 +125,7 @@ FileList={ tr.data('renaming',true); var td=tr.children('td.filename'); var input=$('<input class="filename"></input>').val(name); - var form=$('<form action="#"></form>') + var form=$('<form></form>') form.append(input); td.children('a.name').text(''); td.children('a.name').append(form) @@ -134,9 +134,10 @@ FileList={ event.stopPropagation(); event.preventDefault(); var newname=input.val(); - tr.data('renaming',false); tr.attr('data-file',newname); td.children('a.name').empty(); + var path = td.children('a.name').attr('href'); + td.children('a.name').attr('href', path.replace(encodeURIComponent(name), encodeURIComponent(newname))); if(newname.indexOf('.')>0){ basename=newname.substr(0,newname.lastIndexOf('.')); }else{ @@ -148,12 +149,12 @@ FileList={ if(newname.indexOf('.')>0){ span.append($('<span class="extention">'+newname.substr(newname.lastIndexOf('.'))+'</span>')); } - $.ajax({ - url: 'ajax/rename.php', - data: { dir : $('#dir').val(), newname: newname, file: name } + $.get(OC.filePath('files','ajax','rename.php'), { dir : $('#dir').val(), newname: newname, file: name },function(){ + tr.data('renaming',false); }); + return false; }); - form.click(function(event){ + input.click(function(event){ event.stopPropagation(); event.preventDefault(); }); |