diff --git a/README.md b/README.md index 26b302b61..6b560a77c 100644 --- a/README.md +++ b/README.md @@ -1,101 +1,171 @@ -# angular-seed — the seed for <angular/> apps +# <angular/> Phone Catalog Tutorial Application -This project is an application skeleton for a typical [angular](http://angularjs.org/) web app. You -can use it to quickly bootstrap your angular webapp projects and dev environment for these projects. +# Overview -The seed contains angular libraries, test libraries and a bunch of scripts all preconfigured for -instant web development gratification. Just clone the repo (or download the zip/tarball), start up -our (or yours) webserver and you are ready to develop and test your application. +This application takes the developer thought the process of building a web-application using +angular. The application is loosely based on +[Google phone gallery](http://www.google.com/phone/). Each commit is a separate lesson +teaching a single aspect of angular. -The seed app doesn't do much, just shows how to wire two controllers and views together. You can -check it out by opening app/index.html in your browser (might not work file `file://` scheme in -certain browsers, see note below). -_Note: While angular is client-side-only technology and it's possible to create angular webapps that -don't require a backend server at all, we recommend hosting the project files using a local -webserver during development to avoid issues with security restrictions (sandbox) in browsers. The -sandbox implementation varies between browsers, but quite often prevents things like cookies, xhr, -etc to function properly when an html page is opened via `file://` scheme instead of `http://`._ +# Prerequisites +### Git +- A good place to learn about setting up git is [here][git-github] +- Git [home][git-home] (download, documentation) -## How to use angular-seed +### Node.js +- Generic [installation instructions][node-generic]. +- Mac DMG [here][node-mac] +- Windows download from [here][node-windows]. (You will also need + [7 Zip] to unzip the node archive) + (and don't forget to add `node.exe` to your executable path) -Clone the angular-seed repository and start hacking... +### Java +- http://www.java.com +# Workings of the application -### Running the app during development +- The application filesystem layout structure is based on the [angular-seed] project. +- There is no backend (no server) for this application. Instead we fake the XHRs by fetching + static json files. +- Read the Development section at the end to familiarize yourself with running and developing + an angular application. -You can pick one of these options: +# Commits / Tutorial Outline -* serve this repository with your webserver -* install node.js and run `scripts/web-server.js` +You can check out any point of the tutorial using + git checkout step-? -Then navigate your browser to `http://localhost:/app/index.html` to see the app running in -your browser. +To see the changes which between any two lessons use the git diff command. + git diff step-?..step-? +## step-0 -### Running the app in production +- Initial [angular-seed] project layout -This really depends on how complex is your app and the overall infrastructure of your system, but -the general rule is that all you need in production are all the files under the `app/` directory. -Everything else should be omitted. -angular apps are really just a bunch of static html, css and js files that just need to be hosted -somewhere, where they can be accessed by browsers. +## step-1 -If your angular app is talking to the backend server via xhr or other means, you need to figure -out what is the best way to host the static files to comply with the same origin policy if -applicable. Usually this is done by hosting the files by the backend server or through -reverse-proxying the backend server(s) and a webserver(s). +- We have converted the seed application by removing all of the boiler-plate code. +- We have added single static HTML file which shows a static list of phones. (we will convert this + static page into dynamic one with the help of angular) -### Running unit tests +## step-2 -We recommend using [jasmine](http://pivotal.github.com/jasmine/) and -[JsTestDriver](http://code.google.com/p/js-test-driver/) for your unit tests/specs, but you are free -to use whatever works for you. +- Converted static page into dynamic one by: + - create a root controller for the application + - extracting the data from HTML into a the controller as a mock dataset + - convert the static document into a template with the use of `ng:` [directive] (iterate over + mock data using [ng:repeat] and render it into a view) +- Added unit test, which mostly shows how one goes about writing a unit test, rather then test + something of value on our mock dataset. -Requires java and a local or remote browser. -* start `scripts/test-server.sh` -* navigate your browser to `http://localhost:9876/` -* click on one of the capture links (preferably the "strict" one) -* run `scripts/test.sh` +## step-3 +- added a search box to demonstrate how: + - the data-binding works on input fields + - to use [$filter] function + - [ng:repeat] automatically shrinks and grows the number of phones in the view +- added an end-to-end test to: + - show how end-to-end tests are written and used + - to prove that the search box and the repeater are correctly wired together -### Continuous unit testing -Requires ruby and [watchr](https://github.com/mynyml/watchr) gem. +## step-4 + +- replaced the mock data with data loaded from the server (in our case the JSON return is just a + static file) + - The JSON is loaded using the [$xhr] service +- Demonstrate the use of [services][service] and [dependency injection][DI] + - The [$xhr] is injected into the controller through [dependency injection][DI] + + +## step-5 + +- adding phone image and links to phone pages +- css to style the page just a notch + + +## step-6 + +- making the order predicate for catalog dynamic + - adding 'predicates' section to the view with links that control the order + - ordering defaults to 'age' property +- css sugar + + +## step-7 + +- Introduce the [$route] service which allows binding URLs for deep-linking with views + - Replace content of root controller PhonesCtrl with [$route] configuration + - Map `/phones' to PhoneListCtrl and partails/phones-list.html + - Map `/phones/phone-id' to PhoneDetailCtrl and partails/phones-detail.html + - Copy deep linking parameters to root controller `params` property for access in sub controllers + - Replace content of index.html with [ng:view] +- Create PhoneListCtrl view + - Move code which fetches phones data into PhoneListCtrl + - Move existing HTML from index.html to partials/phone-list.html +- Create PhoneDetailsCtrl view + - Wire [$route] service to map `/phanes/phone-id` to map to this controller. + - Empty PhoneDetailsCtrl + - Place holder partials/phane-details.html -* start JSTD server and capture a browser as described above -* start watchr as `watchr scripts/watchr.rb` -* in a different window/tab/editor `tail -f logs/jstd.log` -* edit files in `app/` or `src/` and save them -* watch the log to see updates +## step-8 -There are many other ways to achieve the same effect. Feel free to use them if you prefer them over -watchr. +- Fetch data for and render phone detail view + - [$xhr] to fetch details for a specific phone + - template for the phone detailed view +- CSS to make it look pretty +- Detail data for phones in JSON format +## step-9 -### End to end testing +- replace [$xhr] with [$resource] + - demonstrate how a resource can be created using a [service] -angular ships with a baked-in end-to-end test runner that understands angular, your app and allows -you to write your tests with jasmine-like BDD syntax. +# Development with angular-seed -Requires a webserver, node.js or your backend server that hosts the angular static files. +The following docs apply to all angular-seed projects and since the phonecat tutorial is a project +based on angular-seed, the instructions apply to it as well. -* create your end-to-end tests in `test/e2e/scenarios.js` -* serve your project directory with your http/backend server or node.js + `scripts/web-server.js` -* open `http://localhost:port/test/e2e/runner.html` in your browser +## Running the app during development +1. run `./scripts/web-server.js` +2. navigate your browser to `http://localhost:8000/app/index.html` to see the app running in your + browser. -### Receiving updates from upstream +## Running unit tests -When we upgrade angular-seed's repo with newer angular or testing library code, you can just -fetch the changes and merge them into your project with git. +Requires java. +1. start `./scripts/test-server.sh` +2. navigate your browser to `http://localhost:9876/` +3. click on: capture strict link +4. run `scripts/test.sh` +5. edit files in `app/` or `src/` and save them +6. go to step 4. -## Directory Layout + +## Continuous unit testing + +Requires ruby and [watchr](https://github.com/mynyml/watchr) gem. + +1. start JSTD server and capture a browser as described above +2. start watchr as `watchr scripts/watchr.rb` +3. in a different window/tab/editor `tail -f logs/jstd.log` +4. edit files in `app/` or `src/` and save them +5. watch the log to see updates + + +## End to end testing + +1. open `http://localhost:8000/test/e2e/runner.html` in your browser + + +## Application Directory Layout app/ --> all of the files to be used in production css/ --> css files @@ -114,8 +184,6 @@ fetch the changes and merge them into your project with git. angular-ie-compat.js --> angular patch for IE 6&7 compatibility version.txt --> version number partials/ --> angular view partials (partial html templates) - partial1.html - partial2.html config/jsTestDriver.conf --> config file for JsTestDriver @@ -145,3 +213,21 @@ fetch the changes and merge them into your project with git. ## Contact For more information on angular please check out http://angularjs.org/ + +[7 Zip]: http://www.7-zip.org/ +[angular-seed]: https://github.com/angular/angular-seed +[DI]: http://docs.angularjs.org/#!guide.di +[directive]: http://docs.angularjs.org/#!angular.directive +[$filter]: http://docs.angularjs.org/#!angular.Array.filter +[git-home]: http://git-scm.com +[git-github]: http://help.github.com/set-up-git-redirect +[ng:repeat]: http://docs.angularjs.org/#!angular.widget.@ng:repeat +[ng:view]: http://docs.angularjs.org/#!angular.widget.ng:view +[node-mac]: http://code.google.com/p/rudix/downloads/detail?name=node-0.4.0-0.dmg&can=2&q= +[node-windows]: http://node-js.prcn.co.cc/ +[node-generic]: https://github.com/joyent/node/wiki/Installation +[java]: http://www.java.com +[$resource]: http://docs.angularjs.org/#!angular.service.$resource +[$rouet]: http://docs.angularjs.org/#!angular.service.$route +[service]: http://docs.angularjs.org/#!angular.service +[$xhr]: http://docs.angularjs.org/#!angular.service.$xhr diff --git a/app/css/app.css b/app/css/app.css index c92524070..358b6dc75 100644 --- a/app/css/app.css +++ b/app/css/app.css @@ -1,30 +1,92 @@ /* app css stylesheet */ -.menu { +a { + color: blue; +} + +.predicates { + position: absolute; + width: 9em; + list-style: none; + padding: 0; + margin: 0; +} + +.phones { + margin-left: 11em; + padding: 0; list-style: none; - border-bottom: 0.1em solid black; +} + +.phones .thumb img { + float: left; + margin: -1.5em 1em 1.5em 0em; + padding-bottom: 1em; + height: 100px; + width: 100px; +} + +.phones li { + clear: both; +} + +/** Detail View **/ +img.phone { + float: left; + border: 1px solid black; + margin-right: 3em; margin-bottom: 2em; - padding: 0 0 0.5em; + background-color: white; + padding: 2em; + height: 400px; + width: 400px; } -.menu:before { - content: "["; +ul.phone-thumbs { + margin: 0; + list-style: none; } -.menu:after { - content: "]"; +ul.phone-thumbs li { + border: 1px solid black; + display: inline-block; + margin: 1em; + background-color: white; } -.menu > li { - display: inline; +ul.phone-thumbs img { + height: 100px; + width: 100px; + padding: 1em; } -.menu > li:before { - content: "|"; - padding-right: 0.3em; +ul.phone-thumbs img:hover { + cursor: pointer; } -.menu > li:nth-child(1):before { - content: ""; + +ul.specs { + clear: both; + margin: 0; padding: 0; + list-style: none; +} + +ul.specs > li{ + display: inline-block; + width: 200px; + vertical-align: top; +} + +ul.specs > li > span{ + font-weight: bold; + font-size: 1.2em; +} + +ul.specs dt { + font-weight: bold; +} + +h1 { + border-bottom: 1px solid gray; } diff --git a/app/img/phones/dell-streak-7.0.jpg b/app/img/phones/dell-streak-7.0.jpg new file mode 100644 index 000000000..6ed0eea18 Binary files /dev/null and b/app/img/phones/dell-streak-7.0.jpg differ diff --git a/app/img/phones/dell-streak-7.1.jpg b/app/img/phones/dell-streak-7.1.jpg new file mode 100644 index 000000000..5c14774b8 Binary files /dev/null and b/app/img/phones/dell-streak-7.1.jpg differ diff --git a/app/img/phones/dell-streak-7.2.jpg b/app/img/phones/dell-streak-7.2.jpg new file mode 100644 index 000000000..2a896c579 Binary files /dev/null and b/app/img/phones/dell-streak-7.2.jpg differ diff --git a/app/img/phones/dell-streak-7.3.jpg b/app/img/phones/dell-streak-7.3.jpg new file mode 100644 index 000000000..0f3d6505f Binary files /dev/null and b/app/img/phones/dell-streak-7.3.jpg differ diff --git a/app/img/phones/dell-streak-7.4.jpg b/app/img/phones/dell-streak-7.4.jpg new file mode 100644 index 000000000..c32f57b29 Binary files /dev/null and b/app/img/phones/dell-streak-7.4.jpg differ diff --git a/app/img/phones/dell-venue.0.jpg b/app/img/phones/dell-venue.0.jpg new file mode 100644 index 000000000..c9e2636cb Binary files /dev/null and b/app/img/phones/dell-venue.0.jpg differ diff --git a/app/img/phones/dell-venue.1.jpg b/app/img/phones/dell-venue.1.jpg new file mode 100644 index 000000000..51cd65067 Binary files /dev/null and b/app/img/phones/dell-venue.1.jpg differ diff --git a/app/img/phones/dell-venue.2.jpg b/app/img/phones/dell-venue.2.jpg new file mode 100644 index 000000000..4cd7543d7 Binary files /dev/null and b/app/img/phones/dell-venue.2.jpg differ diff --git a/app/img/phones/dell-venue.3.jpg b/app/img/phones/dell-venue.3.jpg new file mode 100644 index 000000000..4de1dd417 Binary files /dev/null and b/app/img/phones/dell-venue.3.jpg differ diff --git a/app/img/phones/dell-venue.4.jpg b/app/img/phones/dell-venue.4.jpg new file mode 100644 index 000000000..f75499740 Binary files /dev/null and b/app/img/phones/dell-venue.4.jpg differ diff --git a/app/img/phones/dell-venue.5.jpg b/app/img/phones/dell-venue.5.jpg new file mode 100644 index 000000000..cac77540d Binary files /dev/null and b/app/img/phones/dell-venue.5.jpg differ diff --git a/app/img/phones/droid-2-global-by-motorola.0.jpg b/app/img/phones/droid-2-global-by-motorola.0.jpg new file mode 100644 index 000000000..2b286ed7b Binary files /dev/null and b/app/img/phones/droid-2-global-by-motorola.0.jpg differ diff --git a/app/img/phones/droid-2-global-by-motorola.1.jpg b/app/img/phones/droid-2-global-by-motorola.1.jpg new file mode 100644 index 000000000..07aa2c2e6 Binary files /dev/null and b/app/img/phones/droid-2-global-by-motorola.1.jpg differ diff --git a/app/img/phones/droid-2-global-by-motorola.2.jpg b/app/img/phones/droid-2-global-by-motorola.2.jpg new file mode 100644 index 000000000..3ac10a351 Binary files /dev/null and b/app/img/phones/droid-2-global-by-motorola.2.jpg differ diff --git a/app/img/phones/droid-pro-by-motorola.0.jpg b/app/img/phones/droid-pro-by-motorola.0.jpg new file mode 100644 index 000000000..7e132696f Binary files /dev/null and b/app/img/phones/droid-pro-by-motorola.0.jpg differ diff --git a/app/img/phones/droid-pro-by-motorola.1.jpg b/app/img/phones/droid-pro-by-motorola.1.jpg new file mode 100644 index 000000000..ed50c5eaf Binary files /dev/null and b/app/img/phones/droid-pro-by-motorola.1.jpg differ diff --git a/app/img/phones/lg-axis.0.jpg b/app/img/phones/lg-axis.0.jpg new file mode 100644 index 000000000..fa4ec1183 Binary files /dev/null and b/app/img/phones/lg-axis.0.jpg differ diff --git a/app/img/phones/lg-axis.1.jpg b/app/img/phones/lg-axis.1.jpg new file mode 100644 index 000000000..00640be94 Binary files /dev/null and b/app/img/phones/lg-axis.1.jpg differ diff --git a/app/img/phones/lg-axis.2.jpg b/app/img/phones/lg-axis.2.jpg new file mode 100644 index 000000000..88447acbc Binary files /dev/null and b/app/img/phones/lg-axis.2.jpg differ diff --git a/app/img/phones/motorola-atrix-4g.0.jpg b/app/img/phones/motorola-atrix-4g.0.jpg new file mode 100644 index 000000000..e05531434 Binary files /dev/null and b/app/img/phones/motorola-atrix-4g.0.jpg differ diff --git a/app/img/phones/motorola-atrix-4g.1.jpg b/app/img/phones/motorola-atrix-4g.1.jpg new file mode 100644 index 000000000..df83f1c6a Binary files /dev/null and b/app/img/phones/motorola-atrix-4g.1.jpg differ diff --git a/app/img/phones/motorola-atrix-4g.2.jpg b/app/img/phones/motorola-atrix-4g.2.jpg new file mode 100644 index 000000000..0aadff3e4 Binary files /dev/null and b/app/img/phones/motorola-atrix-4g.2.jpg differ diff --git a/app/img/phones/motorola-atrix-4g.3.jpg b/app/img/phones/motorola-atrix-4g.3.jpg new file mode 100644 index 000000000..131593375 Binary files /dev/null and b/app/img/phones/motorola-atrix-4g.3.jpg differ diff --git a/app/img/phones/motorola-bravo-with-motoblur.0.jpg b/app/img/phones/motorola-bravo-with-motoblur.0.jpg new file mode 100644 index 000000000..0d8028233 Binary files /dev/null and b/app/img/phones/motorola-bravo-with-motoblur.0.jpg differ diff --git a/app/img/phones/motorola-bravo-with-motoblur.1.jpg b/app/img/phones/motorola-bravo-with-motoblur.1.jpg new file mode 100644 index 000000000..1173844db Binary files /dev/null and b/app/img/phones/motorola-bravo-with-motoblur.1.jpg differ diff --git a/app/img/phones/motorola-bravo-with-motoblur.2.jpg b/app/img/phones/motorola-bravo-with-motoblur.2.jpg new file mode 100644 index 000000000..7958d5b23 Binary files /dev/null and b/app/img/phones/motorola-bravo-with-motoblur.2.jpg differ diff --git a/app/img/phones/motorola-charm-with-motoblur.0.jpg b/app/img/phones/motorola-charm-with-motoblur.0.jpg new file mode 100644 index 000000000..21153dab1 Binary files /dev/null and b/app/img/phones/motorola-charm-with-motoblur.0.jpg differ diff --git a/app/img/phones/motorola-charm-with-motoblur.1.jpg b/app/img/phones/motorola-charm-with-motoblur.1.jpg new file mode 100644 index 000000000..0b64e59ab Binary files /dev/null and b/app/img/phones/motorola-charm-with-motoblur.1.jpg differ diff --git a/app/img/phones/motorola-charm-with-motoblur.2.jpg b/app/img/phones/motorola-charm-with-motoblur.2.jpg new file mode 100644 index 000000000..1fe79930e Binary files /dev/null and b/app/img/phones/motorola-charm-with-motoblur.2.jpg differ diff --git a/app/img/phones/motorola-defy-with-motoblur.0.jpg b/app/img/phones/motorola-defy-with-motoblur.0.jpg new file mode 100644 index 000000000..9453993b4 Binary files /dev/null and b/app/img/phones/motorola-defy-with-motoblur.0.jpg differ diff --git a/app/img/phones/motorola-defy-with-motoblur.1.jpg b/app/img/phones/motorola-defy-with-motoblur.1.jpg new file mode 100644 index 000000000..3eb190be7 Binary files /dev/null and b/app/img/phones/motorola-defy-with-motoblur.1.jpg differ diff --git a/app/img/phones/motorola-defy-with-motoblur.2.jpg b/app/img/phones/motorola-defy-with-motoblur.2.jpg new file mode 100644 index 000000000..30339208b Binary files /dev/null and b/app/img/phones/motorola-defy-with-motoblur.2.jpg differ diff --git a/app/img/phones/motorola-xoom-with-wi-fi.0.jpg b/app/img/phones/motorola-xoom-with-wi-fi.0.jpg new file mode 100644 index 000000000..5f78a0e88 Binary files /dev/null and b/app/img/phones/motorola-xoom-with-wi-fi.0.jpg differ diff --git a/app/img/phones/motorola-xoom-with-wi-fi.1.jpg b/app/img/phones/motorola-xoom-with-wi-fi.1.jpg new file mode 100644 index 000000000..e530574b9 Binary files /dev/null and b/app/img/phones/motorola-xoom-with-wi-fi.1.jpg differ diff --git a/app/img/phones/motorola-xoom-with-wi-fi.2.jpg b/app/img/phones/motorola-xoom-with-wi-fi.2.jpg new file mode 100644 index 000000000..e7a7825af Binary files /dev/null and b/app/img/phones/motorola-xoom-with-wi-fi.2.jpg differ diff --git a/app/img/phones/motorola-xoom-with-wi-fi.3.jpg b/app/img/phones/motorola-xoom-with-wi-fi.3.jpg new file mode 100644 index 000000000..7f408f00f Binary files /dev/null and b/app/img/phones/motorola-xoom-with-wi-fi.3.jpg differ diff --git a/app/img/phones/motorola-xoom-with-wi-fi.4.jpg b/app/img/phones/motorola-xoom-with-wi-fi.4.jpg new file mode 100644 index 000000000..71d8f0c58 Binary files /dev/null and b/app/img/phones/motorola-xoom-with-wi-fi.4.jpg differ diff --git a/app/img/phones/motorola-xoom-with-wi-fi.5.jpg b/app/img/phones/motorola-xoom-with-wi-fi.5.jpg new file mode 100644 index 000000000..ba44b3171 Binary files /dev/null and b/app/img/phones/motorola-xoom-with-wi-fi.5.jpg differ diff --git a/app/img/phones/motorola-xoom.0.jpg b/app/img/phones/motorola-xoom.0.jpg new file mode 100644 index 000000000..8f895552b Binary files /dev/null and b/app/img/phones/motorola-xoom.0.jpg differ diff --git a/app/img/phones/motorola-xoom.1.jpg b/app/img/phones/motorola-xoom.1.jpg new file mode 100644 index 000000000..cdca56de0 Binary files /dev/null and b/app/img/phones/motorola-xoom.1.jpg differ diff --git a/app/img/phones/motorola-xoom.2.jpg b/app/img/phones/motorola-xoom.2.jpg new file mode 100644 index 000000000..aa138d8e5 Binary files /dev/null and b/app/img/phones/motorola-xoom.2.jpg differ diff --git a/app/img/phones/nexus-s.0.jpg b/app/img/phones/nexus-s.0.jpg new file mode 100644 index 000000000..0c4b73ff0 Binary files /dev/null and b/app/img/phones/nexus-s.0.jpg differ diff --git a/app/img/phones/nexus-s.1.jpg b/app/img/phones/nexus-s.1.jpg new file mode 100644 index 000000000..7bfc751df Binary files /dev/null and b/app/img/phones/nexus-s.1.jpg differ diff --git a/app/img/phones/nexus-s.2.jpg b/app/img/phones/nexus-s.2.jpg new file mode 100644 index 000000000..84e392e99 Binary files /dev/null and b/app/img/phones/nexus-s.2.jpg differ diff --git a/app/img/phones/nexus-s.3.jpg b/app/img/phones/nexus-s.3.jpg new file mode 100644 index 000000000..872e4d8b9 Binary files /dev/null and b/app/img/phones/nexus-s.3.jpg differ diff --git a/app/img/phones/samsung-galaxy-tab.0.jpg b/app/img/phones/samsung-galaxy-tab.0.jpg new file mode 100644 index 000000000..80c403742 Binary files /dev/null and b/app/img/phones/samsung-galaxy-tab.0.jpg differ diff --git a/app/img/phones/samsung-galaxy-tab.1.jpg b/app/img/phones/samsung-galaxy-tab.1.jpg new file mode 100644 index 000000000..ea451fff4 Binary files /dev/null and b/app/img/phones/samsung-galaxy-tab.1.jpg differ diff --git a/app/img/phones/samsung-galaxy-tab.2.jpg b/app/img/phones/samsung-galaxy-tab.2.jpg new file mode 100644 index 000000000..e7f440509 Binary files /dev/null and b/app/img/phones/samsung-galaxy-tab.2.jpg differ diff --git a/app/img/phones/samsung-galaxy-tab.3.jpg b/app/img/phones/samsung-galaxy-tab.3.jpg new file mode 100644 index 000000000..9b06ef3cd Binary files /dev/null and b/app/img/phones/samsung-galaxy-tab.3.jpg differ diff --git a/app/img/phones/samsung-galaxy-tab.4.jpg b/app/img/phones/samsung-galaxy-tab.4.jpg new file mode 100644 index 000000000..e043d33f3 Binary files /dev/null and b/app/img/phones/samsung-galaxy-tab.4.jpg differ diff --git a/app/img/phones/samsung-galaxy-tab.5.jpg b/app/img/phones/samsung-galaxy-tab.5.jpg new file mode 100644 index 000000000..1f054b6d4 Binary files /dev/null and b/app/img/phones/samsung-galaxy-tab.5.jpg differ diff --git a/app/img/phones/samsung-galaxy-tab.6.jpg b/app/img/phones/samsung-galaxy-tab.6.jpg new file mode 100644 index 000000000..87d3ba80d Binary files /dev/null and b/app/img/phones/samsung-galaxy-tab.6.jpg differ diff --git a/app/img/phones/samsung-gem.0.jpg b/app/img/phones/samsung-gem.0.jpg new file mode 100644 index 000000000..3ca91415e Binary files /dev/null and b/app/img/phones/samsung-gem.0.jpg differ diff --git a/app/img/phones/samsung-gem.1.jpg b/app/img/phones/samsung-gem.1.jpg new file mode 100644 index 000000000..addd1bf2b Binary files /dev/null and b/app/img/phones/samsung-gem.1.jpg differ diff --git a/app/img/phones/samsung-gem.2.jpg b/app/img/phones/samsung-gem.2.jpg new file mode 100644 index 000000000..3d2e9b09e Binary files /dev/null and b/app/img/phones/samsung-gem.2.jpg differ diff --git a/app/img/phones/samsung-mesmerize-a-galaxy-s-phone.0.jpg b/app/img/phones/samsung-mesmerize-a-galaxy-s-phone.0.jpg new file mode 100644 index 000000000..f111c6b75 Binary files /dev/null and b/app/img/phones/samsung-mesmerize-a-galaxy-s-phone.0.jpg differ diff --git a/app/img/phones/samsung-mesmerize-a-galaxy-s-phone.1.jpg b/app/img/phones/samsung-mesmerize-a-galaxy-s-phone.1.jpg new file mode 100644 index 000000000..8a66c7037 Binary files /dev/null and b/app/img/phones/samsung-mesmerize-a-galaxy-s-phone.1.jpg differ diff --git a/app/img/phones/samsung-mesmerize-a-galaxy-s-phone.2.jpg b/app/img/phones/samsung-mesmerize-a-galaxy-s-phone.2.jpg new file mode 100644 index 000000000..d7f4aa7c4 Binary files /dev/null and b/app/img/phones/samsung-mesmerize-a-galaxy-s-phone.2.jpg differ diff --git a/app/img/phones/samsung-mesmerize-a-galaxy-s-phone.3.jpg b/app/img/phones/samsung-mesmerize-a-galaxy-s-phone.3.jpg new file mode 100644 index 000000000..b584bfb83 Binary files /dev/null and b/app/img/phones/samsung-mesmerize-a-galaxy-s-phone.3.jpg differ diff --git a/app/img/phones/samsung-showcase-a-galaxy-s-phone.0.jpg b/app/img/phones/samsung-showcase-a-galaxy-s-phone.0.jpg new file mode 100644 index 000000000..f111c6b75 Binary files /dev/null and b/app/img/phones/samsung-showcase-a-galaxy-s-phone.0.jpg differ diff --git a/app/img/phones/samsung-showcase-a-galaxy-s-phone.1.jpg b/app/img/phones/samsung-showcase-a-galaxy-s-phone.1.jpg new file mode 100644 index 000000000..8a66c7037 Binary files /dev/null and b/app/img/phones/samsung-showcase-a-galaxy-s-phone.1.jpg differ diff --git a/app/img/phones/samsung-showcase-a-galaxy-s-phone.2.jpg b/app/img/phones/samsung-showcase-a-galaxy-s-phone.2.jpg new file mode 100644 index 000000000..d7f4aa7c4 Binary files /dev/null and b/app/img/phones/samsung-showcase-a-galaxy-s-phone.2.jpg differ diff --git a/app/img/phones/samsung-transform.0.jpg b/app/img/phones/samsung-transform.0.jpg new file mode 100644 index 000000000..8d1aa87b6 Binary files /dev/null and b/app/img/phones/samsung-transform.0.jpg differ diff --git a/app/img/phones/samsung-transform.1.jpg b/app/img/phones/samsung-transform.1.jpg new file mode 100644 index 000000000..6287e2539 Binary files /dev/null and b/app/img/phones/samsung-transform.1.jpg differ diff --git a/app/img/phones/samsung-transform.2.jpg b/app/img/phones/samsung-transform.2.jpg new file mode 100644 index 000000000..9daaadab3 Binary files /dev/null and b/app/img/phones/samsung-transform.2.jpg differ diff --git a/app/img/phones/samsung-transform.3.jpg b/app/img/phones/samsung-transform.3.jpg new file mode 100644 index 000000000..b0607bef9 Binary files /dev/null and b/app/img/phones/samsung-transform.3.jpg differ diff --git a/app/img/phones/samsung-transform.4.jpg b/app/img/phones/samsung-transform.4.jpg new file mode 100644 index 000000000..11584d5db Binary files /dev/null and b/app/img/phones/samsung-transform.4.jpg differ diff --git a/app/img/phones/sanyo-zio.0.jpg b/app/img/phones/sanyo-zio.0.jpg new file mode 100644 index 000000000..08aafe1a4 Binary files /dev/null and b/app/img/phones/sanyo-zio.0.jpg differ diff --git a/app/img/phones/sanyo-zio.1.jpg b/app/img/phones/sanyo-zio.1.jpg new file mode 100644 index 000000000..f4aa3c28e Binary files /dev/null and b/app/img/phones/sanyo-zio.1.jpg differ diff --git a/app/img/phones/sanyo-zio.2.jpg b/app/img/phones/sanyo-zio.2.jpg new file mode 100644 index 000000000..b7caf629b Binary files /dev/null and b/app/img/phones/sanyo-zio.2.jpg differ diff --git a/app/img/phones/t-mobile-g2.0.jpg b/app/img/phones/t-mobile-g2.0.jpg new file mode 100644 index 000000000..8b30b4a04 Binary files /dev/null and b/app/img/phones/t-mobile-g2.0.jpg differ diff --git a/app/img/phones/t-mobile-g2.1.jpg b/app/img/phones/t-mobile-g2.1.jpg new file mode 100644 index 000000000..61a3eaa65 Binary files /dev/null and b/app/img/phones/t-mobile-g2.1.jpg differ diff --git a/app/img/phones/t-mobile-g2.2.jpg b/app/img/phones/t-mobile-g2.2.jpg new file mode 100644 index 000000000..7ad28f57b Binary files /dev/null and b/app/img/phones/t-mobile-g2.2.jpg differ diff --git a/app/img/phones/t-mobile-mytouch-4g.0.jpg b/app/img/phones/t-mobile-mytouch-4g.0.jpg new file mode 100644 index 000000000..671dbb032 Binary files /dev/null and b/app/img/phones/t-mobile-mytouch-4g.0.jpg differ diff --git a/app/img/phones/t-mobile-mytouch-4g.1.jpg b/app/img/phones/t-mobile-mytouch-4g.1.jpg new file mode 100644 index 000000000..1f2a0c8d8 Binary files /dev/null and b/app/img/phones/t-mobile-mytouch-4g.1.jpg differ diff --git a/app/img/phones/t-mobile-mytouch-4g.2.jpg b/app/img/phones/t-mobile-mytouch-4g.2.jpg new file mode 100644 index 000000000..f027d21e2 Binary files /dev/null and b/app/img/phones/t-mobile-mytouch-4g.2.jpg differ diff --git a/app/img/phones/t-mobile-mytouch-4g.3.jpg b/app/img/phones/t-mobile-mytouch-4g.3.jpg new file mode 100644 index 000000000..161a340a3 Binary files /dev/null and b/app/img/phones/t-mobile-mytouch-4g.3.jpg differ diff --git a/app/img/phones/t-mobile-mytouch-4g.4.jpg b/app/img/phones/t-mobile-mytouch-4g.4.jpg new file mode 100644 index 000000000..f6ec2ed57 Binary files /dev/null and b/app/img/phones/t-mobile-mytouch-4g.4.jpg differ diff --git a/app/img/phones/t-mobile-mytouch-4g.5.jpg b/app/img/phones/t-mobile-mytouch-4g.5.jpg new file mode 100644 index 000000000..671dbb032 Binary files /dev/null and b/app/img/phones/t-mobile-mytouch-4g.5.jpg differ diff --git a/app/index.html b/app/index.html index e62bac8f9..b5dca86b0 100644 --- a/app/index.html +++ b/app/index.html @@ -2,21 +2,16 @@ - my angular app + Google Phone Gallery - - + - - + diff --git a/app/js/controllers.js b/app/js/controllers.js index e7bb8ea51..f135775fc 100644 --- a/app/js/controllers.js +++ b/app/js/controllers.js @@ -1,10 +1,42 @@ /* App Controllers */ +function PhoneCatCtrl($route) { + var self = this; -function MyCtrl1() {} -MyCtrl1.$inject = []; + $route.when('/phones', + {template: 'partials/phone-list.html', controller: PhoneListCtrl}); + $route.when('/phones/:phoneId', + {template: 'partials/phone-detail.html', controller: PhoneDetailCtrl}); + $route.otherwise({redirectTo: '/phones'}); + $route.onChange(function(){ + self.params = $route.current.params; + }); -function MyCtrl2() { + $route.parent(this); } -MyCtrl2.$inject = []; + +//PhoneCatCtrl.$inject = ['$route']; + + +function PhoneListCtrl(Phone_) { + this.orderProp = 'age'; + this.phones = Phone_.query(); +} + +//PhoneListCtrl.$inject = ['Phone']; + + +function PhoneDetailCtrl(Phone_) { + var self = this; + + self.phone = Phone_.get({phoneId: self.params.phoneId}, function(phone) { + self.mainImageUrl = phone.images[0]; + }); + + self.setImage = function(imageUrl) { + self.mainImageUrl = imageUrl; + } +} + +//PhoneDetailCtrl.$inject = ['Phone']; diff --git a/app/js/filters.js b/app/js/filters.js index 25be4a483..527e5b110 100644 --- a/app/js/filters.js +++ b/app/js/filters.js @@ -1 +1,5 @@ /* http://docs.angularjs.org/#!angular.filter */ + +angular.filter('checkmark', function(input) { + return input ? '\u2713' : '\u2718'; +}); diff --git a/app/js/services.js b/app/js/services.js index 92b2b4ced..a8116cdfd 100644 --- a/app/js/services.js +++ b/app/js/services.js @@ -1,23 +1,7 @@ /* http://docs.angularjs.org/#!angular.service */ -/** - * App service which is responsible for the main configuration of the app. - */ -angular.service('myAngularApp', function($route, $location, $window) { - - $route.when('/view1', {template: 'partials/partial1.html', controller: MyCtrl1}); - $route.when('/view2', {template: 'partials/partial2.html', controller: MyCtrl2}); - - var self = this; - - $route.onChange(function() { - if ($location.hash === '') { - $location.updateHash('/view1'); - self.$eval(); - } else { - $route.current.scope.params = $route.current.params; - $window.scrollTo(0,0); - } +angular.service('Phone', function($resource){ + return $resource('phones/:phoneId.json', {}, { + query: {method:'GET', params:{phoneId:'phones'}, isArray:true} }); - -}, {$inject:['$route', '$location', '$window'], $eager: true}); +}); diff --git a/app/partials/partial1.html b/app/partials/partial1.html deleted file mode 100644 index 89459a65c..000000000 --- a/app/partials/partial1.html +++ /dev/null @@ -1 +0,0 @@ -

This is the partial for view 1.

diff --git a/app/partials/partial2.html b/app/partials/partial2.html deleted file mode 100644 index 15e45ae58..000000000 --- a/app/partials/partial2.html +++ /dev/null @@ -1 +0,0 @@ -

This is the partial for view 2.

diff --git a/app/partials/phone-detail.html b/app/partials/phone-detail.html new file mode 100644 index 000000000..757e76148 --- /dev/null +++ b/app/partials/phone-detail.html @@ -0,0 +1,113 @@ + + +

{{phone.name}}

+ +

{{phone.description}}

+ + + + diff --git a/app/partials/phone-list.html b/app/partials/phone-list.html new file mode 100644 index 000000000..aa1523224 --- /dev/null +++ b/app/partials/phone-list.html @@ -0,0 +1,21 @@ + + + + \ No newline at end of file diff --git a/app/phones/dell-streak-7.json b/app/phones/dell-streak-7.json new file mode 100644 index 000000000..a32eb6ff9 --- /dev/null +++ b/app/phones/dell-streak-7.json @@ -0,0 +1,64 @@ +{ + "additionalFeatures": "Front Facing 1.3MP Camera", + "android": { + "os": "Android 2.2", + "ui": "Dell Stage" + }, + "availability": [ + "T-Mobile" + ], + "battery": { + "standbyTime": "", + "talkTime": "", + "type": "Lithium Ion (Li-Ion) (2780 mAH)" + }, + "camera": { + "features": [ + "Flash", + "Video" + ], + "primary": "5.0 megapixels" + }, + "connectivity": { + "bluetooth": "Bluetooth 2.1", + "cell": "T-mobile HSPA+ @ 2100/1900/AWS/850 MHz", + "gps": true, + "infrared": false, + "wifi": "802.11 b/g" + }, + "description": "Introducing Dell\u2122 Streak 7. Share photos, videos and movies together. It\u2019s small enough to carry around, big enough to gather around. Android\u2122 2.2-based tablet with over-the-air upgrade capability for future OS releases. A vibrant 7-inch, multitouch display with full Adobe\u00ae Flash 10.1 pre-installed. Includes a 1.3 MP front-facing camera for face-to-face chats on popular services such as Qik or Skype. 16 GB of internal storage, plus Wi-Fi, Bluetooth and built-in GPS keeps you in touch with the world around you. Connect on your terms. Save with 2-year contract or flexibility with prepaid pay-as-you-go plans", + "display": { + "screenResolution": "WVGA (800 x 480)", + "screenSize": "7.0 inches", + "touchScreen": true + }, + "hardware": { + "accelerometer": true, + "audioJack": "3.5mm", + "cpu": "nVidia Tegra T20", + "fmRadio": false, + "physicalKeyboard": false, + "usb": "USB 2.0" + }, + "id": "dell-streak-7", + "images": [ + "img/phones/dell-streak-7.0.jpg", + "img/phones/dell-streak-7.1.jpg", + "img/phones/dell-streak-7.2.jpg", + "img/phones/dell-streak-7.3.jpg", + "img/phones/dell-streak-7.4.jpg" + ], + "name": "Dell Streak 7", + "sizeAndWeight": { + "dimensions": [ + "199.9 mm (w)", + "119.8 mm (h)", + "12.4 mm (d)" + ], + "weight": "450.0 grams" + }, + "storage": { + "flash": "16000MB", + "ram": "512MB" + } +} diff --git a/app/phones/dell-venue.json b/app/phones/dell-venue.json new file mode 100644 index 000000000..72a15b613 --- /dev/null +++ b/app/phones/dell-venue.json @@ -0,0 +1,67 @@ +{ + "additionalFeatures": "Gorilla Glass display, Dedicated Camera Key, Ring Silence Switch, Swype keyboard.", + "android": { + "os": "Android 2.2", + "ui": "Dell Stage" + }, + "availability": [ + "AT&T,", + "KT,", + "T-Mobile" + ], + "battery": { + "standbyTime": "400 hours", + "talkTime": "7 hours", + "type": "Lithium Ion (Li-Ion) (1400 mAH)" + }, + "camera": { + "features": [ + "Flash", + "Video" + ], + "primary": "8.0 megapixels" + }, + "connectivity": { + "bluetooth": "Bluetooth 2.1", + "cell": "850/1900/2100 3G; 850/900/1800/1900 GSM/GPRS/EDGE\n900/1700/2100 3G; 850/900/1800/1900 GSM/GPRS/EDGE", + "gps": true, + "infrared": false, + "wifi": "802.11 b/g/n" + }, + "description": "The Venue is the perfect one-touch, Smart Phone providing instant access to everything you love. All of Venue's features make it perfect for on-the-go students, mobile professionals, and active social communicators who love style and performance.\n\nElegantly designed, the Venue offers a vibrant, curved glass display that\u2019s perfect for viewing all types of content. The Venue\u2019s slender form factor feels great in your hand and also slips easily into your pocket. A mobile entertainment powerhouse that lets you download the latest tunes from Amazon MP3 or books from Kindle, watch video, or stream your favorite radio stations. All on the go, anytime, anywhere.", + "display": { + "screenResolution": "WVGA (800 x 480)", + "screenSize": "4.1 inches", + "touchScreen": true + }, + "hardware": { + "accelerometer": true, + "audioJack": "3.5mm", + "cpu": "1 Ghz processor", + "fmRadio": false, + "physicalKeyboard": false, + "usb": "USB 2.0" + }, + "id": "dell-venue", + "images": [ + "img/phones/dell-venue.0.jpg", + "img/phones/dell-venue.1.jpg", + "img/phones/dell-venue.2.jpg", + "img/phones/dell-venue.3.jpg", + "img/phones/dell-venue.4.jpg", + "img/phones/dell-venue.5.jpg" + ], + "name": "Dell Venue", + "sizeAndWeight": { + "dimensions": [ + "64.0 mm (w)", + "121.0 mm (h)", + "12.9 mm (d)" + ], + "weight": "164.0 grams" + }, + "storage": { + "flash": "1000MB", + "ram": "512MB" + } +} diff --git a/app/phones/droid-2-global-by-motorola.json b/app/phones/droid-2-global-by-motorola.json new file mode 100644 index 000000000..59d4fd08d --- /dev/null +++ b/app/phones/droid-2-global-by-motorola.json @@ -0,0 +1,62 @@ +{ + "additionalFeatures": "Adobe Flash Player 10, Quadband GSM Worldphone, Advance Business Security, Complex Password Secure, Review & Edit Documents with Quick Office, Personal 3G Mobile Hotspot for up to 5 WiFi enabled Devices, Advanced Social Networking brings all social content into a single homescreen widget", + "android": { + "os": "Android 2.2", + "ui": "" + }, + "availability": [ + "Verizon" + ], + "battery": { + "standbyTime": "230 hours", + "talkTime": "8 hours", + "type": "Lithium Ion (Li-Ion) (1400 mAH)" + }, + "camera": { + "features": [ + "Flash", + "Video" + ], + "primary": "5.0 megapixels" + }, + "connectivity": { + "bluetooth": "Bluetooth 2.1", + "cell": "WCDMA 850/1900/2100, CDMA 800/1900, GSM 850/900/1800/1900, HSDPA 10.2 Mbps (Category 9/10), CDMA EV-DO Release A, EDGE Class 12, GPRS Class 12, HSUPA 1.8 Mbps", + "gps": true, + "infrared": false, + "wifi": "802.11 b/g/n" + }, + "description": "With Quad Band GSM, the DROID 2 Global can send email and make and receive calls from more than 200 countries. It features an improved QWERTY keyboard, super-fast 1.2 GHz processor and enhanced security for all your business needs.", + "display": { + "screenResolution": "FWVGA (854 x 480)", + "screenSize": "3.7 inches", + "touchScreen": true + }, + "hardware": { + "accelerometer": true, + "audioJack": "3.5mm", + "cpu": "1.2 GHz TI OMAP", + "fmRadio": false, + "physicalKeyboard": true, + "usb": "USB 2.0" + }, + "id": "droid-2-global-by-motorola", + "images": [ + "img/phones/droid-2-global-by-motorola.0.jpg", + "img/phones/droid-2-global-by-motorola.1.jpg", + "img/phones/droid-2-global-by-motorola.2.jpg" + ], + "name": "DROID\u2122 2 Global by Motorola", + "sizeAndWeight": { + "dimensions": [ + "60.5 mm (w)", + "116.3 mm (h)", + "13.7 mm (d)" + ], + "weight": "169.0 grams" + }, + "storage": { + "flash": "8192MB", + "ram": "512MB" + } +} diff --git a/app/phones/droid-pro-by-motorola.json b/app/phones/droid-pro-by-motorola.json new file mode 100644 index 000000000..3e21e9a53 --- /dev/null +++ b/app/phones/droid-pro-by-motorola.json @@ -0,0 +1,61 @@ +{ + "additionalFeatures": "Adobe Flash Player 10, Quadband GSM Worldphone, Advance Business Security, Complex Password Secure, Review & Edit Documents with Quick Office, Personal 3G Mobile Hotspot for up to 5 WiFi enabled Devices, Advanced Social Networking brings all social content into a single homescreen widget", + "android": { + "os": "Android 2.2", + "ui": "" + }, + "availability": [ + "Verizon" + ], + "battery": { + "standbyTime": "330 hours", + "talkTime": "7 hours", + "type": "Lithium Ion (Li-Ion) (1400 mAH)" + }, + "camera": { + "features": [ + "Flash", + "Video" + ], + "primary": "5.0 megapixels" + }, + "connectivity": { + "bluetooth": "Bluetooth 2.1", + "cell": "800/1900 CDMA EVDO Rev. A with dual diversity antenna, 850/900/1800/1900MHz GSM, GPRS Class 12, EDGE Class 12, 850/1900/2100 WCDMA (category 9/10), HSDPA 10.2mbps, HSUPA 1.8 mbps", + "gps": true, + "infrared": false, + "wifi": "802.11 b/g/n" + }, + "description": "Access your work directory, email or calendar with DROID Pro by Motorola., an Android-for-business smartphone with corporate-level security. It features both a QWERTY keyboard and touchscreen, a speedy 1 GHz processor and Adobe\u00ae Flash\u00ae Player 10.", + "display": { + "screenResolution": "HVGA (480 x 320)", + "screenSize": "3.1 inches", + "touchScreen": true + }, + "hardware": { + "accelerometer": true, + "audioJack": "3.5mm", + "cpu": "1 GHz TI OMAP", + "fmRadio": false, + "physicalKeyboard": true, + "usb": "USB 2.0" + }, + "id": "droid-pro-by-motorola", + "images": [ + "img/phones/droid-pro-by-motorola.0.jpg", + "img/phones/droid-pro-by-motorola.1.jpg" + ], + "name": "DROID\u2122 Pro by Motorola", + "sizeAndWeight": { + "dimensions": [ + "61.0 mm (w)", + "119.0 mm (h)", + "11.7 mm (d)" + ], + "weight": "134.0 grams" + }, + "storage": { + "flash": "2048MB", + "ram": "512MB" + } +} diff --git a/app/phones/lg-axis.json b/app/phones/lg-axis.json new file mode 100644 index 000000000..ff8fdef2d --- /dev/null +++ b/app/phones/lg-axis.json @@ -0,0 +1,62 @@ +{ + "additionalFeatures": "Accessibility features: Tactile QWERTY keyboard, four-direction keypad, start and end call buttons, dedicated number keys, camera button, TalkBack screen reader", + "android": { + "os": "Android 2.1", + "ui": "LG Home" + }, + "availability": [ + "Cellular South" + ], + "battery": { + "standbyTime": "500 hours", + "talkTime": "8 hours", + "type": "Lithium Ion (Li-Ion) (1500 mAH)" + }, + "camera": { + "features": [ + "Flash", + "Video" + ], + "primary": "3.0 megapixels" + }, + "connectivity": { + "bluetooth": "Bluetooth 2.1", + "cell": "1.9 GHz CDMA PCS, 800 MHz CDMA, EVDO Rev. A, 1xRTT", + "gps": true, + "infrared": false, + "wifi": "802.11 b/g" + }, + "description": "Android plus QWERTY is a powerful duo. LG Axis melds a speedy UI with the limitless micro-entertainment of 80,000+ apps including voice-activated Google. Feel the tactile vibration on its tempered glass touchscreen. Take the fuzziness out of your fun with a 3.2MP camera that does 360\u00b0 panoramics. And customize your home screens with shortcuts to your apps, favorites, and widgets. It's the centerpiece of your life.", + "display": { + "screenResolution": "WVGA (800 x 480)", + "screenSize": "3.2 inches", + "touchScreen": true + }, + "hardware": { + "accelerometer": true, + "audioJack": "", + "cpu": "600 MHz Qualcomm MSM7627", + "fmRadio": false, + "physicalKeyboard": true, + "usb": "USB 2.0" + }, + "id": "lg-axis", + "images": [ + "img/phones/lg-axis.0.jpg", + "img/phones/lg-axis.1.jpg", + "img/phones/lg-axis.2.jpg" + ], + "name": "LG Axis", + "sizeAndWeight": { + "dimensions": [ + "56.0 mm (w)", + "116.0 mm (h)", + "16.0 mm (d)" + ], + "weight": "158.0 grams" + }, + "storage": { + "flash": "126MB", + "ram": "256MB" + } +} diff --git a/app/phones/motorola-atrix-4g.json b/app/phones/motorola-atrix-4g.json new file mode 100644 index 000000000..803794b04 --- /dev/null +++ b/app/phones/motorola-atrix-4g.json @@ -0,0 +1,62 @@ +{ + "additionalFeatures": "", + "android": { + "os": "Android 2.2", + "ui": "MOTOBLUR" + }, + "availability": [ + "AT&T" + ], + "battery": { + "standbyTime": "400 hours", + "talkTime": "5 hours", + "type": "Lithium Ion (Li-Ion) (1930 mAH)" + }, + "camera": { + "features": [ + "" + ], + "primary": "" + }, + "connectivity": { + "bluetooth": "Bluetooth 2.1", + "cell": "WCDMA 850/1900/2100, GSM 850/900/1800/1900, HSDPA 14Mbps (Category 10) Edge Class 12, GPRS Class 12, eCompass, AGPS", + "gps": true, + "infrared": false, + "wifi": "802.11 a/b/g/n" + }, + "description": "MOTOROLA ATRIX 4G gives you dual-core processing power and the revolutionary webtop application. With webtop and a compatible Motorola docking station, sold separately, you can surf the Internet with a full Firefox browser, create and edit docs, or access multimedia on a large screen almost anywhere.", + "display": { + "screenResolution": "QHD (960 x 540)", + "screenSize": "4.0 inches", + "touchScreen": true + }, + "hardware": { + "accelerometer": true, + "audioJack": "3.5mm", + "cpu": "1 GHz Dual Core", + "fmRadio": false, + "physicalKeyboard": false, + "usb": "USB 2.0" + }, + "id": "motorola-atrix-4g", + "images": [ + "img/phones/motorola-atrix-4g.0.jpg", + "img/phones/motorola-atrix-4g.1.jpg", + "img/phones/motorola-atrix-4g.2.jpg", + "img/phones/motorola-atrix-4g.3.jpg" + ], + "name": "MOTOROLA ATRIX\u2122 4G", + "sizeAndWeight": { + "dimensions": [ + "63.5 mm (w)", + "117.75 mm (h)", + "10.95 mm (d)" + ], + "weight": "135.0 grams" + }, + "storage": { + "flash": "", + "ram": "" + } +} diff --git a/app/phones/motorola-bravo-with-motoblur.json b/app/phones/motorola-bravo-with-motoblur.json new file mode 100644 index 000000000..17e5f975c --- /dev/null +++ b/app/phones/motorola-bravo-with-motoblur.json @@ -0,0 +1,61 @@ +{ + "additionalFeatures": "Adobe\u00ae Flash\u00ae Lite\u00ae 3, DNLA, CrystalTalk\u2122 PLUS technology", + "android": { + "os": "Android 2.1", + "ui": "MOTOBLUR\u2122" + }, + "availability": [ + "AT&T" + ], + "battery": { + "standbyTime": "216 hours", + "talkTime": "6 hours", + "type": "Lithium Ion (Li-Ion) (1540 mAH)" + }, + "camera": { + "features": [ + "Video" + ], + "primary": "3.0 megapixels" + }, + "connectivity": { + "bluetooth": "Bluetooth 2.1", + "cell": "WCDMA 850/1900, GSM 850/900/1800/1900, HSDPA 7.2 Mbps (Category 7/8), EDGE Class 12, GPRS Class 12, HSUPA 2.0 Mbps", + "gps": true, + "infrared": false, + "wifi": "802.11 b/g/n" + }, + "description": "MOTOROLA BRAVO\u2122 with MOTOBLUR\u2122 with its large 3.7-inch touchscreen and web-browsing capabilities is sure to make an impression. And it keeps your life updated and secure through MOTOBLUR.", + "display": { + "screenResolution": "WVGA (800 x 480)", + "screenSize": "3.7 inches", + "touchScreen": true + }, + "hardware": { + "accelerometer": true, + "audioJack": "3.5mm", + "cpu": "800 Mhz", + "fmRadio": true, + "physicalKeyboard": false, + "usb": "USB 2.0" + }, + "id": "motorola-bravo-with-motoblur", + "images": [ + "img/phones/motorola-bravo-with-motoblur.0.jpg", + "img/phones/motorola-bravo-with-motoblur.1.jpg", + "img/phones/motorola-bravo-with-motoblur.2.jpg" + ], + "name": "MOTOROLA BRAVO\u2122 with MOTOBLUR\u2122", + "sizeAndWeight": { + "dimensions": [ + "63.0 mm (w)", + "109.0 mm (h)", + "13.3 mm (d)" + ], + "weight": "130.0 grams" + }, + "storage": { + "flash": "", + "ram": "" + } +} diff --git a/app/phones/motorola-charm-with-motoblur.json b/app/phones/motorola-charm-with-motoblur.json new file mode 100644 index 000000000..6ed30bbae --- /dev/null +++ b/app/phones/motorola-charm-with-motoblur.json @@ -0,0 +1,62 @@ +{ + "additionalFeatures": "MOTOBLUR-enabled; battery manager; seven home screens; customize by moving or resizing widgets; Android HTML WebKit w/Flash Lite; BACKTRACK\u2122 navigation pad behind screen", + "android": { + "os": "Android 2.1", + "ui": "MOTOBLUR" + }, + "availability": [ + "T-Mobile,", + "Telus" + ], + "battery": { + "standbyTime": "267 hours", + "talkTime": "5 hours", + "type": "Lithium Ion (Li-Ion) (1170 mAH)" + }, + "camera": { + "features": [ + "Video" + ], + "primary": "3.0 megapixels" + }, + "connectivity": { + "bluetooth": "Bluetooth 2.0", + "cell": "WCDMA 1700/2100, GSM 850/900/1800/1900, HSDPA 3.6 Mbps (Category 5/6), EDGE Class 12, GPRS Class 12", + "gps": true, + "infrared": false, + "wifi": "802.11 b/g" + }, + "description": "Motorola CHARM fits easily in your pocket or palm. Includes MOTOBLUR so you can sync and merge your contacts, emails, messages and posts with continuous updates and back-ups.", + "display": { + "screenResolution": "QVGA (320 x 240)", + "screenSize": "2.8 inches", + "touchScreen": true + }, + "hardware": { + "accelerometer": true, + "audioJack": "3.5mm", + "cpu": "600 MHz", + "fmRadio": false, + "physicalKeyboard": true, + "usb": "USB 2.0" + }, + "id": "motorola-charm-with-motoblur", + "images": [ + "img/phones/motorola-charm-with-motoblur.0.jpg", + "img/phones/motorola-charm-with-motoblur.1.jpg", + "img/phones/motorola-charm-with-motoblur.2.jpg" + ], + "name": "Motorola CHARM\u2122 with MOTOBLUR\u2122", + "sizeAndWeight": { + "dimensions": [ + "67.2 mm (w)", + "98.4 mm (h)", + "11.4 mm (d)" + ], + "weight": "110.0 grams" + }, + "storage": { + "flash": "150MB", + "ram": "512MB" + } +} diff --git a/app/phones/motorola-defy-with-motoblur.json b/app/phones/motorola-defy-with-motoblur.json new file mode 100644 index 000000000..ae327b2b9 --- /dev/null +++ b/app/phones/motorola-defy-with-motoblur.json @@ -0,0 +1,64 @@ +{ + "additionalFeatures": "Blockbuster On Demand\u00ae movies and music downloads with connected music player\nWater-resistant and dustproof", + "android": { + "os": "Android 2.1", + "ui": "MOTOBLUR" + }, + "availability": [ + "SFR,", + "T-Mobile,", + "Vodafone" + ], + "battery": { + "standbyTime": "400 hours", + "talkTime": "6 hours", + "type": "Lithium Ion (Li-Ion) (1540 mAH)" + }, + "camera": { + "features": [ + "Flash", + "Video" + ], + "primary": "5.0 megapixels" + }, + "connectivity": { + "bluetooth": "Bluetooth 2.1", + "cell": "WCDMA 850/1700/2100, GSM 850/900/1800/1900, HSDPA 7.2 Mbps (Category 7/8), EDGE Class 12, GPRS Class 12, HSUPA 2.0 Mbps", + "gps": true, + "infrared": false, + "wifi": "802.11 b/g/n" + }, + "description": "DEFY with MOTOBLUR is ready for everything life throws your way. It's water-resistant and dustproof, with plenty of entertainment options; and, with MOTOBLUR, it automatically delivers messages and status updates right to your home screen.", + "display": { + "screenResolution": "FWVGA (854 x 480)", + "screenSize": "3.7 inches", + "touchScreen": true + }, + "hardware": { + "accelerometer": true, + "audioJack": "3.5mm", + "cpu": "800 MHz TI OMAP3610", + "fmRadio": false, + "physicalKeyboard": false, + "usb": "USB 2.0" + }, + "id": "motorola-defy-with-motoblur", + "images": [ + "img/phones/motorola-defy-with-motoblur.0.jpg", + "img/phones/motorola-defy-with-motoblur.1.jpg", + "img/phones/motorola-defy-with-motoblur.2.jpg" + ], + "name": "Motorola DEFY\u2122 with MOTOBLUR\u2122", + "sizeAndWeight": { + "dimensions": [ + "59.0 mm (w)", + "107.0 mm (h)", + "13.4 mm (d)" + ], + "weight": "118.0 grams" + }, + "storage": { + "flash": "2000MB", + "ram": "512MB" + } +} diff --git a/app/phones/motorola-xoom-with-wi-fi.json b/app/phones/motorola-xoom-with-wi-fi.json new file mode 100644 index 000000000..4ba9c8d5b --- /dev/null +++ b/app/phones/motorola-xoom-with-wi-fi.json @@ -0,0 +1,65 @@ +{ + "additionalFeatures": "Sensors: proximity, ambient light, barometer, gyroscope", + "android": { + "os": "Android 3.0", + "ui": "Honeycomb" + }, + "availability": [ + "" + ], + "battery": { + "standbyTime": "336 hours", + "talkTime": "24 hours", + "type": "Other ( mAH)" + }, + "camera": { + "features": [ + "Flash", + "Video" + ], + "primary": "5.0 megapixels" + }, + "connectivity": { + "bluetooth": "Bluetooth 2.1", + "cell": "", + "gps": true, + "infrared": false, + "wifi": "802.11 b/g/n" + }, + "description": "Motorola XOOM with Wi-Fi has a super-powerful dual-core processor and Android\u2122 3.0 (Honeycomb) \u2014 the Android platform designed specifically for tablets. With its 10.1-inch HD widescreen display, you\u2019ll enjoy HD video in a thin, light, powerful and upgradeable tablet.", + "display": { + "screenResolution": "WXGA (1200 x 800)", + "screenSize": "10.1 inches", + "touchScreen": true + }, + "hardware": { + "accelerometer": true, + "audioJack": "3.5mm", + "cpu": "1 GHz Dual Core Tegra 2", + "fmRadio": false, + "physicalKeyboard": false, + "usb": "USB 2.0" + }, + "id": "motorola-xoom-with-wi-fi", + "images": [ + "img/phones/motorola-xoom-with-wi-fi.0.jpg", + "img/phones/motorola-xoom-with-wi-fi.1.jpg", + "img/phones/motorola-xoom-with-wi-fi.2.jpg", + "img/phones/motorola-xoom-with-wi-fi.3.jpg", + "img/phones/motorola-xoom-with-wi-fi.4.jpg", + "img/phones/motorola-xoom-with-wi-fi.5.jpg" + ], + "name": "Motorola XOOM\u2122 with Wi-Fi", + "sizeAndWeight": { + "dimensions": [ + "249.1 mm (w)", + "167.8 mm (h)", + "12.9 mm (d)" + ], + "weight": "708.0 grams" + }, + "storage": { + "flash": "32000MB", + "ram": "1000MB" + } +} diff --git a/app/phones/motorola-xoom.json b/app/phones/motorola-xoom.json new file mode 100644 index 000000000..f0f0c8711 --- /dev/null +++ b/app/phones/motorola-xoom.json @@ -0,0 +1,62 @@ +{ + "additionalFeatures": "Front-facing camera. Sensors: proximity, ambient light, barometer, gyroscope.", + "android": { + "os": "Android 3.0", + "ui": "Android" + }, + "availability": [ + "Verizon" + ], + "battery": { + "standbyTime": "336 hours", + "talkTime": "24 hours", + "type": "Other (3250 mAH)" + }, + "camera": { + "features": [ + "Flash", + "Video" + ], + "primary": "5.0 megapixels" + }, + "connectivity": { + "bluetooth": "Bluetooth 2.1", + "cell": "CDMA 800 /1900 LTE 700, Rx diversity in all bands", + "gps": true, + "infrared": false, + "wifi": "802.11 a/b/g/n" + }, + "description": "MOTOROLA XOOM has a super-powerful dual-core processor and Android\u2122 3.0 (Honeycomb) \u2014 the Android platform designed specifically for tablets. With its 10.1-inch HD widescreen display, you\u2019ll enjoy HD video in a thin, light, powerful and upgradeable tablet.", + "display": { + "screenResolution": "WXGA (1200 x 800)", + "screenSize": "10.1 inches", + "touchScreen": true + }, + "hardware": { + "accelerometer": true, + "audioJack": "3.5mm", + "cpu": "1 GHz Dual Core Tegra 2", + "fmRadio": false, + "physicalKeyboard": false, + "usb": "USB 2.0" + }, + "id": "motorola-xoom", + "images": [ + "img/phones/motorola-xoom.0.jpg", + "img/phones/motorola-xoom.1.jpg", + "img/phones/motorola-xoom.2.jpg" + ], + "name": "MOTOROLA XOOM\u2122", + "sizeAndWeight": { + "dimensions": [ + "249.0 mm (w)", + "168.0 mm (h)", + "12.7 mm (d)" + ], + "weight": "726.0 grams" + }, + "storage": { + "flash": "32000MB", + "ram": "1000MB" + } +} diff --git a/app/phones/nexus-s.json b/app/phones/nexus-s.json new file mode 100644 index 000000000..5e712e2ff --- /dev/null +++ b/app/phones/nexus-s.json @@ -0,0 +1,69 @@ +{ + "additionalFeatures": "Contour Display, Near Field Communications (NFC), Three-axis gyroscope, Anti-fingerprint display coating, Internet Calling support (VoIP/SIP)", + "android": { + "os": "Android 2.3", + "ui": "Android" + }, + "availability": [ + "M1,", + "O2,", + "Orange,", + "Singtel,", + "StarHub,", + "T-Mobile,", + "Vodafone" + ], + "battery": { + "standbyTime": "428 hours", + "talkTime": "6 hours", + "type": "Lithium Ion (Li-Ion) (1500 mAH)" + }, + "camera": { + "features": [ + "Flash", + "Video" + ], + "primary": "5.0 megapixels" + }, + "connectivity": { + "bluetooth": "Bluetooth 2.1", + "cell": "Quad-band GSM: 850, 900, 1800, 1900\r\nTri-band HSPA: 900, 2100, 1700\r\nHSPA type: HSDPA (7.2Mbps) HSUPA (5.76Mbps)", + "gps": true, + "infrared": false, + "wifi": "802.11 b/g/n" + }, + "description": "Nexus S is the next generation of Nexus devices, co-developed by Google and Samsung. The latest Android platform (Gingerbread), paired with a 1 GHz Hummingbird processor and 16GB of memory, makes Nexus S one of the fastest phones on the market. It comes pre-installed with the best of Google apps and enabled with new and popular features like true multi-tasking, Wi-Fi hotspot, Internet Calling, NFC support, and full web browsing. With this device, users will also be the first to receive software upgrades and new Google mobile apps as soon as they become available. For more details, visit http://www.google.com/nexus.", + "display": { + "screenResolution": "WVGA (800 x 480)", + "screenSize": "4.0 inches", + "touchScreen": true + }, + "hardware": { + "accelerometer": true, + "audioJack": "3.5mm", + "cpu": "1GHz Cortex A8 (Hummingbird) processor", + "fmRadio": false, + "physicalKeyboard": false, + "usb": "USB 2.0" + }, + "id": "nexus-s", + "images": [ + "img/phones/nexus-s.0.jpg", + "img/phones/nexus-s.1.jpg", + "img/phones/nexus-s.2.jpg", + "img/phones/nexus-s.3.jpg" + ], + "name": "Nexus S", + "sizeAndWeight": { + "dimensions": [ + "63.0 mm (w)", + "123.9 mm (h)", + "10.88 mm (d)" + ], + "weight": "129.0 grams" + }, + "storage": { + "flash": "16384MB", + "ram": "512MB" + } +} diff --git a/app/phones/phones.json b/app/phones/phones.json new file mode 100644 index 000000000..472b2b169 --- /dev/null +++ b/app/phones/phones.json @@ -0,0 +1,155 @@ +[ + { + "age": 0, + "id": "motorola-xoom-with-wi-fi", + "imageUrl": "img/phones/motorola-xoom-with-wi-fi.0.jpg", + "name": "Motorola XOOM\u2122 with Wi-Fi", + "snippet": "The Next, Next Generation\r\n\r\nExperience the future with Motorola XOOM with Wi-Fi, the world's first tablet powered by Android 3.0 (Honeycomb)." + }, + { + "age": 1, + "id": "motorola-xoom", + "imageUrl": "img/phones/motorola-xoom.0.jpg", + "name": "MOTOROLA XOOM\u2122", + "snippet": "The Next, Next Generation\n\nExperience the future with MOTOROLA XOOM, the world's first tablet powered by Android 3.0 (Honeycomb)." + }, + { + "age": 2, + "carrier": "AT&T", + "id": "motorola-atrix-4g", + "imageUrl": "img/phones/motorola-atrix-4g.0.jpg", + "name": "MOTOROLA ATRIX\u2122 4G", + "snippet": "MOTOROLA ATRIX 4G the world's most powerful smartphone." + }, + { + "age": 3, + "id": "dell-streak-7", + "imageUrl": "img/phones/dell-streak-7.0.jpg", + "name": "Dell Streak 7", + "snippet": "Introducing Dell\u2122 Streak 7. Share photos, videos and movies together. It\u2019s small enough to carry around, big enough to gather around." + }, + { + "age": 4, + "carrier": "Cellular South", + "id": "samsung-gem", + "imageUrl": "img/phones/samsung-gem.0.jpg", + "name": "Samsung Gem\u2122", + "snippet": "The Samsung Gem\u2122 brings you everything that you would expect and more from a touch display smart phone \u2013 more apps, more features and a more affordable price." + }, + { + "age": 5, + "carrier": "Dell", + "id": "dell-venue", + "imageUrl": "img/phones/dell-venue.0.jpg", + "name": "Dell Venue", + "snippet": "The Dell Venue; Your Personal Express Lane to Everything" + }, + { + "age": 6, + "carrier": "Best Buy", + "id": "nexus-s", + "imageUrl": "img/phones/nexus-s.0.jpg", + "name": "Nexus S", + "snippet": "Fast just got faster with Nexus S. A pure Google experience, Nexus S is the first phone to run Gingerbread (Android 2.3), the fastest version of Android yet." + }, + { + "age": 7, + "carrier": "Cellular South", + "id": "lg-axis", + "imageUrl": "img/phones/lg-axis.0.jpg", + "name": "LG Axis", + "snippet": "Android Powered, Google Maps Navigation, 5 Customizable Home Screens" + }, + { + "age": 8, + "id": "samsung-galaxy-tab", + "imageUrl": "img/phones/samsung-galaxy-tab.0.jpg", + "name": "Samsung Galaxy Tab\u2122", + "snippet": "Feel Free to Tab\u2122. The Samsung Galaxy Tab\u2122 brings you an ultra-mobile entertainment experience through its 7\u201d display, high-power processor and Adobe\u00ae Flash\u00ae Player compatibility." + }, + { + "age": 9, + "carrier": "Cellular South", + "id": "samsung-showcase-a-galaxy-s-phone", + "imageUrl": "img/phones/samsung-showcase-a-galaxy-s-phone.0.jpg", + "name": "Samsung Showcase\u2122 a Galaxy S\u2122 phone", + "snippet": "The Samsung Showcase\u2122 delivers a cinema quality experience like you\u2019ve never seen before. Its innovative 4\u201d touch display technology provides rich picture brilliance, even outdoors" + }, + { + "age": 10, + "carrier": "Verizon", + "id": "droid-2-global-by-motorola", + "imageUrl": "img/phones/droid-2-global-by-motorola.0.jpg", + "name": "DROID\u2122 2 Global by Motorola", + "snippet": "The first smartphone with a 1.2 GHz processor and global capabilities." + }, + { + "age": 11, + "carrier": "Verizon", + "id": "droid-pro-by-motorola", + "imageUrl": "img/phones/droid-pro-by-motorola.0.jpg", + "name": "DROID\u2122 Pro by Motorola", + "snippet": "The next generation of DOES." + }, + { + "age": 12, + "carrier": "AT&T", + "id": "motorola-bravo-with-motoblur", + "imageUrl": "img/phones/motorola-bravo-with-motoblur.0.jpg", + "name": "MOTOROLA BRAVO\u2122 with MOTOBLUR\u2122", + "snippet": "An experience to cheer about." + }, + { + "age": 13, + "carrier": "T-Mobile", + "id": "motorola-defy-with-motoblur", + "imageUrl": "img/phones/motorola-defy-with-motoblur.0.jpg", + "name": "Motorola DEFY\u2122 with MOTOBLUR\u2122", + "snippet": "Are you ready for everything life throws your way?" + }, + { + "age": 14, + "carrier": "T-Mobile", + "id": "t-mobile-mytouch-4g", + "imageUrl": "img/phones/t-mobile-mytouch-4g.0.jpg", + "name": "T-Mobile myTouch 4G", + "snippet": "The T-Mobile myTouch 4G is a premium smartphone designed to deliver blazing fast 4G speeds so that you can video chat from practically anywhere, with or without Wi-Fi." + }, + { + "age": 15, + "carrier": "US Cellular", + "id": "samsung-mesmerize-a-galaxy-s-phone", + "imageUrl": "img/phones/samsung-mesmerize-a-galaxy-s-phone.0.jpg", + "name": "Samsung Mesmerize\u2122 a Galaxy S\u2122 phone", + "snippet": "The Samsung Mesmerize\u2122 delivers a cinema quality experience like you\u2019ve never seen before. Its innovative 4\u201d touch display technology provides rich picture brilliance,even outdoors" + }, + { + "age": 16, + "carrier": "Sprint", + "id": "sanyo-zio", + "imageUrl": "img/phones/sanyo-zio.0.jpg", + "name": "SANYO ZIO", + "snippet": "The Sanyo Zio by Kyocera is an Android smartphone with a combination of ultra-sleek styling, strong performance and unprecedented value." + }, + { + "age": 17, + "id": "samsung-transform", + "imageUrl": "img/phones/samsung-transform.0.jpg", + "name": "Samsung Transform\u2122", + "snippet": "The Samsung Transform\u2122 brings you a fun way to customize your Android powered touch screen phone to just the way you like it through your favorite themed \u201cSprint ID Service Pack\u201d." + }, + { + "age": 18, + "id": "t-mobile-g2", + "imageUrl": "img/phones/t-mobile-g2.0.jpg", + "name": "T-Mobile G2", + "snippet": "The T-Mobile G2 with Google is the first smartphone built for 4G speeds on T-Mobile's new network. Get the information you need, faster than you ever thought possible." + }, + { + "age": 19, + "id": "motorola-charm-with-motoblur", + "imageUrl": "img/phones/motorola-charm-with-motoblur.0.jpg", + "name": "Motorola CHARM\u2122 with MOTOBLUR\u2122", + "snippet": "Motorola CHARM fits easily in your pocket or palm. Includes MOTOBLUR service." + } +] diff --git a/app/phones/samsung-galaxy-tab.json b/app/phones/samsung-galaxy-tab.json new file mode 100644 index 000000000..551cfcf9b --- /dev/null +++ b/app/phones/samsung-galaxy-tab.json @@ -0,0 +1,69 @@ +{ + "additionalFeatures": "Adobe\u00ae Flash\u00ae Player compatible; 1.3MP front-facing camera for video chat; eReader pre-loaded; Swype text input technology\r\n", + "android": { + "os": "Android 2.2", + "ui": "TouchWiz" + }, + "availability": [ + "AT&T,", + "Sprint,", + "T-Mobile,", + "Verizon" + ], + "battery": { + "standbyTime": "780 hours", + "talkTime": "", + "type": "Lithium Ion (Li-Ion) (4000 mAH)" + }, + "camera": { + "features": [ + "Flash", + "Video" + ], + "primary": "3.0 megapixels" + }, + "connectivity": { + "bluetooth": "Bluetooth 3.0", + "cell": "AT&T: GSM/EDGE : 850/900/1800/1900; 3G : 850/1900/2100<p>\r\n\r\nSprint: CDMA : 850/1900MHz<p>\r\n\r\nT-Mobile: GSM/EDGE : 850/900/1800/1900; 3G : 1700/1900<p>\r\n\r\nVerizon: CDMA : 800MHz/1900MHz", + "gps": true, + "infrared": false, + "wifi": "802.11 b/g/n" + }, + "description": "Feel Free to Tab\u2122. The Samsung Galaxy Tab\u2122, the tablet device that delivers enhanced capabilities with advanced mobility, has a large, perfectly sized, 7.0\" screen that offers plenty of room for the thousands of interactive games and apps available for the Android\u2122 platform, and its slim design makes it perfect for travel and one-handed grip. Use the Galaxy Tab to relax and enjoy an e-book, watch rich video or full web content with its Adobe\u00ae Flash\u00ae Player compatibility, video chat using the front-facing camera, or send user-generated content wirelessly to other devices like your TV via AllShare\u2122. With so many options for customization and interactivity, the Galaxy Tab gives you everything you want, anywhere you go\u2026Feel Free to Tab\u2122.", + "display": { + "screenResolution": "WSVGA (1024 x 600)", + "screenSize": "7.0 inches", + "touchScreen": true + }, + "hardware": { + "accelerometer": true, + "audioJack": "3.5mm", + "cpu": "1GHz", + "fmRadio": false, + "physicalKeyboard": false, + "usb": "USB 2.0" + }, + "id": "samsung-galaxy-tab", + "images": [ + "img/phones/samsung-galaxy-tab.0.jpg", + "img/phones/samsung-galaxy-tab.1.jpg", + "img/phones/samsung-galaxy-tab.2.jpg", + "img/phones/samsung-galaxy-tab.3.jpg", + "img/phones/samsung-galaxy-tab.4.jpg", + "img/phones/samsung-galaxy-tab.5.jpg", + "img/phones/samsung-galaxy-tab.6.jpg" + ], + "name": "Samsung Galaxy Tab\u2122", + "sizeAndWeight": { + "dimensions": [ + "120.39 mm (w)", + "189.99 mm (h)", + "11.9 mm (d)" + ], + "weight": "379.88 grams" + }, + "storage": { + "flash": "16384MB", + "ram": "640MB" + } +} diff --git a/app/phones/samsung-gem.json b/app/phones/samsung-gem.json new file mode 100644 index 000000000..ffb7651ca --- /dev/null +++ b/app/phones/samsung-gem.json @@ -0,0 +1,61 @@ +{ + "additionalFeatures": "3.2\u201d Full touch screen with Advanced anti smudge, anti reflective and anti scratch glass; Swype text input for easy and fast message creation; multiple messaging options, including text with threaded messaging for organized, easy-to-follow text; Social Community support, including Facebook and MySpace; Next generation Address book; Visual Voice Mail\n", + "android": { + "os": "Android 2.1", + "ui": "TouchWiz" + }, + "availability": [ + "Cellular South" + ], + "battery": { + "standbyTime": "800 hours", + "talkTime": "7 hours", + "type": "Nickel Cadmium (NiCd) (1500 mAH)" + }, + "camera": { + "features": [ + "" + ], + "primary": "3.0 megapixels" + }, + "connectivity": { + "bluetooth": "Bluetooth 3.0", + "cell": "3G/CDMA : 850MHz/1900MHz\n", + "gps": true, + "infrared": false, + "wifi": "802.11 b/g" + }, + "description": "The Samsung Gem\u2122 maps a route to a smarter mobile experience. By pairing one of the fastest processors in the category with the Android\u2122 platform, the Gem delivers maximum multitasking speed and social networking capabilities to let you explore new territory online. A smart phone at an even smarter price is a real find, so uncover the Gem and discover what\u2019s next.", + "display": { + "screenResolution": "WQVGA (400 x 240)", + "screenSize": "3.2 inches", + "touchScreen": true + }, + "hardware": { + "accelerometer": true, + "audioJack": "3.5mm", + "cpu": "800 MHz", + "fmRadio": false, + "physicalKeyboard": false, + "usb": "USB 2.0" + }, + "id": "samsung-gem", + "images": [ + "img/phones/samsung-gem.0.jpg", + "img/phones/samsung-gem.1.jpg", + "img/phones/samsung-gem.2.jpg" + ], + "name": "Samsung Gem\u2122", + "sizeAndWeight": { + "dimensions": [ + "55.5 mm (w)", + "113.0 mm (h)", + "12.4 mm (d)" + ], + "weight": "110.0 grams" + }, + "storage": { + "flash": "220MB", + "ram": "256MB" + } +} diff --git a/app/phones/samsung-mesmerize-a-galaxy-s-phone.json b/app/phones/samsung-mesmerize-a-galaxy-s-phone.json new file mode 100644 index 000000000..4b90428d9 --- /dev/null +++ b/app/phones/samsung-mesmerize-a-galaxy-s-phone.json @@ -0,0 +1,63 @@ +{ + "additionalFeatures": "Swype", + "android": { + "os": "Android 2.1", + "ui": "TouchWiz" + }, + "availability": [ + "US Cellular" + ], + "battery": { + "standbyTime": "1000 hours", + "talkTime": "7 hours", + "type": "Lithium Ion (Li-Ion) (1500 mAH)" + }, + "camera": { + "features": [ + "Flash", + "Video" + ], + "primary": "5.0 megapixels" + }, + "connectivity": { + "bluetooth": "Bluetooth 3.0", + "cell": "3G :800MHz/1900MHz\nCDMA :800MHz/1900MHz", + "gps": true, + "infrared": false, + "wifi": "802.11 b/g/n" + }, + "description": "Experience entertainment in a whole new light. The stylish and slim Samsung Mesmerize\u2122, with its vivid 4-inch Super AMOLED\u2122 display, makes everything from Hollywood blockbusters to music videos to Amazon\u2019s bestsellers look absolutely brilliant \u2013 even outside in the sun. Android\u2122 Market rockets you into a universe filled with equally brilliant apps; download them at blistering speeds thanks to the powerful 1GHz Hummingbird processor. Keep your social life organized and continuously updated with the pre-loaded social networking apps, while uploading all the 5.0MP pics you\u2019ve snapped and 720p HD videos you\u2019ve recorded.", + "display": { + "screenResolution": "WVGA (800 x 480)", + "screenSize": "4.0 inches", + "touchScreen": true + }, + "hardware": { + "accelerometer": true, + "audioJack": "", + "cpu": "1GHz", + "fmRadio": false, + "physicalKeyboard": false, + "usb": "USB 2.0" + }, + "id": "samsung-mesmerize-a-galaxy-s-phone", + "images": [ + "img/phones/samsung-mesmerize-a-galaxy-s-phone.0.jpg", + "img/phones/samsung-mesmerize-a-galaxy-s-phone.1.jpg", + "img/phones/samsung-mesmerize-a-galaxy-s-phone.2.jpg", + "img/phones/samsung-mesmerize-a-galaxy-s-phone.3.jpg" + ], + "name": "Samsung Mesmerize\u2122 a Galaxy S\u2122 phone", + "sizeAndWeight": { + "dimensions": [ + "64.2 mm (w)", + "125.0 mm (h)", + "9.97 mm (d)" + ], + "weight": "118.0 grams" + }, + "storage": { + "flash": "2048MB", + "ram": "512MB" + } +} diff --git a/app/phones/samsung-showcase-a-galaxy-s-phone.json b/app/phones/samsung-showcase-a-galaxy-s-phone.json new file mode 100644 index 000000000..c75302ab3 --- /dev/null +++ b/app/phones/samsung-showcase-a-galaxy-s-phone.json @@ -0,0 +1,62 @@ +{ + "additionalFeatures": "Swype", + "android": { + "os": "Android 2.1", + "ui": "TouchWiz" + }, + "availability": [ + "Cellular South" + ], + "battery": { + "standbyTime": "800 hours", + "talkTime": "7 hours", + "type": "Lithium Ion (Li-Ion) (1500 mAH)" + }, + "camera": { + "features": [ + "Flash", + "Video" + ], + "primary": "5.0 megapixels" + }, + "connectivity": { + "bluetooth": "Bluetooth 3.0", + "cell": "3G : 900MHz/1900MHz\nCDMA : 800MHz/1900MHz", + "gps": true, + "infrared": false, + "wifi": "802.11 b/g/n" + }, + "description": "Experience entertainment in a whole new light. The stylish and slim Samsung Showcase\u2122, with its vivid 4-inch Super AMOLED\u2122 display, makes everything from Hollywood blockbusters to music videos to Amazon\u2019s bestsellers look absolutely brilliant \u2013 even outside in the sun. Android\u2122 Market rockets you into a universe filled with equally brilliant apps; download them at blistering speeds thanks to the powerful 1GHz Hummingbird processor. Keep your social life organized and continuously updated with the pre-loaded social networking apps, while uploading all the 5.0MP pics you\u2019ve snapped and 720p HD videos you\u2019ve recorded", + "display": { + "screenResolution": "WVGA (800 x 480)", + "screenSize": "4.0 inches", + "touchScreen": true + }, + "hardware": { + "accelerometer": true, + "audioJack": "3.5mm", + "cpu": "1 GHz", + "fmRadio": false, + "physicalKeyboard": false, + "usb": "USB 2.0" + }, + "id": "samsung-showcase-a-galaxy-s-phone", + "images": [ + "img/phones/samsung-showcase-a-galaxy-s-phone.0.jpg", + "img/phones/samsung-showcase-a-galaxy-s-phone.1.jpg", + "img/phones/samsung-showcase-a-galaxy-s-phone.2.jpg" + ], + "name": "Samsung Showcase\u2122 a Galaxy S\u2122 phone", + "sizeAndWeight": { + "dimensions": [ + "64.2 mm (w)", + "125.0 mm (h)", + "9.97 mm (d)" + ], + "weight": "118.0 grams" + }, + "storage": { + "flash": "2048MB", + "ram": "512MB" + } +} diff --git a/app/phones/samsung-transform.json b/app/phones/samsung-transform.json new file mode 100644 index 000000000..3e061810c --- /dev/null +++ b/app/phones/samsung-transform.json @@ -0,0 +1,64 @@ +{ + "additionalFeatures": "Access to Sprint ID Service Packs, front and rear facing cameras\n", + "android": { + "os": "Android 2.1", + "ui": "Stock Android + Sprint ID Pack" + }, + "availability": [ + "Sprint" + ], + "battery": { + "standbyTime": "930 hours", + "talkTime": "9 hours", + "type": "Lithium Ion (Li-Ion) (1500 mAH)" + }, + "camera": { + "features": [ + "Flash", + "Video" + ], + "primary": "3.0 megapixels" + }, + "connectivity": { + "bluetooth": "Bluetooth 2.1", + "cell": "800Mhz, 1900MHz", + "gps": true, + "infrared": false, + "wifi": "802.11 b/g/n" + }, + "description": "Change your perspective. The Samsung Transform\u2122 is an Android powered device that delivers the truly customizable experience you want your phone to provide. Enjoy a new and easy way to personalize your device for business or for entertainment, showcasing your own favorite theme and more through the new open software platform and the ability to download individual \u2018Sprint ID Service Packs\u2019 that combine and deliver multiple content items and applications specifically for the features you want. Combine this with the 3.5\u201d touch display, QWERTY keyboard, high-speed processor, and both a front and rear facing camera to bring your unique mobile experience to life.", + "display": { + "screenResolution": "HVGA (480 x 320)", + "screenSize": "3.5 inches", + "touchScreen": true + }, + "hardware": { + "accelerometer": true, + "audioJack": "3.5mm", + "cpu": "800 MHz", + "fmRadio": false, + "physicalKeyboard": true, + "usb": "USB 2.0" + }, + "id": "samsung-transform", + "images": [ + "img/phones/samsung-transform.0.jpg", + "img/phones/samsung-transform.1.jpg", + "img/phones/samsung-transform.2.jpg", + "img/phones/samsung-transform.3.jpg", + "img/phones/samsung-transform.4.jpg" + ], + "name": "Samsung Transform\u2122", + "sizeAndWeight": { + "dimensions": [ + "61.5 mm (w)", + "117.0 mm (h)", + "15.3 mm (d)" + ], + "weight": "148.0 grams" + }, + "storage": { + "flash": "180MB", + "ram": "384MB" + } +} diff --git a/app/phones/sanyo-zio.json b/app/phones/sanyo-zio.json new file mode 100644 index 000000000..a63a131c5 --- /dev/null +++ b/app/phones/sanyo-zio.json @@ -0,0 +1,61 @@ +{ + "additionalFeatures": "Trackball Navigation Control", + "android": { + "os": "Android 2.2", + "ui": "" + }, + "availability": [ + "Sprint" + ], + "battery": { + "standbyTime": "", + "talkTime": "4 hours", + "type": "Lithium Ion (Li-Ion) (1130 mAH)" + }, + "camera": { + "features": [ + "Video" + ], + "primary": "3.2 megapixels" + }, + "connectivity": { + "bluetooth": "Bluetooth 2.1", + "cell": "CDMA2000 1xEV-DO Rev.A", + "gps": true, + "infrared": false, + "wifi": "802.11 b/g" + }, + "description": "Zio uses CDMA2000 1xEV-DO rev. A and Wi-Fi technologies and features a 3.5-inch WVGA touch-screen display as a backdrop for a fully customizable mobile multimedia experience. Along with the touch-screen, a trackball helps users navigate features such as the 3.2 MP camera with video record/playback, media player and full HTML Web browser. Zio supports up to 32GB through its external microSD memory slot.", + "display": { + "screenResolution": "WVGA (800 x 480)", + "screenSize": "3.5 inches", + "touchScreen": true + }, + "hardware": { + "accelerometer": true, + "audioJack": "3.5mm", + "cpu": "600MHz Qualcomm MSM7627", + "fmRadio": false, + "physicalKeyboard": false, + "usb": "USB 2.0" + }, + "id": "sanyo-zio", + "images": [ + "img/phones/sanyo-zio.0.jpg", + "img/phones/sanyo-zio.1.jpg", + "img/phones/sanyo-zio.2.jpg" + ], + "name": "SANYO ZIO", + "sizeAndWeight": { + "dimensions": [ + "58.6 mm (w)", + "116.0 mm (h)", + "12.2 mm (d)" + ], + "weight": "105.0 grams" + }, + "storage": { + "flash": "130MB", + "ram": "256MB" + } +} diff --git a/app/phones/t-mobile-g2.json b/app/phones/t-mobile-g2.json new file mode 100644 index 000000000..7f391bb77 --- /dev/null +++ b/app/phones/t-mobile-g2.json @@ -0,0 +1,62 @@ +{ + "additionalFeatures": "Accessibility features: tactile QWERTY keyboard, trackpad, three programmable keys, camera button", + "android": { + "os": "Android 2.2", + "ui": "Android" + }, + "availability": [ + "T-Mobile" + ], + "battery": { + "standbyTime": "420 hours", + "talkTime": "7 hours", + "type": "Lithium Ion (Li-Ion) (1300 mAH)" + }, + "camera": { + "features": [ + "Flash", + "Video" + ], + "primary": "5.0 megapixels" + }, + "connectivity": { + "bluetooth": "Bluetooth 2.1", + "cell": "GSM: 850, 900, 1800, 1900 UMTS: Yes", + "gps": true, + "infrared": false, + "wifi": "802.11 b/g/n" + }, + "description": "The T-Mobile G1 was the world's first Android-powered phone. Launched nearly two years ago, it created an entirely new class of mobile phones and apps. Its successor, the T-Mobile G2 with Google, will continue the revolution.\n\nThe T-Mobile G2 will deliver tight integration with Google services and break new ground as the first smartphone designed to run at 4G speeds on our new HSPA+ network.", + "display": { + "screenResolution": "WVGA (800 x 480)", + "screenSize": "3.7 inches", + "touchScreen": true + }, + "hardware": { + "accelerometer": true, + "audioJack": "3.5mm", + "cpu": "800 MHz Qualcomm\u00ae Snapdragon\u2122 MSM7230", + "fmRadio": false, + "physicalKeyboard": true, + "usb": "USB 2.0" + }, + "id": "t-mobile-g2", + "images": [ + "img/phones/t-mobile-g2.0.jpg", + "img/phones/t-mobile-g2.1.jpg", + "img/phones/t-mobile-g2.2.jpg" + ], + "name": "T-Mobile G2", + "sizeAndWeight": { + "dimensions": [ + "60.4 mm (w)", + "119.0 mm (h)", + "14.2 mm (d)" + ], + "weight": "180.0 grams" + }, + "storage": { + "flash": "4000MB", + "ram": "512MB" + } +} diff --git a/app/phones/t-mobile-mytouch-4g.json b/app/phones/t-mobile-mytouch-4g.json new file mode 100644 index 000000000..fffeea262 --- /dev/null +++ b/app/phones/t-mobile-mytouch-4g.json @@ -0,0 +1,65 @@ +{ + "additionalFeatures": "Mobile Video Chat, HD Camcorder, Screen Share (DLNA), Genius Button, Wi-Fi Calling, Wi-Fi HotSpot, T-Mobile TV, Slacker Radio, Rock Band, Monopoly, Asphalt 5, myModes, Faves Gallery", + "android": { + "os": "Android 2.2", + "ui": "HTC Sense\u2122" + }, + "availability": [ + "T-Mobile" + ], + "battery": { + "standbyTime": "285 hours", + "talkTime": "7 hours", + "type": "Lithium Ion (Li-Ion) (1400 mAH)" + }, + "camera": { + "features": [ + "Flash", + "Video" + ], + "primary": "5.0 megapixels" + }, + "connectivity": { + "bluetooth": "Bluetooth 2.0", + "cell": "GSM: 850, 900, 1800, 1900; UMTS: Band I/IV", + "gps": true, + "infrared": false, + "wifi": "802.11 b/g/n" + }, + "description": "The myTouch 4G lets you connect fast, communicate easily, and share\u2014all on America\u2019s largest 4G network.\n\nBuilt with families in mind, the newest T-Mobile myTouch 4G helps solve the challenges of staying physically and emotionally connected by sharing photos and video with the HD Camcorder, spontaneous face-to-face conversations through Video Chat, and the ability to reach 4G speeds on T-Mobile\u2019s HSPA+ network.", + "display": { + "screenResolution": "WVGA (800 x 480)", + "screenSize": "3.8 inches", + "touchScreen": true + }, + "hardware": { + "accelerometer": true, + "audioJack": "3.5mm", + "cpu": "2nd Generation 1GHz Qualcomm Snapdragon MSM8255", + "fmRadio": true, + "physicalKeyboard": false, + "usb": "USB 2.0" + }, + "id": "t-mobile-mytouch-4g", + "images": [ + "img/phones/t-mobile-mytouch-4g.0.jpg", + "img/phones/t-mobile-mytouch-4g.1.jpg", + "img/phones/t-mobile-mytouch-4g.2.jpg", + "img/phones/t-mobile-mytouch-4g.3.jpg", + "img/phones/t-mobile-mytouch-4g.4.jpg", + "img/phones/t-mobile-mytouch-4g.5.jpg" + ], + "name": "T-Mobile myTouch 4G", + "sizeAndWeight": { + "dimensions": [ + "62.5 mm (w)", + "122.0 mm (h)", + "11.0 mm (d)" + ], + "weight": "156.0 grams" + }, + "storage": { + "flash": "1100MB", + "ram": "768MB" + } +} diff --git a/scripts/private/format-json.sh b/scripts/private/format-json.sh new file mode 100755 index 000000000..fe64ec57b --- /dev/null +++ b/scripts/private/format-json.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +##### +# Helper script for pretty formatting of json files +##### + +for file in `ls -a app/phones | grep -v \\\.\$`; do + cat app/phones/$file | python -mjson.tool > tmp.json + rm app/phones/$file + mv tmp.json app/phones/$file +done diff --git a/scripts/private/goto_step.bat b/scripts/private/goto_step.bat new file mode 100644 index 000000000..1d821e078 --- /dev/null +++ b/scripts/private/goto_step.bat @@ -0,0 +1,9 @@ +@echo off + +REM Windows script for changing step +REM This script just copies content of given step into sandbox + +set SB_DIR=%~dp0 +set STEP=%1 + +xcopy "%SB_DIR%\..\step-%STEP%" "%SB_DIR%" /E /Y diff --git a/scripts/private/goto_step.sh b/scripts/private/goto_step.sh new file mode 100755 index 000000000..6490a5b88 --- /dev/null +++ b/scripts/private/goto_step.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +cp -r ../step-$1/* . +echo "jumped to step $1" diff --git a/scripts/private/push-to-github.sh b/scripts/private/push-to-github.sh new file mode 100755 index 000000000..0053cbe7f --- /dev/null +++ b/scripts/private/push-to-github.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +scripts/private/retag.sh +git push --force upstream +git push --tags --force upstream diff --git a/scripts/private/retag.sh b/scripts/private/retag.sh new file mode 100755 index 000000000..b295dabb0 --- /dev/null +++ b/scripts/private/retag.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +###### +# This script is useful only for committers to the upstream github repo. +###### + +for tag in `git tag`; do + git tag -d $tag +done + +for sha in `git log --oneline | grep step- | cut -d ' ' -f 1`; do + tag=`git log $sha...$sha~1 --oneline | cut -d ' ' -f 2` + echo Creating tag $tag for $sha + git tag $tag $sha +done diff --git a/scripts/private/snapshot-web.sh b/scripts/private/snapshot-web.sh new file mode 100755 index 000000000..0bba27e33 --- /dev/null +++ b/scripts/private/snapshot-web.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +ROOT_DIR=`dirname $0`/../.. +cd $ROOT_DIR + +SNAP_DIR=snapshot-web + + +rm -rf $SNAP_DIR +mkdir $SNAP_DIR + +for i in {0..11} +do + mkdir $SNAP_DIR/step-$i + git checkout -f step-$i + + cp -r app test $SNAP_DIR/step-$i/ + rm -rf $SNAP_DIR/step-$i/test/lib/jstestdriver +done diff --git a/scripts/private/snapshot.sh b/scripts/private/snapshot.sh new file mode 100755 index 000000000..dff177afa --- /dev/null +++ b/scripts/private/snapshot.sh @@ -0,0 +1,38 @@ +#!/bin/bash + +ROOT_DIR=`dirname $0`/../.. +cd $ROOT_DIR + +SNAP_DIR=snapshot + + +rm -rf $SNAP_DIR +mkdir $SNAP_DIR + +for i in {0..11} +do + mkdir $SNAP_DIR/step-$i + git checkout -f step-$i + + if [[ $i = 0 ]]; then + cp -r app config scripts test $SNAP_DIR/step-0/ + mkdir $SNAP_DIR/step-0/logs + rm $SNAP_DIR/step-0/scripts/private + rm $SNAP_DIR/step-0/scripts/update-repo.sh + else + cp -r app $SNAP_DIR/step-$i/ + mkdir $SNAP_DIR/step-$i/test/ + cp -r test/unit test/e2e $SNAP_DIR/step-$i/test + rm -r $SNAP_DIR/step-$i/app/img + rm -r $SNAP_DIR/step-$i/app/lib + rm -rf $SNAP_DIR/step-$i/app/phones + fi + + if [[ $i = 5 ]]; then + cp -r app/img $SNAP_DIR/step-0/app/ + cp -r app/phones $SNAP_DIR/step-0/app/ + fi +done + +mkdir $SNAP_DIR/sandbox +cp scripts/private/goto_step.sh $SNAP_DIR/sandbox/ diff --git a/scripts/test-server.bat b/scripts/test-server.bat new file mode 100644 index 000000000..9ec172c00 --- /dev/null +++ b/scripts/test-server.bat @@ -0,0 +1,14 @@ +@echo off + +REM Windows script for starting JSTD server +REM +REM Requirements: +REM - Java (http://www.java.com) + +set BASE_DIR=%~dp0 +set PORT=9876 + +echo "Starting JsTestDriver Server (http://code.google.com/p/js-test-driver/)" +echo "Please open the following url and capture one or more browsers:" +echo "http://localhost:%PORT%" +java -jar "%BASE_DIR%\..\test\lib\jstestdriver\JsTestDriver.jar" --port %PORT% --browserTimeout 20000 --config "%BASE_DIR%\..\config\jsTestDriver.conf" --basePath "%BASE_DIR%\.." diff --git a/scripts/test.bat b/scripts/test.bat new file mode 100644 index 000000000..95ccca2b2 --- /dev/null +++ b/scripts/test.bat @@ -0,0 +1,10 @@ +@echo off + +REM Windows script for running unit tests +REM You have to run server and capture some browser first +REM +REM Requirements: +REM - Java (http://www.java.com) + +set BASE_DIR=%~dp0 +java -jar "%BASE_DIR%\..\test\lib\jstestdriver\JsTestDriver.jar" --config "%BASE_DIR%\..\config\jsTestDriver.conf" --basePath "%BASE_DIR%\.." --tests all --reset diff --git a/scripts/test.sh b/scripts/test.sh index 622840b35..0c5dbe0e7 100755 --- a/scripts/test.sh +++ b/scripts/test.sh @@ -7,4 +7,4 @@ if [[ $tests = "" ]]; then tests="all" fi -java -jar "$base_dir/../test/lib/jstestdriver/JsTestDriver.jar" --config "$base_dir/../config/jsTestDriver.conf" --basePath "$base_dir/.." --tests "$tests" +java -jar "$base_dir/../test/lib/jstestdriver/JsTestDriver.jar" --config "$base_dir/../config/jsTestDriver.conf" --basePath "$base_dir/.." --tests "$tests" --reset diff --git a/scripts/update-repo.sh b/scripts/update-repo.sh new file mode 100755 index 000000000..5a85bfd11 --- /dev/null +++ b/scripts/update-repo.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +### +# This scripts updates the local repo with the latest changes from github. +# +# The master branch will be REPLACED with what's in github and all local changes +# will be LOST. +### + +git checkout master +git fetch -f origin +git fetch --tags origin +git reset --hard origin/master diff --git a/test/e2e/scenarios.js b/test/e2e/scenarios.js index 6c958a362..699dca11c 100644 --- a/test/e2e/scenarios.js +++ b/test/e2e/scenarios.js @@ -1,41 +1,76 @@ -describe('my app', function() { +/* jasmine-like end2end tests go here */ +describe('PhoneCat App', function() { - beforeEach(function() { + it('should redirect index.html to index.html#/phones', function() { browser().navigateTo('../../app/index.html'); + expect(browser().location().hash()).toBe('/phones'); }); - it('should automatically redirect to /view1 when location hash/fragment is empty', function() { - expect(browser().location().hash()).toBe("/view1"); - }); + describe('Phone list view', function() { + beforeEach(function() { + browser().navigateTo('../../app/index.html#/phones'); + }); - describe('view1', function() { - beforeEach(function() { - browser().navigateTo('#/view1'); + it('should filter the phone list as user types into the search box', function() { + expect(repeater('.phones li').count()).toBe(20); + + input('query').enter('nexus'); + expect(repeater('.phones li').count()).toBe(1); + + input('query').enter('motorola'); + expect(repeater('.phones li').count()).toBe(8); }); - it('should render view1 when user navigates to /view1', function() { - expect(element('ng\\:view p:first').text()). - toMatch(/partial for view 1/) + it('should be possible to control phone order via the drop down select box', function() { + input('query').enter('tablet'); //let's narrow the dataset to make the test assertions shorter + + expect(repeater('.phones li', 'Phone List').column('a')). + toEqual(["Motorola XOOM\u2122 with Wi-Fi", + "MOTOROLA XOOM\u2122"]); + + select('orderProp').option('alphabetical'); + + expect(repeater('.phones li', 'Phone List').column('a')). + toEqual(["MOTOROLA XOOM\u2122", + "Motorola XOOM\u2122 with Wi-Fi"]); }); + + it('should render phone specific links', function() { + input('query').enter('nexus'); + element('.phones li a').click(); + expect(browser().location().hash()).toBe('/phones/nexus-s'); + }); }); - describe('view2', function() { + describe('Phone detail view', function() { beforeEach(function() { - browser().navigateTo('#/view2'); + browser().navigateTo('../../app/index.html#/phones/nexus-s'); + }); + + + it('should display nexus-s page', function() { + expect(binding('phone.name')).toBe('Nexus S'); }); - it('should render view1 when user navigates to /view2', function() { - expect(element('ng\\:view p:first').text()). - toMatch(/partial for view 2/) + it('should display the first phone image as the main phone image', function() { + expect(element('img.phone').attr('src')).toBe('img/phones/nexus-s.0.jpg'); }); + + it('should swap main image if a thumbnail image is clicked on', function() { + element('.phone-thumbs li:nth-child(3) img').click(); + expect(element('img.phone').attr('src')).toBe('img/phones/nexus-s.2.jpg'); + + element('.phone-thumbs li:nth-child(1) img').click(); + expect(element('img.phone').attr('src')).toBe('img/phones/nexus-s.0.jpg'); + }); }); }); diff --git a/test/unit/controllersSpec.js b/test/unit/controllersSpec.js index 5761a4ea2..5b6a2a18c 100644 --- a/test/unit/controllersSpec.js +++ b/test/unit/controllersSpec.js @@ -1,29 +1,66 @@ /* jasmine specs for controllers go here */ - -describe('MyCtrl1', function(){ - var myCtrl1; +describe('PhoneCat controllers', function() { beforeEach(function(){ - myCtrl1 = new MyCtrl1(); + this.addMatchers({ + toEqualData: function(expected) { + return angular.equals(this.actual, expected); + } + }); }); - it('should ....', function() { - //spec body - }); -}); + describe('PhoneListCtrl', function(){ + var scope, $browser, ctrl; + beforeEach(function() { + scope = angular.scope(); + $browser = scope.$service('$browser'); -describe('MyCtrl2', function(){ - var myCtrl2; + $browser.xhr.expectGET('phones/phones.json').respond([{name: 'Nexus S'}, + {name: 'Motorola DROID'}]); + ctrl = scope.$new(PhoneListCtrl); + }); - beforeEach(function(){ - myCtrl2 = new MyCtrl2(); + it('should create "phones" model with 2 phones fetched from xhr', function() { + expect(ctrl.phones).toEqual([]); + $browser.xhr.flush(); + + expect(ctrl.phones).toEqualData([{name: 'Nexus S'}, + {name: 'Motorola DROID'}]); + }); + + + it('should set the default value of orderProp model', function() { + expect(ctrl.orderProp).toBe('age'); + }); }); - it('should ....', function() { - //spec body + describe('PhoneDetailCtrl', function(){ + var scope, $browser, ctrl; + + beforeEach(function() { + scope = angular.scope(); + $browser = scope.$service('$browser'); + }); + + beforeEach(function() { + scope = angular.scope(); + $browser = scope.$service('$browser'); + }); + + + it('should fetch phone detail', function(){ + scope.params = {phoneId:'xyz'}; + $browser.xhr.expectGET('phones/xyz.json').respond({name:'phone xyz'}); + ctrl = scope.$new(PhoneDetailCtrl); + + expect(ctrl.phone).toEqualData({}); + $browser.xhr.flush(); + + expect(ctrl.phone).toEqualData({name:'phone xyz'}); + }); }); }); diff --git a/test/unit/filtersSpec.js b/test/unit/filtersSpec.js index 0e5691fda..5dabda7d0 100644 --- a/test/unit/filtersSpec.js +++ b/test/unit/filtersSpec.js @@ -1 +1,9 @@ /* jasmine specs for filters go here */ + +describe('checkmark filter', function() { + + it('should convert boolean values to unicode checkmark or cross', function() { + expect(angular.filter.checkmark(true)).toBe('\u2713'); + expect(angular.filter.checkmark(false)).toBe('\u2718'); + }); +})