Fixed trashbin title
This commit is contained in:
parent
476444ab1a
commit
44441b56d6
|
@ -11,6 +11,7 @@
|
||||||
/* global OC, t, n, FileList, FileActions, Files */
|
/* global OC, t, n, FileList, FileActions, Files */
|
||||||
/* global procesSelection, dragOptions, SVGSupport, replaceSVG */
|
/* global procesSelection, dragOptions, SVGSupport, replaceSVG */
|
||||||
window.FileList={
|
window.FileList={
|
||||||
|
appName: t('files', 'Files'),
|
||||||
useUndo:true,
|
useUndo:true,
|
||||||
postProcessList: function() {
|
postProcessList: function() {
|
||||||
$('#fileList tr').each(function() {
|
$('#fileList tr').each(function() {
|
||||||
|
@ -28,7 +29,7 @@ window.FileList={
|
||||||
else {
|
else {
|
||||||
title = '';
|
title = '';
|
||||||
}
|
}
|
||||||
title += t('files', 'Files');
|
title += FileList.appName;
|
||||||
// Sets the page title with the " - ownCloud" suffix as in templates
|
// Sets the page title with the " - ownCloud" suffix as in templates
|
||||||
window.document.title = title + ' - ' + oc_defaults.title;
|
window.document.title = title + ' - ' + oc_defaults.title;
|
||||||
|
|
||||||
|
@ -202,22 +203,12 @@ window.FileList={
|
||||||
changeDirectory: function(targetDir, changeUrl, force) {
|
changeDirectory: function(targetDir, changeUrl, force) {
|
||||||
var $dir = $('#dir'),
|
var $dir = $('#dir'),
|
||||||
url,
|
url,
|
||||||
currentDir = $dir.val() || '/',
|
currentDir = $dir.val() || '/';
|
||||||
baseDir = OC.basename(targetDir),
|
|
||||||
targetDir = targetDir || '/';
|
targetDir = targetDir || '/';
|
||||||
if (!force && currentDir === targetDir) {
|
if (!force && currentDir === targetDir) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (baseDir !== '') {
|
|
||||||
FileList.setPageTitle(baseDir);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
FileList.setPageTitle();
|
|
||||||
}
|
|
||||||
|
|
||||||
FileList.setCurrentDir(targetDir, changeUrl);
|
FileList.setCurrentDir(targetDir, changeUrl);
|
||||||
|
|
||||||
$('#fileList').trigger(
|
$('#fileList').trigger(
|
||||||
jQuery.Event('changeDirectory', {
|
jQuery.Event('changeDirectory', {
|
||||||
dir: targetDir,
|
dir: targetDir,
|
||||||
|
@ -230,7 +221,16 @@ window.FileList={
|
||||||
return OC.linkTo('files', 'index.php')+"?dir="+ encodeURIComponent(dir).replace(/%2F/g, '/');
|
return OC.linkTo('files', 'index.php')+"?dir="+ encodeURIComponent(dir).replace(/%2F/g, '/');
|
||||||
},
|
},
|
||||||
setCurrentDir: function(targetDir, changeUrl) {
|
setCurrentDir: function(targetDir, changeUrl) {
|
||||||
var url;
|
var url,
|
||||||
|
baseDir = OC.basename(targetDir);
|
||||||
|
|
||||||
|
if (baseDir !== '') {
|
||||||
|
FileList.setPageTitle(baseDir);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
FileList.setPageTitle();
|
||||||
|
}
|
||||||
|
|
||||||
$('#dir').val(targetDir);
|
$('#dir').val(targetDir);
|
||||||
if (changeUrl !== false) {
|
if (changeUrl !== false) {
|
||||||
if (window.history.pushState && changeUrl !== false) {
|
if (window.history.pushState && changeUrl !== false) {
|
||||||
|
@ -1158,14 +1158,8 @@ $(document).ready(function() {
|
||||||
FileList.changeDirectory(parseCurrentDirFromUrl(), false, true);
|
FileList.changeDirectory(parseCurrentDirFromUrl(), false, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FileList.setCurrentDir(parseCurrentDirFromUrl(), false);
|
||||||
baseDir = OC.basename(parseCurrentDirFromUrl());
|
|
||||||
|
|
||||||
if (baseDir !== '') {
|
|
||||||
FileList.setPageTitle(baseDir);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
FileList.createFileSummary();
|
FileList.createFileSummary();
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
/* globals OC, FileList, t */
|
||||||
// override reload with own ajax call
|
// override reload with own ajax call
|
||||||
FileList.reload = function(){
|
FileList.reload = function(){
|
||||||
FileList.showMask();
|
FileList.showMask();
|
||||||
|
@ -17,7 +18,36 @@ FileList.reload = function(){
|
||||||
FileList.reloadCallback(result);
|
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){
|
FileList.linkTo = function(dir){
|
||||||
return OC.linkTo('files_trashbin', 'index.php')+"?dir="+ encodeURIComponent(dir).replace(/%2F/g, '/');
|
return OC.linkTo('files_trashbin', 'index.php')+"?dir="+ encodeURIComponent(dir).replace(/%2F/g, '/');
|
||||||
|
|
Loading…
Reference in New Issue