diff --git a/VERSION b/VERSION index bd8bf882..92f201f4 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.7.0 +1.8.0rc1 diff --git a/bin/templates/project/cordova/templates/project/assets/www/index.html b/bin/templates/project/cordova/templates/project/assets/www/index.html index 2bf3dda5..39368e0d 100644 --- a/bin/templates/project/cordova/templates/project/assets/www/index.html +++ b/bin/templates/project/cordova/templates/project/assets/www/index.html @@ -23,7 +23,7 @@ PhoneGap - + diff --git a/framework/assets/js/cordova.android.js b/framework/assets/js/cordova.android.js index dc716fd1..acf64726 100644 --- a/framework/assets/js/cordova.android.js +++ b/framework/assets/js/cordova.android.js @@ -1,6 +1,6 @@ -// commit 68eebbca4a3691fed773d7599dd77c0030beabe6 +// commit 95f199e1c207dc89b84e79a9a7b27d6a3cc8fe14 -// File generated at :: Thu May 24 2012 09:30:21 GMT-0700 (PDT) +// File generated at :: Thu May 24 2012 21:36:17 GMT-0400 (EDT) /* Licensed to the Apache Software Foundation (ASF) under one @@ -5380,10 +5380,16 @@ module.exports = function(uri, successCallback, errorCallback) { errorCallback(new FileError(error)); } }; + // sanity check for 'not:valid:filename' + if(!uri || uri.split(":").length > 2) { + setTimeout( function() { + fail(FileError.ENCODING_ERR); + },0); + return; + } // if successful, return either a file or directory entry var success = function(entry) { var result; - if (entry) { if (typeof successCallback === 'function') { // create appropriate Entry object @@ -5420,6 +5426,68 @@ var splashscreen = { module.exports = splashscreen; }); +// file: lib/common/plugin/widget.js +define("cordova/plugin/widget", function(require, exports, module) { +var exec = require('cordova/exec'), + cordova = require('cordova'), + channel = require('cordova/channel'); + +var Widget = function () { + this.author = null; + this.description = null; + this.name = null; + this.shortName = null; + this.version = null; + this.id = null; + this.authorEmail = null; + this.authorHref = null; + this._firstRun = true; + + var me = this; + + channel.onCordovaReady.subscribeOnce(function() { + me.getInfo(function (info) { + me.author = info.author; + me.description = info.description; + me.name = info.name; + me.shortName = info.shortName; + me.version = info.version; + me.id = info.id; + me.authorEmail = info.authorEmail; + me.authorHref = info.authorHref; + + // should only fire this once + if (me._firstRun) { + me._firstRun = false; + channel.onCordovaAppInfoReady.fire(); + } + }, + function (e) { + // If we can't get the network info we should still tell Cordova + // to fire the deviceready event. + if (me._firstRun) { + me._firstRun = false; + channel.onCordovaAppInfoReady.fire(); + } + console.log("Error initializing Widget: " + e); + }); + }); +}; + +/** + * Get connection info + * + * @param {Function} successCallback The function to call when the Connection data is available + * @param {Function} errorCallback The function to call when there is an error getting the Connection data. (OPTIONAL) + */ +Widget.prototype.getInfo = function (successCallback, errorCallback) { + // Get info + exec(successCallback, errorCallback, "Widget", "getApplicationInfo", []); +}; + +module.exports = new Widget(); +}); + // file: lib/common/utils.js define("cordova/utils", function(require, exports, module) { var utils = exports; @@ -5661,4 +5729,4 @@ window.cordova = require('cordova'); }(window)); -})(); \ No newline at end of file +})(); diff --git a/framework/assets/www/index.html b/framework/assets/www/index.html index 0ca839ab..1f39dc57 100644 --- a/framework/assets/www/index.html +++ b/framework/assets/www/index.html @@ -19,7 +19,7 @@ - + diff --git a/framework/src/org/apache/cordova/CameraLauncher.java b/framework/src/org/apache/cordova/CameraLauncher.java index 94d7e9c7..d1156e05 100755 --- a/framework/src/org/apache/cordova/CameraLauncher.java +++ b/framework/src/org/apache/cordova/CameraLauncher.java @@ -274,8 +274,10 @@ public class CameraLauncher extends Plugin { newWidth = (newHeight * origWidth) / origHeight; } } - - return Bitmap.createScaledBitmap(bitmap, newWidth, newHeight, true); + + Bitmap retval = Bitmap.createScaledBitmap(bitmap, newWidth, newHeight, true); + bitmap.recycle(); + return retval; } /** diff --git a/framework/src/org/apache/cordova/Device.java b/framework/src/org/apache/cordova/Device.java index 2d67b95a..33d35950 100644 --- a/framework/src/org/apache/cordova/Device.java +++ b/framework/src/org/apache/cordova/Device.java @@ -38,7 +38,7 @@ import android.telephony.TelephonyManager; public class Device extends Plugin { public static final String TAG = "Device"; - public static String cordovaVersion = "1.7.0"; // Cordova version + public static String cordovaVersion = "1.8.0rc1"; // Cordova version public static String platform = "Android"; // Device OS public static String uuid; // Device UUID diff --git a/framework/src/org/apache/cordova/Storage.java b/framework/src/org/apache/cordova/Storage.java index f57621ba..59041cf7 100755 --- a/framework/src/org/apache/cordova/Storage.java +++ b/framework/src/org/apache/cordova/Storage.java @@ -42,7 +42,7 @@ public class Storage extends Plugin { private static final String CREATE = "create"; private static final String DROP = "drop"; private static final String TRUNCATE = "truncate"; - + SQLiteDatabase myDb = null; // Database object String path = null; // Database path String dbName = null; // Database name @@ -141,7 +141,7 @@ public class Storage extends Plugin { // If no database path, generate from application package if (this.path == null) { - this.path = this.ctx.getActivity().getApplicationContext().getDir("database", Context.MODE_PRIVATE).getPath(); + this.path = this.ctx.getApplicationContext().getDir("database", Context.MODE_PRIVATE).getPath(); } this.dbName = this.path + File.pathSeparator + db + ".db"; @@ -163,18 +163,19 @@ public class Storage extends Plugin { if (isDDL(query)) { this.myDb.execSQL(query); this.sendJavascript("cordova.require('cordova/plugin/android/storage').completeQuery('" + tx_id + "', '');"); - } + } else { Cursor myCursor = this.myDb.rawQuery(query, params); this.processResults(myCursor, tx_id); myCursor.close(); } - } catch (SQLiteException ex) { + } + catch (SQLiteException ex) { ex.printStackTrace(); - System.out.println("Storage.executeSql(): Error=" + ex.getMessage()); - + System.out.println("Storage.executeSql(): Error=" + ex.getMessage()); + // Send error message back to JavaScript - this.sendJavascript("cordova.require('cordova/plugin/android/storage').fail('" + ex.getMessage() + "','" + tx_id + "');"); + this.sendJavascript("cordova.require('cordova/plugin/android/storage').failQuery('" + ex.getMessage() + "','" + tx_id + "');"); } }