diff options
Diffstat (limited to 'core/js')
-rw-r--r-- | core/js/js.js | 1 | ||||
-rw-r--r-- | core/js/oc-dialogs.js | 15 |
2 files changed, 12 insertions, 4 deletions
diff --git a/core/js/js.js b/core/js/js.js index e907db2837e..9a3b2ee6a5d 100644 --- a/core/js/js.js +++ b/core/js/js.js @@ -159,6 +159,7 @@ function escapeHTML(s) { * @param file The filename * @param dir The directory the file is in - e.g. $('#dir').val() * @return string +* @deprecated use Files.getDownloadURL() instead */ function fileDownloadPath(dir, file) { return OC.filePath('files', 'ajax', 'download.php')+'?files='+encodeURIComponent(file)+'&dir='+encodeURIComponent(dir); diff --git a/core/js/oc-dialogs.js b/core/js/oc-dialogs.js index d1bcb4659b8..73ed20b7553 100644 --- a/core/js/oc-dialogs.js +++ b/core/js/oc-dialogs.js @@ -514,7 +514,7 @@ var OCdialogs = { } return $.getJSON( - OC.filePath('files', 'ajax', 'rawlist.php'), + OC.filePath('files', 'ajax', 'list.php'), { dir: dir, mimetypes: JSON.stringify(mimeType) @@ -539,7 +539,7 @@ var OCdialogs = { this.$filelist.empty().addClass('loading'); this.$filePicker.data('path', dir); $.when(this._getFileList(dir, this.$filePicker.data('mimetype'))).then(function(response) { - $.each(response.data, function(index, file) { + $.each(response.data.files, function(index, file) { if (file.type === 'dir') { dirs.push(file); } else { @@ -555,9 +555,16 @@ var OCdialogs = { type: entry.type, dir: dir, filename: entry.name, - date: OC.mtime2date(entry.mtime) + date: OC.mtime2date(Math.floor(entry.mtime / 1000)) }); - $li.find('img').attr('src', entry.mimetype_icon); + $li.find('img').attr('src', entry.icon); + if (entry.isPreviewAvailable) { + var urlSpec = { + file: dir + '/' + entry.name + }; + var previewUrl = OC.generateUrl('/core/preview.png?') + $.param(urlSpec); + $li.find('img').attr('src', previewUrl); + } self.$filelist.append($li); }); |