From 245475656f363ac5593f4826d59738fced91fe6c Mon Sep 17 00:00:00 2001 From: Gwenhael Le Moine Date: Fri, 15 Jul 2011 11:29:36 +0200 Subject: [PATCH] use jQuery() instead of $() --- star.js/js/star.js | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/star.js/js/star.js b/star.js/js/star.js index a486d19..8353657 100644 --- a/star.js/js/star.js +++ b/star.js/js/star.js @@ -1,6 +1,6 @@ function initialize_a_star( dom_container, level_index ) { // kinda enums - var cell= { WALL: '#', BALL: '@', CUBE: 'H', VOID: ' ', GIFT: 'x' }; + var cell = { WALL: '#', BALL: '@', CUBE: 'H', VOID: ' ', GIFT: 'x' }; var direction = { UP: 38, DOWN: 40, LEFT: 37, RIGHT: 39 }; var assets = { @@ -38,17 +38,17 @@ function initialize_a_star( dom_container, level_index ) { starhtml += ''; starhtml += ''; starhtml += ''; - $( dom_container ).html( starhtml ); + jQuery( dom_container ).html( starhtml ); // Now we can collect some informations about this DOM branch we have var DOM_infos = { container: dom_container, canvas: { - //$() returns a jquery object, [0] to get the canvas itself - context: $( dom_container + " #starboard" )[ 0 ].getContext( '2d' ), - offset: $( dom_container + " #starboard" ).offset(), - width: $( dom_container + " #starboard" ).width(), - height: $( dom_container + " #starboard" ).height() + //jQuery() returns a jquery object, [0] to get the canvas itself + context: jQuery( dom_container + " #starboard" )[ 0 ].getContext( '2d' ), + offset: jQuery( dom_container + " #starboard" ).offset(), + width: jQuery( dom_container + " #starboard" ).width(), + height: jQuery( dom_container + " #starboard" ).height() } }; @@ -166,7 +166,7 @@ function initialize_a_star( dom_container, level_index ) { infos += "" + count_gifts( ) + " gifts left
"; infos += "" + state.distance_travelled + " meters travelled"; - $( DOM_infos.container + " .gstar #infos" ).html( infos ); + jQuery( DOM_infos.container + " .gstar #infos" ).html( infos ); } function format_help( ) { @@ -317,9 +317,9 @@ function initialize_a_star( dom_container, level_index ) { function start_loop( ) { - $(document).focus( ); - $(document).click( event_handler ); - $(document).keydown( event_handler ); + jQuery(document).focus( ); + jQuery(document).click( event_handler ); + jQuery(document).keydown( event_handler ); } ////// MAIN (so to speak) //////