mobile_template 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +17 -0
- data/Gemfile +4 -0
- data/LICENSE +22 -0
- data/README.md +28 -0
- data/Rakefile +3 -0
- data/bin/mobile_template +71 -0
- data/lib/mobile_template/version.rb +4 -0
- data/lib/mobile_template.rb +5 -0
- data/mobile_template.gemspec +21 -0
- data/templates/assets/Gemfile +4 -0
- data/templates/assets/config.rb +96 -0
- data/templates/assets/config.ru +4 -0
- data/templates/assets/source/images/vendor/ajax-loader.gif +0 -0
- data/templates/assets/source/images/vendor/ajax-loader.png +0 -0
- data/templates/assets/source/images/vendor/icons-18-black.png +0 -0
- data/templates/assets/source/images/vendor/icons-18-white.png +0 -0
- data/templates/assets/source/images/vendor/icons-36-black.png +0 -0
- data/templates/assets/source/images/vendor/icons-36-white.png +0 -0
- data/templates/assets/source/index.html.erb +2 -0
- data/templates/assets/source/javascripts/app/index.js.coffee +2 -0
- data/templates/assets/source/javascripts/application.js.coffee +5 -0
- data/templates/assets/source/javascripts/vendor/cordova.js +4841 -0
- data/templates/assets/source/javascripts/vendor/jquery.js +9267 -0
- data/templates/assets/source/javascripts/vendor/jquery.mobile.js +7410 -0
- data/templates/assets/source/layout.erb +24 -0
- data/templates/assets/source/stylesheets/application.css.scss +2 -0
- data/templates/assets/source/stylesheets/vendor/jquery.mobile.css.scss +1872 -0
- data/templates/cordova_android/.gitignore +18 -0
- data/templates/cordova_android/LICENSE +202 -0
- data/templates/cordova_android/NOTICE +5 -0
- data/templates/cordova_android/README.md +95 -0
- data/templates/cordova_android/VERSION +1 -0
- data/templates/cordova_android/bin/BOOM +4 -0
- data/templates/cordova_android/bin/autotest +2 -0
- data/templates/cordova_android/bin/bench +29 -0
- data/templates/cordova_android/bin/create +46 -0
- data/templates/cordova_android/bin/create.bat +1 -0
- data/templates/cordova_android/bin/create.js +88 -0
- data/templates/cordova_android/bin/create.xml +79 -0
- data/templates/cordova_android/bin/node_modules/.bin/cake +7 -0
- data/templates/cordova_android/bin/node_modules/.bin/coffee +7 -0
- data/templates/cordova_android/bin/node_modules/.bin/nodeunit +120 -0
- data/templates/cordova_android/bin/node_modules/coffee-script/.npmignore +11 -0
- data/templates/cordova_android/bin/node_modules/coffee-script/LICENSE +22 -0
- data/templates/cordova_android/bin/node_modules/coffee-script/README +48 -0
- data/templates/cordova_android/bin/node_modules/coffee-script/Rakefile +78 -0
- data/templates/cordova_android/bin/node_modules/coffee-script/bin/cake +7 -0
- data/templates/cordova_android/bin/node_modules/coffee-script/bin/coffee +7 -0
- data/templates/cordova_android/bin/node_modules/coffee-script/extras/jsl.conf +44 -0
- data/templates/cordova_android/bin/node_modules/coffee-script/lib/browser.js +75 -0
- data/templates/cordova_android/bin/node_modules/coffee-script/lib/cake.js +76 -0
- data/templates/cordova_android/bin/node_modules/coffee-script/lib/coffee-script.js +135 -0
- data/templates/cordova_android/bin/node_modules/coffee-script/lib/command.js +301 -0
- data/templates/cordova_android/bin/node_modules/coffee-script/lib/grammar.js +591 -0
- data/templates/cordova_android/bin/node_modules/coffee-script/lib/helpers.js +66 -0
- data/templates/cordova_android/bin/node_modules/coffee-script/lib/index.js +8 -0
- data/templates/cordova_android/bin/node_modules/coffee-script/lib/lexer.js +656 -0
- data/templates/cordova_android/bin/node_modules/coffee-script/lib/nodes.js +2289 -0
- data/templates/cordova_android/bin/node_modules/coffee-script/lib/optparse.js +111 -0
- data/templates/cordova_android/bin/node_modules/coffee-script/lib/parser.js +676 -0
- data/templates/cordova_android/bin/node_modules/coffee-script/lib/repl.js +123 -0
- data/templates/cordova_android/bin/node_modules/coffee-script/lib/rewriter.js +363 -0
- data/templates/cordova_android/bin/node_modules/coffee-script/lib/scope.js +120 -0
- data/templates/cordova_android/bin/node_modules/coffee-script/package.json +27 -0
- data/templates/cordova_android/bin/node_modules/nodeunit/.gitignore +5 -0
- data/templates/cordova_android/bin/node_modules/nodeunit/.npmignore +3 -0
- data/templates/cordova_android/bin/node_modules/nodeunit/CONTRIBUTORS.md +60 -0
- data/templates/cordova_android/bin/node_modules/nodeunit/LICENSE +19 -0
- data/templates/cordova_android/bin/node_modules/nodeunit/Makefile +126 -0
- data/templates/cordova_android/bin/node_modules/nodeunit/README.md +432 -0
- data/templates/cordova_android/bin/node_modules/nodeunit/bin/nodeunit +120 -0
- data/templates/cordova_android/bin/node_modules/nodeunit/bin/nodeunit.json +10 -0
- data/templates/cordova_android/bin/node_modules/nodeunit/deps/async.js +623 -0
- data/templates/cordova_android/bin/node_modules/nodeunit/deps/console.log.js +55 -0
- data/templates/cordova_android/bin/node_modules/nodeunit/deps/ejs.js +125 -0
- data/templates/cordova_android/bin/node_modules/nodeunit/deps/json2.js +483 -0
- data/templates/cordova_android/bin/node_modules/nodeunit/examples/browser/nodeunit.js +1757 -0
- data/templates/cordova_android/bin/node_modules/nodeunit/examples/browser/suite1.js +12 -0
- data/templates/cordova_android/bin/node_modules/nodeunit/examples/browser/suite2.js +13 -0
- data/templates/cordova_android/bin/node_modules/nodeunit/examples/browser/test.html +16 -0
- data/templates/cordova_android/bin/node_modules/nodeunit/img/example_fail.png +0 -0
- data/templates/cordova_android/bin/node_modules/nodeunit/img/example_pass.png +0 -0
- data/templates/cordova_android/bin/node_modules/nodeunit/index.js +3 -0
- data/templates/cordova_android/bin/node_modules/nodeunit/lib/assert.js +316 -0
- data/templates/cordova_android/bin/node_modules/nodeunit/lib/core.js +260 -0
- data/templates/cordova_android/bin/node_modules/nodeunit/lib/nodeunit.js +82 -0
- data/templates/cordova_android/bin/node_modules/nodeunit/lib/reporters/browser.js +119 -0
- data/templates/cordova_android/bin/node_modules/nodeunit/lib/reporters/default.js +123 -0
- data/templates/cordova_android/bin/node_modules/nodeunit/lib/reporters/html.js +107 -0
- data/templates/cordova_android/bin/node_modules/nodeunit/lib/reporters/index.js +9 -0
- data/templates/cordova_android/bin/node_modules/nodeunit/lib/reporters/junit.js +183 -0
- data/templates/cordova_android/bin/node_modules/nodeunit/lib/reporters/minimal.js +112 -0
- data/templates/cordova_android/bin/node_modules/nodeunit/lib/reporters/skip_passed.js +105 -0
- data/templates/cordova_android/bin/node_modules/nodeunit/lib/track.js +48 -0
- data/templates/cordova_android/bin/node_modules/nodeunit/lib/types.js +187 -0
- data/templates/cordova_android/bin/node_modules/nodeunit/lib/utils.js +209 -0
- data/templates/cordova_android/bin/node_modules/nodeunit/man1/nodeunit.1 +95 -0
- data/templates/cordova_android/bin/node_modules/nodeunit/nodelint.cfg +4 -0
- data/templates/cordova_android/bin/node_modules/nodeunit/package.json +56 -0
- data/templates/cordova_android/bin/node_modules/nodeunit/share/junit.xml.ejs +19 -0
- data/templates/cordova_android/bin/node_modules/nodeunit/share/license.js +11 -0
- data/templates/cordova_android/bin/node_modules/nodeunit/share/nodeunit.css +70 -0
- data/templates/cordova_android/bin/templates/project/.cordova/android/readme.md +1 -0
- data/templates/cordova_android/bin/templates/project/.cordova/readme.md +3 -0
- data/templates/cordova_android/bin/templates/project/cordova/create +36 -0
- data/templates/cordova_android/bin/templates/project/cordova/debug +9 -0
- data/templates/cordova_android/bin/templates/project/cordova/emulate +12 -0
- data/templates/cordova_android/bin/templates/project/cordova/log +3 -0
- data/templates/cordova_android/bin/templates/project/cordova/templates/Activity.java +16 -0
- data/templates/cordova_android/bin/templates/project/cordova/templates/project/AndroidManifest.xml +50 -0
- data/templates/cordova_android/bin/templates/project/cordova/templates/project/assets/www/index.html +42 -0
- data/templates/cordova_android/bin/templates/project/cordova/templates/project/assets/www/main.js +146 -0
- data/templates/cordova_android/bin/templates/project/cordova/templates/project/assets/www/master.css +96 -0
- data/templates/cordova_android/bin/templates/project/cordova/templates/project/res/drawable/icon.png +0 -0
- data/templates/cordova_android/bin/templates/project/cordova/templates/project/res/xml/cordova.xml +5 -0
- data/templates/cordova_android/bin/templates/project/cordova/templates/project/res/xml/plugins.xml +19 -0
- data/templates/cordova_android/bin/test +26 -0
- data/templates/cordova_android/bin/tests/autotest.coffee +4 -0
- data/templates/cordova_android/bin/tests/create.coffee +21 -0
- data/templates/cordova_android/bin/tests/debug.coffee +0 -0
- data/templates/cordova_android/bin/tests/test.coffee +0 -0
- data/templates/cordova_android/framework/.classpath +8 -0
- data/templates/cordova_android/framework/.project +33 -0
- data/templates/cordova_android/framework/AndroidManifest.xml +68 -0
- data/templates/cordova_android/framework/ant.properties +34 -0
- data/templates/cordova_android/framework/assets/js/accelerometer.js +137 -0
- data/templates/cordova_android/framework/assets/js/app.js +89 -0
- data/templates/cordova_android/framework/assets/js/battery.js +134 -0
- data/templates/cordova_android/framework/assets/js/camera.js +168 -0
- data/templates/cordova_android/framework/assets/js/capture.js +203 -0
- data/templates/cordova_android/framework/assets/js/compass.js +168 -0
- data/templates/cordova_android/framework/assets/js/contact.js +310 -0
- data/templates/cordova_android/framework/assets/js/cordova.android.js +4841 -0
- data/templates/cordova_android/framework/assets/js/cordova.js.base +924 -0
- data/templates/cordova_android/framework/assets/js/crypto.js +54 -0
- data/templates/cordova_android/framework/assets/js/device.js +83 -0
- data/templates/cordova_android/framework/assets/js/file.js +1082 -0
- data/templates/cordova_android/framework/assets/js/filetransfer.js +125 -0
- data/templates/cordova_android/framework/assets/js/geolocation.js +209 -0
- data/templates/cordova_android/framework/assets/js/header.txt +19 -0
- data/templates/cordova_android/framework/assets/js/media.js +233 -0
- data/templates/cordova_android/framework/assets/js/network.js +100 -0
- data/templates/cordova_android/framework/assets/js/notification.js +133 -0
- data/templates/cordova_android/framework/assets/js/position.js +100 -0
- data/templates/cordova_android/framework/assets/js/storage.js +439 -0
- data/templates/cordova_android/framework/assets/www/index.html +27 -0
- data/templates/cordova_android/framework/build.xml +216 -0
- data/templates/cordova_android/framework/libs/commons-codec-1.3.jar +0 -0
- data/templates/cordova_android/framework/proguard-project.txt +20 -0
- data/templates/cordova_android/framework/project.properties +14 -0
- data/templates/cordova_android/framework/res/drawable/icon.png +0 -0
- data/templates/cordova_android/framework/res/drawable/splash.png +0 -0
- data/templates/cordova_android/framework/res/layout/main.xml +29 -0
- data/templates/cordova_android/framework/res/values/strings.xml +23 -0
- data/templates/cordova_android/framework/res/xml/cordova.xml +37 -0
- data/templates/cordova_android/framework/res/xml/plugins.xml +37 -0
- data/templates/cordova_android/framework/src/com/phonegap/api/IPlugin.java +27 -0
- data/templates/cordova_android/framework/src/com/phonegap/api/LOG.java +28 -0
- data/templates/cordova_android/framework/src/com/phonegap/api/PhonegapActivity.java +28 -0
- data/templates/cordova_android/framework/src/com/phonegap/api/Plugin.java +27 -0
- data/templates/cordova_android/framework/src/com/phonegap/api/PluginManager.java +35 -0
- data/templates/cordova_android/framework/src/com/phonegap/api/PluginResult.java +53 -0
- data/templates/cordova_android/framework/src/org/apache/cordova/AccelListener.java +311 -0
- data/templates/cordova_android/framework/src/org/apache/cordova/App.java +198 -0
- data/templates/cordova_android/framework/src/org/apache/cordova/AudioHandler.java +364 -0
- data/templates/cordova_android/framework/src/org/apache/cordova/AudioPlayer.java +450 -0
- data/templates/cordova_android/framework/src/org/apache/cordova/AuthenticationToken.java +69 -0
- data/templates/cordova_android/framework/src/org/apache/cordova/BatteryListener.java +156 -0
- data/templates/cordova_android/framework/src/org/apache/cordova/CallbackServer.java +431 -0
- data/templates/cordova_android/framework/src/org/apache/cordova/CameraLauncher.java +500 -0
- data/templates/cordova_android/framework/src/org/apache/cordova/Capture.java +400 -0
- data/templates/cordova_android/framework/src/org/apache/cordova/CompassListener.java +308 -0
- data/templates/cordova_android/framework/src/org/apache/cordova/ContactAccessor.java +198 -0
- data/templates/cordova_android/framework/src/org/apache/cordova/ContactAccessorSdk5.java +1934 -0
- data/templates/cordova_android/framework/src/org/apache/cordova/ContactManager.java +113 -0
- data/templates/cordova_android/framework/src/org/apache/cordova/CordovaChromeClient.java +314 -0
- data/templates/cordova_android/framework/src/org/apache/cordova/CordovaWebViewClient.java +306 -0
- data/templates/cordova_android/framework/src/org/apache/cordova/Device.java +219 -0
- data/templates/cordova_android/framework/src/org/apache/cordova/DirectoryManager.java +161 -0
- data/templates/cordova_android/framework/src/org/apache/cordova/DroidGap.java +1417 -0
- data/templates/cordova_android/framework/src/org/apache/cordova/ExifHelper.java +165 -0
- data/templates/cordova_android/framework/src/org/apache/cordova/FileTransfer.java +458 -0
- data/templates/cordova_android/framework/src/org/apache/cordova/FileUploadResult.java +63 -0
- data/templates/cordova_android/framework/src/org/apache/cordova/FileUtils.java +1048 -0
- data/templates/cordova_android/framework/src/org/apache/cordova/GeoBroker.java +165 -0
- data/templates/cordova_android/framework/src/org/apache/cordova/GeoListener.java +133 -0
- data/templates/cordova_android/framework/src/org/apache/cordova/GpsListener.java +163 -0
- data/templates/cordova_android/framework/src/org/apache/cordova/HttpHandler.java +80 -0
- data/templates/cordova_android/framework/src/org/apache/cordova/LinearLayoutSoftKeyboardDetect.java +104 -0
- data/templates/cordova_android/framework/src/org/apache/cordova/NetworkListener.java +153 -0
- data/templates/cordova_android/framework/src/org/apache/cordova/NetworkManager.java +248 -0
- data/templates/cordova_android/framework/src/org/apache/cordova/Notification.java +366 -0
- data/templates/cordova_android/framework/src/org/apache/cordova/PreferenceNode.java +34 -0
- data/templates/cordova_android/framework/src/org/apache/cordova/PreferenceSet.java +62 -0
- data/templates/cordova_android/framework/src/org/apache/cordova/StandAlone.java +35 -0
- data/templates/cordova_android/framework/src/org/apache/cordova/Storage.java +239 -0
- data/templates/cordova_android/framework/src/org/apache/cordova/TempListener.java +112 -0
- data/templates/cordova_android/framework/src/org/apache/cordova/api/CordovaInterface.java +145 -0
- data/templates/cordova_android/framework/src/org/apache/cordova/api/IPlugin.java +116 -0
- data/templates/cordova_android/framework/src/org/apache/cordova/api/LOG.java +234 -0
- data/templates/cordova_android/framework/src/org/apache/cordova/api/Plugin.java +210 -0
- data/templates/cordova_android/framework/src/org/apache/cordova/api/PluginManager.java +359 -0
- data/templates/cordova_android/framework/src/org/apache/cordova/api/PluginResult.java +119 -0
- data/templates/cordova_android/framework/src/org/apache/cordova/file/EncodingException.java +28 -0
- data/templates/cordova_android/framework/src/org/apache/cordova/file/FileExistsException.java +28 -0
- data/templates/cordova_android/framework/src/org/apache/cordova/file/InvalidModificationException.java +29 -0
- data/templates/cordova_android/framework/src/org/apache/cordova/file/NoModificationAllowedException.java +28 -0
- data/templates/cordova_android/framework/src/org/apache/cordova/file/TypeMismatchException.java +29 -0
- data/templates/cordova_android/framework/test/org/apache/cordova/PreferenceNodeTest.java +53 -0
- data/templates/cordova_android/framework/test/org/apache/cordova/PreferenceSetTest.java +73 -0
- metadata +279 -0
data/templates/cordova_android/bin/templates/project/cordova/templates/project/assets/www/master.css
ADDED
@@ -0,0 +1,96 @@
|
|
1
|
+
body {
|
2
|
+
background:#222 none repeat scroll 0 0;
|
3
|
+
color:#666;
|
4
|
+
font-family:Helvetica;
|
5
|
+
font-size:72%;
|
6
|
+
line-height:1.5em;
|
7
|
+
margin:0;
|
8
|
+
border-top:1px solid #393939;
|
9
|
+
}
|
10
|
+
|
11
|
+
#info{
|
12
|
+
background:#ffa;
|
13
|
+
border: 1px solid #ffd324;
|
14
|
+
-webkit-border-radius: 5px;
|
15
|
+
border-radius: 5px;
|
16
|
+
clear:both;
|
17
|
+
margin:15px 6px 0;
|
18
|
+
width:295px;
|
19
|
+
padding:4px 0px 2px 10px;
|
20
|
+
}
|
21
|
+
|
22
|
+
#info > h4{
|
23
|
+
font-size:.95em;
|
24
|
+
margin:5px 0;
|
25
|
+
}
|
26
|
+
|
27
|
+
#stage.theme{
|
28
|
+
padding-top:3px;
|
29
|
+
}
|
30
|
+
|
31
|
+
/* Definition List */
|
32
|
+
#stage.theme > dl{
|
33
|
+
padding-top:10px;
|
34
|
+
clear:both;
|
35
|
+
margin:0;
|
36
|
+
list-style-type:none;
|
37
|
+
padding-left:10px;
|
38
|
+
overflow:auto;
|
39
|
+
}
|
40
|
+
|
41
|
+
#stage.theme > dl > dt{
|
42
|
+
font-weight:bold;
|
43
|
+
float:left;
|
44
|
+
margin-left:5px;
|
45
|
+
}
|
46
|
+
|
47
|
+
#stage.theme > dl > dd{
|
48
|
+
width:45px;
|
49
|
+
float:left;
|
50
|
+
color:#a87;
|
51
|
+
font-weight:bold;
|
52
|
+
}
|
53
|
+
|
54
|
+
/* Content Styling */
|
55
|
+
#stage.theme > h1, #stage.theme > h2, #stage.theme > p{
|
56
|
+
margin:1em 0 .5em 13px;
|
57
|
+
}
|
58
|
+
|
59
|
+
#stage.theme > h1{
|
60
|
+
color:#eee;
|
61
|
+
font-size:1.6em;
|
62
|
+
text-align:center;
|
63
|
+
margin:0;
|
64
|
+
margin-top:15px;
|
65
|
+
padding:0;
|
66
|
+
}
|
67
|
+
|
68
|
+
#stage.theme > h2{
|
69
|
+
clear:both;
|
70
|
+
margin:0;
|
71
|
+
padding:3px;
|
72
|
+
font-size:1em;
|
73
|
+
text-align:center;
|
74
|
+
}
|
75
|
+
|
76
|
+
/* Stage Buttons */
|
77
|
+
#stage.theme a.btn{
|
78
|
+
border: 1px solid #555;
|
79
|
+
-webkit-border-radius: 5px;
|
80
|
+
border-radius: 5px;
|
81
|
+
text-align:center;
|
82
|
+
display:block;
|
83
|
+
float:left;
|
84
|
+
background:#444;
|
85
|
+
width:150px;
|
86
|
+
color:#9ab;
|
87
|
+
font-size:1.1em;
|
88
|
+
text-decoration:none;
|
89
|
+
padding:1.2em 0;
|
90
|
+
margin:3px 0px 3px 5px;
|
91
|
+
}
|
92
|
+
#stage.theme a.btn.large{
|
93
|
+
width:308px;
|
94
|
+
padding:1.2em 0;
|
95
|
+
}
|
96
|
+
|
data/templates/cordova_android/bin/templates/project/cordova/templates/project/res/drawable/icon.png
ADDED
Binary file
|
data/templates/cordova_android/bin/templates/project/cordova/templates/project/res/xml/plugins.xml
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
2
|
+
<plugins>
|
3
|
+
<plugin name="App" value="org.apache.cordova.App"/>
|
4
|
+
<plugin name="Geolocation" value="org.apache.cordova.GeoBroker"/>
|
5
|
+
<plugin name="Device" value="org.apache.cordova.Device"/>
|
6
|
+
<plugin name="Accelerometer" value="org.apache.cordova.AccelListener"/>
|
7
|
+
<plugin name="Compass" value="org.apache.cordova.CompassListener"/>
|
8
|
+
<plugin name="Media" value="org.apache.cordova.AudioHandler"/>
|
9
|
+
<plugin name="Camera" value="org.apache.cordova.CameraLauncher"/>
|
10
|
+
<plugin name="Contacts" value="org.apache.cordova.ContactManager"/>
|
11
|
+
<plugin name="File" value="org.apache.cordova.FileUtils"/>
|
12
|
+
<plugin name="Network Status" value="org.apache.cordova.NetworkManager"/>
|
13
|
+
<plugin name="Notification" value="org.apache.cordova.Notification"/>
|
14
|
+
<plugin name="Storage" value="org.apache.cordova.Storage"/>
|
15
|
+
<plugin name="Temperature" value="org.apache.cordova.TempListener"/>
|
16
|
+
<plugin name="FileTransfer" value="org.apache.cordova.FileTransfer"/>
|
17
|
+
<plugin name="Capture" value="org.apache.cordova.Capture"/>
|
18
|
+
<plugin name="Battery" value="org.apache.cordova.BatteryListener"/>
|
19
|
+
</plugins>
|
@@ -0,0 +1,26 @@
|
|
1
|
+
#! /bin/sh
|
2
|
+
set -e
|
3
|
+
|
4
|
+
VERSION=$(cat ./VERSION)
|
5
|
+
|
6
|
+
# get the latest mobile-spec
|
7
|
+
git clone git@github.com:callback/callback-test.git
|
8
|
+
|
9
|
+
# clobber test if it exists
|
10
|
+
if [ -e ./test ]
|
11
|
+
then
|
12
|
+
rm -rf ./test
|
13
|
+
fi
|
14
|
+
|
15
|
+
# generate a working proj
|
16
|
+
./bin/create ./test org.apache.cordova.test CordovaTest
|
17
|
+
|
18
|
+
# kill the default app and replace it w/ mobile-spec
|
19
|
+
rm -rf ./test/assets/www
|
20
|
+
mv ./callback-test ./test/assets/www
|
21
|
+
|
22
|
+
# copy in cordova.js since www dir was replaced above
|
23
|
+
cp ./framework/assets/www/cordova-$VERSION.js ./test/assets/www/cordova-$VERSION.js
|
24
|
+
|
25
|
+
# build it, launch it and start logging on stdout
|
26
|
+
cd ./test && ./cordova/debug && ./cordova/log
|
@@ -0,0 +1,21 @@
|
|
1
|
+
util = require 'util'
|
2
|
+
exec = require('child_process').exec
|
3
|
+
path = require 'path'
|
4
|
+
|
5
|
+
exports['default example project is generated'] = (test) ->
|
6
|
+
test.expect 1
|
7
|
+
exec './bin/create', (error, stdout, stderr) ->
|
8
|
+
test.ok true, "this assertion should pass" unless error?
|
9
|
+
test.done()
|
10
|
+
|
11
|
+
exports['default example project has a ./.cordova folder'] = (test) ->
|
12
|
+
test.expect 1
|
13
|
+
path.exists './example/.cordova', (exists) ->
|
14
|
+
test.ok exists, 'the cordova folder exists'
|
15
|
+
test.done()
|
16
|
+
|
17
|
+
exports['default example project has a /cordova folder'] = (test) ->
|
18
|
+
test.expect 1
|
19
|
+
path.exists './example/cordova', (exists) ->
|
20
|
+
test.ok exists, 'the other cordova folder exists'
|
21
|
+
test.done()
|
File without changes
|
File without changes
|
@@ -0,0 +1,8 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<classpath>
|
3
|
+
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
|
4
|
+
<classpathentry kind="src" path="src"/>
|
5
|
+
<classpathentry kind="src" path="gen"/>
|
6
|
+
<classpathentry kind="lib" path="libs/commons-codec-1.3.jar"/>
|
7
|
+
<classpathentry kind="output" path="bin/classes"/>
|
8
|
+
</classpath>
|
@@ -0,0 +1,33 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<projectDescription>
|
3
|
+
<name>Cordova</name>
|
4
|
+
<comment></comment>
|
5
|
+
<projects>
|
6
|
+
</projects>
|
7
|
+
<buildSpec>
|
8
|
+
<buildCommand>
|
9
|
+
<name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>
|
10
|
+
<arguments>
|
11
|
+
</arguments>
|
12
|
+
</buildCommand>
|
13
|
+
<buildCommand>
|
14
|
+
<name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>
|
15
|
+
<arguments>
|
16
|
+
</arguments>
|
17
|
+
</buildCommand>
|
18
|
+
<buildCommand>
|
19
|
+
<name>org.eclipse.jdt.core.javabuilder</name>
|
20
|
+
<arguments>
|
21
|
+
</arguments>
|
22
|
+
</buildCommand>
|
23
|
+
<buildCommand>
|
24
|
+
<name>com.android.ide.eclipse.adt.ApkBuilder</name>
|
25
|
+
<arguments>
|
26
|
+
</arguments>
|
27
|
+
</buildCommand>
|
28
|
+
</buildSpec>
|
29
|
+
<natures>
|
30
|
+
<nature>com.android.ide.eclipse.adt.AndroidNature</nature>
|
31
|
+
<nature>org.eclipse.jdt.core.javanature</nature>
|
32
|
+
</natures>
|
33
|
+
</projectDescription>
|
@@ -0,0 +1,68 @@
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
2
|
+
<!--
|
3
|
+
Licensed to the Apache Software Foundation (ASF) under one
|
4
|
+
or more contributor license agreements. See the NOTICE file
|
5
|
+
distributed with this work for additional information
|
6
|
+
regarding copyright ownership. The ASF licenses this file
|
7
|
+
to you under the Apache License, Version 2.0 (the
|
8
|
+
"License"); you may not use this file except in compliance
|
9
|
+
with the License. You may obtain a copy of the License at
|
10
|
+
|
11
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
12
|
+
|
13
|
+
Unless required by applicable law or agreed to in writing,
|
14
|
+
software distributed under the License is distributed on an
|
15
|
+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
16
|
+
KIND, either express or implied. See the License for the
|
17
|
+
specific language governing permissions and limitations
|
18
|
+
under the License.
|
19
|
+
-->
|
20
|
+
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:windowSoftInputMode="adjustPan"
|
21
|
+
package="org.apache.cordova" android:versionName="1.1" android:versionCode="5">
|
22
|
+
<supports-screens
|
23
|
+
android:largeScreens="true"
|
24
|
+
android:normalScreens="true"
|
25
|
+
android:smallScreens="true"
|
26
|
+
android:resizeable="true"
|
27
|
+
android:anyDensity="true"
|
28
|
+
/>
|
29
|
+
<!-- android:xlargeScreens="true" screen supported only after Android-9 -->
|
30
|
+
|
31
|
+
<uses-permission android:name="android.permission.VIBRATE" />
|
32
|
+
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
|
33
|
+
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
|
34
|
+
<uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" />
|
35
|
+
<uses-permission android:name="android.permission.INTERNET" />
|
36
|
+
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
|
37
|
+
<uses-permission android:name="android.permission.RECEIVE_SMS" />
|
38
|
+
<uses-permission android:name="android.permission.RECORD_AUDIO" />
|
39
|
+
<uses-permission android:name="android.permission.RECORD_VIDEO"/>
|
40
|
+
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
|
41
|
+
<uses-permission android:name="android.permission.READ_CONTACTS" />
|
42
|
+
<uses-permission android:name="android.permission.WRITE_CONTACTS" />
|
43
|
+
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
44
|
+
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
45
|
+
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
|
46
|
+
<uses-permission android:name="android.permission.BROADCAST_STICKY" />
|
47
|
+
|
48
|
+
<uses-feature android:name="android.hardware.camera" />
|
49
|
+
<uses-feature android:name="android.hardware.camera.autofocus" />
|
50
|
+
|
51
|
+
<application android:icon="@drawable/icon" android:label="@string/app_name"
|
52
|
+
android:debuggable="true">
|
53
|
+
<activity android:name=".StandAlone" android:windowSoftInputMode="adjustPan"
|
54
|
+
android:label="@string/app_name" android:configChanges="orientation|keyboardHidden">
|
55
|
+
<intent-filter>
|
56
|
+
<action android:name="android.intent.action.MAIN" />
|
57
|
+
<category android:name="android.intent.category.LAUNCHER" />
|
58
|
+
</intent-filter>
|
59
|
+
</activity>
|
60
|
+
<activity android:name="org.apache.cordova.DroidGap" android:label="@string/app_name"
|
61
|
+
android:configChanges="orientation|keyboardHidden">
|
62
|
+
<intent-filter>
|
63
|
+
</intent-filter>
|
64
|
+
</activity>
|
65
|
+
</application>
|
66
|
+
|
67
|
+
<uses-sdk android:minSdkVersion="2" />
|
68
|
+
</manifest>
|
@@ -0,0 +1,34 @@
|
|
1
|
+
# Licensed to the Apache Software Foundation (ASF) under one
|
2
|
+
# or more contributor license agreements. See the NOTICE file
|
3
|
+
# distributed with this work for additional information
|
4
|
+
# regarding copyright ownership. The ASF licenses this file
|
5
|
+
# to you under the Apache License, Version 2.0 (the
|
6
|
+
# "License"); you may not use this file except in compliance
|
7
|
+
# with the License. You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing,
|
12
|
+
# software distributed under the License is distributed on an
|
13
|
+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
14
|
+
# KIND, either express or implied. See the License for the
|
15
|
+
# specific language governing permissions and limitations
|
16
|
+
# under the License.
|
17
|
+
#
|
18
|
+
# This file is used to override default values used by the Ant build system.
|
19
|
+
#
|
20
|
+
# This file must be checked in Version Control Systems, as it is
|
21
|
+
# integral to the build system of your project.
|
22
|
+
|
23
|
+
# This file is only used by the Ant script.
|
24
|
+
|
25
|
+
# You can use this to override default values such as
|
26
|
+
# 'source.dir' for the location of your java source folder and
|
27
|
+
# 'out.dir' for the location of your output folder.
|
28
|
+
|
29
|
+
# You can also use it define how the release builds are signed by declaring
|
30
|
+
# the following properties:
|
31
|
+
# 'key.store' for the location of your keystore and
|
32
|
+
# 'key.alias' for the name of the key to use.
|
33
|
+
# The password will be asked during the build when you use the 'release' target.
|
34
|
+
|
@@ -0,0 +1,137 @@
|
|
1
|
+
/*
|
2
|
+
* Licensed to the Apache Software Foundation (ASF) under one
|
3
|
+
* or more contributor license agreements. See the NOTICE file
|
4
|
+
* distributed with this work for additional information
|
5
|
+
* regarding copyright ownership. The ASF licenses this file
|
6
|
+
* to you under the Apache License, Version 2.0 (the
|
7
|
+
* "License"); you may not use this file except in compliance
|
8
|
+
* with the License. You may obtain a copy of the License at
|
9
|
+
*
|
10
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
11
|
+
*
|
12
|
+
* Unless required by applicable law or agreed to in writing,
|
13
|
+
* software distributed under the License is distributed on an
|
14
|
+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
15
|
+
* KIND, either express or implied. See the License for the
|
16
|
+
* specific language governing permissions and limitations
|
17
|
+
* under the License.
|
18
|
+
*/
|
19
|
+
|
20
|
+
if (!Cordova.hasResource("accelerometer")) {
|
21
|
+
Cordova.addResource("accelerometer");
|
22
|
+
|
23
|
+
/** @constructor */
|
24
|
+
var Acceleration = function(x, y, z) {
|
25
|
+
this.x = x;
|
26
|
+
this.y = y;
|
27
|
+
this.z = z;
|
28
|
+
this.timestamp = new Date().getTime();
|
29
|
+
};
|
30
|
+
|
31
|
+
/**
|
32
|
+
* This class provides access to device accelerometer data.
|
33
|
+
* @constructor
|
34
|
+
*/
|
35
|
+
var Accelerometer = function() {
|
36
|
+
|
37
|
+
/**
|
38
|
+
* The last known acceleration. type=Acceleration()
|
39
|
+
*/
|
40
|
+
this.lastAcceleration = null;
|
41
|
+
|
42
|
+
/**
|
43
|
+
* List of accelerometer watch timers
|
44
|
+
*/
|
45
|
+
this.timers = {};
|
46
|
+
};
|
47
|
+
|
48
|
+
Accelerometer.ERROR_MSG = ["Not running", "Starting", "", "Failed to start"];
|
49
|
+
|
50
|
+
/**
|
51
|
+
* Asynchronously aquires the current acceleration.
|
52
|
+
*
|
53
|
+
* @param {Function} successCallback The function to call when the acceleration data is available
|
54
|
+
* @param {Function} errorCallback The function to call when there is an error getting the acceleration data. (OPTIONAL)
|
55
|
+
* @param {AccelerationOptions} options The options for getting the accelerometer data such as timeout. (OPTIONAL)
|
56
|
+
*/
|
57
|
+
Accelerometer.prototype.getCurrentAcceleration = function(successCallback, errorCallback, options) {
|
58
|
+
|
59
|
+
// successCallback required
|
60
|
+
if (typeof successCallback !== "function") {
|
61
|
+
console.log("Accelerometer Error: successCallback is not a function");
|
62
|
+
return;
|
63
|
+
}
|
64
|
+
|
65
|
+
// errorCallback optional
|
66
|
+
if (errorCallback && (typeof errorCallback !== "function")) {
|
67
|
+
console.log("Accelerometer Error: errorCallback is not a function");
|
68
|
+
return;
|
69
|
+
}
|
70
|
+
|
71
|
+
// Get acceleration
|
72
|
+
Cordova.exec(successCallback, errorCallback, "Accelerometer", "getAcceleration", []);
|
73
|
+
};
|
74
|
+
|
75
|
+
/**
|
76
|
+
* Asynchronously aquires the acceleration repeatedly at a given interval.
|
77
|
+
*
|
78
|
+
* @param {Function} successCallback The function to call each time the acceleration data is available
|
79
|
+
* @param {Function} errorCallback The function to call when there is an error getting the acceleration data. (OPTIONAL)
|
80
|
+
* @param {AccelerationOptions} options The options for getting the accelerometer data such as timeout. (OPTIONAL)
|
81
|
+
* @return String The watch id that must be passed to #clearWatch to stop watching.
|
82
|
+
*/
|
83
|
+
Accelerometer.prototype.watchAcceleration = function(successCallback, errorCallback, options) {
|
84
|
+
|
85
|
+
// Default interval (10 sec)
|
86
|
+
var frequency = (options !== undefined)? options.frequency : 10000;
|
87
|
+
|
88
|
+
// successCallback required
|
89
|
+
if (typeof successCallback !== "function") {
|
90
|
+
console.log("Accelerometer Error: successCallback is not a function");
|
91
|
+
return;
|
92
|
+
}
|
93
|
+
|
94
|
+
// errorCallback optional
|
95
|
+
if (errorCallback && (typeof errorCallback !== "function")) {
|
96
|
+
console.log("Accelerometer Error: errorCallback is not a function");
|
97
|
+
return;
|
98
|
+
}
|
99
|
+
|
100
|
+
// Make sure accelerometer timeout > frequency + 10 sec
|
101
|
+
Cordova.exec(
|
102
|
+
function(timeout) {
|
103
|
+
if (timeout < (frequency + 10000)) {
|
104
|
+
Cordova.exec(null, null, "Accelerometer", "setTimeout", [frequency + 10000]);
|
105
|
+
}
|
106
|
+
},
|
107
|
+
function(e) { }, "Accelerometer", "getTimeout", []);
|
108
|
+
|
109
|
+
// Start watch timer
|
110
|
+
var id = Cordova.createUUID();
|
111
|
+
navigator.accelerometer.timers[id] = setInterval(function() {
|
112
|
+
Cordova.exec(successCallback, errorCallback, "Accelerometer", "getAcceleration", []);
|
113
|
+
}, (frequency ? frequency : 1));
|
114
|
+
|
115
|
+
return id;
|
116
|
+
};
|
117
|
+
|
118
|
+
/**
|
119
|
+
* Clears the specified accelerometer watch.
|
120
|
+
*
|
121
|
+
* @param {String} id The id of the watch returned from #watchAcceleration.
|
122
|
+
*/
|
123
|
+
Accelerometer.prototype.clearWatch = function(id) {
|
124
|
+
|
125
|
+
// Stop javascript timer & remove from timer list
|
126
|
+
if (id && navigator.accelerometer.timers[id] !== undefined) {
|
127
|
+
clearInterval(navigator.accelerometer.timers[id]);
|
128
|
+
delete navigator.accelerometer.timers[id];
|
129
|
+
}
|
130
|
+
};
|
131
|
+
|
132
|
+
Cordova.addConstructor(function() {
|
133
|
+
if (typeof navigator.accelerometer === "undefined") {
|
134
|
+
navigator.accelerometer = new Accelerometer();
|
135
|
+
}
|
136
|
+
});
|
137
|
+
}
|
@@ -0,0 +1,89 @@
|
|
1
|
+
/*
|
2
|
+
* Licensed to the Apache Software Foundation (ASF) under one
|
3
|
+
* or more contributor license agreements. See the NOTICE file
|
4
|
+
* distributed with this work for additional information
|
5
|
+
* regarding copyright ownership. The ASF licenses this file
|
6
|
+
* to you under the Apache License, Version 2.0 (the
|
7
|
+
* "License"); you may not use this file except in compliance
|
8
|
+
* with the License. You may obtain a copy of the License at
|
9
|
+
*
|
10
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
11
|
+
*
|
12
|
+
* Unless required by applicable law or agreed to in writing,
|
13
|
+
* software distributed under the License is distributed on an
|
14
|
+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
15
|
+
* KIND, either express or implied. See the License for the
|
16
|
+
* specific language governing permissions and limitations
|
17
|
+
* under the License.
|
18
|
+
*/
|
19
|
+
|
20
|
+
if (!Cordova.hasResource("app")) {
|
21
|
+
Cordova.addResource("app");
|
22
|
+
(function() {
|
23
|
+
|
24
|
+
/**
|
25
|
+
* Constructor
|
26
|
+
* @constructor
|
27
|
+
*/
|
28
|
+
var App = function() {};
|
29
|
+
|
30
|
+
/**
|
31
|
+
* Clear the resource cache.
|
32
|
+
*/
|
33
|
+
App.prototype.clearCache = function() {
|
34
|
+
Cordova.exec(null, null, "App", "clearCache", []);
|
35
|
+
};
|
36
|
+
|
37
|
+
/**
|
38
|
+
* Load the url into the webview or into new browser instance.
|
39
|
+
*
|
40
|
+
* @param url The URL to load
|
41
|
+
* @param props Properties that can be passed in to the activity:
|
42
|
+
* wait: int => wait msec before loading URL
|
43
|
+
* loadingDialog: "Title,Message" => display a native loading dialog
|
44
|
+
* loadUrlTimeoutValue: int => time in msec to wait before triggering a timeout error
|
45
|
+
* clearHistory: boolean => clear webview history (default=false)
|
46
|
+
* openExternal: boolean => open in a new browser (default=false)
|
47
|
+
*
|
48
|
+
* Example:
|
49
|
+
* navigator.app.loadUrl("http://server/myapp/index.html", {wait:2000, loadingDialog:"Wait,Loading App", loadUrlTimeoutValue: 60000});
|
50
|
+
*/
|
51
|
+
App.prototype.loadUrl = function(url, props) {
|
52
|
+
Cordova.exec(null, null, "App", "loadUrl", [url, props]);
|
53
|
+
};
|
54
|
+
|
55
|
+
/**
|
56
|
+
* Cancel loadUrl that is waiting to be loaded.
|
57
|
+
*/
|
58
|
+
App.prototype.cancelLoadUrl = function() {
|
59
|
+
Cordova.exec(null, null, "App", "cancelLoadUrl", []);
|
60
|
+
};
|
61
|
+
|
62
|
+
/**
|
63
|
+
* Clear web history in this web view.
|
64
|
+
* Instead of BACK button loading the previous web page, it will exit the app.
|
65
|
+
*/
|
66
|
+
App.prototype.clearHistory = function() {
|
67
|
+
Cordova.exec(null, null, "App", "clearHistory", []);
|
68
|
+
};
|
69
|
+
|
70
|
+
/**
|
71
|
+
* Go to previous page displayed.
|
72
|
+
* This is the same as pressing the backbutton on Android device.
|
73
|
+
*/
|
74
|
+
App.prototype.backHistory = function() {
|
75
|
+
Cordova.exec(null, null, "App", "backHistory", []);
|
76
|
+
};
|
77
|
+
|
78
|
+
/**
|
79
|
+
* Exit and terminate the application.
|
80
|
+
*/
|
81
|
+
App.prototype.exitApp = function() {
|
82
|
+
return Cordova.exec(null, null, "App", "exitApp", []);
|
83
|
+
};
|
84
|
+
|
85
|
+
Cordova.addConstructor(function() {
|
86
|
+
navigator.app = new App();
|
87
|
+
});
|
88
|
+
}());
|
89
|
+
}
|