diff --git a/phonegap/phonegap-tests.ts b/phonegap/phonegap-tests.ts
index 1dafd8d797..2316c56460 100644
--- a/phonegap/phonegap-tests.ts
+++ b/phonegap/phonegap-tests.ts
@@ -111,7 +111,7 @@ function test_capture() {
var options = { limit: 3, duration: 10 };
navigator.device.capture.captureAudio(captureSuccess, captureError, options);
var captureSuccess = function (mediaFiles) {
- var i, path, len;
+ var i, path, len;
for (i = 0, len = mediaFiles.length; i < len; i += 1) {
path = mediaFiles[i].fullPath;
}
@@ -150,7 +150,7 @@ function test_capture() {
{ fileName: name });
}
function captureSuccess(mediaFiles) {
- var i, len;
+ var i, len;
for (i = 0, len = mediaFiles.length; i < len; i += 1) {
uploadFile(mediaFiles[i]);
}
@@ -333,11 +333,13 @@ function test_contacts() {
}
function test_device() {
+ var element = document.getElementById('deviceProperties');
element.innerHTML = 'Device Name: ' + device.name + '
' +
'Device Cordova: ' + device.cordova + '
' +
'Device Platform: ' + device.platform + '
' +
'Device UUID: ' + device.uuid + '
' +
- 'Device Version: ' + device.version + '
';
+ 'Device Model: ' + device.model + '
' +
+ 'Device Version: ' + device.version + '
';
}
function test_file() {
@@ -590,6 +592,13 @@ function test_globalization() {
);
}
+function test_inAppBrowser() {
+ var ref = window.open('http://apache.org', '_blank', 'location=yes');
+ ref.addEventListener('loadstart', function () { alert(event.url); });
+ ref.removeEventListener('loadstart', null);
+ ref.close();
+}
+
function test_media() {
var my_media = new Media(src, onSuccess, onError);
var mediaTimer = setInterval(function () {
diff --git a/phonegap/phonegap.d.ts b/phonegap/phonegap.d.ts
index a3794dc3bc..b7125e227b 100644
--- a/phonegap/phonegap.d.ts
+++ b/phonegap/phonegap.d.ts
@@ -1,4 +1,4 @@
-// Type definitions for PhoneGap 2.2
+// Type definitions for PhoneGap 2.3
// Project: http://phonegap.com
// Definitions by: Boris Yankov
// Definitions: https://github.com/borisyankov/DefinitelyTyped
@@ -170,6 +170,7 @@ interface Device {
platform: string;
uuid: string;
version: string;
+ model: string;
}
/* Defined in lib.d.ts
@@ -314,6 +315,15 @@ interface Globalization {
getCurrencyPattern(currencyCode, successCB, errorCB): void;
}
+/*
+interface InAppBrowser {
+ addEventListener(eventname: string, callback): void;
+ removeEventListener(eventname: string, callback): void;
+ open(url?: string, target?: string, features?: string, replace?: bool): Window;
+ close(): void;
+}
+*/
+
interface Media {
new (src: string, mediaSuccess: Function, mediaError?: MediaError, mediaStatus?: Function);
getCurrentPosition(mediaSuccess: Function, mediaError?: MediaError): void;
@@ -375,7 +385,7 @@ interface LocalStorage {
}
*/
-interface Navigator {
+interface Navigator extends Navigator {
accelerometer: Accelerometer;
camera: Camera;
capture: Capture;
@@ -391,4 +401,6 @@ interface Navigator {
interface Window {
openDatabase(database_name: string, database_version: string, database_displayname: string, database_size: number): Database;
-}
\ No newline at end of file
+}
+
+declare var device: Device;
\ No newline at end of file