jsHint enhancements
This commit is contained in:
parent
00e52e483a
commit
2d66c445da
File diff suppressed because one or more lines are too long
@ -339,4 +339,4 @@ album = {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
};
|
@ -85,4 +85,4 @@ albums = {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
};
|
@ -150,7 +150,7 @@ build = {
|
||||
modal += "<div class='message center'" + custom_style + ">";
|
||||
modal += "<h1>" + title + "</h1>";
|
||||
|
||||
if (closeButton!=false) {
|
||||
if (closeButton!==false) {
|
||||
|
||||
modal += "<a class='close icon-remove-sign'></a>";
|
||||
|
||||
@ -160,7 +160,7 @@ build = {
|
||||
|
||||
$.each(button, function(index) {
|
||||
|
||||
if (this[0]!="") {
|
||||
if (this[0]!=="") {
|
||||
|
||||
if (index===0) modal += "<a class='button active'>" + this[0] + "</a>";
|
||||
else modal += "<a class='button'>" + this[0] + "</a>";
|
||||
@ -334,7 +334,7 @@ build = {
|
||||
|
||||
$.each(infos, function(index) {
|
||||
|
||||
if (infos[index][1]===""||infos[index][1]==undefined||infos[index][1]==null) infos[index][1] = "-";
|
||||
if (infos[index][1]===""||infos[index][1]===undefined||infos[index][1]===null) infos[index][1] = "-";
|
||||
|
||||
switch (infos[index][0]) {
|
||||
|
||||
@ -426,7 +426,7 @@ build = {
|
||||
|
||||
$.each(infos, function(index) {
|
||||
|
||||
if (infos[index][1]===""||infos[index][1]==undefined||infos[index][1]==null) infos[index][1] = "-";
|
||||
if (infos[index][1]===""||infos[index][1]===undefined||infos[index][1]===null) infos[index][1] = "-";
|
||||
|
||||
if (infos[index][0]==="") {
|
||||
|
||||
@ -453,4 +453,4 @@ build = {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
};
|
@ -19,7 +19,7 @@ contextMenu = {
|
||||
|
||||
// Do not leave the screen
|
||||
if ((mouse_x+$(".contextmenu").outerWidth(true))>$("html").width()) orientation = "left";
|
||||
if ((mouse_y+$(".contextmenu").outerHeight(true))>$("html").height()) mouse_y -= (mouse_y+$(".contextmenu").outerHeight(true)-$("html").height())
|
||||
if ((mouse_y+$(".contextmenu").outerHeight(true))>$("html").height()) mouse_y -= (mouse_y+$(".contextmenu").outerHeight(true)-$("html").height());
|
||||
|
||||
if (mouse_x>$(document).width()) mouse_x = $(document).width();
|
||||
if (mouse_x<0) mouse_x = 0;
|
||||
@ -30,10 +30,10 @@ contextMenu = {
|
||||
|
||||
if (mouse_x===null||
|
||||
mouse_x===undefined||
|
||||
mouse_x===NaN||
|
||||
isNaN(mouse_x)||
|
||||
mouse_y===null||
|
||||
mouse_y===undefined||
|
||||
mouse_y===NaN) {
|
||||
isNaN(mouse_y)) {
|
||||
mouse_x = "10px";
|
||||
mouse_y = "10px";
|
||||
}
|
||||
@ -41,7 +41,7 @@ contextMenu = {
|
||||
$(".contextmenu").css({
|
||||
"top": mouse_y,
|
||||
"left": mouse_x,
|
||||
"opacity": .98
|
||||
"opacity": 0.98
|
||||
});
|
||||
|
||||
},
|
||||
@ -330,4 +330,4 @@ contextMenu = {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
};
|
@ -45,8 +45,8 @@ $(document).ready(function(){
|
||||
|
||||
/* Clear Search */
|
||||
$("#clearSearch").on(event_name, function () {
|
||||
$("#search").focus();
|
||||
search.reset();
|
||||
$("#search").focus();
|
||||
search.reset();
|
||||
});
|
||||
|
||||
/* Back Buttons */
|
||||
@ -116,8 +116,8 @@ $(document).ready(function(){
|
||||
|
||||
/* Modal */
|
||||
.on(event_name, ".message .close", modal.close)
|
||||
.on(event_name, ".message .button:first", function() { if (modal.fns!=null) modal.fns[0](); if (!visible.signin()) modal.close() })
|
||||
.on(event_name, ".message .button:last", function() { if (modal.fns!=null) modal.fns[1](); if (!visible.signin()) modal.close() })
|
||||
.on(event_name, ".message .button:first", function() { if (modal.fns!==null) modal.fns[0](); if (!visible.signin()) modal.close() })
|
||||
.on(event_name, ".message .button:last", function() { if (modal.fns!==null) modal.fns[1](); if (!visible.signin()) modal.close() })
|
||||
|
||||
/* Add Dialog */
|
||||
.on(event_name, ".button_add", function(e) { contextMenu.add(e) })
|
||||
|
@ -15,7 +15,7 @@ loadingBar = {
|
||||
|
||||
loadingBar.status = "error";
|
||||
|
||||
if (!errorText) errorText = "Whoops, it looks like something went wrong. Please reload the site and try again!"
|
||||
if (!errorText) errorText = "Whoops, it looks like something went wrong. Please reload the site and try again!";
|
||||
|
||||
lychee.loadingBar
|
||||
.removeClass("loading uploading error")
|
||||
@ -28,7 +28,7 @@ loadingBar = {
|
||||
clearTimeout(lychee.loadingBar.data("timeout"));
|
||||
lychee.loadingBar.data("timeout", setTimeout(function() { loadingBar.hide(true) }, 3000));
|
||||
|
||||
} else if (loadingBar.status==null) {
|
||||
} else if (loadingBar.status===null) {
|
||||
|
||||
loadingBar.status = "loading";
|
||||
|
||||
@ -47,7 +47,7 @@ loadingBar = {
|
||||
|
||||
hide: function(force_hide) {
|
||||
|
||||
if ((loadingBar.status!=="error"&&loadingBar.status!=null)||force_hide) {
|
||||
if ((loadingBar.status!=="error"&&loadingBar.status!==null)||force_hide) {
|
||||
|
||||
loadingBar.status = null;
|
||||
clearTimeout(lychee.loadingBar.data("timeout"));
|
||||
@ -59,4 +59,4 @@ loadingBar = {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
};
|
@ -73,7 +73,7 @@ var lychee = {
|
||||
|
||||
api: function(params, callback, loading) {
|
||||
|
||||
if (loading==undefined) loadingBar.show();
|
||||
if (loading===undefined) loadingBar.show();
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
@ -135,7 +135,7 @@ var lychee = {
|
||||
$("#username").focus();
|
||||
if (localStorage) {
|
||||
local_username = localStorage.getItem("username");
|
||||
if (local_username!=null) {
|
||||
if (local_username!==null) {
|
||||
if (local_username.length>0) $("#username").val(local_username);
|
||||
$("#password").focus();
|
||||
}
|
||||
@ -154,7 +154,7 @@ var lychee = {
|
||||
|
||||
goto: function(url) {
|
||||
|
||||
if (url==undefined) url = "";
|
||||
if (url===undefined) url = "";
|
||||
document.location.hash = url;
|
||||
|
||||
},
|
||||
@ -323,7 +323,7 @@ var lychee = {
|
||||
|
||||
settings.setDropboxKey(callback);
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
@ -336,4 +336,4 @@ var lychee = {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
};
|
@ -12,7 +12,7 @@ modal = {
|
||||
show: function(title, text, buttons, marginTop, closeButton) {
|
||||
|
||||
if (!buttons) {
|
||||
var buttons = [
|
||||
buttons = [
|
||||
["", function() {}],
|
||||
["", function() {}]
|
||||
];
|
||||
@ -32,4 +32,4 @@ modal = {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
};
|
@ -21,7 +21,7 @@ multiselect = {
|
||||
if (mobileBrowser()) return false;
|
||||
if (lychee.publicMode) return false;
|
||||
if (visible.search()) return false;
|
||||
if ($('.album:hover, .photo:hover').length!=0) return false;
|
||||
if ($('.album:hover, .photo:hover').length!==0) return false;
|
||||
if (visible.multiselect()) $('#multiselect').remove();
|
||||
|
||||
multiselect.position.top = e.pageY;
|
||||
@ -109,7 +109,7 @@ multiselect = {
|
||||
left: $('#multiselect').offset().left,
|
||||
width: parseInt($('#multiselect').css('width').replace('px', '')),
|
||||
height: parseInt($('#multiselect').css('height').replace('px', ''))
|
||||
}
|
||||
};
|
||||
|
||||
},
|
||||
|
||||
@ -146,8 +146,8 @@ multiselect = {
|
||||
|
||||
});
|
||||
|
||||
if (ids.length!=0&&visible.album()) contextMenu.photoMulti(ids, e);
|
||||
else if (ids.length!=0&&visible.albums()) contextMenu.albumMulti(ids, e);
|
||||
if (ids.length!==0&&visible.album()) contextMenu.photoMulti(ids, e);
|
||||
else if (ids.length!==0&&visible.albums()) contextMenu.albumMulti(ids, e);
|
||||
else multiselect.close();
|
||||
|
||||
},
|
||||
@ -168,4 +168,4 @@ multiselect = {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
};
|
@ -105,4 +105,4 @@ password = {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
};
|
@ -33,7 +33,7 @@ photo = {
|
||||
checkPasswd = function() {
|
||||
if (password.value!=="") photo.load(photoID, albumID);
|
||||
else setTimeout(checkPasswd, 250);
|
||||
}
|
||||
};
|
||||
checkPasswd();
|
||||
return false;
|
||||
}
|
||||
@ -69,7 +69,7 @@ photo = {
|
||||
// Get title if only one photo is selected
|
||||
if (visible.photo()) photoTitle = photo.json.title;
|
||||
else photoTitle = album.json.content[photoIDs].title;
|
||||
if (photoTitle=="") photoTitle = "Untitled";
|
||||
if (photoTitle==="") photoTitle = "Untitled";
|
||||
}
|
||||
|
||||
buttons = [
|
||||
@ -411,15 +411,15 @@ photo = {
|
||||
|
||||
isSmall: function() {
|
||||
|
||||
var size = [
|
||||
["width", false],
|
||||
["height", false]
|
||||
];
|
||||
var size = {
|
||||
width: false,
|
||||
height: false
|
||||
};
|
||||
|
||||
if (photo.json.width<$(window).width()-60) size["width"] = true;
|
||||
if (photo.json.height<$(window).height()-100) size["height"] = true;
|
||||
if (photo.json.width<$(window).width()-60) size.width = true;
|
||||
if (photo.json.height<$(window).height()-100) size.height = true;
|
||||
|
||||
if (size["width"]&&size["height"]) return true;
|
||||
if (size.width&&size.height) return true;
|
||||
else return false;
|
||||
|
||||
},
|
||||
@ -450,4 +450,4 @@ photo = {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
};
|
@ -90,4 +90,4 @@ search = {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
};
|
@ -230,7 +230,7 @@ var settings = {
|
||||
order.\
|
||||
", buttons);
|
||||
|
||||
if (lychee.sorting!="") {
|
||||
if (lychee.sorting!=="") {
|
||||
sorting = lychee.sorting.replace("ORDER BY ", "").replace(" ", ";").split(";");
|
||||
$("select#settings_type").val(sorting[0]);
|
||||
$("select#settings_order").val(sorting[1]);
|
||||
@ -267,4 +267,4 @@ var settings = {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
};
|
@ -42,9 +42,9 @@ upload = {
|
||||
|
||||
if (!window.webkitNotifications) return false;
|
||||
|
||||
if (window.webkitNotifications.checkPermission()!=0) window.webkitNotifications.requestPermission();
|
||||
if (window.webkitNotifications.checkPermission()!==0) window.webkitNotifications.requestPermission();
|
||||
|
||||
if (window.webkitNotifications.checkPermission()==0&&title) {
|
||||
if (window.webkitNotifications.checkPermission()===0&&title) {
|
||||
popup = window.webkitNotifications.createNotification("", title, "You can now manage your new photo(s).");
|
||||
popup.show();
|
||||
}
|
||||
@ -270,4 +270,4 @@ upload = {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
};
|
@ -471,4 +471,4 @@ view = {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
};
|
@ -57,4 +57,4 @@ visible = {
|
||||
else return false;
|
||||
}
|
||||
|
||||
}
|
||||
};
|
Loading…
Reference in New Issue
Block a user