You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by pu...@apache.org on 2012/02/22 09:15:23 UTC
[1/29] wp7 commit: almost there
Updated Branches:
refs/heads/master 85ca66293 -> 25b09ad74
almost there
Project: http://git-wip-us.apache.org/repos/asf/incubator-cordova-wp7/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cordova-wp7/commit/25b09ad7
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-wp7/tree/25b09ad7
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-wp7/diff/25b09ad7
Branch: refs/heads/master
Commit: 25b09ad749fa276005ef69f5467b6df3a9a0099e
Parents: 0587c74
Author: Jesse MacFadyen <pu...@gmail.com>
Authored: Thu Feb 9 17:52:41 2012 -0800
Committer: Jesse MacFadyen <pu...@gmail.com>
Committed: Thu Feb 9 17:52:41 2012 -0800
----------------------------------------------------------------------
example/Calculator.cs | 16 +-
example/GapExample.csproj | 3 +-
example/GapSourceDictionary.xml | 2 +-
example/www/accelerometer.html | 210 +-
example/www/accelerometer2.html | 2 +-
example/www/audio.html | 2 +-
example/www/calculator.html | 6 +-
example/www/camera.html | 4 +-
example/www/capture.html | 2 +-
example/www/compass.html | 4 +-
example/www/contacts.html | 4 +-
example/www/cordova-1.4.1.js | 3832 ++++++++++++++++++++++++++++++++++
example/www/events.html | 2 +-
example/www/file.html | 4 +-
example/www/index.html | 8 +-
example/www/location.html | 4 +-
example/www/network.html | 6 +-
example/www/notification.html | 4 +-
example/www/phonegap-1.3.0.js | 3682 --------------------------------
example/www/storage.html | 4 +-
20 files changed, 3973 insertions(+), 3828 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-cordova-wp7/blob/25b09ad7/example/Calculator.cs
----------------------------------------------------------------------
diff --git a/example/Calculator.cs b/example/Calculator.cs
index 092321d..7963fe8 100644
--- a/example/Calculator.cs
+++ b/example/Calculator.cs
@@ -1,17 +1,11 @@
-/*
- * PhoneGap is available under *either* the terms of the modified BSD license *or* the
- * MIT License (2008). See http://opensource.org/licenses/alphabetical for full text.
- *
- * Copyright (c) 2005-2011, Nitobi Software Inc.
- * Copyright (c) 2011, Microsoft Corporation
- */
+
using System.Runtime.Serialization;
-using WP7GapClassLib.PhoneGap;
-using WP7GapClassLib.PhoneGap.Commands;
-using WP7GapClassLib.PhoneGap.JSON;
+using WP7GapClassLib.Cordova;
+using WP7GapClassLib.Cordova.Commands;
+using WP7GapClassLib.Cordova.JSON;
-namespace PhoneGap.Extension.Commands
+namespace Cordova.Extension.Commands
{
public class Calculator : BaseCommand
{
http://git-wip-us.apache.org/repos/asf/incubator-cordova-wp7/blob/25b09ad7/example/GapExample.csproj
----------------------------------------------------------------------
diff --git a/example/GapExample.csproj b/example/GapExample.csproj
index 48517b5..2754084 100644
--- a/example/GapExample.csproj
+++ b/example/GapExample.csproj
@@ -103,6 +103,7 @@
<Content Include="www\contacts.html">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
+ <Content Include="www\cordova-1.4.1.js" />
<Content Include="www\events.html">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
@@ -111,6 +112,7 @@
</Content>
<Content Include="www\index.html">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ <SubType>Designer</SubType>
</Content>
<Content Include="www\location.html">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
@@ -124,7 +126,6 @@
<Content Include="www\notification.html">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
- <Content Include="www\phonegap-1.3.0.js" />
<Content Include="www\storage.html">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
http://git-wip-us.apache.org/repos/asf/incubator-cordova-wp7/blob/25b09ad7/example/GapSourceDictionary.xml
----------------------------------------------------------------------
diff --git a/example/GapSourceDictionary.xml b/example/GapSourceDictionary.xml
index e77dfe5..8be0e3c 100644
--- a/example/GapSourceDictionary.xml
+++ b/example/GapSourceDictionary.xml
@@ -9,6 +9,7 @@
<FilePath Value="www\capture.html"/>
<FilePath Value="www\compass.html"/>
<FilePath Value="www\contacts.html"/>
+ <FilePath Value="www\cordova-1.4.1.js"/>
<FilePath Value="www\events.html"/>
<FilePath Value="www\file.html"/>
<FilePath Value="www\index.html"/>
@@ -16,6 +17,5 @@
<FilePath Value="www\master.css"/>
<FilePath Value="www\network.html"/>
<FilePath Value="www\notification.html"/>
- <FilePath Value="www\cordova-1.3.0.js"/>
<FilePath Value="www\storage.html"/>
</GapSourceDictionary>
http://git-wip-us.apache.org/repos/asf/incubator-cordova-wp7/blob/25b09ad7/example/www/accelerometer.html
----------------------------------------------------------------------
diff --git a/example/www/accelerometer.html b/example/www/accelerometer.html
index b1b97a8..64e691e 100644
--- a/example/www/accelerometer.html
+++ b/example/www/accelerometer.html
@@ -4,7 +4,7 @@
<meta name="viewport" content="width=device-width, height=device-height, initial-scale=1.0, maximum-scale=1.0, user-scalable=no;" />
<meta http-equiv="Content-type" content="text/html; charset=utf-8"/>
- <title>PhoneGap</title>
+ <title>Cordova</title>
<link rel="stylesheet" href="master.css" type="text/css" media="screen"/>
<script type="text/javascript">
@@ -29,110 +29,110 @@
<script type="text/javascript" charset="utf-8">
- var deviceReady = false;
-
- function roundNumber(num) {
- var dec = 3;
- var result = Math.round(num*Math.pow(10,dec))/Math.pow(10,dec);
- return result;
- }
-
- //-------------------------------------------------------------------------
- // Acceleration
- //-------------------------------------------------------------------------
- var watchAccelId = null;
-
- /**
- * Start watching acceleration
- */
- var watchAccel = function() {
- console.log("watchAccel()");
-
- // Success callback
- var success = function (a) {
- document.getElementById('x').innerHTML = roundNumber(a.x);
- document.getElementById('y').innerHTML = roundNumber(a.y);
- document.getElementById('z').innerHTML = roundNumber(a.z);
- console.log("watchAccel success callback");
- };
-
- // Fail callback
- var fail = function(e){
- console.log("watchAccel fail callback with error code "+e);
- stopAccel();
- setAccelStatus(Accelerometer.ERROR_MSG[e]);
- };
-
- // Update acceleration every 1 sec
- var opt = {};
- opt.frequency = 50;
- watchAccelId = navigator.accelerometer.watchAcceleration(success, fail, opt);
-
- setAccelStatus("Running");
- };
-
- /**
- * Stop watching the acceleration
- */
- var stopAccel = function() {
- console.log("stopAccel()");
- setAccelStatus("Stopped");
- if (watchAccelId) {
- navigator.accelerometer.clearWatch(watchAccelId);
- watchAccelId = null;
- }
- };
-
- /**
- * Get current acceleration
- */
- var getAccel = function() {
- console.log("getAccel()");
-
- // Stop accel if running
- //stopAccel();
-
- // Success callback
- var success = function (a) {
- document.getElementById('x').innerHTML = roundNumber(a.x);
- document.getElementById('y').innerHTML = roundNumber(a.y);
- document.getElementById('z').innerHTML = roundNumber(a.z);
- };
-
- // Fail callback
- var fail = function(e){
- console.log("getAccel fail callback with error code "+e);
- setAccelStatus(Accelerometer.ERROR_MSG[e]);
- };
-
- // Make call
- var opt = {};
- navigator.accelerometer.getCurrentAcceleration(success, fail, opt);
- };
-
- /**
- * Set accelerometer status
- */
- var setAccelStatus = function (status) {
-
- document.getElementById('accel_status').innerHTML = status;
- };
-
- /**
- * Function called when page has finished loading.
- */
- function init() {
-
- document.addEventListener("deviceready", function() {
- deviceReady = true;
- console.log("Device="+device.platform+" "+device.version);
- }, false);
- window.setTimeout(function() {
- if (!deviceReady) {
- alert("Error: PhoneGap did not initialize. Demo will not run correctly.");
- }
- },1000);
- }
+ var deviceReady = false;
+
+ function roundNumber(num) {
+ var dec = 3;
+ var result = Math.round(num*Math.pow(10,dec))/Math.pow(10,dec);
+ return result;
+ }
+
+ //-------------------------------------------------------------------------
+ // Acceleration
+ //-------------------------------------------------------------------------
+ var watchAccelId = null;
+
+ /**
+ * Start watching acceleration
+ */
+ var watchAccel = function() {
+ console.log("watchAccel()");
+
+ // Success callback
+ var success = function (a) {
+ document.getElementById('x').innerHTML = roundNumber(a.x);
+ document.getElementById('y').innerHTML = roundNumber(a.y);
+ document.getElementById('z').innerHTML = roundNumber(a.z);
+ console.log("watchAccel success callback");
+ };
+
+ // Fail callback
+ var fail = function(e){
+ console.log("watchAccel fail callback with error code "+e);
+ stopAccel();
+ setAccelStatus(Accelerometer.ERROR_MSG[e]);
+ };
+
+ // Update acceleration every 1 sec
+ var opt = {};
+ opt.frequency = 50;
+ watchAccelId = navigator.accelerometer.watchAcceleration(success, fail, opt);
+
+ setAccelStatus("Running");
+ };
+
+ /**
+ * Stop watching the acceleration
+ */
+ var stopAccel = function() {
+ console.log("stopAccel()");
+ setAccelStatus("Stopped");
+ if (watchAccelId) {
+ navigator.accelerometer.clearWatch(watchAccelId);
+ watchAccelId = null;
+ }
+ };
+
+ /**
+ * Get current acceleration
+ */
+ var getAccel = function() {
+ console.log("getAccel()");
+
+ // Stop accel if running
+ //stopAccel();
+
+ // Success callback
+ var success = function (a) {
+ document.getElementById('x').innerHTML = roundNumber(a.x);
+ document.getElementById('y').innerHTML = roundNumber(a.y);
+ document.getElementById('z').innerHTML = roundNumber(a.z);
+ };
+
+ // Fail callback
+ var fail = function(e){
+ console.log("getAccel fail callback with error code "+e);
+ setAccelStatus(Accelerometer.ERROR_MSG[e]);
+ };
+
+ // Make call
+ var opt = {};
+ navigator.accelerometer.getCurrentAcceleration(success, fail, opt);
+ };
+
+ /**
+ * Set accelerometer status
+ */
+ var setAccelStatus = function (status) {
+
+ document.getElementById('accel_status').innerHTML = status;
+ };
+
+ /**
+ * Function called when page has finished loading.
+ */
+ function init() {
+
+ document.addEventListener("deviceready", function() {
+ deviceReady = true;
+ console.log("Device="+device.platform+" "+device.version);
+ }, false);
+ window.setTimeout(function() {
+ if (!deviceReady) {
+ alert("Error: Cordova did not initialize. Demo will not run correctly.");
+ }
+ },1000);
+ }
</script>
http://git-wip-us.apache.org/repos/asf/incubator-cordova-wp7/blob/25b09ad7/example/www/accelerometer2.html
----------------------------------------------------------------------
diff --git a/example/www/accelerometer2.html b/example/www/accelerometer2.html
index 0c1023a..a1b660e 100644
--- a/example/www/accelerometer2.html
+++ b/example/www/accelerometer2.html
@@ -4,7 +4,7 @@
<!-- meta name="viewport" content="width=device-width, height=device-height, user-scalable=yes, initial-scale=2.0, maximum-scale=4.0, minimum-scale=1.0" / -->
<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no;" />
<meta http-equiv="Content-type" content="text/html; charset=utf-8"/>
- <title>PhoneGap</title>
+ <title>Cordova</title>
<link rel="stylesheet" href="master.css" type="text/css" media="screen"/>
<script type="text/javascript">
http://git-wip-us.apache.org/repos/asf/incubator-cordova-wp7/blob/25b09ad7/example/www/audio.html
----------------------------------------------------------------------
diff --git a/example/www/audio.html b/example/www/audio.html
index d4c806f..24d1e52 100644
--- a/example/www/audio.html
+++ b/example/www/audio.html
@@ -4,7 +4,7 @@
<!-- meta name="viewport" content="width=device-width, height=device-height, user-scalable=yes, initial-scale=2.0, maximum-scale=4.0, minimum-scale=1.0" / -->
<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no;" />
<meta http-equiv="Content-type" content="text/html; charset=utf-8"> <!-- ISO-8859-1 -->
- <title>PhoneGap</title>
+ <title>Cordova</title>
<link rel="stylesheet" href="master.css" type="text/css" media="screen">
<script type="text/javascript" charset="utf-8" src="cordova-1.3.0.js"></script>
http://git-wip-us.apache.org/repos/asf/incubator-cordova-wp7/blob/25b09ad7/example/www/calculator.html
----------------------------------------------------------------------
diff --git a/example/www/calculator.html b/example/www/calculator.html
index 92c218e..16d7b05 100644
--- a/example/www/calculator.html
+++ b/example/www/calculator.html
@@ -4,7 +4,7 @@
<!-- meta name="viewport" content="width=device-width, height=device-height, user-scalable=yes, initial-scale=2.0, maximum-scale=4.0, minimum-scale=1.0" / -->
<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no;" />
<meta http-equiv="Content-type" content="text/html; charset=utf-8"> <!-- ISO-8859-1 -->
- <title>PhoneGap</title>
+ <title>Cordova</title>
<link rel="stylesheet" href="master.css" type="text/css" media="screen"/>
<script type="text/javascript">
@@ -38,14 +38,14 @@
}, false);
window.setTimeout(function () {
if (!deviceReady) {
- alert("Error: PhoneGap did not initialize. Demo will not run correctly.");
+ alert("Error: Cordova did not initialize. Demo will not run correctly.");
}
}, 1000);
}
function calculateSum() {
- PhoneGap.exec(
+ Cordova.exec(
function (res) {
document.getElementById('res').innerHTML = res;
},
http://git-wip-us.apache.org/repos/asf/incubator-cordova-wp7/blob/25b09ad7/example/www/camera.html
----------------------------------------------------------------------
diff --git a/example/www/camera.html b/example/www/camera.html
index 15179ee..ce8987a 100644
--- a/example/www/camera.html
+++ b/example/www/camera.html
@@ -4,7 +4,7 @@
<!-- meta name="viewport" content="width=device-width, height=device-height, user-scalable=yes, initial-scale=2.0, maximum-scale=4.0, minimum-scale=1.0" / -->
<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no;" />
<meta http-equiv="Content-type" content="text/html; charset=utf-8"> <!-- ISO-8859-1 -->
- <title>PhoneGap</title>
+ <title>Cordova</title>
<link rel="stylesheet" href="master.css" type="text/css" media="screen"/>
<script type="text/javascript">
@@ -87,7 +87,7 @@
}, false);
window.setTimeout(function() {
if (!deviceReady) {
- alert("Error: PhoneGap did not initialize. Demo will not run correctly.");
+ alert("Error: Cordova did not initialize. Demo will not run correctly.");
}
},1000);
}
http://git-wip-us.apache.org/repos/asf/incubator-cordova-wp7/blob/25b09ad7/example/www/capture.html
----------------------------------------------------------------------
diff --git a/example/www/capture.html b/example/www/capture.html
index 3188c8e..167c2ae 100644
--- a/example/www/capture.html
+++ b/example/www/capture.html
@@ -4,7 +4,7 @@
<!-- meta name="viewport" content="width=device-width, height=device-height, user-scalable=yes, initial-scale=2.0, maximum-scale=4.0, minimum-scale=1.0" / -->
<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no;" />
<meta http-equiv="Content-type" content="text/html; charset=utf-8"> <!-- ISO-8859-1 -->
- <title>PhoneGap</title>
+ <title>Cordova</title>
<link rel="stylesheet" href="master.css" type="text/css" media="screen"/>
http://git-wip-us.apache.org/repos/asf/incubator-cordova-wp7/blob/25b09ad7/example/www/compass.html
----------------------------------------------------------------------
diff --git a/example/www/compass.html b/example/www/compass.html
index 21625c1..a93deec 100644
--- a/example/www/compass.html
+++ b/example/www/compass.html
@@ -4,7 +4,7 @@
<!-- meta name="viewport" content="width=device-width, height=device-height, user-scalable=yes, initial-scale=2.0, maximum-scale=4.0, minimum-scale=1.0" / -->
<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no;" />
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
- <title>PhoneGap</title>
+ <title>Cordova</title>
<link rel="stylesheet" href="master.css" type="text/css" media="screen"/>
<script type="text/javascript">
@@ -121,7 +121,7 @@
}, false);
window.setTimeout(function() {
if (!deviceReady) {
- alert("Error: PhoneGap did not initialize. Demo will not run correctly.");
+ alert("Error: Cordova did not initialize. Demo will not run correctly.");
}
},1000);
}
http://git-wip-us.apache.org/repos/asf/incubator-cordova-wp7/blob/25b09ad7/example/www/contacts.html
----------------------------------------------------------------------
diff --git a/example/www/contacts.html b/example/www/contacts.html
index 92e8727..5757c8b 100644
--- a/example/www/contacts.html
+++ b/example/www/contacts.html
@@ -4,7 +4,7 @@
<!-- meta name="viewport" content="width=device-width, height=device-height, user-scalable=yes, initial-scale=2.0, maximum-scale=4.0, minimum-scale=1.0" / -->
<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no;" />
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
- <title>PhoneGap</title>
+ <title>Cordova</title>
<link rel="stylesheet" href="master.css" type="text/css" media="screen">
<script type="text/javascript">
@@ -139,7 +139,7 @@
}, false);
window.setTimeout(function() {
if (!deviceReady) {
- alert("Error: PhoneGap did not initialize. Demo will not run correctly.");
+ alert("Error: Cordova did not initialize. Demo will not run correctly.");
}
},1000);
}