01org/webapps-memory-match — pull request #1 by townxelliot (2013-04-08 09:54:58+00:00)
Title: Optimisations

Outline of work done:

* Move all app-related common files to app/ directory.
* Move non-essential files out of app/ (e.g. OFL.txt).
* Use requirejs to load all JS: this reduces the number of script tags and makes the app structure more obvious.
* Load HTML in two stages: HTML for the front page, then load the remaining HTML via an ajax call. This accelerates the initial page show.
* Split game-specific code into a Game object.
* Move gamesound into its own "class" file.
* Manage sounds through a central Sounds object. This is also used to lazy-load audio files once the DOM is loaded, rather than loading them up-front with the DOM.
* Refer to levels, level-related objects (sounds, game data) and their related DOM elements with a level number, rather than using zero-indexed arrays. This removes the need to add/subtract 1 from the level number to enable correlation between game objects, DOM elements, and game levels.
* Add a grunt build to make and deploy a wgt file to Tizen devices. This also concatenates and minifies JS (using r.js) and CSS, optimises images, and removes unnecessary whitespace from the HTML index file. In addition, it provides a simple web server for testing, and can build a distribution suitable for use as a Chrome extension.
* Use bower to install and track external 3rd party library dependencies.
* Fix the Chrome manifest so the app will load correctly as an extension.
* Fix Makefile and desktop file so Linux installation works.
* Switch to jqmobi rather than jQuery: smaller JS file to load, but with the same API; also, jqmobi performance is better (at least according to http://www.codefessions.com/2012/08/performance-of-jquery-compatible-mobile.html).