From: Thomas Mueller Date: Sun, 6 Jan 2013 21:46:40 +0000 (+0100) Subject: Merge branch 'master' into fix_minor_files_annoyances X-Git-Tag: v5.0.0alpha1~150^2~22^2~5 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=9671ace32e57ce6b176a50dc346baf3b3b7eb14e;p=nextcloud-server.git Merge branch 'master' into fix_minor_files_annoyances Conflicts: apps/files/js/files.js --- 9671ace32e57ce6b176a50dc346baf3b3b7eb14e diff --cc apps/files/js/filelist.js index 1fbfc24e1e4,22d701d8ff9..c4c53ca878a --- a/apps/files/js/filelist.js +++ b/apps/files/js/filelist.js @@@ -149,12 -149,8 +149,12 @@@ var FileList= event.stopPropagation(); event.preventDefault(); var newname=input.val(); - if (Files.containsInvalidCharacters(newname)) { + if (!Files.isFileNameValid(newname)) { return false; + } else if (newname.length == 0) { + $('#notification').text(t('files', "Name cannot be empty.")); + $('#notification').fadeIn(); + return false; } if (newname != name) { if (FileList.checkName(name, newname, false)) { diff --cc apps/files/js/files.js index c795469e2d5,ba2495eb728..a824b9d3059 --- a/apps/files/js/files.js +++ b/apps/files/js/files.js @@@ -505,29 -517,16 +517,29 @@@ $(document).ready(function() var text=$(this).children('p').text(); $(this).data('text',text); $(this).children('p').remove(); + var form=$('
'); var input=$(''); - $(this).append(input); + form.append(input); + $(this).append(form); input.focus(); - input.change(function(){ - if (type != 'web' && !Files.isFileNameValid($(this).val())) { - return; - } else if( type == 'folder' && $('#dir').val() == '/' && $(this).val() == 'Shared') { + form.submit(function(event){ + 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') { + $('#notification').text(t('files', "URL cannot be empty.")); + } else { + $('#notification').text(t('files', "Name cannot be empty.")); + } + $('#notification').fadeIn(); + return false; + } else if( type == 'folder' && $('#dir').val() == '/' && newname == 'Shared') { $('#notification').text(t('files','Invalid folder name. Usage of "Shared" is reserved by Owncloud')); $('#notification').fadeIn(); - return; + return false; } if (FileList.lastAction) { FileList.lastAction();