diff options
author | Robin Appelman <icewind@owncloud.com> | 2014-02-05 13:36:55 +0100 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2014-02-05 13:36:55 +0100 |
commit | 1e79369338e8435952e2eda60a2cfc49bb6c4882 (patch) | |
tree | 12d3ac88978887f16e795c54873bbd6b99bb8ee5 /apps/files/js/filelist.js | |
parent | 3c1ab66edac1ba2f1b398c859cd933c410ea3d8d (diff) | |
parent | 3d88b10f201b7979f250b49b10360b3581030ec7 (diff) | |
download | nextcloud-server-1e79369338e8435952e2eda60a2cfc49bb6c4882.tar.gz nextcloud-server-1e79369338e8435952e2eda60a2cfc49bb6c4882.zip |
merge master into storagestatistics-reuse
Diffstat (limited to 'apps/files/js/filelist.js')
-rw-r--r-- | apps/files/js/filelist.js | 32 |
1 files changed, 30 insertions, 2 deletions
diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js index 66968ab54c7..81c52e2a863 100644 --- a/apps/files/js/filelist.js +++ b/apps/files/js/filelist.js @@ -1,4 +1,16 @@ -var FileList={ +/* + * Copyright (c) 2014 + * + * This file is licensed under the Affero General Public License version 3 + * or later. + * + * See the COPYING-README file. + * + */ + +/* global OC, t, n, FileList, FileActions, Files */ +/* global procesSelection, dragOptions, SVGSupport, replaceSVG */ +window.FileList={ useUndo:true, postProcessList: function() { $('#fileList tr').each(function() { @@ -191,6 +203,7 @@ var FileList={ return OC.linkTo('files', 'index.php')+"?dir="+ encodeURIComponent(dir).replace(/%2F/g, '/'); }, setCurrentDir: function(targetDir, changeUrl) { + var url; $('#dir').val(targetDir); if (changeUrl !== false) { if (window.history.pushState && changeUrl !== false) { @@ -477,6 +490,7 @@ var FileList={ td.find('a.name span.extension').text(newname.substr(newname.lastIndexOf('.'))); } form.remove(); + FileActions.display( tr.find('td.filename'), true); td.children('a.name').show(); } catch (error) { input.attr('title', error); @@ -780,6 +794,20 @@ var FileList={ $('#fileList tr.searchresult').each(function(i,e) { $(e).removeClass("searchresult"); }); + }, + + /** + * Returns the download URL of the given file + * @param filename file name of the file + * @param dir optional directory in which the file name is, defaults to the current directory + */ + getDownloadUrl: function(filename, dir) { + var params = { + files: filename, + dir: dir || FileList.getCurrentDirectory(), + download: null + }; + return OC.filePath('files', 'ajax', 'download.php') + '?' + OC.buildQueryString(params); } }; @@ -819,7 +847,7 @@ $(document).ready(function() { {name: 'requesttoken', value: oc_requesttoken} ]; }; - } + } }); file_upload_start.on('fileuploadadd', function(e, data) { |