Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Show original path in trashbin via extraData
Signed-off-by: Morris Jobke <[email protected]>
Signed-off-by: Roeland Jago Douma <[email protected]>
  • Loading branch information
MorrisJobke committed Feb 5, 2019
commit 979cf79555ca06ac3a31cad027d76bc20424b36b
7 changes: 5 additions & 2 deletions apps/files_trashbin/js/filelist.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
var DELETED_REGEXP = new RegExp(/^(.+)\.d[0-9]+$/);
var FILENAME_PROP = '{http://nextcloud.org/ns}trashbin-filename';
var DELETION_TIME_PROP = '{http://nextcloud.org/ns}trashbin-deletion-time';
var TRASHBIN_ORIGINAL_LOCATION = '{http://nextcloud.org/ns}trashbin-original-location';

/**
* Convert a file name in the format filename.d12345 to the real file name.
Expand Down Expand Up @@ -54,11 +55,13 @@
initialize: function() {
this.client.addFileInfoParser(function(response, data) {
var props = response.propStat[0].properties;
var path = props[TRASHBIN_ORIGINAL_LOCATION];
return {
displayName: props[FILENAME_PROP],
mtime: parseInt(props[DELETION_TIME_PROP], 10) * 1000,
hasPreview: true,
path: data.path.substr(6), // remove leading /trash
path: path,
extraData: path
}
});

Expand Down Expand Up @@ -248,7 +251,7 @@
* Returns list of webdav properties to request
*/
_getWebdavProperties: function() {
return [FILENAME_PROP, DELETION_TIME_PROP].concat(this.filesClient.getPropfindProperties());
return [FILENAME_PROP, DELETION_TIME_PROP, TRASHBIN_ORIGINAL_LOCATION].concat(this.filesClient.getPropfindProperties());
},

/**
Expand Down