summaryrefslogtreecommitdiffstats
path: root/apps/files
diff options
context:
space:
mode:
authorkondou <kondou@ts.unde.re>2013-07-31 21:21:02 +0200
committerkondou <kondou@ts.unde.re>2013-07-31 21:21:02 +0200
commitaaf0fec9f54bc6f9eef5df00441d593e053ee74b (patch)
treeca65f4c20b8d1e698d815a3b5970926023093478 /apps/files
parent50101a85a63f29c47abe325aecb3af26bc8a96d1 (diff)
downloadnextcloud-server-aaf0fec9f54bc6f9eef5df00441d593e053ee74b.tar.gz
nextcloud-server-aaf0fec9f54bc6f9eef5df00441d593e053ee74b.zip
Fix some JSLint warnings
Diffstat (limited to 'apps/files')
-rw-r--r--apps/files/js/file-upload.js23
-rw-r--r--apps/files/js/fileactions.js2
-rw-r--r--apps/files/js/keyboardshortcuts.js4
3 files changed, 14 insertions, 15 deletions
diff --git a/apps/files/js/file-upload.js b/apps/files/js/file-upload.js
index 942a07dfccc..08047c25fdb 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);
};
@@ -156,20 +156,21 @@ $(document).ready(function() {
// http://stackoverflow.com/a/6700/11236
var size = 0, key;
for (key in obj) {
- if (obj.hasOwnProperty(key)) size++;
+ if (obj.hasOwnProperty(key)) { size++; }
}
return size;
};
// 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
@@ -179,7 +180,7 @@ $(document).ready(function() {
crumb=crumb.next('div.crumb');
}
//if that isn't enough, start removing items from the breacrumb except for the current folder and it's parent
- var crumb=$('div.crumb').first();
+ crumb=$('div.crumb').first();
var next=crumb.next('div.crumb');
while($('div.controls').height()>40 && next.next('div.crumb').length>0){
crumb.remove();
@@ -189,7 +190,7 @@ $(document).ready(function() {
//still not enough, start shorting down the current folder name
var crumb=$('div.crumb>a').last();
while($('div.controls').height()>40 && crumb.text().length>6){
- var text=crumb.text()
+ var text=crumb.text();
text=text.substr(0,text.length-6)+'...';
crumb.text(text);
}
@@ -291,7 +292,7 @@ $(document).ready(function() {
}
var localName=name;
if(localName.substr(localName.length-1,1)=='/'){//strip /
- localName=localName.substr(0,localName.length-1)
+ localName=localName.substr(0,localName.length-1);
}
if(localName.indexOf('/')){//use last part of url
localName=localName.split('/').pop();
@@ -300,8 +301,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();
}
@@ -309,8 +309,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 aa66a57a7b5..f05a320e72d 100644
--- a/apps/files/js/fileactions.js
+++ b/apps/files/js/fileactions.js
@@ -200,7 +200,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 cc2b5d42139..1d3bae925bc 100644
--- a/apps/files/js/keyboardshortcuts.js
+++ b/apps/files/js/keyboardshortcuts.js
@@ -131,7 +131,7 @@ 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
@@ -165,4 +165,4 @@ var Files = Files || {};
removeA(keys, event.keyCode);
});
};
-})(Files); \ No newline at end of file
+})(Files);