日期:2014-05-16 浏览次数:20476 次
PhoneGap.addConstructor(function() {
navigator._geo = new Geolocation();
// No native geolocation object for Android 1.x, so use PhoneGap
// geolocation
if (typeof navigator.geolocation === 'undefined') {
navigator.geolocation = navigator._geo;
Geolocation.usingPhoneGap = true;
}
//Geolocation.usePhoneGap();
});
// Drop the common globals into the window object, but be nice // and don't overwrite anything. builder.build(base.objects).intoButDontClobber(window); // Drop the platform-specific globals into the window object and // do it like a honey badger does it. builder.build(platform.objects).intoAndClobberTheFOutOf(window); // Call the platform-specific initialization platform.initialize();
function include(parent, objects, clobber) {
each(objects, function(obj, key) {
try {
var result = obj.path ? require(obj.path) : {};
if (clobber) {
// Clobber if it doesn't exist or if an
// override is specified.
if (typeof parent[key] === 'undefined'
|| typeof obj.path !== 'undefined') {
parent[key] = result;
}
result = parent[key];
} else {
// Don't clobber if something already exists
// there
if (typeof parent[key] == 'undefined') {
parent[key] = result;
} else {
// Set result to what already exists, so
// we can build children into it if they
// exist.
result = parent[key];
}
}
if (obj.children) {
include(result, obj.children, clobber);
}
} catch (e) {
alert('Exception building cordova JS globals: '
+ e + ' for key "' + key + '"');
}
});
}
window.cordova.JSCallback : "cordova/plugin/android/callback" window.cordova.JSCallbackPolling : "cordova/plugin/android/polling" window.navigator.app : "cordova/plugin/android/app" window.device : "cordova/plugin/android/device" window.File : "cordova/plugin/File" window.FileReader : "cordova/plugin/FileReader" window.FileError : "cordova/plugin/FileError"