summaryrefslogtreecommitdiffstats
path: root/apps/files/js/filelist.js
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files/js/filelist.js')
-rw-r--r--apps/files/js/filelist.js42
1 files changed, 35 insertions, 7 deletions
diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js
index d6cffde05de..550c10dba3e 100644
--- a/apps/files/js/filelist.js
+++ b/apps/files/js/filelist.js
@@ -11,6 +11,7 @@
/* global OC, t, n, FileList, FileActions, Files */
/* global procesSelection, dragOptions, SVGSupport, replaceSVG */
window.FileList={
+ appName: t('files', 'Files'),
useUndo:true,
postProcessList: function() {
$('#fileList tr').each(function() {
@@ -19,6 +20,21 @@ window.FileList={
});
},
/**
+ * Sets a new page title
+ */
+ setPageTitle: function(title){
+ if (title) {
+ title += ' - ';
+ } else {
+ title = '';
+ }
+ title += FileList.appName;
+ // Sets the page title with the " - ownCloud" suffix as in templates
+ window.document.title = title + ' - ' + oc_defaults.title;
+
+ return true;
+ },
+ /**
* Returns the tr element for a given file name
*/
findFileEl: function(fileName){
@@ -129,7 +145,7 @@ window.FileList={
if (loading) {
imgurl = OC.imagePath('core', 'loading.gif');
} else {
- imgurl = OC.imagePath('core', 'filetypes/file.png');
+ imgurl = OC.imagePath('core', 'filetypes/file');
}
var tr = this.createRow(
'file',
@@ -157,7 +173,7 @@ window.FileList={
var tr = this.createRow(
'dir',
name,
- OC.imagePath('core', 'filetypes/folder.png'),
+ OC.imagePath('core', 'filetypes/folder'),
OC.linkTo('files', 'index.php')+"?dir="+ encodeURIComponent($('#dir').val()+'/'+name).replace(/%2F/g, '/'),
size,
lastModified,
@@ -204,7 +220,16 @@ window.FileList={
return OC.linkTo('files', 'index.php')+"?dir="+ encodeURIComponent(dir).replace(/%2F/g, '/');
},
setCurrentDir: function(targetDir, changeUrl) {
- var url;
+ var url,
+ baseDir = OC.basename(targetDir);
+
+ if (baseDir !== '') {
+ FileList.setPageTitle(baseDir);
+ }
+ else {
+ FileList.setPageTitle();
+ }
+
$('#dir').val(targetDir);
if (changeUrl !== false) {
if (window.history.pushState && changeUrl !== false) {
@@ -847,7 +872,8 @@ window.FileList={
};
$(document).ready(function() {
- var isPublic = !!$('#isPublic').val();
+ var baseDir,
+ isPublic = !!$('#isPublic').val();
// handle upload events
var file_upload_start = $('#file_upload_start');
@@ -943,7 +969,7 @@ $(document).ready(function() {
uploadtext.attr('currentUploads', currentUploads);
var translatedText = n('files', 'Uploading %n file', 'Uploading %n files', currentUploads);
if (currentUploads === 0) {
- var img = OC.imagePath('core', 'filetypes/folder.png');
+ var img = OC.imagePath('core', 'filetypes/folder');
data.context.find('td.filename').attr('style','background-image:url('+img+')');
uploadtext.text(translatedText);
uploadtext.hide();
@@ -1003,7 +1029,7 @@ $(document).ready(function() {
if (data.errorThrown === 'abort') {
//cleanup uploading to a dir
var uploadtext = $('tr .uploadtext');
- var img = OC.imagePath('core', 'filetypes/folder.png');
+ var img = OC.imagePath('core', 'filetypes/folder');
uploadtext.parents('td.filename').attr('style','background-image:url('+img+')');
uploadtext.fadeOut();
uploadtext.attr('currentUploads', 0);
@@ -1016,7 +1042,7 @@ $(document).ready(function() {
if (data.errorThrown === 'abort') {
//cleanup uploading to a dir
var uploadtext = $('tr .uploadtext');
- var img = OC.imagePath('core', 'filetypes/folder.png');
+ var img = OC.imagePath('core', 'filetypes/folder');
uploadtext.parents('td.filename').attr('style','background-image:url('+img+')');
uploadtext.fadeOut();
uploadtext.attr('currentUploads', 0);
@@ -1132,5 +1158,7 @@ $(document).ready(function() {
}
}
+ FileList.setCurrentDir(parseCurrentDirFromUrl(), false);
+
FileList.createFileSummary();
});