Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

upgraded to Apache Callback (phonegap) 1.3

  • Loading branch information...
commit 59a746bf3be501478885cab3d4b3c32db4b0c134 1 parent 7ba1d95
@mschoch mschoch authored
View
9 .classpath
@@ -1,8 +1,11 @@
-<?xml version="1.0" encoding="UTF-8"?><classpath>
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="gen"/>
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
<classpathentry kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
- <classpathentry kind="lib" path="libs/phonegap-1.2.0.jar"/>
+ <classpathentry kind="lib" path="libs/couchbase-2.0.0-dp-31.jar"/>
+ <classpathentry kind="lib" path="libs/OtpErlang-r14b03.jar"/>
+ <classpathentry kind="lib" path="libs/phonegap-1.3.0.jar"/>
<classpathentry kind="output" path="bin/classes"/>
-<classpathentry kind="lib" path="libs/couchbase-2.0.0-dp-31.jar"/><classpathentry kind="lib" path="libs/OtpErlang-r14b03.jar"/></classpath>
+</classpath>
View
BIN  .phonegap/android/phonegap-1.2.0.jar
Binary file not shown
View
BIN  .phonegap/android/phonegap-1.3.0.jar
Binary file not shown
View
23 ..._attachments/javascript/phonegap-1.2.0.js → .phonegap/android/phonegap-1.3.0.js
@@ -1270,16 +1270,6 @@ App.prototype.exitApp = function() {
return PhoneGap.exec(null, null, "App", "exitApp", []);
};
-/**
- * Add entry to approved list of URLs (whitelist) that will be loaded into PhoneGap container instead of default browser.
- *
- * @param origin URL regular expression to allow
- * @param subdomains T=include all subdomains under origin
- */
-App.prototype.addWhiteListEntry = function(origin, subdomains) {
- return PhoneGap.exec(null, null, "App", "addWhiteListEntry", [origin, subdomains]);
-};
-
PhoneGap.addConstructor(function() {
navigator.app = new App();
});
@@ -3405,6 +3395,17 @@ FileTransfer.prototype.upload = function(filePath, server, successCallback, erro
};
/**
+ * Downloads a file form a given URL and saves it to the specified directory.
+ * @param source {String} URL of the server to receive the file
+ * @param target {String} Full path of the file on the device
+ * @param successCallback (Function} Callback to be invoked when upload has completed
+ * @param errorCallback {Function} Callback to be invoked upon error
+ */
+FileTransfer.prototype.download = function(source, target, successCallback, errorCallback) {
+ PhoneGap.exec(successCallback, errorCallback, 'FileTransfer', 'download', [source, target]);
+};
+
+/**
* Options to customize the HTTP request used to upload files.
* @constructor
* @param fileKey {String} Name of file request parameter.
@@ -4627,7 +4628,7 @@ PhoneGap.addConstructor(function() {
};
}
- if (typeof window.localStorage === "undefined") {
+ if ((typeof window.localStorage == "undefined") || (window.localStorage == null)) {
navigator.localStorage = window.localStorage = new CupcakeLocalStorage();
PhoneGap.waitForInitialization("cupcakeStorage");
}
View
2  .phonegap/config
@@ -1,4 +1,4 @@
-VERSION=1.2.0
+VERSION=1.3.0
PROJECT_PATH=/Users/mschoch/Documents/workspace/Android-Couchbase-Callback/
PACKAGE=com.couchbase.callback
ACTIVITY=PhoneGapExample
View
68 assets/www/couchapp.html
@@ -1,68 +0,0 @@
-<!DOCTYPE HTML>
-<html>
- <head>
- <meta name="viewport" content="width=320; user-scalable=no" />
- <meta http-equiv="Content-type" content="text/html; charset=utf-8">
- <title>Couchbase Mobile with Callback</title>
- <script type="text/javascript" charset="utf-8" src="phonegap-1.2.0.js"></script>
- <script type="text/javascript" charset="utf-8">
-
- // Wait for PhoneGap to load
- //
- function init() {
- document.addEventListener("deviceready", onDeviceReady, false);
- }
-
- // PhoneGap is ready
- //
- function onDeviceReady() {
- window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, gotFS, fail);
- }
-
- function gotFS(fileSystem) {
- fileSystem.root.getFile("Android/data/com.couchbase.callback/db/couch.uri", null, gotFileEntry, fail);
- }
-
- function gotFileEntry(fileEntry) {
- fileEntry.file(gotFile, fail);
- }
-
- function gotFile(file){
- readAsText(file);
- }
-
- function readAsText(file) {
- var reader = new FileReader();
- reader.onloadend = function(evt) {
- var colonSeparated = evt.target.result.split(':');
- var port = new Number(colonSeparated[2].replace(/[^0-9]/g, ''));
- console.log("Read as text");
- console.log(evt.target.result);
- console.log('Port is: ' + port);
- var couchbasePortTag = document.getElementById('couchbasePort');
- while(couchbasePortTag.childNodes.length >= 1) {
- couchbasePortTag.removeChild(couchbasePortTag.firstChild);
- }
- couchbasePortTag.appendChild(couchbasePortTag.ownerDocument.createTextNode(port));
- };
- reader.readAsText(file);
- }
-
- function fail(evt) {
- console.log(evt.target.error.code);
- }
-
- </script>
- </head>
- <body onload="init();">
- <h1>Welcome to Couchbase Mobile with Callback!</h1>
- <p>Follow these simple steps to install a couchapp in your Callback appliction.</p>
- <ol>
- <li>Forward Couchbase Mobile from your device/emulator to your development machine. <pre>adb forward tcp:8984 tcp:<span id="couchbasePort">PORT</span></pre></li>
- <li>From within your couchapp project directory run: <pre>couchapp push . http://localhost:8984/couchapp<pre></li>
- <li>Compact your database. <pre>curl -X POST -H "Content-Type: application/json" http://localhost:8984/couchapp/_compact</pre></li>
- <li>From within the Android project, copy the Couchbase Mobile database to the assets folder. <pre>adb pull /mnt/sdcard/Android/data/com.couchbase.callback/db/couchapp.couch assets</pre></li>
- <li>Repackage your application for distribution. <pre>ant debug</pre></li>
- </ol>
- </body>
-</html>
View
2  assets/www/index.html
@@ -5,7 +5,7 @@
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title>PhoneGap</title>
<link rel="stylesheet" href="master.css" type="text/css" media="screen" title="no title" charset="utf-8">
- <script type="text/javascript" charset="utf-8" src="phonegap-1.2.0.js"></script>
+ <script type="text/javascript" charset="utf-8" src="phonegap-1.3.0.js"></script>
<script type="text/javascript" charset="utf-8" src="main.js"></script>
</head>
View
23 .phonegap/android/phonegap-1.2.0.js → assets/www/phonegap-1.3.0.js
@@ -1270,16 +1270,6 @@ App.prototype.exitApp = function() {
return PhoneGap.exec(null, null, "App", "exitApp", []);
};
-/**
- * Add entry to approved list of URLs (whitelist) that will be loaded into PhoneGap container instead of default browser.
- *
- * @param origin URL regular expression to allow
- * @param subdomains T=include all subdomains under origin
- */
-App.prototype.addWhiteListEntry = function(origin, subdomains) {
- return PhoneGap.exec(null, null, "App", "addWhiteListEntry", [origin, subdomains]);
-};
-
PhoneGap.addConstructor(function() {
navigator.app = new App();
});
@@ -3405,6 +3395,17 @@ FileTransfer.prototype.upload = function(filePath, server, successCallback, erro
};
/**
+ * Downloads a file form a given URL and saves it to the specified directory.
+ * @param source {String} URL of the server to receive the file
+ * @param target {String} Full path of the file on the device
+ * @param successCallback (Function} Callback to be invoked when upload has completed
+ * @param errorCallback {Function} Callback to be invoked upon error
+ */
+FileTransfer.prototype.download = function(source, target, successCallback, errorCallback) {
+ PhoneGap.exec(successCallback, errorCallback, 'FileTransfer', 'download', [source, target]);
+};
+
+/**
* Options to customize the HTTP request used to upload files.
* @constructor
* @param fileKey {String} Name of file request parameter.
@@ -4627,7 +4628,7 @@ PhoneGap.addConstructor(function() {
};
}
- if (typeof window.localStorage === "undefined") {
+ if ((typeof window.localStorage == "undefined") || (window.localStorage == null)) {
navigator.localStorage = window.localStorage = new CupcakeLocalStorage();
PhoneGap.waitForInitialization("cupcakeStorage");
}
View
2  examples/PhoneGapCouchApp/couchapp/_attachments/index.html
@@ -5,7 +5,7 @@
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title>PhoneGap</title>
<link rel="stylesheet" href="master.css" type="text/css" media="screen" title="no title" charset="utf-8">
- <script type="text/javascript" charset="utf-8" src="phonegap-1.2.0.js"></script>
+ <script type="text/javascript" charset="utf-8" src="phonegap-1.3.0.js"></script>
<script type="text/javascript" charset="utf-8" src="main.js"></script>
</head>
View
23 ...p/couchapp/_attachments/phonegap-1.2.0.js → ...p/couchapp/_attachments/phonegap-1.3.0.js
@@ -1270,16 +1270,6 @@ App.prototype.exitApp = function() {
return PhoneGap.exec(null, null, "App", "exitApp", []);
};
-/**
- * Add entry to approved list of URLs (whitelist) that will be loaded into PhoneGap container instead of default browser.
- *
- * @param origin URL regular expression to allow
- * @param subdomains T=include all subdomains under origin
- */
-App.prototype.addWhiteListEntry = function(origin, subdomains) {
- return PhoneGap.exec(null, null, "App", "addWhiteListEntry", [origin, subdomains]);
-};
-
PhoneGap.addConstructor(function() {
navigator.app = new App();
});
@@ -3405,6 +3395,17 @@ FileTransfer.prototype.upload = function(filePath, server, successCallback, erro
};
/**
+ * Downloads a file form a given URL and saves it to the specified directory.
+ * @param source {String} URL of the server to receive the file
+ * @param target {String} Full path of the file on the device
+ * @param successCallback (Function} Callback to be invoked when upload has completed
+ * @param errorCallback {Function} Callback to be invoked upon error
+ */
+FileTransfer.prototype.download = function(source, target, successCallback, errorCallback) {
+ PhoneGap.exec(successCallback, errorCallback, 'FileTransfer', 'download', [source, target]);
+};
+
+/**
* Options to customize the HTTP request used to upload files.
* @constructor
* @param fileKey {String} Name of file request parameter.
@@ -4627,7 +4628,7 @@ PhoneGap.addConstructor(function() {
};
}
- if (typeof window.localStorage === "undefined") {
+ if ((typeof window.localStorage == "undefined") || (window.localStorage == null)) {
navigator.localStorage = window.localStorage = new CupcakeLocalStorage();
PhoneGap.waitForInitialization("cupcakeStorage");
}
View
2  examples/PhotoShare/couchapp/_attachments/index.html
@@ -283,7 +283,7 @@
</script>
<script src="javascript/jquery-1.6.4.min.js">
</script>
- <script src="javascript/phonegap-1.2.0.js">
+ <script src="javascript/phonegap-1.3.0.js">
</script>
<script src="javascript/coux.js">
</script>
View
23 assets/www/phonegap-1.2.0.js → ..._attachments/javascript/phonegap-1.3.0.js
@@ -1270,16 +1270,6 @@ App.prototype.exitApp = function() {
return PhoneGap.exec(null, null, "App", "exitApp", []);
};
-/**
- * Add entry to approved list of URLs (whitelist) that will be loaded into PhoneGap container instead of default browser.
- *
- * @param origin URL regular expression to allow
- * @param subdomains T=include all subdomains under origin
- */
-App.prototype.addWhiteListEntry = function(origin, subdomains) {
- return PhoneGap.exec(null, null, "App", "addWhiteListEntry", [origin, subdomains]);
-};
-
PhoneGap.addConstructor(function() {
navigator.app = new App();
});
@@ -3405,6 +3395,17 @@ FileTransfer.prototype.upload = function(filePath, server, successCallback, erro
};
/**
+ * Downloads a file form a given URL and saves it to the specified directory.
+ * @param source {String} URL of the server to receive the file
+ * @param target {String} Full path of the file on the device
+ * @param successCallback (Function} Callback to be invoked when upload has completed
+ * @param errorCallback {Function} Callback to be invoked upon error
+ */
+FileTransfer.prototype.download = function(source, target, successCallback, errorCallback) {
+ PhoneGap.exec(successCallback, errorCallback, 'FileTransfer', 'download', [source, target]);
+};
+
+/**
* Options to customize the HTTP request used to upload files.
* @constructor
* @param fileKey {String} Name of file request parameter.
@@ -4627,7 +4628,7 @@ PhoneGap.addConstructor(function() {
};
}
- if (typeof window.localStorage === "undefined") {
+ if ((typeof window.localStorage == "undefined") || (window.localStorage == null)) {
navigator.localStorage = window.localStorage = new CupcakeLocalStorage();
PhoneGap.waitForInitialization("cupcakeStorage");
}
View
BIN  libs/phonegap-1.2.0.jar
Binary file not shown
View
BIN  libs/phonegap-1.3.0.jar
Binary file not shown
View
2  phonegap/templates/project/assets/www/index.html
@@ -5,7 +5,7 @@
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title>PhoneGap</title>
<link rel="stylesheet" href="master.css" type="text/css" media="screen" title="no title" charset="utf-8">
- <script type="text/javascript" charset="utf-8" src="phonegap-1.2.0.js"></script>
+ <script type="text/javascript" charset="utf-8" src="phonegap-1.3.0.js"></script>
<script type="text/javascript" charset="utf-8" src="main.js"></script>
</head>
Please sign in to comment.
Something went wrong with that request. Please try again.