You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by fi...@apache.org on 2012/04/22 09:19:24 UTC
ios commit: [CB-511] Changed deviceproperties version to "cordova"
property
Updated Branches:
refs/heads/master 499cf514f -> d199580bb
[CB-511] Changed deviceproperties version to "cordova" property
Project: http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/commit/d199580b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/tree/d199580b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/diff/d199580b
Branch: refs/heads/master
Commit: d199580bba5a0e5a4a45207667cf56e7ba5007ed
Parents: 499cf51
Author: Fil Maj <ma...@gmail.com>
Authored: Sun Apr 22 00:21:05 2012 -0700
Committer: Fil Maj <ma...@gmail.com>
Committed: Sun Apr 22 00:21:05 2012 -0700
----------------------------------------------------------------------
CordovaLib/Classes/CDVViewController.m | 2 +-
CordovaLib/javascript/cordova.ios.js | 558 ++++++++++++---------------
2 files changed, 255 insertions(+), 305 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/blob/d199580b/CordovaLib/Classes/CDVViewController.m
----------------------------------------------------------------------
diff --git a/CordovaLib/Classes/CDVViewController.m b/CordovaLib/Classes/CDVViewController.m
index 24c8d93..60579d9 100644
--- a/CordovaLib/Classes/CDVViewController.m
+++ b/CordovaLib/Classes/CDVViewController.m
@@ -854,7 +854,7 @@ BOOL gSplashScreenShown = NO;
[devProps setObject:[device systemVersion] forKey:@"version"];
[devProps setObject:[device uniqueAppInstanceIdentifier] forKey:@"uuid"];
[devProps setObject:[device name] forKey:@"name"];
- [devProps setObject:[CDVViewController cordovaVersion] forKey:@"gap"];
+ [devProps setObject:[CDVViewController cordovaVersion] forKey:@"cordova"];
NSDictionary *devReturn = [NSDictionary dictionaryWithDictionary:devProps];
return devReturn;
http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/blob/d199580b/CordovaLib/javascript/cordova.ios.js
----------------------------------------------------------------------
diff --git a/CordovaLib/javascript/cordova.ios.js b/CordovaLib/javascript/cordova.ios.js
index 1c6bbc2..2eb0594 100644
--- a/CordovaLib/javascript/cordova.ios.js
+++ b/CordovaLib/javascript/cordova.ios.js
@@ -1,6 +1,6 @@
-// commit b2de4baa76a94ecb916619a536339ffee9ef6843
+// commit 017a948047e355ae0c2cdc8c4188ae57b115528a
-// File generated at :: Mon Apr 16 2012 15:13:41 GMT-0700 (PDT)
+// File generated at :: Sun Apr 22 2012 00:18:57 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/ios/exec.js
@@ -865,14 +880,14 @@ var cordova = require('cordova'),
},
channel = require('cordova/channel');
-module.exports = function() {
+module.exports = function() {
if (!channel.onCordovaInfoReady.fired) {
utils.alert("ERROR: Attempting to call cordova.exec()" +
" before 'deviceready'. Ignoring.");
return;
}
- var successCallback, failCallback, service, action, actionArgs;
+ var successCallback, failCallback, service, action, actionArgs, splitCommand;
var callbackId = null;
if (typeof arguments[0] !== "string") {
// FORMAT ONE
@@ -894,33 +909,33 @@ module.exports = function() {
service = splitCommand.join(".");
actionArgs = Array.prototype.splice.call(arguments, 1);
}
-
+
// Start building the command object.
var command = {
className: service,
methodName: action,
- arguments: []
+ "arguments": []
};
// Register the callbacks and add the callbackId to the positional
// arguments if given.
if (successCallback || failCallback) {
callbackId = service + cordova.callbackId++;
- cordova.callbacks[callbackId] =
+ cordova.callbacks[callbackId] =
{success:successCallback, fail:failCallback};
}
- if (callbackId != null) {
- command.arguments.push(callbackId);
+ if (callbackId !== null) {
+ command["arguments"].push(callbackId);
}
for (var i = 0; i < actionArgs.length; ++i) {
var arg = actionArgs[i];
- if (arg == undefined || arg == null) { // nulls are pushed to the args now (becomes NSNull)
- continue; //command.arguments.push(arg);
+ if (arg === undefined || arg === null) { // nulls are pushed to the args now (becomes NSNull)
+ command["arguments"].push(arg);
} else if (typeof(arg) == 'object' && !(arg instanceof Array)) {
command.options = arg;
} else {
- command.arguments.push(arg);
+ command["arguments"].push(arg);
}
}
@@ -951,7 +966,7 @@ module.exports = {
// iOS doesn't allow reassigning / overriding navigator.geolocation object.
// So clobber its methods here instead :)
var geo = require('cordova/plugin/geolocation');
-
+
navigator.geolocation.getCurrentPosition = geo.getCurrentPosition;
navigator.geolocation.watchPosition = geo.watchPosition;
navigator.geolocation.clearWatch = geo.clearWatch;
@@ -971,9 +986,9 @@ module.exports = {
}
},
merges:{
- Contact:{
- path: "cordova/plugin/ios/Contact"
- },
+ Contact:{
+ path: "cordova/plugin/ios/Contact"
+ },
Entry:{
path: "cordova/plugin/ios/Entry"
},
@@ -986,13 +1001,12 @@ module.exports = {
path:"cordova/plugin/ios/notification"
},
contacts:{
- path:"cordova/plugin/ios/contacts"
+ path:"cordova/plugin/ios/contacts"
}
}
}
}
};
-
});
// file: lib/common/plugin/Acceleration.js
@@ -1005,7 +1019,6 @@ var Acceleration = function(x, y, z, timestamp) {
};
module.exports = Acceleration;
-
});
// file: lib/common/plugin/Camera.js
@@ -1087,35 +1100,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
@@ -1140,7 +1152,6 @@ module.exports = {
SAVEDPHOTOALBUM : 2 // Choose image from picture library (same as PHOTOLIBRARY for Android)
}
};
-
});
// file: lib/common/plugin/CaptureAudioOptions.js
@@ -1149,16 +1160,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
@@ -1170,7 +1180,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;
@@ -1182,7 +1192,6 @@ CaptureError.CAPTURE_NO_MEDIA_FILES = 3;
CaptureError.CAPTURE_NOT_SUPPORTED = 20;
module.exports = CaptureError;
-
});
// file: lib/common/plugin/CaptureImageOptions.js
@@ -1191,14 +1200,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
@@ -1207,16 +1215,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
@@ -1234,7 +1241,6 @@ CompassError.COMPASS_INTERNAL_ERR = 0;
CompassError.COMPASS_NOT_SUPPORTED = 20;
module.exports = CompassError;
-
});
// file: lib/common/plugin/CompassHeading.js
@@ -1247,7 +1253,6 @@ var CompassHeading = function(magneticHeading, trueHeading, headingAccuracy, tim
};
module.exports = CompassHeading;
-
});
// file: lib/common/plugin/ConfigurationData.js
@@ -1256,18 +1261,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
@@ -1276,15 +1280,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
@@ -1305,7 +1308,7 @@ function convertIn(contact) {
console.log("Cordova Contact convertIn error: exception creating date.");
}
return contact;
-};
+}
/**
* Converts Complex objects into primitives
@@ -1314,7 +1317,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 {
@@ -1329,7 +1332,7 @@ function convertOut(contact) {
contact.birthday = value;
}
return contact;
-};
+}
/**
* Contains information about a single contact.
@@ -1448,7 +1451,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);
@@ -1460,13 +1463,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
@@ -1496,7 +1498,6 @@ var ContactAddress = function(pref, type, formatted, streetAddress, locality, re
};
module.exports = ContactAddress;
-
});
// file: lib/common/plugin/ContactError.js
@@ -1522,7 +1523,6 @@ ContactError.NOT_SUPPORTED_ERROR = 5;
ContactError.PERMISSION_DENIED_ERROR = 20;
module.exports = ContactError;
-
});
// file: lib/common/plugin/ContactField.js
@@ -1543,7 +1543,6 @@ var ContactField = function(type, value, pref) {
};
module.exports = ContactField;
-
});
// file: lib/common/plugin/ContactFindOptions.js
@@ -1561,7 +1560,6 @@ var ContactFindOptions = function(filter, multiple) {
};
module.exports = ContactFindOptions;
-
});
// file: lib/common/plugin/ContactName.js
@@ -1586,7 +1584,6 @@ var ContactName = function(formatted, familyName, givenName, middle, prefix, suf
};
module.exports = ContactName;
-
});
// file: lib/common/plugin/ContactOrganization.js
@@ -1614,7 +1611,6 @@ var ContactOrganization = function(pref, type, name, dept, title) {
};
module.exports = ContactOrganization;
-
});
// file: lib/common/plugin/Coordinates.js
@@ -1662,7 +1658,6 @@ var Coordinates = function(lat, lng, alt, acc, head, vel, altacc) {
};
module.exports = Coordinates;
-
});
// file: lib/common/plugin/DirectoryEntry.js
@@ -1670,6 +1665,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');
/**
@@ -1752,7 +1748,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.
@@ -1773,10 +1770,10 @@ DirectoryReader.prototype.readEntries = function(successCallback, errorCallback)
for (var i=0; i<result.length; i++) {
var entry = null;
if (result[i].isDirectory) {
- entry = new DirectoryEntry();
+ entry = new (require('cordova/plugin/DirectoryEntry'))();
}
else if (result[i].isFile) {
- entry = new FileEntry();
+ entry = new (require('cordova/plugin/FileEntry'))();
}
entry.isDirectory = result[i].isDirectory;
entry.isFile = result[i].isFile;
@@ -2001,7 +1998,6 @@ Entry.prototype.getParent = function(successCallback, errorCallback) {
};
module.exports = Entry;
-
});
// file: lib/common/plugin/File.js
@@ -2016,15 +2012,14 @@ define("cordova/plugin/File", function(require, exports, module) {
*/
var File = function(name, fullPath, type, lastModifiedDate, size){
- this.name = name || '';
- this.fullPath = fullPath || null;
- this.type = type || null;
- this.lastModifiedDate = lastModifiedDate || null;
- this.size = size || 0;
+ this.name = name || '';
+ this.fullPath = fullPath || null;
+ this.type = type || null;
+ this.lastModifiedDate = lastModifiedDate || null;
+ this.size = size || 0;
};
module.exports = File;
-
});
// file: lib/common/plugin/FileEntry.js
@@ -2092,7 +2087,6 @@ FileEntry.prototype.file = function(successCallback, errorCallback) {
module.exports = FileEntry;
-
});
// file: lib/common/plugin/FileError.js
@@ -2122,7 +2116,6 @@ FileError.TYPE_MISMATCH_ERR = 11;
FileError.PATH_EXISTS_ERR = 12;
module.exports = FileError;
-
});
// file: lib/common/plugin/FileReader.js
@@ -2376,7 +2369,6 @@ FileReader.prototype.readAsArrayBuffer = function(file) {
};
module.exports = FileReader;
-
});
// file: lib/common/plugin/FileSystem.js
@@ -2398,7 +2390,6 @@ var FileSystem = function(name, root) {
};
module.exports = FileSystem;
-
});
// file: lib/common/plugin/FileTransfer.js
@@ -2457,16 +2448,16 @@ FileTransfer.prototype.download = function(source, target, successCallback, erro
var win = function(result) {
var entry = null;
if (result.isDirectory) {
- entry = new DirectoryEntry();
+ entry = new (require('cordova/plugin/DirectoryEntry'))();
}
else if (result.isFile) {
- entry = new FileEntry();
+ entry = new (require('cordova/plugin/FileEntry'))();
}
entry.isDirectory = result.isDirectory;
entry.isFile = result.isFile;
entry.name = result.name;
entry.fullPath = result.fullPath;
- successCallback(entry);
+ successCallback(entry);
};
exec(win, errorCallback, 'FileTransfer', 'download', [source, target]);
};
@@ -2490,7 +2481,6 @@ FileTransferError.INVALID_URL_ERR = 2;
FileTransferError.CONNECTION_ERR = 3;
module.exports = FileTransferError;
-
});
// file: lib/common/plugin/FileUploadOptions.js
@@ -2511,7 +2501,6 @@ var FileUploadOptions = function(fileKey, fileName, mimeType, params) {
};
module.exports = FileUploadOptions;
-
});
// file: lib/common/plugin/FileUploadResult.js
@@ -2527,13 +2516,12 @@ var FileUploadResult = function() {
};
module.exports = FileUploadResult;
-
});
// file: lib/common/plugin/FileWriter.js
define("cordova/plugin/FileWriter", function(require, exports, module) {
var exec = require('cordova/exec'),
- FileError = require('cordova/plugin/FileError');
+ FileError = require('cordova/plugin/FileError'),
ProgressEvent = require('cordova/plugin/ProgressEvent');
/**
@@ -2692,7 +2680,7 @@ FileWriter.prototype.seek = function(offset) {
throw new FileError(FileError.INVALID_STATE_ERR);
}
- if (!offset && offset != 0) {
+ if (!offset && offset !== 0) {
return;
}
@@ -2792,7 +2780,7 @@ module.exports = FileWriter;
define("cordova/plugin/Flags", function(require, exports, module) {
/**
* Supplies arguments to methods that lookup or create files and directories.
- *
+ *
* @param create
* {boolean} file or directory if it doesn't exist
* @param exclusive
@@ -2805,7 +2793,6 @@ function Flags(create, exclusive) {
}
module.exports = Flags;
-
});
// file: lib/common/plugin/LocalFileSystem.js
@@ -2823,7 +2810,6 @@ LocalFileSystem.TEMPORARY = 0; //temporary, with no guarantee of persistence
LocalFileSystem.PERSISTENT = 1; //persistent
module.exports = LocalFileSystem;
-
});
// file: lib/common/plugin/Media.js
@@ -3005,7 +2991,7 @@ Media.onStatus = function(id, msg, value) {
}
else if (msg === Media.MEDIA_ERROR) {
if (media.errorCallback) {
- // value should be a MediaError object when msg == MEDIA_ERROR
+ // value should be a MediaError object when msg == MEDIA_ERROR
media.errorCallback(value);
}
}
@@ -3015,7 +3001,6 @@ Media.onStatus = function(id, msg, value) {
};
module.exports = Media;
-
});
// file: lib/common/plugin/MediaError.js
@@ -3036,7 +3021,6 @@ MediaError.MEDIA_ERR_DECODE = 3;
MediaError.MEDIA_ERR_NONE_SUPPORTED = 4;
module.exports = MediaError;
-
});
// file: lib/common/plugin/MediaFile.js
@@ -3062,16 +3046,16 @@ utils.extend(MediaFile, File);
/**
* Request capture format data for a specific file and type
- *
+ *
* @param {Function} successCB
* @param {Function} errorCB
*/
MediaFile.prototype.getFormatData = function(successCallback, errorCallback) {
- if (typeof this.fullPath === "undefined" || this.fullPath === null) {
- errorCallback(new CaptureError(CaptureError.CAPTURE_INVALID_ARGUMENT));
- } else {
+ if (typeof this.fullPath === "undefined" || this.fullPath === null) {
+ errorCallback(new CaptureError(CaptureError.CAPTURE_INVALID_ARGUMENT));
+ } else {
exec(successCallback, errorCallback, "Capture", "getFormatData", [this.fullPath, this.type]);
- }
+ }
};
/**
@@ -3097,7 +3081,6 @@ MediaFile.cast = function(pluginResult) {
};
module.exports = MediaFile;
-
});
// file: lib/common/plugin/MediaFileData.js
@@ -3112,22 +3095,21 @@ define("cordova/plugin/MediaFileData", function(require, exports, module) {
* @param {float} duration
*/
var MediaFileData = function(codecs, bitrate, height, width, duration){
- this.codecs = codecs || null;
- this.bitrate = bitrate || 0;
- this.height = height || 0;
- this.width = width || 0;
- this.duration = duration || 0;
+ this.codecs = codecs || null;
+ this.bitrate = bitrate || 0;
+ this.height = height || 0;
+ this.width = width || 0;
+ this.duration = duration || 0;
};
module.exports = MediaFileData;
-
});
// file: lib/common/plugin/Metadata.js
define("cordova/plugin/Metadata", function(require, exports, module) {
/**
* Information about the state of the file or directory
- *
+ *
* {Date} modificationTime (readonly)
*/
var Metadata = function(time) {
@@ -3135,7 +3117,6 @@ var Metadata = function(time) {
};
module.exports = Metadata;
-
});
// file: lib/common/plugin/Position.js
@@ -3143,12 +3124,11 @@ define("cordova/plugin/Position", function(require, exports, module) {
var Coordinates = require('cordova/plugin/Coordinates');
var Position = function(coords, timestamp) {
- this.coords = new Coordinates(coords.latitude, coords.longitude, coords.altitude, coords.accuracy, coords.heading, coords.velocity, coords.altitudeAccuracy);
- this.timestamp = (timestamp !== undefined) ? timestamp : new Date().getTime();
+ this.coords = new Coordinates(coords.latitude, coords.longitude, coords.altitude, coords.accuracy, coords.heading, coords.velocity, coords.altitudeAccuracy);
+ this.timestamp = (timestamp !== undefined) ? timestamp : new Date().getTime();
};
module.exports = Position;
-
});
// file: lib/common/plugin/PositionError.js
@@ -3170,7 +3150,6 @@ PositionError.POSITION_UNAVAILABLE = 2;
PositionError.TIMEOUT = 3;
module.exports = PositionError;
-
});
// file: lib/common/plugin/ProgressEvent.js
@@ -3221,7 +3200,6 @@ var ProgressEvent = (function() {
})();
module.exports = ProgressEvent;
-
});
// file: lib/common/plugin/accelerometer.js
@@ -3321,7 +3299,6 @@ var accelerometer = {
};
module.exports = accelerometer;
-
});
// file: lib/common/plugin/battery.js
@@ -3334,7 +3311,7 @@ var cordova = require('cordova'),
exec = require('cordova/exec');
function handlers() {
- return battery.channels.batterystatus.numHandlers +
+ return battery.channels.batterystatus.numHandlers +
battery.channels.batterylow.numHandlers +
battery.channels.batterycritical.numHandlers;
}
@@ -3377,30 +3354,30 @@ Battery.prototype.onUnsubscribe = function() {
/**
* Callback for battery status
- *
- * @param {Object} info keys: level, isPlugged
+ *
+ * @param {Object} info keys: level, isPlugged
*/
Battery.prototype._status = function(info) {
- if (info) {
- var me = battery;
+ 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;
- }
+ 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;
+ }
};
/**
@@ -3413,7 +3390,6 @@ Battery.prototype._error = function(e) {
var battery = new Battery();
module.exports = battery;
-
});
// file: lib/common/plugin/capture.js
@@ -3424,7 +3400,7 @@ var exec = require('cordova/exec'),
/**
* Launches a capture of different types.
*
- * @param (DOMString} type
+ * @param (DOMString} type
* @param {Function} successCB
* @param {Function} errorCB
* @param {CaptureVideoOptions} options
@@ -3450,9 +3426,9 @@ function _capture(type, successCallback, errorCallback, options) {
* The Capture interface exposes an interface to the camera and microphone of the hosting device.
*/
function Capture() {
- this.supportedAudioModes = [];
- this.supportedImageModes = [];
- this.supportedVideoModes = [];
+ this.supportedAudioModes = [];
+ this.supportedImageModes = [];
+ this.supportedVideoModes = [];
}
/**
@@ -3505,7 +3481,7 @@ var exec = require('cordova/exec'),
* 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
+ * @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).
*/
@@ -3529,8 +3505,8 @@ var exec = require('cordova/exec'),
var fail = function(code) {
var ce = new CompassError(code);
errorCallback(ce);
- }
-
+ };
+
// Get heading
exec(win, fail, "Compass", "getHeading", [options]);
},
@@ -3539,7 +3515,7 @@ var exec = require('cordova/exec'),
* 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
+ * @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. For iOS, filter parameter
@@ -3563,17 +3539,17 @@ var exec = require('cordova/exec'),
}
var id = utils.createUUID();
- 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);
- }
-
+ 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;
},
@@ -3584,19 +3560,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
@@ -3658,7 +3633,6 @@ var contacts = {
};
module.exports = contacts;
-
});
// file: lib/common/plugin/geolocation.js
@@ -3722,7 +3696,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,
@@ -3757,40 +3731,39 @@ var geolocation = {
};
module.exports = geolocation;
-
});
// file: lib/ios/plugin/ios/Contact.js
define("cordova/plugin/ios/Contact", function(require, exports, module) {
var exec = require('cordova/exec'),
- ContactError = require('cordova/plugin/ContactError');
+ ContactError = require('cordova/plugin/ContactError');
/**
* Provides iOS Contact.display API.
*/
module.exports = {
- display : function(errorCB, options) {
- /*
- * Display a contact using the iOS Contact Picker UI
- * NOT part of W3C spec so no official documentation
- *
- * @param errorCB error callback
- * @param options object
- * allowsEditing: boolean AS STRING
- * "true" to allow editing the contact
- * "false" (default) display contact
- */
-
- if (this.id == null) {
- if (typeof errorCB === "function") {
- var errorObj = new ContactError(ContactError.UNKNOWN_ERROR);
- errorCB(errorObj);
- }
- }
- else {
- exec(null, errorCB, "Contacts","displayContact", [this.id, options]);
- }
- }
+ display : function(errorCB, options) {
+ /*
+ * Display a contact using the iOS Contact Picker UI
+ * NOT part of W3C spec so no official documentation
+ *
+ * @param errorCB error callback
+ * @param options object
+ * allowsEditing: boolean AS STRING
+ * "true" to allow editing the contact
+ * "false" (default) display contact
+ */
+
+ if (this.id === null) {
+ if (typeof errorCB === "function") {
+ var errorObj = new ContactError(ContactError.UNKNOWN_ERROR);
+ errorCB(errorObj);
+ }
+ }
+ else {
+ exec(null, errorCB, "Contacts","displayContact", [this.id, options]);
+ }
+ }
};
});
@@ -3798,16 +3771,15 @@ module.exports = {
define("cordova/plugin/ios/Entry", function(require, exports, module) {
module.exports = {
toURL:function() {
- // TODO: refactor path in a cross-platform way so we can eliminate
+ // TODO: refactor path in a cross-platform way so we can eliminate
// these kinds of platform-specific hacks.
return "file://localhost" + this.fullPath;
},
toURI: function() {
- console.log("DEPRECATED: Update your code to use 'toURL'");
- return "file://localhost" + this.fullPath;
+ console.log("DEPRECATED: Update your code to use 'toURL'");
+ return "file://localhost" + this.fullPath;
}
};
-
});
// file: lib/ios/plugin/ios/FileReader.js
@@ -3895,11 +3867,10 @@ module.exports = {
if (typeof me.onloadend === "function") {
me.onloadend(new ProgressEvent("loadend", {target:me}));
}
- },
+ },
"File", "readAsText", [this.fileName, enc]);
}
-}
-
+};
});
// file: lib/ios/plugin/ios/console.js
@@ -3921,22 +3892,22 @@ DebugConsole.INFO_LEVEL = 1;
DebugConsole.WARN_LEVEL = 2;
DebugConsole.ERROR_LEVEL = 4;
DebugConsole.NONE_LEVEL = 8;
-
+
DebugConsole.prototype.setLevel = function(level) {
this.logLevel = level;
};
var stringify = function(message) {
- try {
- if (typeof message === "object" && JSON && JSON.stringify) {
- return JSON.stringify(message);
- } else {
- return message.toString();
- }
- } catch (e) {
- return e.toString();
- }
-}
+ try {
+ if (typeof message === "object" && JSON && JSON.stringify) {
+ return JSON.stringify(message);
+ } else {
+ return message.toString();
+ }
+ } catch (e) {
+ return e.toString();
+ }
+};
/**
* Print a normal log message to the console
@@ -3945,10 +3916,10 @@ var stringify = function(message) {
DebugConsole.prototype.log = function(message) {
if (this.logLevel <= DebugConsole.INFO_LEVEL) {
exec(null, null, 'Debug Console', 'log', [ stringify(message), { logLevel: 'INFO' } ]);
- }
+ }
else if (this.winConsole && this.winConsole.log) {
this.winConsole.log(message);
- }
+ }
};
/**
@@ -3971,14 +3942,13 @@ DebugConsole.prototype.warn = function(message) {
DebugConsole.prototype.error = function(message) {
if (this.logLevel <= DebugConsole.ERROR_LEVEL) {
exec(null, null, 'Debug Console', 'log', [ stringify(message), { logLevel: 'ERROR' } ]);
- }
+ }
else if (this.winConsole && this.winConsole.error){
this.winConsole.error(message);
- }
+ }
};
module.exports = new DebugConsole();
-
});
// file: lib/ios/plugin/ios/contacts.js
@@ -3989,30 +3959,30 @@ var exec = require('cordova/exec');
* Provides iOS enhanced contacts API.
*/
module.exports = {
- newContactUI : function(successCallback) {
- /*
- * Create a contact using the iOS Contact Picker UI
- * NOT part of W3C spec so no official documentation
- *
- * returns: the id of the created contact as param to successCallback
- */
- exec(successCallback, null, "Contacts","newContact", []);
- },
- chooseContact : function(successCallback, options) {
- /*
- * Select a contact using the iOS Contact Picker UI
- * NOT part of W3C spec so no official documentation
- *
- * @param errorCB error callback
- * @param options object
- * allowsEditing: boolean AS STRING
- * "true" to allow editing the contact
- * "false" (default) display contact
- *
- * returns: the id of the selected contact as param to successCallback
- */
- exec(successCallback, null, "Contacts","chooseContact", [options]);
- }
+ newContactUI : function(successCallback) {
+ /*
+ * Create a contact using the iOS Contact Picker UI
+ * NOT part of W3C spec so no official documentation
+ *
+ * returns: the id of the created contact as param to successCallback
+ */
+ exec(successCallback, null, "Contacts","newContact", []);
+ },
+ chooseContact : function(successCallback, options) {
+ /*
+ * Select a contact using the iOS Contact Picker UI
+ * NOT part of W3C spec so no official documentation
+ *
+ * @param errorCB error callback
+ * @param options object
+ * allowsEditing: boolean AS STRING
+ * "true" to allow editing the contact
+ * "false" (default) display contact
+ *
+ * returns: the id of the selected contact as param to successCallback
+ */
+ exec(successCallback, null, "Contacts","chooseContact", [options]);
+ }
};
});
@@ -4040,7 +4010,7 @@ Device.prototype.setInfo = function(info) {
this.platform = info.platform;
this.version = info.version;
this.name = info.name;
- this.cordova = info.gap;
+ this.cordova = info.cordova;
this.uuid = info.uuid;
channel.onCordovaInfoReady.fire();
} catch(e) {
@@ -4064,7 +4034,6 @@ module.exports = function() {
cordova.commandQueue = [];
return json;
};
-
});
// file: lib/ios/plugin/ios/notification.js
@@ -4075,8 +4044,7 @@ module.exports = {
beep:function(count) {
(new Media('beep.wav')).play();
}
-}
-
+};
});
// file: lib/common/plugin/network.js
@@ -4141,7 +4109,6 @@ NetworkConnection.prototype.getInfo = function (successCallback, errorCallback)
};
module.exports = new NetworkConnection();
-
});
// file: lib/common/plugin/notification.js
@@ -4202,7 +4169,6 @@ module.exports = {
exec(null, null, "Notification", "beep", [count]);
}
};
-
});
// file: lib/common/plugin/requestFileSystem.js
@@ -4247,13 +4213,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');
/**
@@ -4315,12 +4281,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){
@@ -4328,15 +4294,15 @@ var _self = {
}
return retVal;
}
-
+
if (obj instanceof Function) {
return obj;
}
-
+
if(!(obj instanceof Object)){
return obj;
}
-
+
if(obj instanceof Date){
return obj;
}
@@ -4379,7 +4345,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;
@@ -4402,7 +4368,6 @@ var _self = {
};
module.exports = _self;
-
});
@@ -4413,20 +4378,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.
*/
@@ -4459,11 +4410,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);
@@ -4476,5 +4427,4 @@ window.cordova = require('cordova');
}(window));
-
})();
\ No newline at end of file