aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files/js/files.js
diff options
context:
space:
mode:
authorThomas Mueller <thomas.mueller@tmit.eu>2013-01-06 22:46:40 +0100
committerThomas Mueller <thomas.mueller@tmit.eu>2013-01-06 22:46:40 +0100
commit9671ace32e57ce6b176a50dc346baf3b3b7eb14e (patch)
treebf3b4afd8de851d108909fc5a9ad198c13d93c8a /apps/files/js/files.js
parent9cd7bb2c8d7b7207a3c67e09158641b0c33e631d (diff)
parent08d7b8ce309baebfc243727c215b63e732bf874e (diff)
downloadnextcloud-server-9671ace32e57ce6b176a50dc346baf3b3b7eb14e.tar.gz
nextcloud-server-9671ace32e57ce6b176a50dc346baf3b3b7eb14e.zip
Merge branch 'master' into fix_minor_files_annoyances
Conflicts: apps/files/js/files.js
Diffstat (limited to 'apps/files/js/files.js')
-rw-r--r--apps/files/js/files.js20
1 files changed, 16 insertions, 4 deletions
diff --git a/apps/files/js/files.js b/apps/files/js/files.js
index c795469e2d5..a824b9d3059 100644
--- a/apps/files/js/files.js
+++ b/apps/files/js/files.js
@@ -26,17 +26,29 @@ Files={
});
procesSelection();
},
- containsInvalidCharacters:function (name) {
+ isFileNameValid:function (name) {
+ if (name === '.') {
+ $('#notification').text(t('files', "'.' is an invalid file name."));
+ $('#notification').fadeIn();
+ return false;
+ }
+ if (name.length == 0) {
+ $('#notification').text(t('files', "File name cannot be empty."));
+ $('#notification').fadeIn();
+ return false;
+ }
+
+ // check for invalid characters
var invalid_characters = ['\\', '/', '<', '>', ':', '"', '|', '?', '*'];
for (var i = 0; i < invalid_characters.length; i++) {
if (name.indexOf(invalid_characters[i]) != -1) {
$('#notification').text(t('files', "Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed."));
$('#notification').fadeIn();
- return true;
+ return false;
}
}
$('#notification').fadeOut();
- return false;
+ return true;
}
};
$(document).ready(function() {
@@ -514,7 +526,7 @@ $(document).ready(function() {
event.stopPropagation();
event.preventDefault();
var newname=input.val();
- if(type != 'web' && Files.containsInvalidCharacters(newname)){
+ if(type != 'web' && !Files.isFileNameValid(newname)){
return false;
} else if (newname.length == 0) {
if(type == 'web') {