Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Now with phonegap

  • Loading branch information...
commit 36c021cf96f18a68ae83dc4983aa052710b39ec6 1 parent d51bc08
Gabe Hamilton authored
Showing with 4,613 additions and 129 deletions.
  1. +27 −0 app/index.html
  2. +0 −43 app/index6.html
  3. +4,586 −0 app/phonegap-1.4.1.js
  4. +0 −86 index.html
View
27 app/index.html
@@ -22,6 +22,30 @@
}
);
</script>
+ <script type="text/javascript" charset="utf-8" src="phonegap-1.4.1.js"></script>
+
+ <script>
+ function PictureSourceType() {};
+ PictureSourceType.PHOTO_LIBRARY = 0;
+ PictureSourceType.CAMERA = 1;
+
+ function getPicture(sourceType)
+ {
+ var options = { quality: 10 };
+ if (sourceType != undefined) {
+ options["sourceType"] = sourceType;
+ }
+ // if no sourceType specified, the default is CAMERA
+ navigator.camera.getPicture(getPicture_Success, null, options);
+ };
+
+ function getPicture_Success(imageData)
+ {
+ alert("getpic success");
+ document.getElementById("test_img").src = "data:image/jpeg;base64," + imageData;
+ }
+
+ </script>
<style>
/* vertically center the image */
.refresh img {
@@ -63,11 +87,14 @@ <h1 data-dojo-type="dojox.mobile.Heading" back="Home" moveTo="home">Back</h1>
<li data-dojo-type="dojox.mobile.ListItem" icon="images/camera-photo.png" rightText="">
<div data-dojo-type="dojox.mobile.ToolBarButton"
data-dojo-props="icon: 'images/camera-photo.png'" class="actionButton refresh"></div>
+ <button onclick="getPicture()">From Camera</button>
+ <button onclick="getPicture(PictureSourceType.PHOTO_LIBRARY)">From Photo Library</button>
</li>
</ul>
</div>
<div id="screens" data-dojo-type="dojox.mobile.ScrollableView">
<h1 data-dojo-type="dojox.mobile.Heading" back="Home" moveTo="home">Back</h1>
+ <img style="width:60px;height:60px" id="test_img" src="" />
</div>
<ul id="tabBar" data-dojo-type="dojox.mobile.TabBar" data-dojo-props="iconBase: 'images/iconStrip.png'">
View
43 app/index6.html
@@ -1,43 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
- "http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<head>
- <title></title>
-</head>
-<body>
-
-<!-- the view or "page"; select it as the "home" screen -->
-<div id="settings" dojoType="dojox.mobile.View" selected="true">
-
- <h1 dojoType="dojox.mobile.Heading">Blasting Agent</h1>
-
- <ul dojoType="dojox.mobile.RoundRectList">
-
- <li dojoType="dojox.mobile.ListItem" icon="images/icon-3.png" rightText="Slow"
- moveTo="screens">
- Display Screens
- <div class="mblItemSwitch" dojoType="dojox.mobile.Switch"></div>
- </li>
-
- <li dojoType="dojox.mobile.ListItem" icon="images/icon-3.png" rightText=""
- moveTo="camera">
- Take Pictures
- </li>
- </ul>
-</div>
-
-<!-- The "General" sub-page -->
-<div id="camera" dojoType="dojox.mobile.View">
- <h1 dojoType="dojox.mobile.Heading" back="Settings" moveTo="settings">Back</h1>
-
- <ul dojoType="dojox.mobile.RoundRectList">
- <li dojoType="dojox.mobile.ListItem" icon="images/icon-3.png" rightText="">
- </li>
- </ul>
-</div>
-<div id="screens" dojoType="dojox.mobile.View">
-
-</div>
-
-</body>
-</html>
View
4,586 app/phonegap-1.4.1.js
4,586 additions, 0 deletions not shown
View
86 index.html
@@ -1,86 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
- <title>Blasting Agent</title>
- <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no"/>
- <meta name="apple-mobile-web-app-capable" content="yes" />
- <link href="http://ajax.googleapis.com/ajax/libs/dojo/1.7.1/dojox/mobile/themes/android/android.css" rel="stylesheet"></link>
- <script src="http://ajax.googleapis.com/ajax/libs/dojo/1.7.1/dojo/dojo.js"
- djConfig="isDebug:true, parseOnLoad:true"></script>
- <script type="text/javascript">
- // Load the widget parser
- dojo.require("dojox.mobile.parser");
- // Load the base lib
- dojo.require("dojox.mobile");
- // If not a WebKit-based client, load compat
- dojo.requireIf(!dojo.isWebKit, "dojox.mobile.compat");
- </script>
-</head>
-<body>
-<!-- the view or "page"; select it as the "home" screen -->
-<div id="settings" dojoType="dojox.mobile.View" selected="true">
-
- <!-- a sample heading -->
- <h1 dojoType="dojox.mobile.Heading">"Homepage" View</h1>
-
- <!-- a rounded rectangle list container -->
- <ul dojoType="dojox.mobile.RoundRectList">
-
- <!-- list item with an icon containing a switch -->
- <li dojoType="dojox.mobile.ListItem" icon="images/icon-1.png">
- Airplane Mode
- <!-- the switch -->
- <div class="mblItemSwitch" dojoType="dojox.mobile.Switch"></div>
- </li>
-
- <!-- list item with an icon that slides this view away and then loads another page -->
- <li dojoType="dojox.mobile.ListItem" icon="images/icon-2.png" rightText="mac">
- Wi-Fi
- </li>
-
- <!-- list item with an icon that slides to a view called "general" -->
- <li dojoType="dojox.mobile.ListItem" icon="images/icon-3.png" rightText="AcmePhone" moveTo="general">
- Carrier
- </li>
- </ul>
-</div>
-
-<!-- The "General" sub-page -->
-<div id="general" dojoType="dojox.mobile.View">
- <!-- a sample heading -->
- <h1 dojoType="dojox.mobile.Heading" back="Settings" moveTo="settings">General View</h1>
- <!-- a rounded rectangle list container -->
- <ul dojoType="dojox.mobile.RoundRectList">
- <li dojoType="dojox.mobile.ListItem" moveTo="about">
- About
- </li>
- <li dojoType="dojox.mobile.ListItem" rightText="2h 40m" moveTo="about">
- Usage
- </li>
- </ul>
-</div>
-
-<!-- And let's add another view "About" -->
-<div id="about" dojoType="dojox.mobile.View">
- <!-- Main view heading -->
- <h1 dojoType="dojox.mobile.Heading" back="General" moveTo="general">About</h1>
- <!-- subheading -->
- <h2 dojoType="dojox.mobile.RoundRectCategory">Generic Mobile Device</h2>
- <!-- a rounded rectangle list container -->
- <ul dojoType="dojox.mobile.RoundRectList">
- <li dojoType="dojox.mobile.ListItem" rightText="AcmePhone">
- Network
- </li>
- <li dojoType="dojox.mobile.ListItem" rightText="AcmePhone">
- Line
- </li>
- <li dojoType="dojox.mobile.ListItem" rightText="1024">
- Songs
- </li>
- <li dojoType="dojox.mobile.ListItem" rightText="10">
- Videos
- </li>
- </ul>
-</div>
-</body>
-</html>
Please sign in to comment.
Something went wrong with that request. Please try again.