From 31501e48fe73898525336d9b118a563090bfae8b Mon Sep 17 00:00:00 2001 From: jgen Date: Wed, 23 Apr 2014 23:31:20 -0400 Subject: [PATCH] More JS linting. --- lib/shimmie.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/lib/shimmie.js b/lib/shimmie.js index 2a1f09ed..457cb71b 100644 --- a/lib/shimmie.js +++ b/lib/shimmie.js @@ -1,3 +1,4 @@ +/*jshint bitwise:false, curly:true, eqeqeq:true, evil:true, forin:false, noarg:true, noempty:true, nonew:true, undef:false, strict:false, browser:true */ // Adding jQuery ui stuff $(document).ready(function() { @@ -49,7 +50,7 @@ $(document).ready(function() { if(sidebar_hidden.hasOwnProperty(i) && sidebar_hidden[i].length > 0) { $(sidebar_hidden[i]+" .blockbody").hide(); } - }; + } } catch(err) { var sidebar_hidden = []; @@ -59,7 +60,7 @@ $(document).ready(function() { var tob = $(tid+" .blockbody"); $(elm).click(function(e) { tob.slideToggle("slow"); - if(sidebar_hidden.indexOf(tid) == -1) { + if(sidebar_hidden.indexOf(tid) === -1) { sidebar_hidden.push(tid); } else { @@ -70,7 +71,7 @@ $(document).ready(function() { } } $.cookie("ui-sidebar-hidden", sidebar_hidden.join("|"), {path: '/', expires: 365}); - }) + }); }); $(".shm-unlocker").each(function(idx, elm) { @@ -143,9 +144,9 @@ function getCookie( name ) { if ( ( !start ) && ( name != document.cookie.substring( 0, name.length ) ) ) { return null; } - if ( start == -1 ) return null; + if ( start === -1 ) { return null; } var end = document.cookie.indexOf( ";", len ); - if ( end == -1 ) end = document.cookie.length; + if ( end === -1 ) { end = document.cookie.length; } return unescape( document.cookie.substring( len, end ) ); } @@ -164,10 +165,11 @@ function setCookie( name, value, expires, path, domain, secure ) { } function deleteCookie( name, path, domain ) { - if ( getCookie( name ) ) document.cookie = name + "=" + + if ( getCookie( name ) ) { document.cookie = name + "=" + ( ( path ) ? ";path=" + path : "") + ( ( domain ) ? ";domain=" + domain : "" ) + ";expires=Thu, 01-Jan-1970 00:00:01 GMT"; + } } function replyTo(imageId, commentId, userId) {