diff options
author | Georg Ehrke <developer@georgehrke.com> | 2013-08-23 23:10:37 +0200 |
---|---|---|
committer | Georg Ehrke <developer@georgehrke.com> | 2013-08-23 23:10:37 +0200 |
commit | 6ffa2a28d0ae63b061e1e88ee3b12726d31c3f9d (patch) | |
tree | b564539f21866e6049d69da6d011647ff46540f7 /apps/files/js | |
parent | 1dab0767502013b5e86e8e24e3b12a2a8939f7a8 (diff) | |
parent | 02b2b5a808b135007d8d54b837e70c38f02729fd (diff) | |
download | nextcloud-server-6ffa2a28d0ae63b061e1e88ee3b12726d31c3f9d.tar.gz nextcloud-server-6ffa2a28d0ae63b061e1e88ee3b12726d31c3f9d.zip |
Merge branch 'master' into oc_preview
Diffstat (limited to 'apps/files/js')
-rw-r--r-- | apps/files/js/file-upload.js | 15 | ||||
-rw-r--r-- | apps/files/js/fileactions.js | 2 | ||||
-rw-r--r-- | apps/files/js/keyboardshortcuts.js | 4 |
3 files changed, 11 insertions, 10 deletions
diff --git a/apps/files/js/file-upload.js b/apps/files/js/file-upload.js index 16d96fbb386..c401419fa42 100644 --- a/apps/files/js/file-upload.js +++ b/apps/files/js/file-upload.js @@ -1,6 +1,6 @@ $(document).ready(function() { - file_upload_param = { + var file_upload_param = { dropZone: $('#content'), // restrict dropZone to content div //singleFileUploads is on by default, so the data.files array will always have length 1 add: function(e, data) { @@ -142,7 +142,7 @@ $(document).ready(function() { $('#uploadprogressbar').progressbar('value',100); $('#uploadprogressbar').fadeOut(); } - } + }; var file_upload_handler = function() { $('#file_upload_start').fileupload(file_upload_param); }; @@ -163,13 +163,14 @@ $(document).ready(function() { // warn user not to leave the page while upload is in progress $(window).bind('beforeunload', function(e) { - if ($.assocArraySize(uploadingFiles) > 0) + if ($.assocArraySize(uploadingFiles) > 0) { return t('files','File upload is in progress. Leaving the page now will cancel the upload.'); + } }); //add multiply file upload attribute to all browsers except konqueror (which crashes when it's used) if(navigator.userAgent.search(/konqueror/i)==-1){ - $('#file_upload_start').attr('multiple','multiple') + $('#file_upload_start').attr('multiple','multiple'); } //if the breadcrumb is to long, start by replacing foldernames with '...' except for the current folder @@ -302,8 +303,7 @@ $(document).ready(function() { } localName = getUniqueName(localName); //IE < 10 does not fire the necessary events for the progress bar. - if($('html.lte9').length > 0) { - } else { + if($('html.lte9').length === 0) { $('#uploadprogressbar').progressbar({value:0}); $('#uploadprogressbar').fadeIn(); } @@ -311,8 +311,7 @@ $(document).ready(function() { var eventSource=new OC.EventSource(OC.filePath('files','ajax','newfile.php'),{dir:$('#dir').val(),source:name,filename:localName}); eventSource.listen('progress',function(progress){ //IE < 10 does not fire the necessary events for the progress bar. - if($('html.lte9').length > 0) { - } else { + if($('html.lte9').length === 0) { $('#uploadprogressbar').progressbar('value',progress); } }); diff --git a/apps/files/js/fileactions.js b/apps/files/js/fileactions.js index 5027211b536..097fe521aa6 100644 --- a/apps/files/js/fileactions.js +++ b/apps/files/js/fileactions.js @@ -198,7 +198,7 @@ FileActions.register('all', 'Rename', OC.PERMISSION_UPDATE, function () { FileActions.register('dir', 'Open', OC.PERMISSION_READ, '', function (filename) { - var dir = $('#dir').val() + var dir = $('#dir').val(); if (dir !== '/') { dir = dir + '/'; } diff --git a/apps/files/js/keyboardshortcuts.js b/apps/files/js/keyboardshortcuts.js index 418c38adb99..9d6c3ae8c33 100644 --- a/apps/files/js/keyboardshortcuts.js +++ b/apps/files/js/keyboardshortcuts.js @@ -131,7 +131,9 @@ var Files = Files || {}; return; } var preventDefault = false; - if ($.inArray(event.keyCode, keys) === -1) keys.push(event.keyCode); + if ($.inArray(event.keyCode, keys) === -1) { + keys.push(event.keyCode); + } if ( $.inArray(keyCodes.n, keys) !== -1 && ($.inArray(keyCodes.cmdFirefox, keys) !== -1 || $.inArray(keyCodes.cmdOpera, keys) !== -1 || $.inArray(keyCodes.leftCmdWebKit, keys) !== -1 || $.inArray(keyCodes.rightCmdWebKit, keys) !== -1 || $.inArray(keyCodes.ctrl, keys) !== -1 || event.ctrlKey)) { preventDefault = true; //new file/folder prevent browser from responding |