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.js17
1 files changed, 8 insertions, 9 deletions
diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js
index 550c10dba3e..503bf681139 100644
--- a/apps/files/js/filelist.js
+++ b/apps/files/js/filelist.js
@@ -137,7 +137,9 @@ window.FileList={
var download_url = null;
if (!param.download_url) {
- download_url = OC.Router.generate('download', { file: $('#dir').val()+'/'+name });
+ download_url = OC.generateUrl(
+ 'apps/files/download{file}',
+ { file: $('#dir').val()+'/'+name });
} else {
download_url = param.download_url;
}
@@ -419,15 +421,12 @@ window.FileList={
len = input.val().length;
}
input.selectRange(0, len);
-
var checkInput = function () {
var filename = input.val();
if (filename !== oldname) {
- if (!Files.isFileNameValid(filename)) {
- // Files.isFileNameValid(filename) throws an exception itself
- } else if($('#dir').val() === '/' && filename === 'Shared') {
- throw t('files','In the home folder \'Shared\' is a reserved filename');
- } else if (FileList.inList(filename)) {
+ // Files.isFileNameValid(filename) throws an exception itself
+ Files.isFileNameValid(filename, FileList.getCurrentDirectory());
+ if (FileList.inList(filename)) {
throw t('files', '{new_name} already exists', {new_name: filename});
}
}
@@ -1156,9 +1155,9 @@ $(document).ready(function() {
// need to initially switch the dir to the one from the hash (IE8)
FileList.changeDirectory(parseCurrentDirFromUrl(), false, true);
}
- }
- FileList.setCurrentDir(parseCurrentDirFromUrl(), false);
+ FileList.setCurrentDir(parseCurrentDirFromUrl(), false);
+ }
FileList.createFileSummary();
});