use a more descriptive error message when the user tries to create '/Shared'

This commit is contained in:
Jörn Friedrich Dreyer 2013-10-23 11:08:30 +02:00
parent a9735c8a6f
commit 8ed73e5ced
2 changed files with 3 additions and 3 deletions

View file

@ -508,11 +508,11 @@ $(document).ready(function() {
var checkInput = function () {
var filename = input.val();
if (type === 'web' && filename.length === 0) {
throw t('files', 'URL cannot be empty.');
throw t('files', 'URL cannot be empty');
} else if (type !== 'web' && !Files.isFileNameValid(filename)) {
// Files.isFileNameValid(filename) throws an exception itself
} else if ($('#dir').val() === '/' && filename === 'Shared') {
throw t('files','Invalid name. Usage of \'Shared\' is reserved by ownCloud');
throw t('files', 'In the home folder \'Shared\' is a reserved filename');
} else if (FileList.inList(filename)) {
throw t('files', '{new_name} already exists', {new_name: filename});
} else {

View file

@ -359,7 +359,7 @@ var FileList={
if (!Files.isFileNameValid(filename)) {
// Files.isFileNameValid(filename) throws an exception itself
} else if($('#dir').val() === '/' && filename === 'Shared') {
throw t('files','Invalid name. Usage of \'Shared\' is reserved by ownCloud');
throw t('files','In the home folder \'Shared\' is a reserved filename');
} else if (FileList.inList(filename)) {
throw t('files', '{new_name} already exists', {new_name: filename});
}