mirror of
https://github.com/apache/cordova-android.git
synced 2025-02-22 00:32:55 +08:00
Update to version 1.6.0.
This commit is contained in:
parent
3bda8afdc1
commit
36e6b572b7
@ -5,7 +5,7 @@
|
||||
<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.6.0rc1.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>
|
||||
|
@ -4,6 +4,5 @@
|
||||
<classpathentry kind="src" path="gen"/>
|
||||
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
|
||||
<classpathentry kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
|
||||
<classpathentry kind="lib" path="libs/cordova-1.6.0rc1.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?
|
||||
|
||||
exec(successCallback, errorCallback, "Camera", "takePicture", [quality, destinationType, sourceType, targetWidth, targetHeight, 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;
|
||||
} 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, 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,12 +4386,17 @@ var exec = require('cordova/exec'),
|
||||
return;
|
||||
}
|
||||
|
||||
// Start watch timer to get headings
|
||||
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);
|
||||
}
|
||||
|
||||
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]) {
|
||||
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…
Reference in New Issue
Block a user