From 4c99b2aba895834d4551eb03c790ecc337351ca7 Mon Sep 17 00:00:00 2001 From: Shea Bunge Date: Sun, 14 Jul 2013 16:38:08 +1000 Subject: [PATCH 1/2] Use === and !== instead of == and != --- js/customizer.js | 4 ++-- js/keyboard-image-navigation.js | 6 +++--- js/navigation.js | 10 +++++----- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/js/customizer.js b/js/customizer.js index 344e191f..16fef19e 100644 --- a/js/customizer.js +++ b/js/customizer.js @@ -19,7 +19,7 @@ // Header text color. wp.customize( 'header_textcolor', function( value ) { value.bind( function( to ) { - if ( 'blank' == to ) { + if ( 'blank' === to ) { $( '.site-title, .site-description' ).css( { 'clip': 'rect(1px, 1px, 1px, 1px)', 'position': 'absolute' @@ -33,4 +33,4 @@ } } ); } ); -} )( jQuery ); \ No newline at end of file +} )( jQuery ); diff --git a/js/keyboard-image-navigation.js b/js/keyboard-image-navigation.js index 323af7fb..6cc01ac1 100644 --- a/js/keyboard-image-navigation.js +++ b/js/keyboard-image-navigation.js @@ -1,14 +1,14 @@ jQuery( document ).ready( function( $ ) { $( document ).keydown( function( e ) { var url = false; - if ( e.which == 37 ) { // Left arrow key code + if ( e.which === 37 ) { // Left arrow key code url = $( '.previous-image a' ).attr( 'href' ); } - else if ( e.which == 39 ) { // Right arrow key code + else if ( e.which === 39 ) { // Right arrow key code url = $( '.entry-attachment a' ).attr( 'href' ); } if ( url && ( !$( 'textarea, input' ).is( ':focus' ) ) ) { window.location = url; } } ); -} ); \ No newline at end of file +} ); diff --git a/js/navigation.js b/js/navigation.js index d4f9cf8b..dd92b7bf 100644 --- a/js/navigation.js +++ b/js/navigation.js @@ -11,24 +11,24 @@ return; button = container.getElementsByTagName( 'h1' )[0]; - if ( 'undefined' == typeof button ) + if ( 'undefined' === typeof button ) return; menu = container.getElementsByTagName( 'ul' )[0]; // Hide menu toggle button if menu is empty and return early. - if ( 'undefined' == typeof menu ) { + if ( 'undefined' === typeof menu ) { button.style.display = 'none'; return; } - if ( -1 == menu.className.indexOf( 'nav-menu' ) ) + if ( -1 === menu.className.indexOf( 'nav-menu' ) ) menu.className += ' nav-menu'; button.onclick = function() { - if ( -1 != container.className.indexOf( 'toggled' ) ) + if ( -1 !== container.className.indexOf( 'toggled' ) ) container.className = container.className.replace( ' toggled', '' ); else container.className += ' toggled'; }; -} )(); \ No newline at end of file +} )(); From e5a8931afc2aa5400fb62f3f34f3c0f17d33263e Mon Sep 17 00:00:00 2001 From: Shea Bunge Date: Sun, 14 Jul 2013 16:39:03 +1000 Subject: [PATCH 2/2] Add missing semicolon --- js/navigation.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/navigation.js b/js/navigation.js index dd92b7bf..f7adf551 100644 --- a/js/navigation.js +++ b/js/navigation.js @@ -6,7 +6,7 @@ ( function() { var container, button, menu; - container = document.getElementById( 'site-navigation' ) + container = document.getElementById( 'site-navigation' ); if ( ! container ) return;