diff --git a/package.json b/package.json index 742fab8c50..959ddf1d10 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "habitrpg", "description": "A habit tracker app which treats your goals like a Role Playing Game.", - "version": "0.0.0-150", + "version": "0.0.0-151", "main": "./server.js", "dependencies": { "derby": "git://github.com/Unroll-Me/derby#master", diff --git a/public/img/sprites/Egg_Sprite_Sheet.png b/public/img/sprites/Egg_Sprite_Sheet.png index c2834447bb..716f5e96de 100644 Binary files a/public/img/sprites/Egg_Sprite_Sheet.png and b/public/img/sprites/Egg_Sprite_Sheet.png differ diff --git a/public/img/sprites/PetEggs.css b/public/img/sprites/PetEggs.css index bd70a03b65..b39998480e 100644 --- a/public/img/sprites/PetEggs.css +++ b/public/img/sprites/PetEggs.css @@ -1,4 +1,4 @@ -.Pet_Egg_Wolf, .Pet_Egg_TigerCub, .Pet_Egg_PolarBear, .Pet_Egg_PandaCub, .Pet_Egg_LionCub, .Pet_Egg_Fox, .Pet_Egg_FlyingPig, .Pet_Egg_Dragon, .Pet_Egg_Cactus, .Pet_Egg_BearCub, .Pet_HatchingPotion_Base, .Pet_HatchingPotion_White, .Pet_HatchingPotion_Desert, .Pet_HatchingPotion_Red, .Pet_HatchingPotion_Shade, .Pet_HatchingPotion_Skeleton, .Pet_HatchingPotion_Zombie, .Pet_HatchingPotion_CottonCandyPink, .Pet_HatchingPotion_CottonCandyBlue, .Pet_HatchingPotion_Golden {background: url("/img/sprites/Egg_Sprite_Sheet.png") no-repeat} +.Pet_Egg_Wolf, .Pet_Egg_TigerCub, .Pet_Egg_PolarBear, .Pet_Egg_PandaCub, .Pet_Egg_LionCub, .Pet_Egg_Fox, .Pet_Egg_FlyingPig, .Pet_Egg_Dragon, .Pet_Egg_Cactus, .Pet_Egg_BearCub, .Pet_HatchingPotion_Base, .Pet_HatchingPotion_White, .Pet_HatchingPotion_Desert, .Pet_HatchingPotion_Red, .Pet_HatchingPotion_Shade, .Pet_HatchingPotion_Skeleton, .Pet_HatchingPotion_Zombie, .Pet_HatchingPotion_CottonCandyPink, .Pet_HatchingPotion_CottonCandyBlue, .Pet_HatchingPotion_Golden, .Pet_Currency_Gem, .Pet_Currency_Gem2x, .Pet_Currency_Gem1x {background: url("/img/sprites/Egg_Sprite_Sheet.png") no-repeat} .Pet_Egg_Wolf {background-position: 0px 0px; width: 48px; height: 51px} .Pet_Egg_TigerCub {background-position: 0px -51px; width: 48px; height: 51px} .Pet_Egg_PolarBear {background-position: 0px -102px; width: 48px; height: 51px} @@ -19,4 +19,8 @@ .Pet_HatchingPotion_Zombie {background-position: -48px -306px; width: 48px; height: 51px} .Pet_HatchingPotion_CottonCandyPink {background-position: -48px -357px; width: 48px; height: 51px} .Pet_HatchingPotion_CottonCandyBlue {background-position: -48px -408px; width: 48px; height: 51px} -.Pet_HatchingPotion_Golden {background-position: -48px -459px; width: 48px; height: 54px} /* This sprite was a bit taller than everything else, will affect the math of anything inserted below it */ \ No newline at end of file +.Pet_HatchingPotion_Golden {background-position: -48px -459px; width: 48px; height: 54px} /* This sprite was a bit taller than everything else, will affect the math of anything inserted below it */ + +.Pet_Currency_Gem {background-position: 0px -510px; width: 51px; height: 45px} /* Not an egg or potion so has a different size */ +.Pet_Currency_Gem2x {background-position: -55px -513px; width: 34px; height: 30px} +.Pet_Currency_Gem1x {background-position: -63px -542px; width: 19px; height: 17px} diff --git a/src/app/browser.coffee b/src/app/browser.coffee index a2bd6f7194..873ce7eb83 100644 --- a/src/app/browser.coffee +++ b/src/app/browser.coffee @@ -9,9 +9,9 @@ restoreRefs = module.exports.restoreRefs = (model) -> model.refList "_#{type}List", "_user.tasks", "_user.#{type}Ids" ### - Loads JavaScript files from (1) public/js/* and (2) external sources + Loads JavaScript files from public/js/* If a library is available in a CDN, we put it in (index.html) for better caching. If not, we use - this function to utilize require() to concatinate for faster page load, and $.getScript for asyncronous external script loading + this function to utilize require() to concatinate for faster page load ### loadJavaScripts = (model) -> @@ -24,19 +24,6 @@ loadJavaScripts = (model) -> require '../../public/vendor/bootstrap-tour/bootstrap-tour' - # JS files not needed right away (google charts) or entirely optional (analytics) - # Each file getsload asyncronously via $.getScript, so it doesn't bog page-load - unless model.get('_view.mobileDevice') - - $.getScript("//s7.addthis.com/js/250/addthis_widget.js#pubid=lefnire"); - - # Google Charts - $.getScript "//www.google.com/jsapi", -> - # Specifying callback in options param is vital! Otherwise you get blank screen, see http://stackoverflow.com/a/12200566/362790 - google.load "visualization", "1", {packages:["corechart"], callback: ->} - -# Note, Google Analyatics giving beef if in this file. Moved back to index.html. It's ok, it's async - really the -# syncronous requires up top are what benefit the most from this file. ### Setup jQuery UI Sortable @@ -189,6 +176,26 @@ module.exports.resetDom = (model) -> DERBY.app.dom.clear() DERBY.app.view.render(model, DERBY.app.view._lastRender.ns, DERBY.app.view._lastRender.context); +### + Load external scripts that need re-calculation on page re-write +### +loadExternalScripts = (model) -> + $.getScript('//checkout.stripe.com/v2/checkout.js') + + # JS files not needed right away (google charts) or entirely optional (analytics) + # Each file getsload asyncronously via $.getScript, so it doesn't bog page-load + unless model.get('_view.mobileDevice') + + $.getScript("//s7.addthis.com/js/250/addthis_widget.js#pubid=lefnire") + + # Google Charts + $.getScript "//www.google.com/jsapi", -> + # Specifying callback in options param is vital! Otherwise you get blank screen, see http://stackoverflow.com/a/12200566/362790 + google.load "visualization", "1", {packages:["corechart"], callback: ->} + +# Note, Google Analyatics giving beef if in this file. Moved back to index.html. It's ok, it's async - really the +# syncronous requires up top are what benefit the most from this file. + module.exports.app = (appExports, model, app) -> loadJavaScripts(model) setupGrowlNotifications(model) unless model.get('_view.mobileDevice') @@ -199,8 +206,9 @@ module.exports.app = (appExports, model, app) -> setupTooltips(model) setupTour(model) initStickyHeader(model) unless model.get('_view.mobileDevice') + loadExternalScripts(model) $('.datepicker').datepicker({autoclose:true, todayBtn:true}) .on 'changeDate', (ev) -> - #for some reason selecting a date doesn't fire a change event on the field, meaning our changes aren't saved - #FIXME also, it saves as a day behind?? - model.at(ev.target).set 'date', moment(ev.date).add('d',1).format('MM/DD/YYYY') \ No newline at end of file + #for some reason selecting a date doesn't fire a change event on the field, meaning our changes aren't saved + #FIXME also, it saves as a day behind?? + model.at(ev.target).set 'date', moment(ev.date).add('d',1).format('MM/DD/YYYY') \ No newline at end of file diff --git a/views/app/index.html b/views/app/index.html index 43caf7933f..d29d9a52b2 100644 --- a/views/app/index.html +++ b/views/app/index.html @@ -61,8 +61,6 @@ - - {{#if equal(_view.nodeEnv,"production")}}