diff options
author | Vincent Petry <pvince81@owncloud.com> | 2014-02-20 15:16:45 +0100 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2014-02-20 15:16:45 +0100 |
commit | 44441b56d63783a0be5c9b24f5b1ee9264509bef (patch) | |
tree | 4ab3b9a27301f76b2326a867b9d8c9d1de3d136d /apps/files_trashbin/js | |
parent | 476444ab1a6f925b87ca6f6382953633fd060283 (diff) | |
download | nextcloud-server-44441b56d63783a0be5c9b24f5b1ee9264509bef.tar.gz nextcloud-server-44441b56d63783a0be5c9b24f5b1ee9264509bef.zip |
Fixed trashbin title
Diffstat (limited to 'apps/files_trashbin/js')
-rw-r--r-- | apps/files_trashbin/js/filelist.js | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/apps/files_trashbin/js/filelist.js b/apps/files_trashbin/js/filelist.js index f42abb6d029..a88459b0a9a 100644 --- a/apps/files_trashbin/js/filelist.js +++ b/apps/files_trashbin/js/filelist.js @@ -1,3 +1,4 @@ +/* globals OC, FileList, t */ // override reload with own ajax call FileList.reload = function(){ FileList.showMask(); @@ -17,7 +18,36 @@ FileList.reload = function(){ FileList.reloadCallback(result); } }); -} +}; + +FileList.appName = t('files_trashbin', 'Deleted files'); + +FileList._deletedRegExp = new RegExp(/^(.+)\.d[0-9]+$/); + +/** + * Convert a file name in the format filename.d12345 to the real file name. + * This will use basename. + * The name will not be changed if it has no ".d12345" suffix. + * @param name file name + * @return converted file name + */ +FileList.getDeletedFileName = function(name) { + name = OC.basename(name); + var match = FileList._deletedRegExp.exec(name); + if (match && match.length > 1) { + name = match[1]; + } + return name; +}; +var oldSetCurrentDir = FileList.setCurrentDir; +FileList.setCurrentDir = function(targetDir) { + oldSetCurrentDir.apply(this, arguments); + + var baseDir = OC.basename(targetDir); + if (baseDir !== '') { + FileList.setPageTitle(FileList.getDeletedFileName(baseDir)); + } +}; FileList.linkTo = function(dir){ return OC.linkTo('files_trashbin', 'index.php')+"?dir="+ encodeURIComponent(dir).replace(/%2F/g, '/'); |