Return-Path: X-Original-To: apmail-incubator-callback-commits-archive@minotaur.apache.org Delivered-To: apmail-incubator-callback-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 985B89A95 for ; Sat, 24 Mar 2012 18:10:23 +0000 (UTC) Received: (qmail 35330 invoked by uid 500); 24 Mar 2012 18:10:23 -0000 Delivered-To: apmail-incubator-callback-commits-archive@incubator.apache.org Received: (qmail 35274 invoked by uid 500); 24 Mar 2012 18:10:23 -0000 Mailing-List: contact callback-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: callback-dev@incubator.apache.org Delivered-To: mailing list callback-commits@incubator.apache.org Received: (qmail 35252 invoked by uid 99); 24 Mar 2012 18:10:23 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 24 Mar 2012 18:10:23 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id A438A8D8D; Sat, 24 Mar 2012 18:10:22 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: macdonst@apache.org To: callback-commits@incubator.apache.org X-Mailer: ASF-Git Admin Mailer Subject: [2/2] CB-383: Fixes issue with misspelled destinationType for Camera.getPicture() Message-Id: <20120324181022.A438A8D8D@tyr.zones.apache.org> Date: Sat, 24 Mar 2012 18:10:22 +0000 (UTC) http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/blob/1e2c3859/framework/assets/js/cordova.android.js ---------------------------------------------------------------------- diff --git a/framework/assets/js/cordova.android.js b/framework/assets/js/cordova.android.js index 7f16f2f..705d4e4 100644 --- a/framework/assets/js/cordova.android.js +++ b/framework/assets/js/cordova.android.js @@ -1,302 +1,25 @@ /* + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. +*/ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - -============================================================== -This product also include the following software: -============================================================== - --------------------------------------------------------------- -jasmine from GitHub - - https://github.com/pivotal/jasmine - -MIT-style license - -license available from: - - https://github.com/pivotal/jasmine/blob/master/MIT.LICENSE - ------------------------------ - -Copyright (c) 2008-2011 Pivotal Labs - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - - --------------------------------------------------------------- -commonjs tests from the commonjs organization at GitHub - - https://github.com/commonjs/commonjs - -MIT-style license - -license available from: - - https://github.com/commonjs/commonjs/blob/master/docs/license.html.markdown - -contributor list available from: - - https://github.com/commonjs/commonjs/blob/master/docs/contributors.html.markdown - ------------------------------ - -Copyright 2009 Kevin Dangoor -Copyright 2009 Ihab Awad -Copyright 2009 Ash Berlin -Copyright 2009 Aristid Breitkreuz -Copyright 2009 Kevin Dangoor -Copyright 2009 Daniel Friesen -Copyright 2009 Wes Garland -Copyright 2009 Kris Kowal -Copyright 2009 Dean Landolt -Copyright 2009 Peter Michaux -Copyright 2009 George Moschovitis -Copyright 2009 Michael O'Brien -Copyright 2009 Tom Robinson -Copyright 2009 Hannes Wallnoefer -Copyright 2009 Mike Wilson -Copyright 2009 Ondrej Zara -Copyright 2009 Chris Zumbrunn -Copyright 2009 Kris Zyp - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. +;(function() { -*/ -(function() { +// file: lib/scripts/require.js var require, define; @@ -316,7 +39,7 @@ var require, throw "module " + id + " not found"; } return modules[id].factory ? build(modules[id]) : modules[id].exports; - } + }; define = function (id, factory) { if (modules[id]) { @@ -327,7 +50,7 @@ var require, id: id, factory: factory }; - } + }; define.remove = function (id) { delete modules[id]; @@ -341,154 +64,8 @@ if (typeof module === "object" && typeof require === "function") { module.exports.define = define; } -define('cordova/channel', function(require, exports, module) { -/** - * Custom pub-sub channel that can have functions subscribed to it - * @constructor - * @param type String the channel name - * @param opts Object options to pass into the channel, currently - * supports: - * onSubscribe: callback that fires when - * something subscribes to the Channel. Sets - * context to the Channel. - * onUnsubscribe: callback that fires when - * something unsubscribes to the Channel. Sets - * context to the Channel. - */ -var Channel = function(type, opts) { - this.type = type; - this.handlers = {}; - this.numHandlers = 0; - this.guid = 0; - this.fired = false; - this.enabled = true; - this.events = { - onSubscribe:null, - onUnsubscribe:null - }; - if (opts) { - if (opts.onSubscribe) this.events.onSubscribe = opts.onSubscribe; - if (opts.onUnsubscribe) this.events.onUnsubscribe = opts.onUnsubscribe; - } - }, - channel = { - /** - * Calls the provided function only after all of the channels specified - * have been fired. - */ - join: function (h, c) { - var i = c.length; - var len = i; - var f = function() { - if (!(--i)) h(); - }; - for (var j=0; j 0) { - eval("var v="+r+";"); - - // If status is OK, then return value back to caller - if (v.status === cordova.callbackStatus.OK) { - - // If there is a success callback, then call it now with - // returned value - if (success) { - try { - success(v.message); - } catch (e) { - console.log("Error in success callback: " + callbackId + " = " + e); - } +function include(parent, objects, clobber, merge) { + each(objects, function (obj, key) { + try { + var result = obj.path ? require(obj.path) : {}; - // Clear callback if not expecting any more results - if (!v.keepCallback) { - delete cordova.callbacks[callbackId]; - } + if (clobber) { + // Clobber if it doesn't exist. + if (typeof parent[key] === 'undefined') { + parent[key] = result; + } else if (typeof obj.path !== 'undefined') { + // If merging, merge properties onto parent, otherwise, clobber. + if (merge) { + recursiveMerge(parent[key], result); + } else { + parent[key] = result; + } + } + result = parent[key]; + } else { + // Overwrite if not currently defined. + if (typeof parent[key] == 'undefined') { + parent[key] = result; + } else if (merge && typeof obj.path !== 'undefined') { + // If merging, merge parent onto result + recursiveMerge(result, parent[key]); + parent[key] = result; + } else { + // Set result to what already exists, so we can build children into it if they exist. + result = parent[key]; } - return v.message; + } + + if (obj.children) { + include(result, obj.children, clobber, merge); + } + } catch(e) { + alert('Exception building cordova JS globals: ' + e + ' for key "' + key + '"'); } + }); +} - // If no result - else if (v.status === cordova.callbackStatus.NO_RESULT) { - // Clear callback if not expecting any more results - if (!v.keepCallback) { - delete cordova.callbacks[callbackId]; +/** + * Merge properties from one object onto another recursively. Properties from + * the src object will overwrite existing target property. + * + * @param target Object to merge properties into. + * @param src Object to merge properties from. + */ +function recursiveMerge(target, src) { + for (var prop in src) { + if (src.hasOwnProperty(prop)) { + if (typeof target.prototype !== 'undefined' && target.prototype.constructor === target) { + // If the target object is a constructor override off prototype. + target.prototype[prop] = src[prop]; + } else { + target[prop] = typeof src[prop] === 'object' ? recursiveMerge( + target[prop], src[prop]) : src[prop]; } } + } + return target; +} - // If error, then display error - else { - console.log("Error: Status="+v.status+" Message="+v.message); +module.exports = { + build: function (objects) { + return { + intoButDontClobber: function (target) { + include(target, objects, false, false); + }, + intoAndClobber: function(target) { + include(target, objects, true, false); + }, + intoAndMerge: function(target) { + include(target, objects, true, true); + } + }; + } +}; - // If there is a fail callback, then call it now with returned value - if (fail) { - try { - fail(v.message); - } - catch (e1) { - console.log("Error in error callback: "+callbackId+" = "+e1); - } +}) - // Clear callback if not expecting any more results - if (!v.keepCallback) { - delete cordova.callbacks[callbackId]; +// file: lib/common/channel.js +define("cordova/channel", function(require, exports, module) { +/** + * Custom pub-sub channel that can have functions subscribed to it + * @constructor + * @param type String the channel name + * @param opts Object options to pass into the channel, currently + * supports: + * onSubscribe: callback that fires when + * something subscribes to the Channel. Sets + * context to the Channel. + * onUnsubscribe: callback that fires when + * something unsubscribes to the Channel. Sets + * context to the Channel. + */ +var Channel = function(type, opts) { + this.type = type; + this.handlers = {}; + this.numHandlers = 0; + this.guid = 0; + this.fired = false; + this.enabled = true; + this.events = { + onSubscribe:null, + onUnsubscribe:null + }; + if (opts) { + if (opts.onSubscribe) this.events.onSubscribe = opts.onSubscribe; + if (opts.onUnsubscribe) this.events.onUnsubscribe = opts.onUnsubscribe; + } + }, + channel = { + /** + * Calls the provided function only after all of the channels specified + * have been fired. + */ + join: function (h, c) { + var i = c.length; + var len = i; + var f = function() { + if (!(--i)) h(); + }; + for (var j=0; j 0) { + eval("var v="+r+";"); - // First patch WebSQL if necessary - if (typeof window.openDatabase == 'undefined') { - // Not defined, create an openDatabase function for all to use! - window.openDatabase = storage.openDatabase; - } else { - // Defined, but some Android devices will throw a SECURITY_ERR - - // so we wrap the whole thing in a try-catch and shim in our own - // if the device has Android bug 16175. - var originalOpenDatabase = window.openDatabase; - window.openDatabase = function(name, version, desc, size) { - var db = null; - try { - db = originalOpenDatabase(name, version, desc, size); - } - catch (ex) { - db = null; - } + // If status is OK, then return value back to caller + if (v.status === cordova.callbackStatus.OK) { - if (db === null) { - return storage.openDatabase(name, version, desc, size); - } - else { - return db; - } - - }; - } + // If there is a success callback, then call it now with + // returned value + if (success) { + try { + success(v.message); + } catch (e) { + console.log("Error in success callback: " + callbackId + " = " + e); + } - // Patch localStorage if necessary - if (typeof window.localStorage == 'undefined' || window.localStorage === null) { - window.localStorage = new storage.CupCakeLocalStorage(); - } - }, - objects: { - cordova: { - children: { - JSCallback:{ - path:"cordova/plugin/android/callback" - }, - JSCallbackPolling:{ - path:"cordova/plugin/android/polling" + // Clear callback if not expecting any more results + if (!v.keepCallback) { + delete cordova.callbacks[callbackId]; + } + } + return v.message; } - } - }, - navigator: { - children: { - app:{ - path: "cordova/plugin/android/app" + + // If no result + else if (v.status === cordova.callbackStatus.NO_RESULT) { + // Clear callback if not expecting any more results + if (!v.keepCallback) { + delete cordova.callbacks[callbackId]; + } } - } - }, - device:{ - path: "cordova/plugin/android/device" - }, - File: { // exists natively on Android WebView, override - path: "cordova/plugin/File" - }, - FileReader: { // exists natively on Android WebView, override - path: "cordova/plugin/FileReader" - }, - FileError: { //exists natively on Android WebView on Android 4.x - path: "cordova/plugin/FileError" - } - } -}; -}); -define('cordova/utils', function(require, exports, module) { -function UUIDcreatePart(length) { - var uuidpart = ""; - for (var i=0; i frequency + 10 sec - exec( - function(timeout) { - if (timeout < (frequency + 10000)) { - exec(null, null, "Accelerometer", "setTimeout", [frequency + 10000]); - } - }, - function(e) { }, "Accelerometer", "getTimeout", []); - - // Start watch timer - var id = utils.createUUID(); - timers[id] = window.setInterval(function() { - exec(successCallback, errorCallback, "Accelerometer", "getAcceleration", []); - }, (frequency ? frequency : 1)); - - return id; - }, - - /** - * Clears the specified accelerometer watch. - * - * @param {String} id The id of the watch returned from #watchAcceleration. - */ - clearWatch: function(id) { - - // Stop javascript timer & remove from timer list - if (id && timers[id] !== undefined) { - window.clearInterval(timers[id]); - delete timers[id]; - } - } -}; - -module.exports = accelerometer; - -}); - - -define('cordova/plugin/battery', function(require, exports, module) { -/** - * This class contains information about the current battery status. - * @constructor - */ -var cordova = require('cordova'), - exec = require('cordova/exec'); - -function handlers() { - return battery.channels.batterystatus.numHandlers + - battery.channels.batterylow.numHandlers + - battery.channels.batterycritical.numHandlers; -} - -var Battery = function() { - this._level = null; - this._isPlugged = null; - // Create new event handlers on the window (returns a channel instance) - var subscriptionEvents = { - onSubscribe:this.onSubscribe, - onUnsubscribe:this.onUnsubscribe - }; - this.channels = { - batterystatus:cordova.addWindowEventHandler("batterystatus", subscriptionEvents), - batterylow:cordova.addWindowEventHandler("batterylow", subscriptionEvents), - batterycritical:cordova.addWindowEventHandler("batterycritical", subscriptionEvents) - }; -}; -/** - * Event handlers for when callbacks get registered for the battery. - * Keep track of how many handlers we have so we can start and stop the native battery listener - * appropriately (and hopefully save on battery life!). - */ -Battery.prototype.onSubscribe = function() { - var me = battery; - // If we just registered the first handler, make sure native listener is started. - if (handlers() === 1) { - exec(me._status, me._error, "Battery", "start", []); - } -}; - -Battery.prototype.onUnsubscribe = function() { - var me = battery; - - // If we just unregistered the last handler, make sure native listener is stopped. - if (handlers() === 0) { - exec(null, null, "Battery", "stop", []); - } -}; - -/** - * Callback for battery status - * - * @param {Object} info keys: level, isPlugged - */ -Battery.prototype._status = function(info) { - if (info) { - var me = battery; - var level = info.level; - if (me._level !== level || me._isPlugged !== info.isPlugged) { - // Fire batterystatus event - cordova.fireWindowEvent("batterystatus", info); - - // Fire low battery event - if (level === 20 || level === 5) { - if (level === 20) { - cordova.fireWindowEvent("batterylow", info); - } - else { - cordova.fireWindowEvent("batterycritical", info); - } - } - } - me._level = level; - me._isPlugged = info.isPlugged; - } -}; - -/** - * Error callback for battery start - */ -Battery.prototype._error = function(e) { - console.log("Error initializing Battery: " + e); -}; - -var battery = new Battery(); - -module.exports = battery; - -}); - - -define('cordova/plugin/Camera', function(require, exports, module) { -var exec = require('cordova/exec'), - Camera = require('cordova/plugin/CameraConstants'); - -var cameraExport = {}; - -// Tack on the Camera Constants to the base camera plugin. -for (var key in Camera) { - cameraExport[key] = Camera[key]; -} - -/** - * Gets a picture from source defined by "options.sourceType", and returns the - * image as defined by the "options.destinationType" option. - - * The defaults are sourceType=CAMERA and destinationType=FILE_URL. - * - * @param {Function} successCallback - * @param {Function} errorCallback - * @param {Object} options - */ -cameraExport.getPicture = function(successCallback, errorCallback, options) { - // successCallback required - if (typeof successCallback != "function") { - console.log("Camera Error: successCallback is not a function"); - return; - } - - // errorCallback optional - if (errorCallback && (typeof errorCallback != "function")) { - console.log("Camera Error: errorCallback is not a function"); - return; - } - - var quality = 50; - if (options && typeof options.quality == "number") { - quality = options.quality; - } else if (options && typeof options.quality == "string") { - var qlity = parseInt(options.quality, 10); - if (isNaN(qlity) === false) { - quality = qlity.valueOf(); - } - } - - var destinationType = Camera.DestinationType.FILE_URL; - if (typeof options.destinationType == "number") { - destinationType = options.destinationType; - } + var destinationType = Camera.DestinationType.FILE_URI; + if (typeof options.destinationType == "number") { + destinationType = options.destinationType; + } var sourceType = Camera.PictureSourceType.CAMERA; if (typeof options.sourceType == "number") { @@ -1564,9 +1112,10 @@ cameraExport.getPicture = function(successCallback, errorCallback, options) { module.exports = cameraExport; -}); +}) -define('cordova/plugin/CameraConstants', function(require, exports, module) { +// file: lib/common/plugin/CameraConstants.js +define("cordova/plugin/CameraConstants", function(require, exports, module) { module.exports = { DestinationType:{ DATA_URL: 0, // Return base64 encoded string @@ -1588,107 +1137,33 @@ module.exports = { } }; -}); - -define('cordova/plugin/capture', function(require, exports, module) { -var exec = require('cordova/exec'), - MediaFile = require('cordova/plugin/MediaFile'); - -/** - * Launches a capture of different types. - * - * @param (DOMString} type - * @param {Function} successCB - * @param {Function} errorCB - * @param {CaptureVideoOptions} options - */ -function _capture(type, successCallback, errorCallback, options) { - var win = function(pluginResult) { - var mediaFiles = []; - var i; - for (i = 0; i < pluginResult.length; i++) { - var mediaFile = new MediaFile(); - mediaFile.name = pluginResult[i].name; - mediaFile.fullPath = pluginResult[i].fullPath; - mediaFile.type = pluginResult[i].type; - mediaFile.lastModifiedDate = pluginResult[i].lastModifiedDate; - mediaFile.size = pluginResult[i].size; - mediaFiles.push(mediaFile); - } - successCallback(mediaFiles); - }; - exec(win, errorCallback, "Capture", type, [options]); -} -/** - * The Capture interface exposes an interface to the camera and microphone of the hosting device. - */ -function Capture() { - this.supportedAudioModes = []; - this.supportedImageModes = []; - this.supportedVideoModes = []; -} +}) +// file: lib/common/plugin/CaptureAudioOptions.js +define("cordova/plugin/CaptureAudioOptions", function(require, exports, module) { /** - * Launch audio recorder application for recording audio clip(s). - * - * @param {Function} successCB - * @param {Function} errorCB - * @param {CaptureAudioOptions} options + * Encapsulates all audio capture operation configuration options. */ -Capture.prototype.captureAudio = function(successCallback, errorCallback, options){ - _capture("captureAudio", successCallback, errorCallback, 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; }; +module.exports = CaptureAudioOptions; + +}) + +// file: lib/common/plugin/CaptureError.js +define("cordova/plugin/CaptureError", function(require, exports, module) { /** - * Launch camera application for taking image(s). - * - * @param {Function} successCB - * @param {Function} errorCB - * @param {CaptureImageOptions} options + * The CaptureError interface encapsulates all errors in the Capture API. */ -Capture.prototype.captureImage = function(successCallback, errorCallback, options){ - _capture("captureImage", successCallback, errorCallback, options); -}; - -/** - * Launch device camera application for recording video(s). - * - * @param {Function} successCB - * @param {Function} errorCB - * @param {CaptureVideoOptions} options - */ -Capture.prototype.captureVideo = function(successCallback, errorCallback, options){ - _capture("captureVideo", successCallback, errorCallback, options); -}; - - -module.exports = new Capture(); - -}); - -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; -}; - -module.exports = CaptureAudioOptions; - -}); - -define('cordova/plugin/CaptureError', function(require, exports, module) { -/** - * The CaptureError interface encapsulates all errors in the Capture API. - */ -var CaptureError = function(c) { - this.code = c || null; +var CaptureError = function(c) { + this.code = c || null; }; // Camera or microphone failed to capture image or sound. @@ -1704,9 +1179,10 @@ CaptureError.CAPTURE_NOT_SUPPORTED = 20; module.exports = CaptureError; -}); +}) -define('cordova/plugin/CaptureImageOptions', function(require, exports, module) { +// file: lib/common/plugin/CaptureImageOptions.js +define("cordova/plugin/CaptureImageOptions", function(require, exports, module) { /** * Encapsulates all image capture operation configuration options. */ @@ -1719,9 +1195,10 @@ var CaptureImageOptions = function(){ module.exports = CaptureImageOptions; -}); +}) -define('cordova/plugin/CaptureVideoOptions', function(require, exports, module) { +// file: lib/common/plugin/CaptureVideoOptions.js +define("cordova/plugin/CaptureVideoOptions", function(require, exports, module) { /** * Encapsulates all video capture operation configuration options. */ @@ -1736,103 +1213,10 @@ var CaptureVideoOptions = function(){ module.exports = CaptureVideoOptions; -}); - -define('cordova/plugin/compass', function(require, exports, module) { -var exec = require('cordova/exec'), - utils = require('cordova/utils'), - CompassHeading = require('cordova/plugin/CompassHeading'), - CompassError = require('cordova/plugin/CompassError'), - timers = {}, - compass = { - /** - * Asynchronously acquires the current heading. - * @param {Function} successCallback The function to call when the heading - * data is available - * @param {Function} errorCallback The function to call when there is an error - * getting the heading data. - * @param {CompassOptions} options The options for getting the heading data (not used). - */ - getCurrentHeading:function(successCallback, errorCallback) { - // successCallback required - if (typeof successCallback !== "function") { - console.log("Compass Error: successCallback is not a function"); - return; - } - - // errorCallback optional - if (errorCallback && (typeof errorCallback !== "function")) { - console.log("Compass Error: errorCallback is not a function"); - return; - } - - var win = function(result) { - var ch = new CompassHeading(result.magneticHeading, result.trueHeading, result.headingAccuracy, result.timestamp); - successCallback(ch); - }; - var fail = function(code) { - var ce = new CompassError(code); - errorCallback(ce); - } - - // Get heading - exec(win, fail, "Compass", "getHeading", []); - }, - - /** - * Asynchronously acquires the heading repeatedly at a given interval. - * @param {Function} successCallback The function to call each time the heading - * data is available - * @param {Function} errorCallback The function to call when there is an error - * getting the heading data. - * @param {HeadingOptions} options The options for getting the heading data - * such as timeout and the frequency of the watch. - */ - watchHeading:function(successCallback, errorCallback, options) { - // Default interval (100 msec) - var frequency = (options !== undefined && options.frequency !== undefined) ? options.frequency : 100; - - // successCallback required - if (typeof successCallback !== "function") { - console.log("Compass Error: successCallback is not a function"); - return; - } - - // errorCallback optional - if (errorCallback && (typeof errorCallback !== "function")) { - console.log("Compass Error: errorCallback is not a function"); - return; - } - - // Start watch timer to get headings - var id = utils.createUUID(); - - timers[id] = window.setInterval(function() { - compass.getCurrentHeading(successCallback, errorCallback); - }, frequency); - - return id; - }, - - /** - * Clears the specified heading watch. - * @param {String} watchId The ID of the watch returned from #watchHeading. - */ - clearWatch:function(id) { - // Stop javascript timer & remove from timer list - if (id && timers[id]) { - clearInterval(timers[id]); - delete timers[id]; - } - } - // TODO: add the filter-based iOS-only methods - }; - -module.exports = compass; - -}); +}) -define('cordova/plugin/CompassError', function(require, exports, module) { +// file: lib/common/plugin/CompassError.js +define("cordova/plugin/CompassError", function(require, exports, module) { /** * CompassError. * An error code assigned by an implementation when an error has occured @@ -1847,9 +1231,10 @@ CompassError.COMPASS_NOT_SUPPORTED = 20; module.exports = CompassError; -}); +}) -define('cordova/plugin/CompassHeading', function(require, exports, module) { +// file: lib/common/plugin/CompassHeading.js +define("cordova/plugin/CompassHeading", function(require, exports, module) { var CompassHeading = function(magneticHeading, trueHeading, headingAccuracy, timestamp) { this.magneticHeading = (magneticHeading !== undefined ? magneticHeading : null); this.trueHeading = (trueHeading !== undefined ? trueHeading : null); @@ -1859,9 +1244,10 @@ var CompassHeading = function(magneticHeading, trueHeading, headingAccuracy, tim module.exports = CompassHeading; -}); +}) -define('cordova/plugin/ConfigurationData', function(require, exports, module) { +// file: lib/common/plugin/ConfigurationData.js +define("cordova/plugin/ConfigurationData", function(require, exports, module) { /** * Encapsulates a set of parameters that the capture device supports. */ @@ -1878,9 +1264,10 @@ function ConfigurationData() { module.exports = ConfigurationData; -}); +}) -define('cordova/plugin/Connection', function(require, exports, module) { +// file: lib/common/plugin/Connection.js +define("cordova/plugin/Connection", function(require, exports, module) { /** * Network status */ @@ -1894,14 +1281,53 @@ module.exports = { NONE: "none" }; -}); +}) -define('cordova/plugin/Contact', function(require, exports, module) { +// file: lib/common/plugin/Contact.js +define("cordova/plugin/Contact", function(require, exports, module) { var exec = require('cordova/exec'), ContactError = require('cordova/plugin/ContactError'), utils = require('cordova/utils'); /** +* Converts primitives into Complex Object +* Currently only used for Date fields +*/ +function convertIn(contact) { + var value = contact.birthday; + try { + contact.birthday = new Date(parseFloat(value)); + } catch (exception){ + console.log("Cordova Contact convertIn error: exception creating date."); + } + return contact; +}; + +/** +* Converts Complex objects into primitives +* Only conversion at present is for Dates. +**/ + +function convertOut(contact) { + var value = contact.birthday; + if (value != null) { + // try to make it a Date object if it is not already + if (!value instanceof Date){ + try { + value = new Date(value); + } catch(exception){ + value = null; + } + } + if (value instanceof Date){ + value = value.valueOf(); // convert to milliseconds + } + contact.birthday = value; + } + return contact; +}; + +/** * Contains information about a single contact. * @constructor * @param {DOMString} id unique identifier @@ -1926,16 +1352,16 @@ var Contact = function (id, displayName, name, nickname, phoneNumbers, emails, a this.displayName = displayName || null; this.name = name || null; // ContactName this.nickname = nickname || null; - this.phoneNumbers = phoneNumbers || []; // ContactField[] - this.emails = emails || []; // ContactField[] - this.addresses = addresses || []; // ContactAddress[] - this.ims = ims || []; // ContactField[] - this.organizations = organizations || []; // ContactOrganization[] + this.phoneNumbers = phoneNumbers || null; // ContactField[] + this.emails = emails || null; // ContactField[] + this.addresses = addresses || null; // ContactAddress[] + this.ims = ims || null; // ContactField[] + this.organizations = organizations || null; // ContactOrganization[] this.birthday = birthday || null; this.note = note || null; - this.photos = photos || []; // ContactField[] - this.categories = categories || []; // ContactField[] - this.urls = urls || []; // ContactField[] + this.photos = photos || null; // ContactField[] + this.categories = categories || null; // ContactField[] + this.urls = urls || null; // ContactField[] }; /** @@ -1944,12 +1370,14 @@ var Contact = function (id, displayName, name, nickname, phoneNumbers, emails, a * @param errorCB error callback */ Contact.prototype.remove = function(successCB, errorCB) { + var fail = function(code) { + errorCB(new ContactError(code)); + }; if (this.id === null) { - var errorObj = new ContactError(ContactError.UNKNOWN_ERROR); - errorCB(errorObj); + fail(ContactError.UNKNOWN_ERROR); } else { - exec(successCB, errorCB, "Contacts", "remove", [this.id]); + exec(successCB, fail, "Contacts", "remove", [this.id]); } }; @@ -2013,15 +1441,32 @@ Contact.prototype.clone = function() { * @param errorCB error callback */ Contact.prototype.save = function(successCB, errorCB) { - exec(successCB, errorCB, "Contacts", "save", [this]); + var fail = function(code) { + errorCB(new ContactError(code)); + }; + var success = function(result) { + if (result) { + if (typeof successCB === 'function') { + var fullContact = require('cordova/plugin/contacts').create(result); + successCB(convertIn(fullContact)); + } + } + else { + // no Entry object returned + fail(ContactError.UNKNOWN_ERROR); + } + }; + var dupContact = convertOut(utils.clone(this)); + exec(success, fail, "Contacts", "save", [dupContact]); }; module.exports = Contact; -}); +}) -define('cordova/plugin/ContactAddress', function(require, exports, module) { +// file: lib/common/plugin/ContactAddress.js +define("cordova/plugin/ContactAddress", function(require, exports, module) { /** * Contact address. * @constructor @@ -2048,9 +1493,10 @@ var ContactAddress = function(pref, type, formatted, streetAddress, locality, re module.exports = ContactAddress; -}); +}) -define('cordova/plugin/ContactError', function(require, exports, module) { +// file: lib/common/plugin/ContactError.js +define("cordova/plugin/ContactError", function(require, exports, module) { /** * ContactError. * An error code assigned by an implementation when an error has occured @@ -2073,9 +1519,10 @@ ContactError.PERMISSION_DENIED_ERROR = 20; module.exports = ContactError; -}); +}) -define('cordova/plugin/ContactField', function(require, exports, module) { +// file: lib/common/plugin/ContactField.js +define("cordova/plugin/ContactField", function(require, exports, module) { /** * Generic contact field. * @constructor @@ -2093,9 +1540,10 @@ var ContactField = function(type, value, pref) { module.exports = ContactField; -}); +}) -define('cordova/plugin/ContactFindOptions', function(require, exports, module) { +// file: lib/common/plugin/ContactFindOptions.js +define("cordova/plugin/ContactFindOptions", function(require, exports, module) { /** * ContactFindOptions. * @constructor @@ -2110,9 +1558,10 @@ var ContactFindOptions = function(filter, multiple) { module.exports = ContactFindOptions; -}); +}) -define('cordova/plugin/ContactName', function(require, exports, module) { +// file: lib/common/plugin/ContactName.js +define("cordova/plugin/ContactName", function(require, exports, module) { /** * Contact name. * @constructor @@ -2134,9 +1583,10 @@ var ContactName = function(formatted, familyName, givenName, middle, prefix, suf module.exports = ContactName; -}); +}) -define('cordova/plugin/ContactOrganization', function(require, exports, module) { +// file: lib/common/plugin/ContactOrganization.js +define("cordova/plugin/ContactOrganization", function(require, exports, module) { /** * Contact organization. * @constructor @@ -2161,70 +1611,10 @@ var ContactOrganization = function(pref, type, name, dept, title) { module.exports = ContactOrganization; -}); - -define('cordova/plugin/contacts', function(require, exports, module) { -var exec = require('cordova/exec'), - ContactError = require('cordova/plugin/ContactError'), - Contact = require('cordova/plugin/Contact'); - -/** -* Represents a group of Contacts. -* @constructor -*/ -var contacts = { - /** - * Returns an array of Contacts matching the search criteria. - * @param fields that should be searched - * @param successCB success callback - * @param errorCB error callback - * @param {ContactFindOptions} options that can be applied to contact searching - * @return array of Contacts matching search criteria - */ - find:function(fields, successCB, errorCB, options) { - if (!successCB) { - throw new TypeError("You must specify a success callback for the find command."); - } - if (!fields || (fields instanceof Array && fields.length === 0)) { - if (typeof errorCB === "function") { - errorCB(new ContactError(ContactError.INVALID_ARGUMENT_ERROR)); - } - } else { - var win = function(result) { - var cs = []; - for (var i = 0, l = result.length; i < l; i++) { - cs.push(contacts.create(result[i])); - } - successCB(cs); - }; - exec(win, errorCB, "Contacts", "search", [fields, options]); - } - }, - - /** - * This function creates a new contact, but it does not persist the contact - * to device storage. To persist the contact to device storage, invoke - * contact.save(). - * @param properties an object who's properties will be examined to create a new Contact - * @returns new Contact object - */ - create:function(properties) { - var i; - var contact = new Contact(); - for (i in properties) { - if (typeof contact[i] !== 'undefined' && properties.hasOwnProperty(i)) { - contact[i] = properties[i]; - } - } - return contact; - } -}; - -module.exports = contacts; - -}); +}) -define('cordova/plugin/Coordinates', function(require, exports, module) { +// file: lib/common/plugin/Coordinates.js +define("cordova/plugin/Coordinates", function(require, exports, module) { /** * This class contains position information. * @param {Object} lat @@ -2269,9 +1659,10 @@ var Coordinates = function(lat, lng, alt, acc, head, vel, altacc) { module.exports = Coordinates; -}); +}) -define('cordova/plugin/DirectoryEntry', function(require, exports, module) { +// file: lib/common/plugin/DirectoryEntry.js +define("cordova/plugin/DirectoryEntry", function(require, exports, module) { var utils = require('cordova/utils'), exec = require('cordova/exec'), Entry = require('cordova/plugin/Entry'), @@ -2353,9 +1744,10 @@ DirectoryEntry.prototype.getFile = function(path, options, successCallback, erro module.exports = DirectoryEntry; -}); +}) -define('cordova/plugin/DirectoryReader', function(require, exports, module) { +// file: lib/common/plugin/DirectoryReader.js +define("cordova/plugin/DirectoryReader", function(require, exports, module) { var exec = require('cordova/exec'); /** @@ -2398,9 +1790,10 @@ DirectoryReader.prototype.readEntries = function(successCallback, errorCallback) module.exports = DirectoryReader; -}); +}) -define('cordova/plugin/Entry', function(require, exports, module) { +// file: lib/common/plugin/Entry.js +define("cordova/plugin/Entry", function(require, exports, module) { var exec = require('cordova/exec'), FileError = require('cordova/plugin/FileError'), Metadata = require('cordova/plugin/Metadata'); @@ -2600,9 +1993,10 @@ Entry.prototype.getParent = function(successCallback, errorCallback) { module.exports = Entry; -}); +}) -define('cordova/plugin/File', function(require, exports, module) { +// file: lib/common/plugin/File.js +define("cordova/plugin/File", function(require, exports, module) { /** * Constructor. * name {DOMString} name of the file, without path information @@ -2622,9 +2016,10 @@ var File = function(name, fullPath, type, lastModifiedDate, size){ module.exports = File; -}); +}) -define('cordova/plugin/FileEntry', function(require, exports, module) { +// file: lib/common/plugin/FileEntry.js +define("cordova/plugin/FileEntry", function(require, exports, module) { var utils = require('cordova/utils'), exec = require('cordova/exec'), Entry = require('cordova/plugin/Entry'), @@ -2689,9 +2084,10 @@ FileEntry.prototype.file = function(successCallback, errorCallback) { module.exports = FileEntry; -}); +}) -define('cordova/plugin/FileError', function(require, exports, module) { +// file: lib/common/plugin/FileError.js +define("cordova/plugin/FileError", function(require, exports, module) { /** * FileError */ @@ -2718,9 +2114,10 @@ FileError.PATH_EXISTS_ERR = 12; module.exports = FileError; -}); +}) -define('cordova/plugin/FileReader', function(require, exports, module) { +// file: lib/common/plugin/FileReader.js +define("cordova/plugin/FileReader", function(require, exports, module) { var exec = require('cordova/exec'), FileError = require('cordova/plugin/FileError'), ProgressEvent = require('cordova/plugin/ProgressEvent'); @@ -2821,6 +2218,7 @@ FileReader.prototype.readAsText = function(file, encoding) { if (me.readyState === FileReader.DONE) { return; } + // Save result me.result = r; @@ -2955,7 +2353,7 @@ FileReader.prototype.readAsDataURL = function(file) { */ FileReader.prototype.readAsBinaryString = function(file) { // TODO - Can't return binary data to browser. - console.log('This method is not supported at this time.'); + console.log('method "readAsBinaryString" is not supported at this time.'); }; /** @@ -2970,9 +2368,10 @@ FileReader.prototype.readAsArrayBuffer = function(file) { module.exports = FileReader; -}); +}) -define('cordova/plugin/FileSystem', function(require, exports, module) { +// file: lib/common/plugin/FileSystem.js +define("cordova/plugin/FileSystem", function(require, exports, module) { var DirectoryEntry = require('cordova/plugin/DirectoryEntry'); /** @@ -2991,9 +2390,10 @@ var FileSystem = function(name, root) { module.exports = FileSystem; -}); +}) -define('cordova/plugin/FileTransfer', function(require, exports, module) { +// file: lib/common/plugin/FileTransfer.js +define("cordova/plugin/FileTransfer", function(require, exports, module) { var exec = require('cordova/exec'); /** @@ -3063,9 +2463,10 @@ FileTransfer.prototype.download = function(source, target, successCallback, erro module.exports = FileTransfer; -}); +}) -define('cordova/plugin/FileTransferError', function(require, exports, module) { +// file: lib/common/plugin/FileTransferError.js +define("cordova/plugin/FileTransferError", function(require, exports, module) { /** * FileTransferError * @constructor @@ -3080,9 +2481,10 @@ FileTransferError.CONNECTION_ERR = 3; module.exports = FileTransferError; -}); +}) -define('cordova/plugin/FileUploadOptions', function(require, exports, module) { +// file: lib/common/plugin/FileUploadOptions.js +define("cordova/plugin/FileUploadOptions", function(require, exports, module) { /** * Options to customize the HTTP request used to upload files. * @constructor @@ -3100,9 +2502,10 @@ var FileUploadOptions = function(fileKey, fileName, mimeType, params) { module.exports = FileUploadOptions; -}); +}) -define('cordova/plugin/FileUploadResult', function(require, exports, module) { +// file: lib/common/plugin/FileUploadResult.js +define("cordova/plugin/FileUploadResult", function(require, exports, module) { /** * FileUploadResult * @constructor @@ -3115,9 +2518,10 @@ var FileUploadResult = function() { module.exports = FileUploadResult; -}); +}) -define('cordova/plugin/FileWriter', function(require, exports, module) { +// file: lib/common/plugin/FileWriter.js +define("cordova/plugin/FileWriter", function(require, exports, module) { var exec = require('cordova/exec'), FileError = require('cordova/plugin/FileError'); ProgressEvent = require('cordova/plugin/ProgressEvent'); @@ -3372,9 +2776,10 @@ FileWriter.prototype.truncate = function(size) { module.exports = FileWriter; -}); +}) -define('cordova/plugin/Flags', function(require, exports, module) { +// file: lib/common/plugin/Flags.js +define("cordova/plugin/Flags", function(require, exports, module) { /** * Supplies arguments to methods that lookup or create files and directories. * @@ -3391,125 +2796,28 @@ function Flags(create, exclusive) { module.exports = Flags; -}); +}) -define('cordova/plugin/geolocation', function(require, exports, module) { -var utils = require('cordova/utils'), - exec = require('cordova/exec'), - PositionError = require('cordova/plugin/PositionError'), - Position = require('cordova/plugin/Position'); +// file: lib/common/plugin/LocalFileSystem.js +define("cordova/plugin/LocalFileSystem", function(require, exports, module) { +var exec = require('cordova/exec'); -var timers = {}; // list of timers in use +/** + * Represents a local file system. + */ +var LocalFileSystem = function() { -// Returns default params, overrides if provided with values -function parseParameters(options) { - var opt = { - maximumAge: 10000, - enableHighAccuracy: false, - timeout: 10000 - }; +}; - if (options) { - if (options.maximumAge !== undefined) { - opt.maximumAge = options.maximumAge; - } - if (options.enableHighAccuracy !== undefined) { - opt.enableHighAccuracy = options.enableHighAccuracy; - } - if (options.timeout !== undefined) { - opt.timeout = options.timeout; - } - } +LocalFileSystem.TEMPORARY = 0; //temporary, with no guarantee of persistence +LocalFileSystem.PERSISTENT = 1; //persistent - return opt; -} +module.exports = LocalFileSystem; -var geolocation = { - /** - * Asynchronously aquires the current position. - * - * @param {Function} successCallback The function to call when the position data is available - * @param {Function} errorCallback The function to call when there is an error getting the heading position. (OPTIONAL) - * @param {PositionOptions} options The options for getting the position data. (OPTIONAL) - */ - getCurrentPosition:function(successCallback, errorCallback, options) { - options = parseParameters(options); +}) - var win = function(p) { - successCallback(new Position( - { -