diff --git a/9781430240389.jpg b/9781430240389.jpg new file mode 100644 index 0000000..1127593 Binary files /dev/null and b/9781430240389.jpg differ diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 0000000..bbd9221 --- /dev/null +++ b/LICENSE.txt @@ -0,0 +1,27 @@ +Freeware License, some rights reserved + +Copyright (c) 2012 Scott Preston + +Permission is hereby granted, free of charge, to anyone obtaining a copy +of this software and associated documentation files (the "Software"), +to work with the Software within the limits of freeware distribution and fair use. +This includes the rights to use, copy, and modify the Software for personal use. +Users are also allowed and encouraged to submit corrections and modifications +to the Software for the benefit of other users. + +It is not allowed to reuse, modify, or redistribute the Software for +commercial use in any way, or for a user’s educational materials such as books +or blog articles without prior permission from the copyright holder. + +The above copyright notice and this permission notice need to be included +in all copies or substantial portions of the software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS OR APRESS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + + diff --git a/README.md b/README.md new file mode 100644 index 0000000..6afad5f --- /dev/null +++ b/README.md @@ -0,0 +1,15 @@ +#Apress Source Code + +This repository accompanies [*Learn HTML5 and JavaScript for iOS*](http://www.apress.com/9781430240389) by Scott Preston (Apress, 2012). + +![Cover image](9781430240389.jpg) + +Download the files as a zip using the green button, or clone the repository to your machine using Git. + +##Releases + +Release v1.0 corresponds to the code in the published book, without corrections or updates. + +##Contributions + +See the file Contributing.md for more information on how you can contribute to this repository. diff --git a/__MACOSX/._index.html b/__MACOSX/._index.html new file mode 100644 index 0000000..24d4842 Binary files /dev/null and b/__MACOSX/._index.html differ diff --git a/__MACOSX/chapter1/._index.html b/__MACOSX/chapter1/._index.html new file mode 100644 index 0000000..cc4ca8b Binary files /dev/null and b/__MACOSX/chapter1/._index.html differ diff --git a/__MACOSX/chapter11/._index.html b/__MACOSX/chapter11/._index.html new file mode 100644 index 0000000..f8c0a8e Binary files /dev/null and b/__MACOSX/chapter11/._index.html differ diff --git a/__MACOSX/chapter13/._abtest.html b/__MACOSX/chapter13/._abtest.html new file mode 100644 index 0000000..6766cef Binary files /dev/null and b/__MACOSX/chapter13/._abtest.html differ diff --git a/__MACOSX/chapter13/._benchmark.html b/__MACOSX/chapter13/._benchmark.html new file mode 100644 index 0000000..24d4842 Binary files /dev/null and b/__MACOSX/chapter13/._benchmark.html differ diff --git a/__MACOSX/chapter13/._index.html b/__MACOSX/chapter13/._index.html new file mode 100644 index 0000000..24d4842 Binary files /dev/null and b/__MACOSX/chapter13/._index.html differ diff --git a/__MACOSX/chapter13/._jasmine.html b/__MACOSX/chapter13/._jasmine.html new file mode 100644 index 0000000..24d4842 Binary files /dev/null and b/__MACOSX/chapter13/._jasmine.html differ diff --git a/__MACOSX/chapter13/._network.html b/__MACOSX/chapter13/._network.html new file mode 100644 index 0000000..0b03e60 Binary files /dev/null and b/__MACOSX/chapter13/._network.html differ diff --git a/__MACOSX/chapter13/._pag1.html b/__MACOSX/chapter13/._pag1.html new file mode 100644 index 0000000..24d4842 Binary files /dev/null and b/__MACOSX/chapter13/._pag1.html differ diff --git a/__MACOSX/chapter13/._tdd.html b/__MACOSX/chapter13/._tdd.html new file mode 100644 index 0000000..24d4842 Binary files /dev/null and b/__MACOSX/chapter13/._tdd.html differ diff --git a/__MACOSX/chapter13/._watir.html b/__MACOSX/chapter13/._watir.html new file mode 100644 index 0000000..48bb872 Binary files /dev/null and b/__MACOSX/chapter13/._watir.html differ diff --git a/__MACOSX/chapter2/._index.html b/__MACOSX/chapter2/._index.html new file mode 100644 index 0000000..0c616f7 Binary files /dev/null and b/__MACOSX/chapter2/._index.html differ diff --git a/__MACOSX/chapter2/._structure.html b/__MACOSX/chapter2/._structure.html new file mode 100644 index 0000000..0224dc1 Binary files /dev/null and b/__MACOSX/chapter2/._structure.html differ diff --git a/__MACOSX/chapter3/._basics1.html b/__MACOSX/chapter3/._basics1.html new file mode 100644 index 0000000..24d4842 Binary files /dev/null and b/__MACOSX/chapter3/._basics1.html differ diff --git a/__MACOSX/chapter3/._basics2.html b/__MACOSX/chapter3/._basics2.html new file mode 100644 index 0000000..24d4842 Binary files /dev/null and b/__MACOSX/chapter3/._basics2.html differ diff --git a/__MACOSX/chapter3/._index.html b/__MACOSX/chapter3/._index.html new file mode 100644 index 0000000..24d4842 Binary files /dev/null and b/__MACOSX/chapter3/._index.html differ diff --git a/__MACOSX/chapter3/._iosselect.html b/__MACOSX/chapter3/._iosselect.html new file mode 100644 index 0000000..11ccdfe Binary files /dev/null and b/__MACOSX/chapter3/._iosselect.html differ diff --git a/__MACOSX/chapter3/._ipad.html b/__MACOSX/chapter3/._ipad.html new file mode 100644 index 0000000..24d4842 Binary files /dev/null and b/__MACOSX/chapter3/._ipad.html differ diff --git a/__MACOSX/chapter3/._orient.html b/__MACOSX/chapter3/._orient.html new file mode 100644 index 0000000..24d4842 Binary files /dev/null and b/__MACOSX/chapter3/._orient.html differ diff --git a/__MACOSX/chapter3/._pag2.html b/__MACOSX/chapter3/._pag2.html new file mode 100644 index 0000000..24d4842 Binary files /dev/null and b/__MACOSX/chapter3/._pag2.html differ diff --git a/__MACOSX/chapter3/._retina.html b/__MACOSX/chapter3/._retina.html new file mode 100644 index 0000000..24d4842 Binary files /dev/null and b/__MACOSX/chapter3/._retina.html differ diff --git a/__MACOSX/chapter3/._sample_buttons.html b/__MACOSX/chapter3/._sample_buttons.html new file mode 100644 index 0000000..24d4842 Binary files /dev/null and b/__MACOSX/chapter3/._sample_buttons.html differ diff --git a/__MACOSX/chapter3/._sample_header.html b/__MACOSX/chapter3/._sample_header.html new file mode 100644 index 0000000..24d4842 Binary files /dev/null and b/__MACOSX/chapter3/._sample_header.html differ diff --git a/__MACOSX/chapter3/._sample_list.html b/__MACOSX/chapter3/._sample_list.html new file mode 100644 index 0000000..24d4842 Binary files /dev/null and b/__MACOSX/chapter3/._sample_list.html differ diff --git a/__MACOSX/chapter3/._sample_list2.html b/__MACOSX/chapter3/._sample_list2.html new file mode 100644 index 0000000..24d4842 Binary files /dev/null and b/__MACOSX/chapter3/._sample_list2.html differ diff --git a/__MACOSX/chapter3/._sample_list3.html b/__MACOSX/chapter3/._sample_list3.html new file mode 100644 index 0000000..24d4842 Binary files /dev/null and b/__MACOSX/chapter3/._sample_list3.html differ diff --git a/__MACOSX/chapter3/css/._basic.css b/__MACOSX/chapter3/css/._basic.css new file mode 100644 index 0000000..738cd8d Binary files /dev/null and b/__MACOSX/chapter3/css/._basic.css differ diff --git a/__MACOSX/chapter4/._index.html b/__MACOSX/chapter4/._index.html new file mode 100644 index 0000000..cf4de2e Binary files /dev/null and b/__MACOSX/chapter4/._index.html differ diff --git a/__MACOSX/chapter6/._events.html b/__MACOSX/chapter6/._events.html new file mode 100644 index 0000000..f905e20 Binary files /dev/null and b/__MACOSX/chapter6/._events.html differ diff --git a/__MACOSX/chapter6/._events2.html b/__MACOSX/chapter6/._events2.html new file mode 100644 index 0000000..f905e20 Binary files /dev/null and b/__MACOSX/chapter6/._events2.html differ diff --git a/__MACOSX/chapter6/._index.html b/__MACOSX/chapter6/._index.html new file mode 100644 index 0000000..fa6d0b5 Binary files /dev/null and b/__MACOSX/chapter6/._index.html differ diff --git a/__MACOSX/chapter9/._index.html b/__MACOSX/chapter9/._index.html new file mode 100644 index 0000000..2a84aa6 Binary files /dev/null and b/__MACOSX/chapter9/._index.html differ diff --git a/chapter1/fullscreen.html b/chapter1/fullscreen.html new file mode 100644 index 0000000..9a1828d --- /dev/null +++ b/chapter1/fullscreen.html @@ -0,0 +1,17 @@ + + + + + Chapter 1 - Full Screen Example + + +

Chapter 1 - Full Screen Example

+
+

No Viewport Setting

+ +

This is an example of a page with no viewport <META> tag.

+ +
+ + + \ No newline at end of file diff --git a/chapter1/images/sample_300.png b/chapter1/images/sample_300.png new file mode 100644 index 0000000..c78e584 Binary files /dev/null and b/chapter1/images/sample_300.png differ diff --git a/chapter1/index.html b/chapter1/index.html new file mode 100644 index 0000000..a3b04c3 --- /dev/null +++ b/chapter1/index.html @@ -0,0 +1,21 @@ + + + + + Chapter 1 - Getting Started + + +

Chapter 1 - Examples

+
    +
  1. Redirect - Ways to redirect to your mobile site.
  2. +
  3. FullScreen - Example of a website desktop version.
  4. +
  5. Viewport - Fullscreen example with <meta> tag viewport.
  6. +
  7. Sample Home Sample home page of GrandviewAve.com
  8. +
+

Putting It All Together

+ + + \ No newline at end of file diff --git a/chapter1/redirect.html b/chapter1/redirect.html new file mode 100644 index 0000000..b2459d0 --- /dev/null +++ b/chapter1/redirect.html @@ -0,0 +1,55 @@ + + + + + Chapter 1 - Browser Redirect Example + + +

Chapter 1 - Browser Redirect Example

+
+

Apache Redirect (Domain)

+
+//This code for redirecting user to the mobile site unless there is a cookie
+RewriteEngine On
+RewriteCond %{HTTP_USER_AGENT} "iphone|ipod|ipad|googlebot-mobile" [NC]
+RewriteCond %{HTTP_COOKIE} !^.*nomobile=true.*$
+RewriteRule ^.*$ https://m.domain.com [R=301]
+
+

Apache Redirect (Directory)

+
+RewriteCond %{REQUEST_URI} !^/m/.*$
+RewriteCond %{HTTP_USER_AGENT} "iphone|ipod|ipad|googlebot-mobile" [NC]
+RewriteCond %{HTTP_COOKIE} !^.*nomobile=true.*$
+RewriteRule ^(.*)$ /m/ [L,R=301]
+
+ +

JavaScript Redirect

+ +

This is an example of redirecting based on your device.

+ + + + \ No newline at end of file diff --git a/chapter1/samplehome.html b/chapter1/samplehome.html new file mode 100644 index 0000000..d051bd0 --- /dev/null +++ b/chapter1/samplehome.html @@ -0,0 +1,24 @@ + + + + + Sample Header? + + + +

Sample Header?

+
+
+

Navigation?

+ + + \ No newline at end of file diff --git a/chapter1/viewport.html b/chapter1/viewport.html new file mode 100644 index 0000000..815fab7 --- /dev/null +++ b/chapter1/viewport.html @@ -0,0 +1,20 @@ + + + + Chapter 1 - ViewPort Example + + + + +

Chapter 1 - ViewPort Example

+
+

With Viewport Setting

+ +

This is an example of a page with the viewport <META> tag set to:

+
+<meta name="viewport" content="width=device-width">
+
+
+ + + \ No newline at end of file diff --git a/chapter10/audio.html b/chapter10/audio.html new file mode 100644 index 0000000..3589d76 --- /dev/null +++ b/chapter10/audio.html @@ -0,0 +1,16 @@ + + + + Chapter 10 - Audio Example + + + + +

Chapter 10 - Audio Example

+
+

Audio Test

+ +

The example below will play an audio file.

+