aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_trashbin/src
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2019-10-02 16:36:53 +0200
committerJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2019-10-05 10:23:30 +0200
commitce433637dad27e944ff2d78167ba962cb2273bad (patch)
treef5a55f235351f2b4146e17ddada1db51db62bd33 /apps/files_trashbin/src
parent2169c261957ee447cfdf27dac593508d8ecc16e9 (diff)
downloadnextcloud-server-ce433637dad27e944ff2d78167ba962cb2273bad.tar.gz
nextcloud-server-ce433637dad27e944ff2d78167ba962cb2273bad.zip
allow trash backends to overwrite the tooltip for trash items
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'apps/files_trashbin/src')
-rw-r--r--apps/files_trashbin/src/filelist.js46
1 files changed, 24 insertions, 22 deletions
diff --git a/apps/files_trashbin/src/filelist.js b/apps/files_trashbin/src/filelist.js
index 661b2f012f4..60b44ea7541 100644
--- a/apps/files_trashbin/src/filelist.js
+++ b/apps/files_trashbin/src/filelist.js
@@ -13,6 +13,7 @@
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'
+ var TRASHBIN_TITLE = '{http://nextcloud.org/ns}trashbin-title'
/**
* Convert a file name in the format filename.d12345 to the real file name.
@@ -45,32 +46,33 @@
}
FileList.prototype = _.extend({}, OCA.Files.FileList.prototype,
/** @lends OCA.Trashbin.FileList.prototype */ {
- id: 'trashbin',
- appName: t('files_trashbin', 'Deleted files'),
- /** @type {OC.Files.Client} */
- client: null,
+ id: 'trashbin',
+ appName: t('files_trashbin', 'Deleted files'),
+ /** @type {OC.Files.Client} */
+ client: null,
- /**
+ /**
* @private
*/
- 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: path,
- extraData: path
- }
- })
+ initialize: function() {
+ this.client.addFileInfoParser(function(response, data) {
+ var props = response.propStat[0].properties
+ var path = props[TRASHBIN_ORIGINAL_LOCATION]
+ var title = props[TRASHBIN_TITLE]
+ return {
+ displayName: props[FILENAME_PROP],
+ mtime: parseInt(props[DELETION_TIME_PROP], 10) * 1000,
+ hasPreview: true,
+ path: path,
+ extraData: title
+ }
+ })
- var result = OCA.Files.FileList.prototype.initialize.apply(this, arguments)
- this.$el.find('.undelete').click('click', _.bind(this._onClickRestoreSelected, this))
+ var result = OCA.Files.FileList.prototype.initialize.apply(this, arguments)
+ this.$el.find('.undelete').click('click', _.bind(this._onClickRestoreSelected, this))
- this.setSort('mtime', 'desc')
- /**
+ this.setSort('mtime', 'desc')
+ /**
* Override crumb making to add "Deleted Files" entry
* and convert files with ".d" extensions to a more
* user friendly name.
@@ -252,7 +254,7 @@
* Returns list of webdav properties to request
*/
_getWebdavProperties: function() {
- return [FILENAME_PROP, DELETION_TIME_PROP, TRASHBIN_ORIGINAL_LOCATION].concat(this.filesClient.getPropfindProperties())
+ return [FILENAME_PROP, DELETION_TIME_PROP, TRASHBIN_ORIGINAL_LOCATION, TRASHBIN_TITLE].concat(this.filesClient.getPropfindProperties())
},
/**