mirror of
https://github.com/apache/cordova-android.git
synced 2025-03-06 10:16:43 +08:00
Fixing eclipse classpath
This commit is contained in:
commit
f34da8a96f
@ -2,13 +2,13 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:windowSoftInputMode="adjustPan"
|
||||
package="__PACKAGE__" android:versionName="1.1" android:versionCode="5">
|
||||
<supports-screens
|
||||
android:largeScreens="true"
|
||||
android:normalScreens="true"
|
||||
android:smallScreens="true"
|
||||
android:xlargeScreens="true"
|
||||
android:resizeable="true"
|
||||
android:anyDensity="true"
|
||||
/>
|
||||
android:largeScreens="true"
|
||||
android:normalScreens="true"
|
||||
android:smallScreens="true"
|
||||
android:xlargeScreens="true"
|
||||
android:resizeable="true"
|
||||
android:anyDensity="true"
|
||||
/>
|
||||
|
||||
<uses-permission android:name="android.permission.CAMERA" />
|
||||
<uses-permission android:name="android.permission.VIBRATE" />
|
||||
@ -27,24 +27,17 @@
|
||||
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
|
||||
<uses-permission android:name="android.permission.BROADCAST_STICKY" />
|
||||
|
||||
<uses-feature android:name="android.hardware.camera" />
|
||||
<uses-feature android:name="android.hardware.camera.autofocus" />
|
||||
|
||||
<application android:icon="@drawable/icon" android:label="@string/app_name"
|
||||
android:debuggable="true">
|
||||
<activity android:name="__ACTIVITY__" android:label="@string/app_name"
|
||||
android:configChanges="orientation|keyboardHidden">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<activity android:name="org.apache.cordova.DroidGap" android:label="@string/app_name"
|
||||
android:configChanges="orientation|keyboardHidden">
|
||||
<intent-filter>
|
||||
</intent-filter>
|
||||
android:debuggable="true">
|
||||
<activity android:name="__ACTIVITY__" android:label="@string/app_name"
|
||||
android:configChanges="orientation|keyboardHidden">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
</application>
|
||||
|
||||
<uses-sdk android:minSdkVersion="5" />
|
||||
<uses-sdk android:minSdkVersion="5" />
|
||||
</manifest>
|
||||
|
@ -5,12 +5,12 @@
|
||||
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
|
||||
<title>PhoneGap</title>
|
||||
<link rel="stylesheet" href="master.css" type="text/css" media="screen" title="no title">
|
||||
<script type="text/javascript" charset="utf-8" src="cordova-1.5.0.js"></script>
|
||||
<script type="text/javascript" charset="utf-8" src="cordova-1.6.0"></script>
|
||||
<script type="text/javascript" charset="utf-8" src="main.js"></script>
|
||||
|
||||
</head>
|
||||
<body onload="init();" id="stage" class="theme">
|
||||
<h1>Welcome to PhoneGap!</h1>
|
||||
<h1>Welcome to Cordova!</h1>
|
||||
<h2>this file is located at assets/www/index.html</h2>
|
||||
<div id="info">
|
||||
<h4>Platform: <span id="platform"> </span>, Version: <span id="version"> </span></h4>
|
||||
|
@ -1,3 +1,5 @@
|
||||
// File generated at :: Tue Apr 10 2012 11:22:35 GMT-0700 (PDT)
|
||||
|
||||
/*
|
||||
Licensed to the Apache Software Foundation (ASF) under one
|
||||
or more contributor license agreements. See the NOTICE file
|
||||
@ -143,6 +145,13 @@ function createEvent(type, data) {
|
||||
return event;
|
||||
}
|
||||
|
||||
if(typeof window.console === "undefined")
|
||||
{
|
||||
window.console = {
|
||||
log:function(){}
|
||||
};
|
||||
}
|
||||
|
||||
var cordova = {
|
||||
define:define,
|
||||
require:require,
|
||||
@ -161,6 +170,15 @@ var cordova = {
|
||||
removeDocumentEventHandler:function(event) {
|
||||
delete documentEventHandlers[event];
|
||||
},
|
||||
/**
|
||||
* Retreive original event handlers that were replaced by Cordova
|
||||
*
|
||||
* @return object
|
||||
*/
|
||||
getOriginalHandlers: function() {
|
||||
return {'document': {'addEventListener': m_document_addEventListener, 'removeEventListener': m_document_removeEventListener},
|
||||
'window': {'addEventListener': m_window_addEventListener, 'removeEventListener': m_window_removeEventListener}};
|
||||
},
|
||||
/**
|
||||
* Method to fire event from native code
|
||||
*/
|
||||
@ -302,7 +320,7 @@ if (!window.plugins) {
|
||||
|
||||
module.exports = cordova;
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
// file: lib/common/builder.js
|
||||
define("cordova/builder", function(require, exports, module) {
|
||||
@ -393,7 +411,7 @@ module.exports = {
|
||||
}
|
||||
};
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
// file: lib/common/channel.js
|
||||
define("cordova/channel", function(require, exports, module) {
|
||||
@ -605,7 +623,7 @@ channel.waitForInitialization('onCordovaConnectionReady');
|
||||
|
||||
module.exports = channel;
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
// file: lib/common/common.js
|
||||
define("cordova/common", function(require, exports, module) {
|
||||
@ -790,7 +808,7 @@ module.exports = {
|
||||
}
|
||||
};
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
// file: lib/android/exec.js
|
||||
define("cordova/exec", function(require, exports, module) {
|
||||
@ -877,7 +895,7 @@ module.exports = function(success, fail, service, action, args) {
|
||||
}
|
||||
};
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
// file: lib/android/platform.js
|
||||
define("cordova/platform", function(require, exports, module) {
|
||||
@ -1022,7 +1040,7 @@ module.exports = {
|
||||
}
|
||||
};
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
// file: lib/common/plugin/Acceleration.js
|
||||
define("cordova/plugin/Acceleration", function(require, exports, module) {
|
||||
@ -1035,7 +1053,7 @@ var Acceleration = function(x, y, z) {
|
||||
|
||||
module.exports = Acceleration;
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
// file: lib/common/plugin/Camera.js
|
||||
define("cordova/plugin/Camera", function(require, exports, module) {
|
||||
@ -1121,14 +1139,31 @@ cameraExport.getPicture = function(successCallback, errorCallback, options) {
|
||||
if (typeof options.mediaType == "number") {
|
||||
mediaType = options.mediaType;
|
||||
}
|
||||
// TODO: enable allow edit?
|
||||
var allowEdit = false;
|
||||
if (typeof options.allowEdit == "boolean") {
|
||||
allowEdit = options.allowEdit;
|
||||
} else if (typeof options.allowEdit == "number") {
|
||||
allowEdit = options.allowEdit <= 0 ? false : true;
|
||||
}
|
||||
var correctOrientation = false;
|
||||
if (typeof options.correctOrientation == "boolean") {
|
||||
correctOrientation = options.correctOrientation;
|
||||
} else if (typeof options.correctOrientation == "number") {
|
||||
correctOrientation = options.correctOrientation <=0 ? false : true;
|
||||
}
|
||||
var saveToPhotoAlbum = false;
|
||||
if (typeof options.saveToPhotoAlbum == "boolean") {
|
||||
saveToPhotoAlbum = options.saveToPhotoAlbum;
|
||||
} else if (typeof options.saveToPhotoAlbum == "number") {
|
||||
saveToPhotoAlbum = options.saveToPhotoAlbum <=0 ? false : true;
|
||||
}
|
||||
|
||||
exec(successCallback, errorCallback, "Camera", "takePicture", [quality, destinationType, sourceType, targetWidth, targetHeight, encodingType, mediaType]);
|
||||
exec(successCallback, errorCallback, "Camera", "takePicture", [quality, destinationType, sourceType, targetWidth, targetHeight, encodingType, mediaType, allowEdit, correctOrientation, saveToPhotoAlbum]);
|
||||
}
|
||||
|
||||
module.exports = cameraExport;
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
// file: lib/common/plugin/CameraConstants.js
|
||||
define("cordova/plugin/CameraConstants", function(require, exports, module) {
|
||||
@ -1153,7 +1188,7 @@ module.exports = {
|
||||
}
|
||||
};
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
// file: lib/common/plugin/CaptureAudioOptions.js
|
||||
define("cordova/plugin/CaptureAudioOptions", function(require, exports, module) {
|
||||
@ -1171,7 +1206,7 @@ var CaptureAudioOptions = function(){
|
||||
|
||||
module.exports = CaptureAudioOptions;
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
// file: lib/common/plugin/CaptureError.js
|
||||
define("cordova/plugin/CaptureError", function(require, exports, module) {
|
||||
@ -1195,7 +1230,7 @@ CaptureError.CAPTURE_NOT_SUPPORTED = 20;
|
||||
|
||||
module.exports = CaptureError;
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
// file: lib/common/plugin/CaptureImageOptions.js
|
||||
define("cordova/plugin/CaptureImageOptions", function(require, exports, module) {
|
||||
@ -1211,7 +1246,7 @@ var CaptureImageOptions = function(){
|
||||
|
||||
module.exports = CaptureImageOptions;
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
// file: lib/common/plugin/CaptureVideoOptions.js
|
||||
define("cordova/plugin/CaptureVideoOptions", function(require, exports, module) {
|
||||
@ -1229,7 +1264,7 @@ var CaptureVideoOptions = function(){
|
||||
|
||||
module.exports = CaptureVideoOptions;
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
// file: lib/common/plugin/CompassError.js
|
||||
define("cordova/plugin/CompassError", function(require, exports, module) {
|
||||
@ -1247,7 +1282,7 @@ CompassError.COMPASS_NOT_SUPPORTED = 20;
|
||||
|
||||
module.exports = CompassError;
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
// file: lib/common/plugin/CompassHeading.js
|
||||
define("cordova/plugin/CompassHeading", function(require, exports, module) {
|
||||
@ -1255,12 +1290,12 @@ var CompassHeading = function(magneticHeading, trueHeading, headingAccuracy, tim
|
||||
this.magneticHeading = (magneticHeading !== undefined ? magneticHeading : null);
|
||||
this.trueHeading = (trueHeading !== undefined ? trueHeading : null);
|
||||
this.headingAccuracy = (headingAccuracy !== undefined ? headingAccuracy : null);
|
||||
this.timestamp = (timestamp !== undefined ? new Date(timestamp) : new Date());
|
||||
this.timestamp = (timestamp !== undefined ? timestamp : new Date().getTime());
|
||||
};
|
||||
|
||||
module.exports = CompassHeading;
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
// file: lib/common/plugin/ConfigurationData.js
|
||||
define("cordova/plugin/ConfigurationData", function(require, exports, module) {
|
||||
@ -1280,7 +1315,7 @@ function ConfigurationData() {
|
||||
|
||||
module.exports = ConfigurationData;
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
// file: lib/common/plugin/Connection.js
|
||||
define("cordova/plugin/Connection", function(require, exports, module) {
|
||||
@ -1297,7 +1332,7 @@ module.exports = {
|
||||
NONE: "none"
|
||||
};
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
// file: lib/common/plugin/Contact.js
|
||||
define("cordova/plugin/Contact", function(require, exports, module) {
|
||||
@ -1479,7 +1514,7 @@ Contact.prototype.save = function(successCB, errorCB) {
|
||||
|
||||
module.exports = Contact;
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
// file: lib/common/plugin/ContactAddress.js
|
||||
define("cordova/plugin/ContactAddress", function(require, exports, module) {
|
||||
@ -1509,7 +1544,7 @@ var ContactAddress = function(pref, type, formatted, streetAddress, locality, re
|
||||
|
||||
module.exports = ContactAddress;
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
// file: lib/common/plugin/ContactError.js
|
||||
define("cordova/plugin/ContactError", function(require, exports, module) {
|
||||
@ -1535,7 +1570,7 @@ ContactError.PERMISSION_DENIED_ERROR = 20;
|
||||
|
||||
module.exports = ContactError;
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
// file: lib/common/plugin/ContactField.js
|
||||
define("cordova/plugin/ContactField", function(require, exports, module) {
|
||||
@ -1556,7 +1591,7 @@ var ContactField = function(type, value, pref) {
|
||||
|
||||
module.exports = ContactField;
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
// file: lib/common/plugin/ContactFindOptions.js
|
||||
define("cordova/plugin/ContactFindOptions", function(require, exports, module) {
|
||||
@ -1574,7 +1609,7 @@ var ContactFindOptions = function(filter, multiple) {
|
||||
|
||||
module.exports = ContactFindOptions;
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
// file: lib/common/plugin/ContactName.js
|
||||
define("cordova/plugin/ContactName", function(require, exports, module) {
|
||||
@ -1599,7 +1634,7 @@ var ContactName = function(formatted, familyName, givenName, middle, prefix, suf
|
||||
|
||||
module.exports = ContactName;
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
// file: lib/common/plugin/ContactOrganization.js
|
||||
define("cordova/plugin/ContactOrganization", function(require, exports, module) {
|
||||
@ -1627,7 +1662,7 @@ var ContactOrganization = function(pref, type, name, dept, title) {
|
||||
|
||||
module.exports = ContactOrganization;
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
// file: lib/common/plugin/Coordinates.js
|
||||
define("cordova/plugin/Coordinates", function(require, exports, module) {
|
||||
@ -1675,7 +1710,7 @@ var Coordinates = function(lat, lng, alt, acc, head, vel, altacc) {
|
||||
|
||||
module.exports = Coordinates;
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
// file: lib/common/plugin/DirectoryEntry.js
|
||||
define("cordova/plugin/DirectoryEntry", function(require, exports, module) {
|
||||
@ -1760,7 +1795,7 @@ DirectoryEntry.prototype.getFile = function(path, options, successCallback, erro
|
||||
|
||||
module.exports = DirectoryEntry;
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
// file: lib/common/plugin/DirectoryReader.js
|
||||
define("cordova/plugin/DirectoryReader", function(require, exports, module) {
|
||||
@ -1806,7 +1841,7 @@ DirectoryReader.prototype.readEntries = function(successCallback, errorCallback)
|
||||
|
||||
module.exports = DirectoryReader;
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
// file: lib/common/plugin/Entry.js
|
||||
define("cordova/plugin/Entry", function(require, exports, module) {
|
||||
@ -2014,7 +2049,7 @@ Entry.prototype.getParent = function(successCallback, errorCallback) {
|
||||
|
||||
module.exports = Entry;
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
// file: lib/common/plugin/File.js
|
||||
define("cordova/plugin/File", function(require, exports, module) {
|
||||
@ -2037,7 +2072,7 @@ var File = function(name, fullPath, type, lastModifiedDate, size){
|
||||
|
||||
module.exports = File;
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
// file: lib/common/plugin/FileEntry.js
|
||||
define("cordova/plugin/FileEntry", function(require, exports, module) {
|
||||
@ -2105,7 +2140,7 @@ FileEntry.prototype.file = function(successCallback, errorCallback) {
|
||||
|
||||
module.exports = FileEntry;
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
// file: lib/common/plugin/FileError.js
|
||||
define("cordova/plugin/FileError", function(require, exports, module) {
|
||||
@ -2135,7 +2170,7 @@ FileError.PATH_EXISTS_ERR = 12;
|
||||
|
||||
module.exports = FileError;
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
// file: lib/common/plugin/FileReader.js
|
||||
define("cordova/plugin/FileReader", function(require, exports, module) {
|
||||
@ -2389,7 +2424,7 @@ FileReader.prototype.readAsArrayBuffer = function(file) {
|
||||
|
||||
module.exports = FileReader;
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
// file: lib/common/plugin/FileSystem.js
|
||||
define("cordova/plugin/FileSystem", function(require, exports, module) {
|
||||
@ -2411,7 +2446,7 @@ var FileSystem = function(name, root) {
|
||||
|
||||
module.exports = FileSystem;
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
// file: lib/common/plugin/FileTransfer.js
|
||||
define("cordova/plugin/FileTransfer", function(require, exports, module) {
|
||||
@ -2431,8 +2466,9 @@ var FileTransfer = function() {};
|
||||
* @param successCallback (Function} Callback to be invoked when upload has completed
|
||||
* @param errorCallback {Function} Callback to be invoked upon error
|
||||
* @param options {FileUploadOptions} Optional parameters such as file name and mimetype
|
||||
* @param trustAllHosts {Boolean} Optional trust all hosts (e.g. for self-signed certs), defaults to false
|
||||
*/
|
||||
FileTransfer.prototype.upload = function(filePath, server, successCallback, errorCallback, options, debug) {
|
||||
FileTransfer.prototype.upload = function(filePath, server, successCallback, errorCallback, options, trustAllHosts) {
|
||||
// check for options
|
||||
var fileKey = null;
|
||||
var fileName = null;
|
||||
@ -2454,7 +2490,7 @@ FileTransfer.prototype.upload = function(filePath, server, successCallback, erro
|
||||
}
|
||||
}
|
||||
|
||||
exec(successCallback, errorCallback, 'FileTransfer', 'upload', [filePath, server, fileKey, fileName, mimeType, params, debug, chunkedMode]);
|
||||
exec(successCallback, errorCallback, 'FileTransfer', 'upload', [filePath, server, fileKey, fileName, mimeType, params, trustAllHosts, chunkedMode]);
|
||||
};
|
||||
|
||||
/**
|
||||
@ -2484,7 +2520,7 @@ FileTransfer.prototype.download = function(source, target, successCallback, erro
|
||||
|
||||
module.exports = FileTransfer;
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
// file: lib/common/plugin/FileTransferError.js
|
||||
define("cordova/plugin/FileTransferError", function(require, exports, module) {
|
||||
@ -2502,7 +2538,7 @@ FileTransferError.CONNECTION_ERR = 3;
|
||||
|
||||
module.exports = FileTransferError;
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
// file: lib/common/plugin/FileUploadOptions.js
|
||||
define("cordova/plugin/FileUploadOptions", function(require, exports, module) {
|
||||
@ -2523,7 +2559,7 @@ var FileUploadOptions = function(fileKey, fileName, mimeType, params) {
|
||||
|
||||
module.exports = FileUploadOptions;
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
// file: lib/common/plugin/FileUploadResult.js
|
||||
define("cordova/plugin/FileUploadResult", function(require, exports, module) {
|
||||
@ -2539,7 +2575,7 @@ var FileUploadResult = function() {
|
||||
|
||||
module.exports = FileUploadResult;
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
// file: lib/common/plugin/FileWriter.js
|
||||
define("cordova/plugin/FileWriter", function(require, exports, module) {
|
||||
@ -2797,7 +2833,7 @@ FileWriter.prototype.truncate = function(size) {
|
||||
|
||||
module.exports = FileWriter;
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
// file: lib/common/plugin/Flags.js
|
||||
define("cordova/plugin/Flags", function(require, exports, module) {
|
||||
@ -2817,7 +2853,7 @@ function Flags(create, exclusive) {
|
||||
|
||||
module.exports = Flags;
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
// file: lib/common/plugin/LocalFileSystem.js
|
||||
define("cordova/plugin/LocalFileSystem", function(require, exports, module) {
|
||||
@ -2835,7 +2871,7 @@ LocalFileSystem.PERSISTENT = 1; //persistent
|
||||
|
||||
module.exports = LocalFileSystem;
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
// file: lib/common/plugin/Media.js
|
||||
define("cordova/plugin/Media", function(require, exports, module) {
|
||||
@ -3027,7 +3063,7 @@ Media.onStatus = function(id, msg, value) {
|
||||
|
||||
module.exports = Media;
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
// file: lib/common/plugin/MediaError.js
|
||||
define("cordova/plugin/MediaError", function(require, exports, module) {
|
||||
@ -3048,7 +3084,7 @@ MediaError.MEDIA_ERR_NONE_SUPPORTED = 4;
|
||||
|
||||
module.exports = MediaError;
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
// file: lib/common/plugin/MediaFile.js
|
||||
define("cordova/plugin/MediaFile", function(require, exports, module) {
|
||||
@ -3109,7 +3145,7 @@ MediaFile.cast = function(pluginResult) {
|
||||
|
||||
module.exports = MediaFile;
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
// file: lib/common/plugin/MediaFileData.js
|
||||
define("cordova/plugin/MediaFileData", function(require, exports, module) {
|
||||
@ -3132,7 +3168,7 @@ var MediaFileData = function(codecs, bitrate, height, width, duration){
|
||||
|
||||
module.exports = MediaFileData;
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
// file: lib/common/plugin/Metadata.js
|
||||
define("cordova/plugin/Metadata", function(require, exports, module) {
|
||||
@ -3147,7 +3183,7 @@ var Metadata = function(time) {
|
||||
|
||||
module.exports = Metadata;
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
// file: lib/common/plugin/Position.js
|
||||
define("cordova/plugin/Position", function(require, exports, module) {
|
||||
@ -3160,7 +3196,7 @@ var Position = function(coords, timestamp) {
|
||||
|
||||
module.exports = Position;
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
// file: lib/common/plugin/PositionError.js
|
||||
define("cordova/plugin/PositionError", function(require, exports, module) {
|
||||
@ -3182,7 +3218,7 @@ PositionError.TIMEOUT = 3;
|
||||
|
||||
module.exports = PositionError;
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
// file: lib/common/plugin/ProgressEvent.js
|
||||
define("cordova/plugin/ProgressEvent", function(require, exports, module) {
|
||||
@ -3233,7 +3269,7 @@ var ProgressEvent = (function() {
|
||||
|
||||
module.exports = ProgressEvent;
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
// file: lib/common/plugin/accelerometer.js
|
||||
define("cordova/plugin/accelerometer", function(require, exports, module) {
|
||||
@ -3333,7 +3369,7 @@ var accelerometer = {
|
||||
|
||||
module.exports = accelerometer;
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
// file: lib/android/plugin/android/app.js
|
||||
define("cordova/plugin/android/app", function(require, exports, module) {
|
||||
@ -3409,7 +3445,7 @@ module.exports = {
|
||||
}
|
||||
};
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
// file: lib/android/plugin/android/callback.js
|
||||
define("cordova/plugin/android/callback", function(require, exports, module) {
|
||||
@ -3499,7 +3535,7 @@ var port = null,
|
||||
|
||||
module.exports = callback;
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
// file: lib/android/plugin/android/device.js
|
||||
define("cordova/plugin/android/device", function(require, exports, module) {
|
||||
@ -3597,7 +3633,7 @@ Device.prototype.exitApp = function() {
|
||||
|
||||
module.exports = new Device();
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
// file: lib/android/plugin/android/notification.js
|
||||
define("cordova/plugin/android/notification", function(require, exports, module) {
|
||||
@ -3654,7 +3690,7 @@ module.exports = {
|
||||
exec(null, null, 'Notification', 'progressValue', [ value ]);
|
||||
},
|
||||
};
|
||||
})
|
||||
});
|
||||
|
||||
// file: lib/android/plugin/android/polling.js
|
||||
define("cordova/plugin/android/polling", function(require, exports, module) {
|
||||
@ -3692,7 +3728,7 @@ var cordova = require('cordova'),
|
||||
|
||||
module.exports = polling;
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
// file: lib/android/plugin/android/storage.js
|
||||
define("cordova/plugin/android/storage", function(require, exports, module) {
|
||||
@ -4074,7 +4110,7 @@ module.exports = {
|
||||
completeQuery:completeQuery
|
||||
};
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
// file: lib/common/plugin/battery.js
|
||||
define("cordova/plugin/battery", function(require, exports, module) {
|
||||
@ -4166,7 +4202,7 @@ var battery = new Battery();
|
||||
|
||||
module.exports = battery;
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
// file: lib/common/plugin/capture.js
|
||||
define("cordova/plugin/capture", function(require, exports, module) {
|
||||
@ -4243,7 +4279,7 @@ Capture.prototype.captureVideo = function(successCallback, errorCallback, option
|
||||
|
||||
module.exports = new Capture();
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
// file: lib/common/plugin/compass.js
|
||||
define("cordova/plugin/compass", function(require, exports, module) {
|
||||
@ -4261,7 +4297,7 @@ var exec = require('cordova/exec'),
|
||||
* getting the heading data.
|
||||
* @param {CompassOptions} options The options for getting the heading data (not used).
|
||||
*/
|
||||
getCurrentHeading:function(successCallback, errorCallback) {
|
||||
getCurrentHeading:function(successCallback, errorCallback, options) {
|
||||
// successCallback required
|
||||
if (typeof successCallback !== "function") {
|
||||
console.log("Compass Error: successCallback is not a function");
|
||||
@ -4284,7 +4320,7 @@ var exec = require('cordova/exec'),
|
||||
}
|
||||
|
||||
// Get heading
|
||||
exec(win, fail, "Compass", "getHeading", []);
|
||||
exec(win, fail, "Compass", "getHeading", [options]);
|
||||
},
|
||||
|
||||
/**
|
||||
@ -4294,11 +4330,13 @@ var exec = require('cordova/exec'),
|
||||
* @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.
|
||||
* such as timeout and the frequency of the watch. For iOS, filter parameter
|
||||
* specifies to watch via a distance filter rather than time.
|
||||
*/
|
||||
watchHeading:function(successCallback, errorCallback, options) {
|
||||
// Default interval (100 msec)
|
||||
var frequency = (options !== undefined && options.frequency !== undefined) ? options.frequency : 100;
|
||||
var filter = (options !== undefined && options.filter !== undefined) ? options.filter : 0;
|
||||
|
||||
// successCallback required
|
||||
if (typeof successCallback !== "function") {
|
||||
@ -4312,13 +4350,18 @@ var exec = require('cordova/exec'),
|
||||
return;
|
||||
}
|
||||
|
||||
// Start watch timer to get headings
|
||||
var id = utils.createUUID();
|
||||
|
||||
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;
|
||||
},
|
||||
|
||||
@ -4329,16 +4372,20 @@ var exec = require('cordova/exec'),
|
||||
clearWatch:function(id) {
|
||||
// Stop javascript timer & remove from timer list
|
||||
if (id && timers[id]) {
|
||||
clearInterval(timers[id]);
|
||||
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];
|
||||
}
|
||||
}
|
||||
// TODO: add the filter-based iOS-only methods
|
||||
};
|
||||
|
||||
module.exports = compass;
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
// file: lib/common/plugin/contacts.js
|
||||
define("cordova/plugin/contacts", function(require, exports, module) {
|
||||
@ -4400,7 +4447,7 @@ var contacts = {
|
||||
|
||||
module.exports = contacts;
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
// file: lib/common/plugin/geolocation.js
|
||||
define("cordova/plugin/geolocation", function(require, exports, module) {
|
||||
@ -4499,7 +4546,7 @@ var geolocation = {
|
||||
|
||||
module.exports = geolocation;
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
// file: lib/common/plugin/network.js
|
||||
define("cordova/plugin/network", function(require, exports, module) {
|
||||
@ -4564,7 +4611,7 @@ NetworkConnection.prototype.getInfo = function (successCallback, errorCallback)
|
||||
|
||||
module.exports = new NetworkConnection();
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
// file: lib/common/plugin/notification.js
|
||||
define("cordova/plugin/notification", function(require, exports, module) {
|
||||
@ -4625,7 +4672,7 @@ module.exports = {
|
||||
}
|
||||
};
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
// file: lib/common/plugin/requestFileSystem.js
|
||||
define("cordova/plugin/requestFileSystem", function(require, exports, module) {
|
||||
@ -4670,7 +4717,7 @@ var requestFileSystem = function(type, size, successCallback, errorCallback) {
|
||||
|
||||
module.exports = requestFileSystem;
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
// file: lib/common/plugin/resolveLocalFileSystemURI.js
|
||||
define("cordova/plugin/resolveLocalFileSystemURI", function(require, exports, module) {
|
||||
@ -4716,7 +4763,7 @@ module.exports = function(uri, successCallback, errorCallback) {
|
||||
exec(success, fail, "File", "resolveLocalFileSystemURI", [uri]);
|
||||
};
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
// file: lib/common/utils.js
|
||||
define("cordova/utils", function(require, exports, module) {
|
||||
@ -4825,7 +4872,7 @@ var _self = {
|
||||
|
||||
module.exports = _self;
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
|
||||
window.cordova = require('cordova');
|
||||
|
@ -19,7 +19,7 @@
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<script src="cordova-1.5.0.js"></script>
|
||||
<script src="cordova-1.6.0.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
|
@ -28,6 +28,7 @@ import android.os.Environment;
|
||||
import android.util.Log;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
@ -116,7 +117,7 @@ public class AudioPlayer implements OnCompletionListener, OnPreparedListener, On
|
||||
public void startRecording(String file) {
|
||||
if (this.mPlayer != null) {
|
||||
Log.d(LOG_TAG, "AudioPlayer Error: Can't record in play mode.");
|
||||
this.handler.sendJavascript("cordova.require('cordova/plugin/Media').onStatus('" + this.id + "', "+MEDIA_ERROR+", "+MEDIA_ERR_ABORTED+");");
|
||||
this.handler.sendJavascript("cordova.require('cordova/plugin/Media').onStatus('" + this.id + "', "+MEDIA_ERROR+", { \"code\":"+MEDIA_ERR_ABORTED+"});");
|
||||
}
|
||||
|
||||
// Make sure we're not already recording
|
||||
@ -137,11 +138,11 @@ public class AudioPlayer implements OnCompletionListener, OnPreparedListener, On
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
this.handler.sendJavascript("cordova.require('cordova/plugin/Media').onStatus('" + this.id + "', "+MEDIA_ERROR+", "+MEDIA_ERR_ABORTED+");");
|
||||
this.handler.sendJavascript("cordova.require('cordova/plugin/Media').onStatus('" + this.id + "', "+MEDIA_ERROR+", { \"code\":"+MEDIA_ERR_ABORTED+"});");
|
||||
}
|
||||
else {
|
||||
Log.d(LOG_TAG, "AudioPlayer Error: Already recording.");
|
||||
this.handler.sendJavascript("cordova.require('cordova/plugin/Media').onStatus('" + this.id + "', "+MEDIA_ERROR+", "+MEDIA_ERR_ABORTED+");");
|
||||
this.handler.sendJavascript("cordova.require('cordova/plugin/Media').onStatus('" + this.id + "', "+MEDIA_ERROR+", { \"code\":"+MEDIA_ERR_ABORTED+"});");
|
||||
}
|
||||
}
|
||||
|
||||
@ -183,7 +184,7 @@ public class AudioPlayer implements OnCompletionListener, OnPreparedListener, On
|
||||
public void startPlaying(String file) {
|
||||
if (this.recorder != null) {
|
||||
Log.d(LOG_TAG, "AudioPlayer Error: Can't play in record mode.");
|
||||
this.handler.sendJavascript("cordova.require('cordova/plugin/Media').onStatus('" + this.id + "', "+MEDIA_ERROR+", "+MEDIA_ERR_ABORTED+");");
|
||||
this.handler.sendJavascript("cordova.require('cordova/plugin/Media').onStatus('" + this.id + "', "+MEDIA_ERROR+", { \"code\":"+MEDIA_ERR_ABORTED+"});");
|
||||
}
|
||||
|
||||
// If this is a new request to play audio, or stopped
|
||||
@ -215,9 +216,16 @@ public class AudioPlayer implements OnCompletionListener, OnPreparedListener, On
|
||||
android.content.res.AssetFileDescriptor fd = this.handler.ctx.getBaseContext().getAssets().openFd(f);
|
||||
this.mPlayer.setDataSource(fd.getFileDescriptor(), fd.getStartOffset(), fd.getLength());
|
||||
}
|
||||
else {
|
||||
this.mPlayer.setDataSource("/sdcard/" + file);
|
||||
}
|
||||
else {
|
||||
File fp = new File(file);
|
||||
if (fp.exists()) {
|
||||
FileInputStream fileInputStream = new FileInputStream(file);
|
||||
this.mPlayer.setDataSource(fileInputStream.getFD());
|
||||
}
|
||||
else {
|
||||
this.mPlayer.setDataSource("/sdcard/" + file);
|
||||
}
|
||||
}
|
||||
this.setState(MEDIA_STARTING);
|
||||
this.mPlayer.setOnPreparedListener(this);
|
||||
this.mPlayer.prepare();
|
||||
@ -228,7 +236,7 @@ public class AudioPlayer implements OnCompletionListener, OnPreparedListener, On
|
||||
}
|
||||
catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
this.handler.sendJavascript("cordova.require('cordova/plugin/Media').onStatus('" + this.id + "', "+MEDIA_ERROR+", "+MEDIA_ERR_ABORTED+");");
|
||||
this.handler.sendJavascript("cordova.require('cordova/plugin/Media').onStatus('" + this.id + "', "+MEDIA_ERROR+", { \"code\":"+MEDIA_ERR_ABORTED+"});");
|
||||
}
|
||||
}
|
||||
|
||||
@ -242,7 +250,7 @@ public class AudioPlayer implements OnCompletionListener, OnPreparedListener, On
|
||||
}
|
||||
else {
|
||||
Log.d(LOG_TAG, "AudioPlayer Error: startPlaying() called during invalid state: "+this.state);
|
||||
this.handler.sendJavascript("cordova.require('cordova/plugin/Media').onStatus('" + this.id + "', "+MEDIA_ERROR+", "+MEDIA_ERR_ABORTED+");");
|
||||
this.handler.sendJavascript("cordova.require('cordova/plugin/Media').onStatus('" + this.id + "', "+MEDIA_ERROR+", { \"code\":"+MEDIA_ERR_ABORTED+"});");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -270,7 +278,7 @@ public class AudioPlayer implements OnCompletionListener, OnPreparedListener, On
|
||||
}
|
||||
else {
|
||||
Log.d(LOG_TAG, "AudioPlayer Error: pausePlaying() called during invalid state: "+this.state);
|
||||
this.handler.sendJavascript("cordova.require('cordova/plugin/Media').onStatus('" + this.id + "', "+MEDIA_ERROR+", "+MEDIA_ERR_NONE_ACTIVE+");");
|
||||
this.handler.sendJavascript("cordova.require('cordova/plugin/Media').onStatus('" + this.id + "', "+MEDIA_ERROR+", { \"code\":"+MEDIA_ERR_NONE_ACTIVE+"});");
|
||||
}
|
||||
}
|
||||
|
||||
@ -284,7 +292,7 @@ public class AudioPlayer implements OnCompletionListener, OnPreparedListener, On
|
||||
}
|
||||
else {
|
||||
Log.d(LOG_TAG, "AudioPlayer Error: stopPlaying() called during invalid state: "+this.state);
|
||||
this.handler.sendJavascript("cordova.require('cordova/plugin/Media').onStatus('" + this.id + "', "+MEDIA_ERROR+", "+MEDIA_ERR_NONE_ACTIVE+");");
|
||||
this.handler.sendJavascript("cordova.require('cordova/plugin/Media').onStatus('" + this.id + "', "+MEDIA_ERROR+", { \"code\":"+MEDIA_ERR_NONE_ACTIVE+"});");
|
||||
}
|
||||
}
|
||||
|
||||
@ -413,7 +421,7 @@ public class AudioPlayer implements OnCompletionListener, OnPreparedListener, On
|
||||
this.mPlayer.release();
|
||||
|
||||
// Send error notification to JavaScript
|
||||
this.handler.sendJavascript("cordova.require('cordova/plugin/Media').onStatus('" + this.id + "', "+MEDIA_ERROR+", "+arg1+");");
|
||||
this.handler.sendJavascript("cordova.require('cordova/plugin/Media').onStatus('" + this.id + "', { \"code\":"+arg1+"});");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -38,7 +38,7 @@ import android.telephony.TelephonyManager;
|
||||
public class Device extends Plugin {
|
||||
public static final String TAG = "Device";
|
||||
|
||||
public static String cordovaVersion = "1.6.0rc1"; // Cordova version
|
||||
public static String cordovaVersion = "1.6.0"; // Cordova version
|
||||
public static String platform = "Android"; // Device OS
|
||||
public static String uuid; // Device UUID
|
||||
|
||||
|
@ -973,23 +973,23 @@ public class FileUtils extends Plugin {
|
||||
/**/
|
||||
public long write(String filename, String data, int offset) throws FileNotFoundException, IOException {
|
||||
filename = stripFileProtocol(filename);
|
||||
|
||||
|
||||
boolean append = false;
|
||||
if (offset > 0) {
|
||||
this.truncateFile(filename, offset);
|
||||
append = true;
|
||||
}
|
||||
|
||||
byte [] rawData = data.getBytes();
|
||||
ByteArrayInputStream in = new ByteArrayInputStream(rawData);
|
||||
FileOutputStream out = new FileOutputStream(filename, append);
|
||||
byte buff[] = new byte[rawData.length];
|
||||
in.read(buff, 0, buff.length);
|
||||
out.write(buff, 0, rawData.length);
|
||||
out.flush();
|
||||
out.close();
|
||||
byte [] rawData = data.getBytes();
|
||||
ByteArrayInputStream in = new ByteArrayInputStream(rawData);
|
||||
FileOutputStream out = new FileOutputStream(filename, append);
|
||||
byte buff[] = new byte[rawData.length];
|
||||
in.read(buff, 0, buff.length);
|
||||
out.write(buff, 0, rawData.length);
|
||||
out.flush();
|
||||
out.close();
|
||||
|
||||
return data.length();
|
||||
return rawData.length;
|
||||
}
|
||||
|
||||
/**
|
||||
|
42
releasenotes.md
Normal file
42
releasenotes.md
Normal file
@ -0,0 +1,42 @@
|
||||
Bryce Curtis (5):
|
||||
[CB-352] Support initializing DroidGap with existing WebView, WebViewClient and webViewChrome. [CB-353] Create PluginEntry object to use by PluginManager.
|
||||
[CB-367] Back button event should fire on key up not key down Also changed menu key and search key to be consistent.
|
||||
Tests to verify Android native features.
|
||||
[CB-423] Problem displaying patch-9 splash screen.
|
||||
Update project template cordova.js reference and title.
|
||||
|
||||
Fil Maj (6):
|
||||
switched from "require" syntax to "cordova.require"
|
||||
cordova.require("cordova") is pretty funny. wish i didnt write it
|
||||
updates to JS: removing require+define from global scope, tweaking geolocation code, online/offline events fire on document now
|
||||
removed old javascript files and removed unused target + commented out lines in build.xml
|
||||
spacing fixes, null check in getPhoneType in contacts, returning error integers instead of objects in contacts
|
||||
updating network status plugin label and updating cordova-js to latest
|
||||
|
||||
Joe Bowser (11):
|
||||
We show the default 404 on non-resolved domains
|
||||
Fixing CB-210 with patch and adding fix for CB-210
|
||||
Tweaked File Transfer to fix CB-74
|
||||
Changing to the modern icon
|
||||
Added temporary Cordova splash for now
|
||||
Checking for the callback server before we call sendJavascript for the Kindle Fire, CB-247
|
||||
Fixing CB-343: We need to respect the whitelist
|
||||
Fixing a bug with File Upload on Android where Chunked mode isn't used by default
|
||||
First stab at CB-21, I really need more info before I can close this
|
||||
Tagged 1.6rc1
|
||||
Fixing the template, since this doesn't have to be unit tested. :)
|
||||
|
||||
macdonst (12):
|
||||
CB-383: Fixes issue with misspelled destinationType for Camera.getPicture()
|
||||
Fix for CB-389: resolveLocalFileSystemURI does not work on a resized image captured from Camera.getPicture()
|
||||
Fixing license header in com.phonegap.api.PluginManager
|
||||
CB-321: Media API: 'mediaSuccess' callback param to new Media() is called soon after new obj created
|
||||
CB-163: contactFindOptions.filter does not work as expected on Android
|
||||
CB-426: camera.getPicture ignores mediaType in 1.5
|
||||
Updating cordova.android.js for CB-421 and CB-426
|
||||
CB-438: File metadata.modificationTime returns an invalid date
|
||||
Return MediaError object and not error code from native side of Media API
|
||||
CB-446: Enhance setting data source for local files in AudioPlayer
|
||||
CB-453: FileWriter.append - Chinese characters are not appended to the file correctly
|
||||
CB-446: Enhance setting data source for local files in AudioPlayer
|
||||
|
@ -12,6 +12,6 @@
|
||||
<classpathentry kind="lib" path="libs/guava-10.0.1.jar"/>
|
||||
<classpathentry kind="lib" path="libs/junit-4.10.jar"/>
|
||||
<classpathentry kind="lib" path="libs/logging.jar"/>
|
||||
<classpathentry kind="lib" path="libs/cordova-1.6.0rc1.jar"/>
|
||||
<classpathentry kind="lib" path="libs/cordova-1.6.0.jar"/>
|
||||
<classpathentry kind="output" path="bin/classes"/>
|
||||
</classpath>
|
||||
|
@ -1,3 +1,5 @@
|
||||
// File generated at :: Tue Apr 10 2012 08:34:16 GMT-0500 (CDT)
|
||||
|
||||
/*
|
||||
Licensed to the Apache Software Foundation (ASF) under one
|
||||
or more contributor license agreements. See the NOTICE file
|
||||
@ -143,6 +145,13 @@ function createEvent(type, data) {
|
||||
return event;
|
||||
}
|
||||
|
||||
if(typeof window.console === "undefined")
|
||||
{
|
||||
window.console = {
|
||||
log:function(){}
|
||||
};
|
||||
}
|
||||
|
||||
var cordova = {
|
||||
define:define,
|
||||
require:require,
|
||||
@ -161,6 +170,15 @@ var cordova = {
|
||||
removeDocumentEventHandler:function(event) {
|
||||
delete documentEventHandlers[event];
|
||||
},
|
||||
/**
|
||||
* Retreive original event handlers that were replaced by Cordova
|
||||
*
|
||||
* @return object
|
||||
*/
|
||||
getOriginalHandlers: function() {
|
||||
return {'document': {'addEventListener': m_document_addEventListener, 'removeEventListener': m_document_removeEventListener},
|
||||
'window': {'addEventListener': m_window_addEventListener, 'removeEventListener': m_window_removeEventListener}};
|
||||
},
|
||||
/**
|
||||
* Method to fire event from native code
|
||||
*/
|
||||
@ -302,7 +320,7 @@ if (!window.plugins) {
|
||||
|
||||
module.exports = cordova;
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
// file: lib/common/builder.js
|
||||
define("cordova/builder", function(require, exports, module) {
|
||||
@ -393,12 +411,45 @@ module.exports = {
|
||||
}
|
||||
};
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
// file: lib/common/channel.js
|
||||
define("cordova/channel", function(require, exports, module) {
|
||||
/**
|
||||
* Custom pub-sub channel that can have functions subscribed to it
|
||||
* Custom pub-sub "channel" that can have functions subscribed to it
|
||||
* This object is used to define and control firing of events for
|
||||
* cordova initialization.
|
||||
*
|
||||
* The order of events during page load and Cordova startup is as follows:
|
||||
*
|
||||
* onDOMContentLoaded Internal event that is received when the web page is loaded and parsed.
|
||||
* onNativeReady Internal event that indicates the Cordova native side is ready.
|
||||
* onCordovaReady Internal event fired when all Cordova JavaScript objects have been created.
|
||||
* onCordovaInfoReady Internal event fired when device properties are available.
|
||||
* onCordovaConnectionReady Internal event fired when the connection property has been set.
|
||||
* onDeviceReady User event fired to indicate that Cordova is ready
|
||||
* onResume User event fired to indicate a start/resume lifecycle event
|
||||
* onPause User event fired to indicate a pause lifecycle event
|
||||
* onDestroy Internal event fired when app is being destroyed (User should use window.onunload event, not this one).
|
||||
*
|
||||
* The only Cordova events that user code should register for are:
|
||||
* deviceready Cordova native code is initialized and Cordova APIs can be called from JavaScript
|
||||
* pause App has moved to background
|
||||
* resume App has returned to foreground
|
||||
*
|
||||
* Listeners can be registered as:
|
||||
* document.addEventListener("deviceready", myDeviceReadyListener, false);
|
||||
* document.addEventListener("resume", myResumeListener, false);
|
||||
* document.addEventListener("pause", myPauseListener, false);
|
||||
*
|
||||
* The DOM lifecycle events should be used for saving and restoring state
|
||||
* window.onload
|
||||
* window.onunload
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* Channel
|
||||
* @constructor
|
||||
* @param type String the channel name
|
||||
* @param opts Object options to pass into the channel, currently
|
||||
@ -571,8 +622,7 @@ Channel.prototype.fire = function(e) {
|
||||
return true;
|
||||
};
|
||||
|
||||
//HACK: defining them here so they are ready super fast!
|
||||
|
||||
// defining them here so they are ready super fast!
|
||||
// DOM event that is received when the web page is loaded and parsed.
|
||||
channel.create('onDOMContentLoaded');
|
||||
|
||||
@ -609,7 +659,7 @@ channel.waitForInitialization('onCordovaConnectionReady');
|
||||
|
||||
module.exports = channel;
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
// file: lib/common/common.js
|
||||
define("cordova/common", function(require, exports, module) {
|
||||
@ -794,7 +844,7 @@ module.exports = {
|
||||
}
|
||||
};
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
// file: lib/android/exec.js
|
||||
define("cordova/exec", function(require, exports, module) {
|
||||
@ -881,7 +931,7 @@ module.exports = function(success, fail, service, action, args) {
|
||||
}
|
||||
};
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
// file: lib/android/platform.js
|
||||
define("cordova/platform", function(require, exports, module) {
|
||||
@ -1026,20 +1076,20 @@ module.exports = {
|
||||
}
|
||||
};
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
// file: lib/common/plugin/Acceleration.js
|
||||
define("cordova/plugin/Acceleration", function(require, exports, module) {
|
||||
var Acceleration = function(x, y, z) {
|
||||
var Acceleration = function(x, y, z, timestamp) {
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
this.z = z;
|
||||
this.timestamp = new Date().getTime();
|
||||
this.timestamp = timestamp || (new Date()).getTime();
|
||||
};
|
||||
|
||||
module.exports = Acceleration;
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
// file: lib/common/plugin/Camera.js
|
||||
define("cordova/plugin/Camera", function(require, exports, module) {
|
||||
@ -1120,15 +1170,36 @@ cameraExport.getPicture = function(successCallback, errorCallback, options) {
|
||||
if (typeof options.encodingType == "number") {
|
||||
encodingType = options.encodingType;
|
||||
}
|
||||
// TODO: parse MediaType
|
||||
// TODO: enable allow edit?
|
||||
|
||||
var mediaType = Camera.MediaType.PICTURE;
|
||||
if (typeof options.mediaType == "number") {
|
||||
mediaType = options.mediaType;
|
||||
}
|
||||
var allowEdit = false;
|
||||
if (typeof options.allowEdit == "boolean") {
|
||||
allowEdit = options.allowEdit;
|
||||
} else if (typeof options.allowEdit == "number") {
|
||||
allowEdit = options.allowEdit <= 0 ? false : true;
|
||||
}
|
||||
var correctOrientation = false;
|
||||
if (typeof options.correctOrientation == "boolean") {
|
||||
correctOrientation = options.correctOrientation;
|
||||
} else if (typeof options.correctOrientation == "number") {
|
||||
correctOrientation = options.correctOrientation <=0 ? false : true;
|
||||
}
|
||||
var saveToPhotoAlbum = false;
|
||||
if (typeof options.saveToPhotoAlbum == "boolean") {
|
||||
saveToPhotoAlbum = options.saveToPhotoAlbum;
|
||||
} else if (typeof options.saveToPhotoAlbum == "number") {
|
||||
saveToPhotoAlbum = options.saveToPhotoAlbum <=0 ? false : true;
|
||||
}
|
||||
|
||||
exec(successCallback, errorCallback, "Camera", "takePicture", [quality, destinationType, sourceType, targetWidth, targetHeight, encodingType]);
|
||||
exec(successCallback, errorCallback, "Camera", "takePicture", [quality, destinationType, sourceType, targetWidth, targetHeight, encodingType, mediaType, allowEdit, correctOrientation, saveToPhotoAlbum]);
|
||||
}
|
||||
|
||||
module.exports = cameraExport;
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
// file: lib/common/plugin/CameraConstants.js
|
||||
define("cordova/plugin/CameraConstants", function(require, exports, module) {
|
||||
@ -1153,7 +1224,7 @@ module.exports = {
|
||||
}
|
||||
};
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
// file: lib/common/plugin/CaptureAudioOptions.js
|
||||
define("cordova/plugin/CaptureAudioOptions", function(require, exports, module) {
|
||||
@ -1171,7 +1242,7 @@ var CaptureAudioOptions = function(){
|
||||
|
||||
module.exports = CaptureAudioOptions;
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
// file: lib/common/plugin/CaptureError.js
|
||||
define("cordova/plugin/CaptureError", function(require, exports, module) {
|
||||
@ -1195,7 +1266,7 @@ CaptureError.CAPTURE_NOT_SUPPORTED = 20;
|
||||
|
||||
module.exports = CaptureError;
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
// file: lib/common/plugin/CaptureImageOptions.js
|
||||
define("cordova/plugin/CaptureImageOptions", function(require, exports, module) {
|
||||
@ -1211,7 +1282,7 @@ var CaptureImageOptions = function(){
|
||||
|
||||
module.exports = CaptureImageOptions;
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
// file: lib/common/plugin/CaptureVideoOptions.js
|
||||
define("cordova/plugin/CaptureVideoOptions", function(require, exports, module) {
|
||||
@ -1229,7 +1300,7 @@ var CaptureVideoOptions = function(){
|
||||
|
||||
module.exports = CaptureVideoOptions;
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
// file: lib/common/plugin/CompassError.js
|
||||
define("cordova/plugin/CompassError", function(require, exports, module) {
|
||||
@ -1247,7 +1318,7 @@ CompassError.COMPASS_NOT_SUPPORTED = 20;
|
||||
|
||||
module.exports = CompassError;
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
// file: lib/common/plugin/CompassHeading.js
|
||||
define("cordova/plugin/CompassHeading", function(require, exports, module) {
|
||||
@ -1255,12 +1326,12 @@ var CompassHeading = function(magneticHeading, trueHeading, headingAccuracy, tim
|
||||
this.magneticHeading = (magneticHeading !== undefined ? magneticHeading : null);
|
||||
this.trueHeading = (trueHeading !== undefined ? trueHeading : null);
|
||||
this.headingAccuracy = (headingAccuracy !== undefined ? headingAccuracy : null);
|
||||
this.timestamp = (timestamp !== undefined ? new Date(timestamp) : new Date());
|
||||
this.timestamp = (timestamp !== undefined ? timestamp : new Date().getTime());
|
||||
};
|
||||
|
||||
module.exports = CompassHeading;
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
// file: lib/common/plugin/ConfigurationData.js
|
||||
define("cordova/plugin/ConfigurationData", function(require, exports, module) {
|
||||
@ -1280,7 +1351,7 @@ function ConfigurationData() {
|
||||
|
||||
module.exports = ConfigurationData;
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
// file: lib/common/plugin/Connection.js
|
||||
define("cordova/plugin/Connection", function(require, exports, module) {
|
||||
@ -1297,7 +1368,7 @@ module.exports = {
|
||||
NONE: "none"
|
||||
};
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
// file: lib/common/plugin/Contact.js
|
||||
define("cordova/plugin/Contact", function(require, exports, module) {
|
||||
@ -1479,7 +1550,7 @@ Contact.prototype.save = function(successCB, errorCB) {
|
||||
|
||||
module.exports = Contact;
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
// file: lib/common/plugin/ContactAddress.js
|
||||
define("cordova/plugin/ContactAddress", function(require, exports, module) {
|
||||
@ -1509,7 +1580,7 @@ var ContactAddress = function(pref, type, formatted, streetAddress, locality, re
|
||||
|
||||
module.exports = ContactAddress;
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
// file: lib/common/plugin/ContactError.js
|
||||
define("cordova/plugin/ContactError", function(require, exports, module) {
|
||||
@ -1535,7 +1606,7 @@ ContactError.PERMISSION_DENIED_ERROR = 20;
|
||||
|
||||
module.exports = ContactError;
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
// file: lib/common/plugin/ContactField.js
|
||||
define("cordova/plugin/ContactField", function(require, exports, module) {
|
||||
@ -1556,7 +1627,7 @@ var ContactField = function(type, value, pref) {
|
||||
|
||||
module.exports = ContactField;
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
// file: lib/common/plugin/ContactFindOptions.js
|
||||
define("cordova/plugin/ContactFindOptions", function(require, exports, module) {
|
||||
@ -1574,7 +1645,7 @@ var ContactFindOptions = function(filter, multiple) {
|
||||
|
||||
module.exports = ContactFindOptions;
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
// file: lib/common/plugin/ContactName.js
|
||||
define("cordova/plugin/ContactName", function(require, exports, module) {
|
||||
@ -1599,7 +1670,7 @@ var ContactName = function(formatted, familyName, givenName, middle, prefix, suf
|
||||
|
||||
module.exports = ContactName;
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
// file: lib/common/plugin/ContactOrganization.js
|
||||
define("cordova/plugin/ContactOrganization", function(require, exports, module) {
|
||||
@ -1627,7 +1698,7 @@ var ContactOrganization = function(pref, type, name, dept, title) {
|
||||
|
||||
module.exports = ContactOrganization;
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
// file: lib/common/plugin/Coordinates.js
|
||||
define("cordova/plugin/Coordinates", function(require, exports, module) {
|
||||
@ -1675,7 +1746,7 @@ var Coordinates = function(lat, lng, alt, acc, head, vel, altacc) {
|
||||
|
||||
module.exports = Coordinates;
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
// file: lib/common/plugin/DirectoryEntry.js
|
||||
define("cordova/plugin/DirectoryEntry", function(require, exports, module) {
|
||||
@ -1760,7 +1831,7 @@ DirectoryEntry.prototype.getFile = function(path, options, successCallback, erro
|
||||
|
||||
module.exports = DirectoryEntry;
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
// file: lib/common/plugin/DirectoryReader.js
|
||||
define("cordova/plugin/DirectoryReader", function(require, exports, module) {
|
||||
@ -1806,7 +1877,7 @@ DirectoryReader.prototype.readEntries = function(successCallback, errorCallback)
|
||||
|
||||
module.exports = DirectoryReader;
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
// file: lib/common/plugin/Entry.js
|
||||
define("cordova/plugin/Entry", function(require, exports, module) {
|
||||
@ -2001,15 +2072,20 @@ Entry.prototype.remove = function(successCallback, errorCallback) {
|
||||
* @param errorCallback {Function} called with a FileError
|
||||
*/
|
||||
Entry.prototype.getParent = function(successCallback, errorCallback) {
|
||||
var win = typeof successCallback !== 'function' ? null : function(result) {
|
||||
var DirectoryEntry = require('cordova/plugin/DirectoryEntry');
|
||||
var entry = new DirectoryEntry(result.name, result.fullPath);
|
||||
successCallback(entry);
|
||||
};
|
||||
var fail = typeof errorCallback !== 'function' ? null : function(code) {
|
||||
errorCallback(new FileError(code));
|
||||
};
|
||||
exec(successCallback, fail, "File", "getParent", [this.fullPath]);
|
||||
exec(win, fail, "File", "getParent", [this.fullPath]);
|
||||
};
|
||||
|
||||
module.exports = Entry;
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
// file: lib/common/plugin/File.js
|
||||
define("cordova/plugin/File", function(require, exports, module) {
|
||||
@ -2032,7 +2108,7 @@ var File = function(name, fullPath, type, lastModifiedDate, size){
|
||||
|
||||
module.exports = File;
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
// file: lib/common/plugin/FileEntry.js
|
||||
define("cordova/plugin/FileEntry", function(require, exports, module) {
|
||||
@ -2100,7 +2176,7 @@ FileEntry.prototype.file = function(successCallback, errorCallback) {
|
||||
|
||||
module.exports = FileEntry;
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
// file: lib/common/plugin/FileError.js
|
||||
define("cordova/plugin/FileError", function(require, exports, module) {
|
||||
@ -2130,7 +2206,7 @@ FileError.PATH_EXISTS_ERR = 12;
|
||||
|
||||
module.exports = FileError;
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
// file: lib/common/plugin/FileReader.js
|
||||
define("cordova/plugin/FileReader", function(require, exports, module) {
|
||||
@ -2384,7 +2460,7 @@ FileReader.prototype.readAsArrayBuffer = function(file) {
|
||||
|
||||
module.exports = FileReader;
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
// file: lib/common/plugin/FileSystem.js
|
||||
define("cordova/plugin/FileSystem", function(require, exports, module) {
|
||||
@ -2406,7 +2482,7 @@ var FileSystem = function(name, root) {
|
||||
|
||||
module.exports = FileSystem;
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
// file: lib/common/plugin/FileTransfer.js
|
||||
define("cordova/plugin/FileTransfer", function(require, exports, module) {
|
||||
@ -2426,8 +2502,9 @@ var FileTransfer = function() {};
|
||||
* @param successCallback (Function} Callback to be invoked when upload has completed
|
||||
* @param errorCallback {Function} Callback to be invoked upon error
|
||||
* @param options {FileUploadOptions} Optional parameters such as file name and mimetype
|
||||
* @param trustAllHosts {Boolean} Optional trust all hosts (e.g. for self-signed certs), defaults to false
|
||||
*/
|
||||
FileTransfer.prototype.upload = function(filePath, server, successCallback, errorCallback, options, debug) {
|
||||
FileTransfer.prototype.upload = function(filePath, server, successCallback, errorCallback, options, trustAllHosts) {
|
||||
// check for options
|
||||
var fileKey = null;
|
||||
var fileName = null;
|
||||
@ -2449,7 +2526,7 @@ FileTransfer.prototype.upload = function(filePath, server, successCallback, erro
|
||||
}
|
||||
}
|
||||
|
||||
exec(successCallback, errorCallback, 'FileTransfer', 'upload', [filePath, server, fileKey, fileName, mimeType, params, debug, chunkedMode]);
|
||||
exec(successCallback, errorCallback, 'FileTransfer', 'upload', [filePath, server, fileKey, fileName, mimeType, params, trustAllHosts, chunkedMode]);
|
||||
};
|
||||
|
||||
/**
|
||||
@ -2479,7 +2556,7 @@ FileTransfer.prototype.download = function(source, target, successCallback, erro
|
||||
|
||||
module.exports = FileTransfer;
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
// file: lib/common/plugin/FileTransferError.js
|
||||
define("cordova/plugin/FileTransferError", function(require, exports, module) {
|
||||
@ -2497,7 +2574,7 @@ FileTransferError.CONNECTION_ERR = 3;
|
||||
|
||||
module.exports = FileTransferError;
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
// file: lib/common/plugin/FileUploadOptions.js
|
||||
define("cordova/plugin/FileUploadOptions", function(require, exports, module) {
|
||||
@ -2518,7 +2595,7 @@ var FileUploadOptions = function(fileKey, fileName, mimeType, params) {
|
||||
|
||||
module.exports = FileUploadOptions;
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
// file: lib/common/plugin/FileUploadResult.js
|
||||
define("cordova/plugin/FileUploadResult", function(require, exports, module) {
|
||||
@ -2534,7 +2611,7 @@ var FileUploadResult = function() {
|
||||
|
||||
module.exports = FileUploadResult;
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
// file: lib/common/plugin/FileWriter.js
|
||||
define("cordova/plugin/FileWriter", function(require, exports, module) {
|
||||
@ -2792,7 +2869,7 @@ FileWriter.prototype.truncate = function(size) {
|
||||
|
||||
module.exports = FileWriter;
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
// file: lib/common/plugin/Flags.js
|
||||
define("cordova/plugin/Flags", function(require, exports, module) {
|
||||
@ -2812,7 +2889,7 @@ function Flags(create, exclusive) {
|
||||
|
||||
module.exports = Flags;
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
// file: lib/common/plugin/LocalFileSystem.js
|
||||
define("cordova/plugin/LocalFileSystem", function(require, exports, module) {
|
||||
@ -2830,7 +2907,7 @@ LocalFileSystem.PERSISTENT = 1; //persistent
|
||||
|
||||
module.exports = LocalFileSystem;
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
// file: lib/common/plugin/Media.js
|
||||
define("cordova/plugin/Media", function(require, exports, module) {
|
||||
@ -2905,7 +2982,7 @@ Media.get = function(id) {
|
||||
* Start or resume playing audio file.
|
||||
*/
|
||||
Media.prototype.play = function(options) {
|
||||
exec(this.successCallback, this.errorCallback, "Media", "startPlayingAudio", [this.id, this.src, options]);
|
||||
exec(null, null, "Media", "startPlayingAudio", [this.id, this.src, options]);
|
||||
};
|
||||
|
||||
/**
|
||||
@ -3022,7 +3099,7 @@ Media.onStatus = function(id, msg, value) {
|
||||
|
||||
module.exports = Media;
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
// file: lib/common/plugin/MediaError.js
|
||||
define("cordova/plugin/MediaError", function(require, exports, module) {
|
||||
@ -3043,7 +3120,7 @@ MediaError.MEDIA_ERR_NONE_SUPPORTED = 4;
|
||||
|
||||
module.exports = MediaError;
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
// file: lib/common/plugin/MediaFile.js
|
||||
define("cordova/plugin/MediaFile", function(require, exports, module) {
|
||||
@ -3104,7 +3181,7 @@ MediaFile.cast = function(pluginResult) {
|
||||
|
||||
module.exports = MediaFile;
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
// file: lib/common/plugin/MediaFileData.js
|
||||
define("cordova/plugin/MediaFileData", function(require, exports, module) {
|
||||
@ -3127,7 +3204,7 @@ var MediaFileData = function(codecs, bitrate, height, width, duration){
|
||||
|
||||
module.exports = MediaFileData;
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
// file: lib/common/plugin/Metadata.js
|
||||
define("cordova/plugin/Metadata", function(require, exports, module) {
|
||||
@ -3142,7 +3219,7 @@ var Metadata = function(time) {
|
||||
|
||||
module.exports = Metadata;
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
// file: lib/common/plugin/Position.js
|
||||
define("cordova/plugin/Position", function(require, exports, module) {
|
||||
@ -3155,7 +3232,7 @@ var Position = function(coords, timestamp) {
|
||||
|
||||
module.exports = Position;
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
// file: lib/common/plugin/PositionError.js
|
||||
define("cordova/plugin/PositionError", function(require, exports, module) {
|
||||
@ -3177,7 +3254,7 @@ PositionError.TIMEOUT = 3;
|
||||
|
||||
module.exports = PositionError;
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
// file: lib/common/plugin/ProgressEvent.js
|
||||
define("cordova/plugin/ProgressEvent", function(require, exports, module) {
|
||||
@ -3228,7 +3305,7 @@ var ProgressEvent = (function() {
|
||||
|
||||
module.exports = ProgressEvent;
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
// file: lib/common/plugin/accelerometer.js
|
||||
define("cordova/plugin/accelerometer", function(require, exports, module) {
|
||||
@ -3328,7 +3405,7 @@ var accelerometer = {
|
||||
|
||||
module.exports = accelerometer;
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
// file: lib/android/plugin/android/app.js
|
||||
define("cordova/plugin/android/app", function(require, exports, module) {
|
||||
@ -3404,7 +3481,7 @@ module.exports = {
|
||||
}
|
||||
};
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
// file: lib/android/plugin/android/callback.js
|
||||
define("cordova/plugin/android/callback", function(require, exports, module) {
|
||||
@ -3494,7 +3571,7 @@ var port = null,
|
||||
|
||||
module.exports = callback;
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
// file: lib/android/plugin/android/device.js
|
||||
define("cordova/plugin/android/device", function(require, exports, module) {
|
||||
@ -3592,7 +3669,7 @@ Device.prototype.exitApp = function() {
|
||||
|
||||
module.exports = new Device();
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
// file: lib/android/plugin/android/notification.js
|
||||
define("cordova/plugin/android/notification", function(require, exports, module) {
|
||||
@ -3649,7 +3726,7 @@ module.exports = {
|
||||
exec(null, null, 'Notification', 'progressValue', [ value ]);
|
||||
},
|
||||
};
|
||||
})
|
||||
});
|
||||
|
||||
// file: lib/android/plugin/android/polling.js
|
||||
define("cordova/plugin/android/polling", function(require, exports, module) {
|
||||
@ -3687,7 +3764,7 @@ var cordova = require('cordova'),
|
||||
|
||||
module.exports = polling;
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
// file: lib/android/plugin/android/storage.js
|
||||
define("cordova/plugin/android/storage", function(require, exports, module) {
|
||||
@ -4069,7 +4146,7 @@ module.exports = {
|
||||
completeQuery:completeQuery
|
||||
};
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
// file: lib/common/plugin/battery.js
|
||||
define("cordova/plugin/battery", function(require, exports, module) {
|
||||
@ -4161,7 +4238,7 @@ var battery = new Battery();
|
||||
|
||||
module.exports = battery;
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
// file: lib/common/plugin/capture.js
|
||||
define("cordova/plugin/capture", function(require, exports, module) {
|
||||
@ -4238,7 +4315,7 @@ Capture.prototype.captureVideo = function(successCallback, errorCallback, option
|
||||
|
||||
module.exports = new Capture();
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
// file: lib/common/plugin/compass.js
|
||||
define("cordova/plugin/compass", function(require, exports, module) {
|
||||
@ -4256,7 +4333,7 @@ var exec = require('cordova/exec'),
|
||||
* getting the heading data.
|
||||
* @param {CompassOptions} options The options for getting the heading data (not used).
|
||||
*/
|
||||
getCurrentHeading:function(successCallback, errorCallback) {
|
||||
getCurrentHeading:function(successCallback, errorCallback, options) {
|
||||
// successCallback required
|
||||
if (typeof successCallback !== "function") {
|
||||
console.log("Compass Error: successCallback is not a function");
|
||||
@ -4279,7 +4356,7 @@ var exec = require('cordova/exec'),
|
||||
}
|
||||
|
||||
// Get heading
|
||||
exec(win, fail, "Compass", "getHeading", []);
|
||||
exec(win, fail, "Compass", "getHeading", [options]);
|
||||
},
|
||||
|
||||
/**
|
||||
@ -4289,11 +4366,13 @@ var exec = require('cordova/exec'),
|
||||
* @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.
|
||||
* such as timeout and the frequency of the watch. For iOS, filter parameter
|
||||
* specifies to watch via a distance filter rather than time.
|
||||
*/
|
||||
watchHeading:function(successCallback, errorCallback, options) {
|
||||
// Default interval (100 msec)
|
||||
var frequency = (options !== undefined && options.frequency !== undefined) ? options.frequency : 100;
|
||||
var filter = (options !== undefined && options.filter !== undefined) ? options.filter : 0;
|
||||
|
||||
// successCallback required
|
||||
if (typeof successCallback !== "function") {
|
||||
@ -4307,13 +4386,18 @@ var exec = require('cordova/exec'),
|
||||
return;
|
||||
}
|
||||
|
||||
// Start watch timer to get headings
|
||||
var id = utils.createUUID();
|
||||
|
||||
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;
|
||||
},
|
||||
|
||||
@ -4324,16 +4408,20 @@ var exec = require('cordova/exec'),
|
||||
clearWatch:function(id) {
|
||||
// Stop javascript timer & remove from timer list
|
||||
if (id && timers[id]) {
|
||||
clearInterval(timers[id]);
|
||||
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];
|
||||
}
|
||||
}
|
||||
// TODO: add the filter-based iOS-only methods
|
||||
};
|
||||
|
||||
module.exports = compass;
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
// file: lib/common/plugin/contacts.js
|
||||
define("cordova/plugin/contacts", function(require, exports, module) {
|
||||
@ -4395,7 +4483,7 @@ var contacts = {
|
||||
|
||||
module.exports = contacts;
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
// file: lib/common/plugin/geolocation.js
|
||||
define("cordova/plugin/geolocation", function(require, exports, module) {
|
||||
@ -4494,7 +4582,7 @@ var geolocation = {
|
||||
|
||||
module.exports = geolocation;
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
// file: lib/common/plugin/network.js
|
||||
define("cordova/plugin/network", function(require, exports, module) {
|
||||
@ -4559,7 +4647,7 @@ NetworkConnection.prototype.getInfo = function (successCallback, errorCallback)
|
||||
|
||||
module.exports = new NetworkConnection();
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
// file: lib/common/plugin/notification.js
|
||||
define("cordova/plugin/notification", function(require, exports, module) {
|
||||
@ -4620,7 +4708,7 @@ module.exports = {
|
||||
}
|
||||
};
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
// file: lib/common/plugin/requestFileSystem.js
|
||||
define("cordova/plugin/requestFileSystem", function(require, exports, module) {
|
||||
@ -4665,7 +4753,7 @@ var requestFileSystem = function(type, size, successCallback, errorCallback) {
|
||||
|
||||
module.exports = requestFileSystem;
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
// file: lib/common/plugin/resolveLocalFileSystemURI.js
|
||||
define("cordova/plugin/resolveLocalFileSystemURI", function(require, exports, module) {
|
||||
@ -4711,7 +4799,7 @@ module.exports = function(uri, successCallback, errorCallback) {
|
||||
exec(success, fail, "File", "resolveLocalFileSystemURI", [uri]);
|
||||
};
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
// file: lib/common/utils.js
|
||||
define("cordova/utils", function(require, exports, module) {
|
||||
@ -4820,7 +4908,7 @@ var _self = {
|
||||
|
||||
module.exports = _self;
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
|
||||
window.cordova = require('cordova');
|
4
test/assets/www/cordova.js
vendored
4
test/assets/www/cordova.js
vendored
@ -1,2 +1,2 @@
|
||||
document.write('<script type="text/javascript" charset="utf-8" src="../cordova-1.6.0rc1.js"></script>');
|
||||
document.write('<script type="text/javascript" charset="utf-8" src="cordova-1.6.0rc1.js"></script>');
|
||||
document.write('<script type="text/javascript" charset="utf-8" src="../cordova-1.6.0.js"></script>');
|
||||
document.write('<script type="text/javascript" charset="utf-8" src="cordova-1.6.0.js"></script>');
|
||||
|
BIN
test/libs/cordova-1.6.0.jar
Executable file
BIN
test/libs/cordova-1.6.0.jar
Executable file
Binary file not shown.
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user