]> source.dussan.org Git - nextcloud-server.git/commitdiff
Merge branch 'master' into fixing-998-master
authorThomas Mueller <thomas.mueller@tmit.eu>
Fri, 11 Jan 2013 09:00:12 +0000 (10:00 +0100)
committerThomas Mueller <thomas.mueller@tmit.eu>
Fri, 11 Jan 2013 09:00:12 +0000 (10:00 +0100)
Conflicts:
apps/files/js/files.js

1  2 
apps/files/js/filelist.js
apps/files/js/files.js
apps/files/templates/index.php
core/js/js.js

Simple merge
index ac47f390826ad0abadeaa9bbda2ea131f61ee750,bb298431e84afe1ea6d1c965574baea96451942c..81f596d6647d5831769e4241f0c54716cf9428d3
@@@ -319,16 -313,18 +321,17 @@@ $(document).ready(function() 
                                                                                        var response;
                                                                                        response=jQuery.parseJSON(result);
                                                                                        if(response[0] == undefined || response[0].status != 'success') {
 -                                                                                              $('#notification').text(t('files', response.data.message));
 -                                                                                              $('#notification').fadeIn();
 +                                                OC.Notification.show(t('files', response.data.message));
                                                                                        }
                                                                                        var file=response[0];
-                                             // TODO: this doesn't work if the file name has been changed server side
+                                                                                       // TODO: this doesn't work if the file name has been changed server side
                                                                                        delete uploadingFiles[dirName][file.name];
-                                             if ($.assocArraySize(uploadingFiles[dirName]) == 0) {
-                                                 delete uploadingFiles[dirName];
-                                             }
+                                                                                       if ($.assocArraySize(uploadingFiles[dirName]) == 0) {
+                                                                                               delete uploadingFiles[dirName];
+                                                                                       }
+                                                                                       //TODO update file upload size limit
  
-                                             var uploadtext = $('tr').filterAttr('data-type', 'dir').filterAttr('data-file', dirName).find('.uploadtext')
+                                                                                       var uploadtext = $('tr').filterAttr('data-type', 'dir').filterAttr('data-file', dirName).find('.uploadtext')
                                                                                        var currentUploads = parseInt(uploadtext.attr('currentUploads'));
                                                                                        currentUploads -= 1;
                                                                                        uploadtext.attr('currentUploads', currentUploads);
                                                                                                if(size==t('files','Pending')){
                                                                                                        $('tr').filterAttr('data-file',file.name).find('td.filesize').text(file.size);
                                                                                                }
+                                                                                               //TODO update file upload size limit
                                                                                                FileList.loadingDone(file.name, file.id);
                                                                                        } else {
 -                                                                                              Files.cancelUpload(this.files[0].name);
 -                                                                                              $('#notification').text(t('files', response.data.message));
 -                                                                                              $('#notification').fadeIn();
++                                                Files.cancelUpload(this.files[0].name);
 +                                                OC.Notification.show(t('files', response.data.message));
                                                                                                $('#fileList > tr').not('[data-mime]').fadeOut();
                                                                                                $('#fileList > tr').not('[data-mime]').remove();
                                                                                        }
                                                                                })
                                                                .error(function(jqXHR, textStatus, errorThrown) {
                                                                        if(errorThrown === 'abort') {
 -                                                                              Files.cancelUpload(this.files[0].name);
 -                                                                              $('#notification').hide();
 -                                                                              $('#notification').text(t('files', 'Upload cancelled.'));
 -                                                                              $('#notification').fadeIn();
++                                        Files.cancelUpload(this.files[0].name);
 +                                        OC.Notification.show(t('files', 'Upload cancelled.'));
                                                                        }
                                                                });
                                                                uploadingFiles[uniqueName] = jqXHR;
                                                                if(size==t('files','Pending')){
                                                                        $('tr').filterAttr('data-file',file.name).find('td.filesize').text(file.size);
                                                                }
+                                                               //TODO update file upload size limit
                                                                FileList.loadingDone(file.name, file.id);
                                                        } else {
 -                                                              //TODO Files.cancelUpload(/*where do we get the filename*/);
 -                                                              $('#notification').text(t('files', response.data.message));
 -                                                              $('#notification').fadeIn();
++                                //TODO Files.cancelUpload(/*where do we get the filename*/);
 +                                OC.Notification.show(t('files', response.data.message));
                                                                $('#fileList > tr').not('[data-mime]').fadeOut();
                                                                $('#fileList > tr').not('[data-mime]').remove();
                                                        }
                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') {
-                 OC.Notification.show(t('files','Invalid folder name. Usage of "Shared" is reserved by Owncloud'));
-                               return;
+               form.submit(function(event){
+                       event.stopPropagation();
+                       event.preventDefault();
+                       var newname=input.val();
+                       if(type == 'web' && newname.length == 0) {
+                               $('#notification').text(t('files', 'URL cannot be empty.'));
+                               $('#notification').fadeIn();
+                               return false;
+                       } else if (type != 'web' && !Files.isFileNameValid(newname)) {
+                               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();
++                OC.Notification.show(t('files','Invalid folder name. Usage of \'Shared\' is reserved by Owncloud'));
+                               return false;
                        }
                        if (FileList.lastAction) {
                                FileList.lastAction();
Simple merge
diff --cc core/js/js.js
Simple merge