]> source.dussan.org Git - nextcloud-server.git/commitdiff
Merge branch 'master' into fix_minor_files_annoyances
authorThomas Mueller <thomas.mueller@tmit.eu>
Sun, 6 Jan 2013 21:46:40 +0000 (22:46 +0100)
committerThomas Mueller <thomas.mueller@tmit.eu>
Sun, 6 Jan 2013 21:46:40 +0000 (22:46 +0100)
Conflicts:
apps/files/js/files.js

1  2 
apps/files/js/filelist.js
apps/files/js/files.js
core/js/js.js

index 1fbfc24e1e41ddeb1fd142d4096609d5deb16370,22d701d8ff919c464c7e2a982134a22cc0a884bf..c4c53ca878a99fa3e94dc6eb290ff3bae9378209
@@@ -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)) {
index c795469e2d5f866db2b420176521255a1e528cf7,ba2495eb7280ce4b571fca0f0694b8ce0ae9ea3c..a824b9d3059ded25925cb6d560f13d36183fd405
@@@ -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=$('<form></form>');
                var input=$('<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();
diff --cc core/js/js.js
Simple merge