From 066d3be697399759d6346fc2806885b2788cdcc8 Mon Sep 17 00:00:00 2001 From: Tobias Reich Date: Sun, 31 Aug 2014 22:11:04 +0200 Subject: [PATCH] JsHint fixes --- assets/js/album.js | 6 +++--- assets/js/contextMenu.js | 3 ++- assets/js/lychee.js | 2 +- assets/js/multiselect.js | 8 +++++--- assets/js/photo.js | 3 +++ assets/js/upload.js | 4 ++-- assets/min/main.js | 8 ++++---- 7 files changed, 20 insertions(+), 14 deletions(-) diff --git a/assets/js/album.js b/assets/js/album.js index f0f60b8..fced508 100644 --- a/assets/js/album.js +++ b/assets/js/album.js @@ -86,7 +86,7 @@ album = { }, - parse: function(photo) { + parse: function() { if (!album.json.title) album.json.title = "Untitled"; @@ -143,7 +143,7 @@ album = { if (visible.albums()) { - albumIDs.forEach(function(id, index, array) { + albumIDs.forEach(function(id) { albums.json.num--; view.albums.content.delete(id); }); @@ -224,7 +224,7 @@ album = { } else if (visible.albums()) { - albumIDs.forEach(function(id, index, array) { + albumIDs.forEach(function(id) { albums.json.content[id].title = newTitle; view.albums.content.title(id); }); diff --git a/assets/js/contextMenu.js b/assets/js/contextMenu.js index 4931780..2800539 100644 --- a/assets/js/contextMenu.js +++ b/assets/js/contextMenu.js @@ -270,7 +270,8 @@ contextMenu = { var mouse_x = e.pageX, mouse_y = e.pageY, - items; + items, + link = ""; mouse_y -= $(document).scrollTop(); diff --git a/assets/js/lychee.js b/assets/js/lychee.js index 2389a80..87ce71f 100644 --- a/assets/js/lychee.js +++ b/assets/js/lychee.js @@ -149,7 +149,7 @@ var lychee = { logout: function() { - lychee.api("logout", function(data) { + lychee.api("logout", function() { window.location.reload(); }); diff --git a/assets/js/multiselect.js b/assets/js/multiselect.js index c76068c..69be00c 100644 --- a/assets/js/multiselect.js +++ b/assets/js/multiselect.js @@ -38,7 +38,9 @@ multiselect = { selectAll: function() { - var e; + var e, + newWidth, + newHeight; if (mobileBrowser()) return false; if (lychee.publicMode) return false; @@ -65,7 +67,7 @@ multiselect = { e = { pageX: $(document).width() - (multiselect.position.right / 2), pageY: $(document).height() - multiselect.position.bottom - } + }; multiselect.getSelection(e); @@ -172,7 +174,7 @@ multiselect = { id = $(this).data('id'); - if (id!=='0'&&id!==0&&id!=='f'&&id!=='s'&&id!=='r'&&id!==null&id!==undefined) { + if (id!=='0'&&id!==0&&id!=='f'&&id!=='s'&&id!=='r'&&id!==null&&id!==undefined) { ids.push(id); $(this).addClass('active'); diff --git a/assets/js/photo.js b/assets/js/photo.js index 5686adf..9890312 100644 --- a/assets/js/photo.js +++ b/assets/js/photo.js @@ -153,6 +153,9 @@ photo = { buttons = [ ["", function() { + var nextPhoto, + previousPhoto; + photoIDs.forEach(function(id, index, array) { // Change reference for the next and previous photo diff --git a/assets/js/upload.js b/assets/js/upload.js index 76f1973..ea68255 100755 --- a/assets/js/upload.js +++ b/assets/js/upload.js @@ -12,7 +12,7 @@ upload = { upload.close(true); $("body").append(build.uploadModal(title, files)); - if (callback!=null&&callback!=undefined) callback(); + if (callback!==null&&callback!==undefined) callback(); }, @@ -158,7 +158,7 @@ upload = { if (e.lengthComputable) { // Calculate progress - progress = (e.loaded / e.total * 100 | 0); + progress = (e.loaded / e.total * 100) || 0; // Set progress when progress has changed if (progress>pre_progress) { diff --git a/assets/min/main.js b/assets/min/main.js index 2179087..4524e46 100644 --- a/assets/min/main.js +++ b/assets/min/main.js @@ -1,6 +1,6 @@ -function mobileBrowser(){return/Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent)?!0:!1}function gup(e){e=e.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var t="[\\?&]"+e+"=([^&#]*)",n=new RegExp(t),o=n.exec(window.location.href);return null===o?"":o[1]}!function(e,t){"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(e,t){function n(e){var t=e.length,n=J.type(e);return"function"===n||J.isWindow(e)?!1:1===e.nodeType&&t?!0:"array"===n||0===t||"number"==typeof t&&t>0&&t-1 in e}function o(e,t,n){if(J.isFunction(t))return J.grep(e,function(e,o){return!!t.call(e,o,e)!==n});if(t.nodeType)return J.grep(e,function(e){return e===t!==n});if("string"==typeof t){if(st.test(t))return J.filter(t,e,n);t=J.filter(t,e)}return J.grep(e,function(e){return z.call(t,e)>=0!==n})}function i(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}function a(e){var t=ft[e]={};return J.each(e.match(ht)||[],function(e,n){t[n]=!0}),t}function r(){Q.removeEventListener("DOMContentLoaded",r,!1),e.removeEventListener("load",r,!1),J.ready()}function s(){Object.defineProperty(this.cache={},0,{get:function(){return{}}}),this.expando=J.expando+Math.random()}function l(e,t,n){var o;if(void 0===n&&1===e.nodeType)if(o="data-"+t.replace(wt,"-$1").toLowerCase(),n=e.getAttribute(o),"string"==typeof n){try{n="true"===n?!0:"false"===n?!1:"null"===n?null:+n+""===n?+n:yt.test(n)?J.parseJSON(n):n}catch(i){}bt.set(e,t,n)}else n=void 0;return n}function u(){return!0}function c(){return!1}function d(){try{return Q.activeElement}catch(e){}}function p(e,t){return J.nodeName(e,"table")&&J.nodeName(11!==t.nodeType?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody")):e}function h(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function f(e){var t=Lt.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function m(e,t){for(var n=0,o=e.length;o>n;n++)vt.set(e[n],"globalEval",!t||vt.get(t[n],"globalEval"))}function g(e,t){var n,o,i,a,r,s,l,u;if(1===t.nodeType){if(vt.hasData(e)&&(a=vt.access(e),r=vt.set(t,a),u=a.events)){delete r.handle,r.events={};for(i in u)for(n=0,o=u[i].length;o>n;n++)J.event.add(t,i,u[i][n])}bt.hasData(e)&&(s=bt.access(e),l=J.extend({},s),bt.set(t,l))}}function v(e,t){var n=e.getElementsByTagName?e.getElementsByTagName(t||"*"):e.querySelectorAll?e.querySelectorAll(t||"*"):[];return void 0===t||t&&J.nodeName(e,t)?J.merge([e],n):n}function b(e,t){var n=t.nodeName.toLowerCase();"input"===n&&kt.test(e.type)?t.checked=e.checked:("input"===n||"textarea"===n)&&(t.defaultValue=e.defaultValue)}function y(t,n){var o,i=J(n.createElement(t)).appendTo(n.body),a=e.getDefaultComputedStyle&&(o=e.getDefaultComputedStyle(i[0]))?o.display:J.css(i[0],"display");return i.detach(),a}function w(e){var t=Q,n=Rt[e];return n||(n=y(e,t),"none"!==n&&n||(qt=(qt||J("