From f4da7e164d85f02b0543317c3976b357193a28a9 Mon Sep 17 00:00:00 2001 From: Joe Bowser Date: Mon, 23 Apr 2012 11:37:33 -0700 Subject: [PATCH] Incrementing project to 1.7.0rc1 --- VERSION | 2 +- .../templates/project/assets/www/index.html | 2 +- framework/assets/js/cordova.android.js | 416 ++++++++---------- framework/assets/www/index.html | 2 +- framework/src/org/apache/cordova/Device.java | 2 +- 5 files changed, 188 insertions(+), 236 deletions(-) diff --git a/VERSION b/VERSION index 9c6d6293..d88d8e71 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.6.1 +1.7.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 bf3e0859..88927d72 100644 --- a/bin/templates/project/cordova/templates/project/assets/www/index.html +++ b/bin/templates/project/cordova/templates/project/assets/www/index.html @@ -5,7 +5,7 @@ PhoneGap - + diff --git a/framework/assets/js/cordova.android.js b/framework/assets/js/cordova.android.js index 1b879160..cf56912e 100644 --- a/framework/assets/js/cordova.android.js +++ b/framework/assets/js/cordova.android.js @@ -1,6 +1,6 @@ -// commit b2de4baa76a94ecb916619a536339ffee9ef6843 +// commit 017a948047e355ae0c2cdc8c4188ae57b115528a -// File generated at :: Tue Apr 17 2012 12:19:35 GMT-0700 (PDT) +// File generated at :: Mon Apr 23 2012 11:36:23 GMT-0700 (PDT) /* Licensed to the Apache Software Foundation (ASF) under one @@ -67,10 +67,20 @@ if (typeof module === "object" && typeof require === "function") { module.exports.require = require; module.exports.define = define; } - // file: lib/cordova.js define("cordova", function(require, exports, module) { var channel = require('cordova/channel'); + +/** + * Listen for DOMContentLoaded and notify our channel subscribers. + */ +document.addEventListener('DOMContentLoaded', function() { + channel.onDOMContentLoaded.fire(); +}, false); +if (document.readyState == 'complete') { + channel.onDOMContentLoaded.fire(); +} + /** * Intercept calls to addEventListener + removeEventListener and handle deviceready, * resume, and pause events. @@ -115,13 +125,18 @@ window.addEventListener = function(evt, handler, capture) { }; document.removeEventListener = function(evt, handler, capture) { - var e = evt.toLowerCase(); - // If unsubcribing from an event that is handled by a plugin - if (typeof documentEventHandlers[e] != "undefined") { - documentEventHandlers[e].unsubscribe(handler); - } else { - m_document_removeEventListener.call(document, evt, handler, capture); - } + var e = evt.toLowerCase(); + // Check for pause/resume events first. + if (e == 'resume') { + channel.onResume.unsubscribe(handler); + } else if (e == 'pause') { + channel.onPause.unsubscribe(handler); + // If unsubcribing from an event that is handled by a plugin + } else if (typeof documentEventHandlers[e] != "undefined") { + documentEventHandlers[e].unsubscribe(handler); + } else { + m_document_removeEventListener.call(document, evt, handler, capture); + } }; window.removeEventListener = function(evt, handler, capture) { @@ -149,9 +164,9 @@ function createEvent(type, data) { if(typeof window.console === "undefined") { - window.console = { - log:function(){} - }; + window.console = { + log:function(){} + }; } var cordova = { @@ -292,7 +307,7 @@ var cordova = { console.log("Error: Plugin "+name+" already exists."); } }, - + addConstructor: function(func) { channel.onCordovaReady.subscribeOnce(function() { try { @@ -304,7 +319,7 @@ var cordova = { } }; -/** +/** * Legacy variable for plugin support * TODO: remove in 2.0. */ @@ -326,6 +341,8 @@ module.exports = cordova; // file: lib/common/builder.js define("cordova/builder", function(require, exports, module) { +var utils = require('cordova/utils'); + function each(objects, func, context) { for (var prop in objects) { if (objects.hasOwnProperty(prop)) { @@ -502,10 +519,10 @@ var Channel = function(type, opts) { /** * cordova Channels that must fire before "deviceready" is fired. - */ + */ deviceReadyChannelsArray: [], deviceReadyChannelsMap: {}, - + /** * Indicate that a feature needs to be initialized before it is ready to be used. * This holds up Cordova's "deviceready" event until the feature has been initialized @@ -542,7 +559,7 @@ var Channel = function(type, opts) { utils = require('cordova/utils'); /** - * Subscribes the given function to the channel. Any time that + * Subscribes the given function to the channel. Any time that * Channel.fire is called so too will the function. * Optionally specify an execution context for the function * and a guid that can be used to stop subscribing to the channel. @@ -587,7 +604,7 @@ Channel.prototype.subscribeOnce = function(f, c) { return g; }; -/** +/** * Unsubscribes the function with the given guid from the channel. */ Channel.prototype.unsubscribe = function(g) { @@ -601,7 +618,7 @@ Channel.prototype.unsubscribe = function(g) { if (this.events.onUnsubscribe) this.events.onUnsubscribe.call(this); }; -/** +/** * Calls all functions subscribed to this channel. */ Channel.prototype.fire = function(e) { @@ -656,7 +673,6 @@ channel.waitForInitialization('onCordovaInfoReady'); channel.waitForInitialization('onCordovaConnectionReady'); module.exports = channel; - }); // file: lib/common/common.js @@ -841,7 +857,6 @@ module.exports = { } } }; - }); // file: lib/android/exec.js @@ -873,7 +888,8 @@ module.exports = function(success, fail, service, action, args) { // If a result was returned if (r.length > 0) { - eval("var v="+r+";"); + var v; + eval("v="+r+";"); // If status is OK, then return value back to caller if (v.status === cordova.callbackStatus.OK) { @@ -1003,7 +1019,7 @@ module.exports = { var db = null; try { db = originalOpenDatabase(name, version, desc, size); - } + } catch (ex) { if (ex.code === 18) { db = null; @@ -1018,7 +1034,7 @@ module.exports = { else { return db; } - + }; } @@ -1077,7 +1093,6 @@ module.exports = { } } }; - }); // file: lib/common/plugin/Acceleration.js @@ -1090,7 +1105,6 @@ var Acceleration = function(x, y, z, timestamp) { }; module.exports = Acceleration; - }); // file: lib/common/plugin/Camera.js @@ -1172,35 +1186,34 @@ cameraExport.getPicture = function(successCallback, errorCallback, options) { if (typeof options.encodingType == "number") { encodingType = options.encodingType; } - + var mediaType = Camera.MediaType.PICTURE; if (typeof options.mediaType == "number") { mediaType = options.mediaType; } var allowEdit = false; if (typeof options.allowEdit == "boolean") { - allowEdit = options.allowEdit; + allowEdit = options.allowEdit; } else if (typeof options.allowEdit == "number") { - allowEdit = options.allowEdit <= 0 ? false : true; + allowEdit = options.allowEdit <= 0 ? false : true; } var correctOrientation = false; if (typeof options.correctOrientation == "boolean") { - correctOrientation = options.correctOrientation; + correctOrientation = options.correctOrientation; } else if (typeof options.correctOrientation == "number") { - correctOrientation = options.correctOrientation <=0 ? false : true; + correctOrientation = options.correctOrientation <=0 ? false : true; } var saveToPhotoAlbum = false; - if (typeof options.saveToPhotoAlbum == "boolean") { - saveToPhotoAlbum = options.saveToPhotoAlbum; + if (typeof options.saveToPhotoAlbum == "boolean") { + saveToPhotoAlbum = options.saveToPhotoAlbum; } else if (typeof options.saveToPhotoAlbum == "number") { - saveToPhotoAlbum = options.saveToPhotoAlbum <=0 ? false : true; + saveToPhotoAlbum = options.saveToPhotoAlbum <=0 ? false : true; } exec(successCallback, errorCallback, "Camera", "takePicture", [quality, destinationType, sourceType, targetWidth, targetHeight, encodingType, mediaType, allowEdit, correctOrientation, saveToPhotoAlbum]); -} +}; module.exports = cameraExport; - }); // file: lib/common/plugin/CameraConstants.js @@ -1225,7 +1238,6 @@ module.exports = { SAVEDPHOTOALBUM : 2 // Choose image from picture library (same as PHOTOLIBRARY for Android) } }; - }); // file: lib/common/plugin/CaptureAudioOptions.js @@ -1234,16 +1246,15 @@ define("cordova/plugin/CaptureAudioOptions", function(require, exports, module) * Encapsulates all audio capture operation configuration options. */ var CaptureAudioOptions = function(){ - // Upper limit of sound clips user can record. Value must be equal or greater than 1. - this.limit = 1; - // Maximum duration of a single sound clip in seconds. - this.duration = 0; - // The selected audio mode. Must match with one of the elements in supportedAudioModes array. - this.mode = null; + // Upper limit of sound clips user can record. Value must be equal or greater than 1. + this.limit = 1; + // Maximum duration of a single sound clip in seconds. + this.duration = 0; + // The selected audio mode. Must match with one of the elements in supportedAudioModes array. + this.mode = null; }; module.exports = CaptureAudioOptions; - }); // file: lib/common/plugin/CaptureError.js @@ -1255,7 +1266,7 @@ var CaptureError = function(c) { this.code = c || null; }; -// Camera or microphone failed to capture image or sound. +// Camera or microphone failed to capture image or sound. CaptureError.CAPTURE_INTERNAL_ERR = 0; // Camera application or audio capture application is currently serving other capture request. CaptureError.CAPTURE_APPLICATION_BUSY = 1; @@ -1267,7 +1278,6 @@ CaptureError.CAPTURE_NO_MEDIA_FILES = 3; CaptureError.CAPTURE_NOT_SUPPORTED = 20; module.exports = CaptureError; - }); // file: lib/common/plugin/CaptureImageOptions.js @@ -1276,14 +1286,13 @@ define("cordova/plugin/CaptureImageOptions", function(require, exports, module) * Encapsulates all image capture operation configuration options. */ var CaptureImageOptions = function(){ - // Upper limit of images user can take. Value must be equal or greater than 1. - this.limit = 1; - // The selected image mode. Must match with one of the elements in supportedImageModes array. - this.mode = null; + // Upper limit of images user can take. Value must be equal or greater than 1. + this.limit = 1; + // The selected image mode. Must match with one of the elements in supportedImageModes array. + this.mode = null; }; module.exports = CaptureImageOptions; - }); // file: lib/common/plugin/CaptureVideoOptions.js @@ -1292,16 +1301,15 @@ define("cordova/plugin/CaptureVideoOptions", function(require, exports, module) * Encapsulates all video capture operation configuration options. */ var CaptureVideoOptions = function(){ - // Upper limit of videos user can record. Value must be equal or greater than 1. - this.limit = 1; - // Maximum duration of a single video clip in seconds. - this.duration = 0; - // The selected video mode. Must match with one of the elements in supportedVideoModes array. - this.mode = null; + // Upper limit of videos user can record. Value must be equal or greater than 1. + this.limit = 1; + // Maximum duration of a single video clip in seconds. + this.duration = 0; + // The selected video mode. Must match with one of the elements in supportedVideoModes array. + this.mode = null; }; module.exports = CaptureVideoOptions; - }); // file: lib/common/plugin/CompassError.js @@ -1319,7 +1327,6 @@ CompassError.COMPASS_INTERNAL_ERR = 0; CompassError.COMPASS_NOT_SUPPORTED = 20; module.exports = CompassError; - }); // file: lib/common/plugin/CompassHeading.js @@ -1332,7 +1339,6 @@ var CompassHeading = function(magneticHeading, trueHeading, headingAccuracy, tim }; module.exports = CompassHeading; - }); // file: lib/common/plugin/ConfigurationData.js @@ -1341,18 +1347,17 @@ define("cordova/plugin/ConfigurationData", function(require, exports, module) { * Encapsulates a set of parameters that the capture device supports. */ function ConfigurationData() { - // The ASCII-encoded string in lower case representing the media type. - this.type = null; - // The height attribute represents height of the image or video in pixels. - // In the case of a sound clip this attribute has value 0. + // The ASCII-encoded string in lower case representing the media type. + this.type = null; + // The height attribute represents height of the image or video in pixels. + // In the case of a sound clip this attribute has value 0. this.height = 0; - // The width attribute represents width of the image or video in pixels. + // The width attribute represents width of the image or video in pixels. // In the case of a sound clip this attribute has value 0 this.width = 0; } module.exports = ConfigurationData; - }); // file: lib/common/plugin/Connection.js @@ -1361,15 +1366,14 @@ define("cordova/plugin/Connection", function(require, exports, module) { * Network status */ module.exports = { - UNKNOWN: "unknown", - ETHERNET: "ethernet", - WIFI: "wifi", - CELL_2G: "2g", - CELL_3G: "3g", - CELL_4G: "4g", - NONE: "none" + UNKNOWN: "unknown", + ETHERNET: "ethernet", + WIFI: "wifi", + CELL_2G: "2g", + CELL_3G: "3g", + CELL_4G: "4g", + NONE: "none" }; - }); // file: lib/common/plugin/Contact.js @@ -1390,7 +1394,7 @@ function convertIn(contact) { console.log("Cordova Contact convertIn error: exception creating date."); } return contact; -}; +} /** * Converts Complex objects into primitives @@ -1399,7 +1403,7 @@ function convertIn(contact) { function convertOut(contact) { var value = contact.birthday; - if (value != null) { + if (value !== null) { // try to make it a Date object if it is not already if (!value instanceof Date){ try { @@ -1414,7 +1418,7 @@ function convertOut(contact) { contact.birthday = value; } return contact; -}; +} /** * Contains information about a single contact. @@ -1533,7 +1537,7 @@ Contact.prototype.save = function(successCB, errorCB) { var fail = function(code) { errorCB(new ContactError(code)); }; - var success = function(result) { + var success = function(result) { if (result) { if (typeof successCB === 'function') { var fullContact = require('cordova/plugin/contacts').create(result); @@ -1545,13 +1549,12 @@ Contact.prototype.save = function(successCB, errorCB) { fail(ContactError.UNKNOWN_ERROR); } }; - var dupContact = convertOut(utils.clone(this)); - exec(success, fail, "Contacts", "save", [dupContact]); + var dupContact = convertOut(utils.clone(this)); + exec(success, fail, "Contacts", "save", [dupContact]); }; module.exports = Contact; - }); // file: lib/common/plugin/ContactAddress.js @@ -1581,7 +1584,6 @@ var ContactAddress = function(pref, type, formatted, streetAddress, locality, re }; module.exports = ContactAddress; - }); // file: lib/common/plugin/ContactError.js @@ -1607,7 +1609,6 @@ ContactError.NOT_SUPPORTED_ERROR = 5; ContactError.PERMISSION_DENIED_ERROR = 20; module.exports = ContactError; - }); // file: lib/common/plugin/ContactField.js @@ -1628,7 +1629,6 @@ var ContactField = function(type, value, pref) { }; module.exports = ContactField; - }); // file: lib/common/plugin/ContactFindOptions.js @@ -1646,7 +1646,6 @@ var ContactFindOptions = function(filter, multiple) { }; module.exports = ContactFindOptions; - }); // file: lib/common/plugin/ContactName.js @@ -1671,7 +1670,6 @@ var ContactName = function(formatted, familyName, givenName, middle, prefix, suf }; module.exports = ContactName; - }); // file: lib/common/plugin/ContactOrganization.js @@ -1699,7 +1697,6 @@ var ContactOrganization = function(pref, type, name, dept, title) { }; module.exports = ContactOrganization; - }); // file: lib/common/plugin/Coordinates.js @@ -1747,7 +1744,6 @@ var Coordinates = function(lat, lng, alt, acc, head, vel, altacc) { }; module.exports = Coordinates; - }); // file: lib/common/plugin/DirectoryEntry.js @@ -1755,6 +1751,7 @@ define("cordova/plugin/DirectoryEntry", function(require, exports, module) { var utils = require('cordova/utils'), exec = require('cordova/exec'), Entry = require('cordova/plugin/Entry'), + FileError = require('cordova/plugin/FileError'), DirectoryReader = require('cordova/plugin/DirectoryReader'); /** @@ -1837,7 +1834,8 @@ module.exports = DirectoryEntry; // file: lib/common/plugin/DirectoryReader.js define("cordova/plugin/DirectoryReader", function(require, exports, module) { -var exec = require('cordova/exec'); +var exec = require('cordova/exec'), + FileError = require('cordova/plugin/FileError') ; /** * An interface that lists the files and directories in a directory. @@ -1858,10 +1856,10 @@ DirectoryReader.prototype.readEntries = function(successCallback, errorCallback) for (var i=0; i 0) { - // is an iOS request for watch by filter, no timer needed - timers[id] = "iOS"; - compass.getCurrentHeading(successCallback, errorCallback, options); - } else { - // Start watch timer to get headings - timers[id] = window.setInterval(function() { - compass.getCurrentHeading(successCallback, errorCallback); - }, frequency); - } - + if (filter > 0) { + // is an iOS request for watch by filter, no timer needed + timers[id] = "iOS"; + compass.getCurrentHeading(successCallback, errorCallback, options); + } else { + // Start watch timer to get headings + timers[id] = window.setInterval(function() { + compass.getCurrentHeading(successCallback, errorCallback); + }, frequency); + } + return id; }, @@ -4410,19 +4383,18 @@ var exec = require('cordova/exec'), clearWatch:function(id) { // Stop javascript timer & remove from timer list if (id && timers[id]) { - if (timers[id] != "iOS") { - clearInterval(timers[id]); - } else { - // is iOS watch by filter so call into device to stop - exec(null, null, "Compass", "stopHeading", []); - } - delete timers[id]; + if (timers[id] != "iOS") { + clearInterval(timers[id]); + } else { + // is iOS watch by filter so call into device to stop + exec(null, null, "Compass", "stopHeading", []); + } + delete timers[id]; } } }; module.exports = compass; - }); // file: lib/common/plugin/contacts.js @@ -4484,7 +4456,6 @@ var contacts = { }; module.exports = contacts; - }); // file: lib/common/plugin/geolocation.js @@ -4548,7 +4519,7 @@ var geolocation = { errorCallback(new PositionError(e.code, e.message)); }; - exec(win, fail, "Geolocation", "getLocation", [options.enableHighAccuracy, options.timeout, options.maximumAge]); + exec(win, fail, "Geolocation", "getLocation", [options.enableHighAccuracy, options.timeout, options.maximumAge]); }, /** * Asynchronously watches the geolocation for changes to geolocation. When a change occurs, @@ -4583,7 +4554,6 @@ var geolocation = { }; module.exports = geolocation; - }); // file: lib/common/plugin/network.js @@ -4648,7 +4618,6 @@ NetworkConnection.prototype.getInfo = function (successCallback, errorCallback) }; module.exports = new NetworkConnection(); - }); // file: lib/common/plugin/notification.js @@ -4709,7 +4678,6 @@ module.exports = { exec(null, null, "Notification", "beep", [count]); } }; - }); // file: lib/common/plugin/requestFileSystem.js @@ -4754,13 +4722,13 @@ var requestFileSystem = function(type, size, successCallback, errorCallback) { }; module.exports = requestFileSystem; - }); // file: lib/common/plugin/resolveLocalFileSystemURI.js define("cordova/plugin/resolveLocalFileSystemURI", function(require, exports, module) { var DirectoryEntry = require('cordova/plugin/DirectoryEntry'), FileEntry = require('cordova/plugin/FileEntry'), + FileError = require('cordova/plugin/FileError'), exec = require('cordova/exec'); /** @@ -4822,12 +4790,12 @@ var _self = { * Does a deep clone of the object. */ clone: function(obj) { - if(!obj) { + if(!obj) { return obj; } - + var retVal, i; - + if(obj instanceof Array){ retVal = []; for(i = 0; i < obj.length; ++i){ @@ -4835,15 +4803,15 @@ var _self = { } return retVal; } - + if (obj instanceof Function) { return obj; } - + if(!(obj instanceof Object)){ return obj; } - + if(obj instanceof Date){ return obj; } @@ -4886,7 +4854,7 @@ var _self = { */ extend: (function() { // proxy used to establish prototype chain - var F = function() {}; + var F = function() {}; // extend Child from Parent return function(Child, Parent) { F.prototype = Parent.prototype; @@ -4909,7 +4877,6 @@ var _self = { }; module.exports = _self; - }); @@ -4920,20 +4887,6 @@ window.cordova = require('cordova'); var channel = require("cordova/channel"), _self = { boot: function () { - //--------------- - // Event handling - //--------------- - - /** - * Listen for DOMContentLoaded and notify our channel subscribers. - */ - document.addEventListener('DOMContentLoaded', function() { - channel.onDOMContentLoaded.fire(); - }, false); - if (document.readyState == 'complete') { - channel.onDOMContentLoaded.fire(); - } - /** * Create all cordova objects once page has fully loaded and native side is ready. */ @@ -4966,11 +4919,11 @@ window.cordova = require('cordova'); channel.join(function() { channel.onDeviceReady.fire(); }, channel.deviceReadyChannelsArray); - + }, [ channel.onDOMContentLoaded, channel.onNativeReady ]); } }; - + // boot up once native side is ready channel.onNativeReady.subscribeOnce(_self.boot); @@ -4983,5 +4936,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 091d25fb..9eee9f3e 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/Device.java b/framework/src/org/apache/cordova/Device.java index b8ced26e..de70cda0 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.6.1"; // Cordova version + public static String cordovaVersion = "1.7.0rc1"; // Cordova version public static String platform = "Android"; // Device OS public static String uuid; // Device UUID