mirror of
https://github.com/apache/cordova-android.git
synced 2026-01-30 00:05:28 +08:00
Compare commits
45 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e2d91c2556 | ||
|
|
634a9c0f4c | ||
|
|
c846111099 | ||
|
|
960e0f3412 | ||
|
|
39f261c6e2 | ||
|
|
d7c8bc799d | ||
|
|
f4da7e164d | ||
|
|
05192a91da | ||
|
|
3835144b93 | ||
|
|
bdf452b02a | ||
|
|
bcc2957f20 | ||
|
|
81059b398f | ||
|
|
31d5a94ea9 | ||
|
|
1e5457a47d | ||
|
|
7b75e2f1b0 | ||
|
|
180696baec | ||
|
|
76820ebaff | ||
|
|
c341cf0d47 | ||
|
|
f2c38ea0a7 | ||
|
|
0772a315c4 | ||
|
|
08d7a9c87a | ||
|
|
eb48055acd | ||
|
|
e4a52de0a5 | ||
|
|
ac06892dec | ||
|
|
5e1997c8d8 | ||
|
|
36e6b572b7 | ||
|
|
3bda8afdc1 | ||
|
|
cdf148bb58 | ||
|
|
b532cf8545 | ||
|
|
ecebcbabf8 | ||
|
|
aa00e07b3c | ||
|
|
cb473dfed4 | ||
|
|
8b05ce41dd | ||
|
|
5d43835db8 | ||
|
|
838286df96 | ||
|
|
04aa6d3c38 | ||
|
|
e213772f98 | ||
|
|
0577b4bf5d | ||
|
|
a37d0699db | ||
|
|
5fa77e97bd | ||
|
|
8d479c8269 | ||
|
|
700ae50e9b | ||
|
|
900be3afe0 | ||
|
|
d2b329636f | ||
|
|
993fb296d6 |
@@ -34,6 +34,10 @@ cp ./framework/assets/www/cordova-$VERSION.js $PROJECT_PATH/.cordova/android/cor
|
||||
# copy in cordova.jar
|
||||
cp ./framework/cordova-$VERSION.jar $PROJECT_PATH/.cordova/android/cordova-$VERSION.jar
|
||||
|
||||
# copy in res/xml
|
||||
cp ./framework/res/xml/cordova.xml $PROJECT_PATH/.cordova/android/cordova.xml
|
||||
cp ./framework/res/xml/plugins.xml $PROJECT_PATH/.cordova/android/plugins.xml
|
||||
|
||||
# app properties
|
||||
cat > $PROJECT_PATH/.cordova/config <<eom
|
||||
VERSION=$VERSION
|
||||
|
||||
@@ -25,6 +25,11 @@ cp ./.cordova/android/cordova-$VERSION.js ./assets/www
|
||||
# copy in cordova.jar
|
||||
cp ./.cordova/android/cordova-$VERSION.jar ./libs
|
||||
|
||||
# copy in res/xml
|
||||
mkdir ./res/xml
|
||||
cp ./.cordova/android/cordova.xml ./res/xml
|
||||
cp ./.cordova/android/plugins.xml ./res/xml
|
||||
|
||||
# copy in default activity
|
||||
cat ./cordova/templates/Activity.java > $ACTIVITY_PATH
|
||||
|
||||
|
||||
@@ -4,6 +4,6 @@
|
||||
|
||||
# if there are no devices listed then emulate
|
||||
|
||||
|
||||
ant clean
|
||||
ant debug install
|
||||
adb shell am start -n $PACKAGE/$PACKAGE.$ACTIVITY
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
<meta name="viewport" content="width=320; user-scalable=no" />
|
||||
<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="main.js"></script>
|
||||
<link rel="stylesheet" href="master.css" type="text/css" media="screen" title="no title">
|
||||
<script type="text/javascript" charset="utf-8" src="cordova-1.7.0.js"></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>
|
||||
@@ -25,14 +25,14 @@
|
||||
</dl>
|
||||
<a href="#" class="btn large" onclick="toggleAccel();">Toggle Accelerometer</a>
|
||||
<a href="#" class="btn large" onclick="getLocation();">Get Location</a>
|
||||
<a href="tel:411" class="btn large">Call 411</a>
|
||||
<a href="tel:411" class="btn large">Call 411</a>
|
||||
<a href="#" class="btn large" onclick="beep();">Beep</a>
|
||||
<a href="#" class="btn large" onclick="vibrate();">Vibrate</a>
|
||||
<a href="#" class="btn large" onclick="show_pic();">Get a Picture</a>
|
||||
<a href="#" class="btn large" onclick="get_contacts();return false;">Get Phone's Contacts</a>
|
||||
<a href="#" class="btn large" onclick="check_network();return false;">Check Network</a>
|
||||
<dl>
|
||||
<dt>Compass Heading:</dt><dd id="h">Off</dd>
|
||||
<dt>Compass Heading:</dt><dd id="h">Off</dd>
|
||||
</dl>
|
||||
<a href="#" class="btn large" onclick="toggleCompass();return false;">Toggle Compass</a>
|
||||
<div id="viewport" class="viewport" style="display: none;">
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<cordova>
|
||||
<access origin="http://127.0.0.1*"/>
|
||||
<log level="DEBUG"/>
|
||||
</cordova>
|
||||
@@ -1,19 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<plugins>
|
||||
<plugin name="App" value="org.apache.cordova.App"/>
|
||||
<plugin name="Geolocation" value="org.apache.cordova.GeoBroker"/>
|
||||
<plugin name="Device" value="org.apache.cordova.Device"/>
|
||||
<plugin name="Accelerometer" value="org.apache.cordova.AccelListener"/>
|
||||
<plugin name="Compass" value="org.apache.cordova.CompassListener"/>
|
||||
<plugin name="Media" value="org.apache.cordova.AudioHandler"/>
|
||||
<plugin name="Camera" value="org.apache.cordova.CameraLauncher"/>
|
||||
<plugin name="Contacts" value="org.apache.cordova.ContactManager"/>
|
||||
<plugin name="File" value="org.apache.cordova.FileUtils"/>
|
||||
<plugin name="Network Status" value="org.apache.cordova.NetworkManager"/>
|
||||
<plugin name="Notification" value="org.apache.cordova.Notification"/>
|
||||
<plugin name="Storage" value="org.apache.cordova.Storage"/>
|
||||
<plugin name="Temperature" value="org.apache.cordova.TempListener"/>
|
||||
<plugin name="FileTransfer" value="org.apache.cordova.FileTransfer"/>
|
||||
<plugin name="Capture" value="org.apache.cordova.Capture"/>
|
||||
<plugin name="Battery" value="org.apache.cordova.BatteryListener"/>
|
||||
</plugins>
|
||||
File diff suppressed because it is too large
Load Diff
@@ -19,7 +19,7 @@
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<script src="cordova-1.5.0.js"></script>
|
||||
<script src="cordova-1.7.0.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
|
||||
@@ -122,6 +122,7 @@
|
||||
<!-- update project files to reference cordova-x.x.x.min.js -->
|
||||
<replaceregexp match="cordova(.*)\.js" replace="cordova-${version}.js" byline="true">
|
||||
<fileset file="assets/www/index.html" />
|
||||
<fileset file="../bin/templates/project/cordova/templates/project/assets/www/index.html" />
|
||||
</replaceregexp>
|
||||
|
||||
<!-- This is sketchy, but it works, ${dblQuote} does not -->
|
||||
|
||||
@@ -27,11 +27,12 @@
|
||||
<plugin name="Camera" value="org.apache.cordova.CameraLauncher"/>
|
||||
<plugin name="Contacts" value="org.apache.cordova.ContactManager"/>
|
||||
<plugin name="File" value="org.apache.cordova.FileUtils"/>
|
||||
<plugin name="Network Status" value="org.apache.cordova.NetworkManager"/>
|
||||
<plugin name="NetworkStatus" value="org.apache.cordova.NetworkManager"/>
|
||||
<plugin name="Notification" value="org.apache.cordova.Notification"/>
|
||||
<plugin name="Storage" value="org.apache.cordova.Storage"/>
|
||||
<plugin name="Temperature" value="org.apache.cordova.TempListener"/>
|
||||
<plugin name="FileTransfer" value="org.apache.cordova.FileTransfer"/>
|
||||
<plugin name="Capture" value="org.apache.cordova.Capture"/>
|
||||
<plugin name="Battery" value="org.apache.cordova.BatteryListener"/>
|
||||
<plugin name="SplashScreen" value="org.apache.cordova.SplashScreen"/>
|
||||
</plugins>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
/*
|
||||
Licensed to the Apache Software Foundation (ASF) under one
|
||||
or more contributor license agreements. See the NOTICE file
|
||||
distributed with this work for additional information
|
||||
regarding copyright ownership. The ASF licenses this file
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -31,8 +31,6 @@ import org.apache.cordova.api.Plugin;
|
||||
import org.apache.cordova.api.PluginResult;
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.ContentValues;
|
||||
@@ -115,6 +113,7 @@ public class CameraLauncher extends Plugin {
|
||||
this.targetWidth = args.getInt(3);
|
||||
this.targetHeight = args.getInt(4);
|
||||
this.encodingType = args.getInt(5);
|
||||
this.mediaType = args.getInt(6);
|
||||
|
||||
if (srcType == CAMERA) {
|
||||
this.takePicture(destType, encodingType);
|
||||
|
||||
@@ -84,7 +84,8 @@ public abstract class ContactAccessor {
|
||||
map.put("displayName", true);
|
||||
}
|
||||
else if (key.startsWith("name")) {
|
||||
map.put("name", true);
|
||||
map.put("displayName", true);
|
||||
map.put("name", true);
|
||||
}
|
||||
else if (key.startsWith("nickname")) {
|
||||
map.put("nickname", true);
|
||||
|
||||
@@ -216,6 +216,9 @@ public class CordovaChromeClient extends WebChromeClient {
|
||||
// Cordova JS has initialized, so show webview
|
||||
// (This solves white flash seen when rendering HTML)
|
||||
else if (reqOk && defaultValue != null && defaultValue.equals("gap_init:")) {
|
||||
if (ctx.splashscreen != 0) {
|
||||
ctx.root.setBackgroundResource(0);
|
||||
}
|
||||
ctx.appView.setVisibility(View.VISIBLE);
|
||||
ctx.spinnerStop();
|
||||
result.confirm("OK");
|
||||
|
||||
@@ -229,6 +229,9 @@ public class CordovaWebViewClient extends WebViewClient {
|
||||
Thread.sleep(2000);
|
||||
ctx.runOnUiThread(new Runnable() {
|
||||
public void run() {
|
||||
if (ctx.splashscreen != 0) {
|
||||
ctx.root.setBackgroundResource(0);
|
||||
}
|
||||
ctx.appView.setVisibility(View.VISIBLE);
|
||||
ctx.spinnerStop();
|
||||
}
|
||||
|
||||
@@ -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.7.0"; // Cordova version
|
||||
public static String platform = "Android"; // Device OS
|
||||
public static String uuid; // Device UUID
|
||||
|
||||
|
||||
@@ -37,17 +37,18 @@ import org.xmlpull.v1.XmlPullParserException;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.AlertDialog;
|
||||
import android.app.Dialog;
|
||||
import android.app.ProgressDialog;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.content.res.Configuration;
|
||||
import android.content.res.XmlResourceParser;
|
||||
import android.database.Cursor;
|
||||
import android.graphics.Color;
|
||||
import android.media.AudioManager;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.view.Display;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.Menu;
|
||||
@@ -433,9 +434,6 @@ public class DroidGap extends Activity implements CordovaInterface {
|
||||
|
||||
// If spashscreen
|
||||
this.splashscreen = this.getIntegerProperty("splashscreen", 0);
|
||||
if ((this.urls.size() == 0) && (this.splashscreen != 0)) {
|
||||
root.setBackgroundResource(this.splashscreen);
|
||||
}
|
||||
|
||||
// If loadUrlTimeoutValue
|
||||
int timeout = this.getIntegerProperty("loadUrlTimeoutValue", 0);
|
||||
@@ -608,38 +606,12 @@ public class DroidGap extends Activity implements CordovaInterface {
|
||||
if (!url.startsWith("javascript:")) {
|
||||
LOG.d(TAG, "DroidGap.loadUrl(%s, %d)", url, time);
|
||||
}
|
||||
final DroidGap me = this;
|
||||
|
||||
// Handle activity parameters
|
||||
this.runOnUiThread(new Runnable() {
|
||||
public void run() {
|
||||
if (me.appView == null) {
|
||||
me.init();
|
||||
}
|
||||
me.handleActivityParameters();
|
||||
}
|
||||
});
|
||||
|
||||
Runnable runnable = new Runnable() {
|
||||
public void run() {
|
||||
try {
|
||||
synchronized(this) {
|
||||
this.wait(time);
|
||||
}
|
||||
} catch (InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
if (!me.cancelLoadUrl) {
|
||||
me.loadUrlIntoView(url);
|
||||
}
|
||||
else{
|
||||
me.cancelLoadUrl = false;
|
||||
LOG.d(TAG, "Aborting loadUrl(%s): Another URL was loaded before timer expired.", url);
|
||||
}
|
||||
}
|
||||
};
|
||||
Thread thread = new Thread(runnable);
|
||||
thread.start();
|
||||
|
||||
this.handleActivityParameters();
|
||||
if (this.splashscreen != 0) {
|
||||
this.showSplashScreen(time);
|
||||
}
|
||||
this.loadUrlIntoView(url);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1072,7 +1044,7 @@ public class DroidGap extends Activity implements CordovaInterface {
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when a key is pressed.
|
||||
* Called when a key is de-pressed. (Key UP)
|
||||
*
|
||||
* @param keyCode
|
||||
* @param event
|
||||
@@ -1085,21 +1057,16 @@ public class DroidGap extends Activity implements CordovaInterface {
|
||||
|
||||
// If back key
|
||||
if (keyCode == KeyEvent.KEYCODE_BACK) {
|
||||
|
||||
// If back key is bound, then send event to JavaScript
|
||||
if (this.bound) {
|
||||
this.appView.loadUrl("javascript:cordova.fireDocumentEvent('backbutton');");
|
||||
return true;
|
||||
}
|
||||
|
||||
// If not bound
|
||||
else {
|
||||
|
||||
} else {
|
||||
// If not bound
|
||||
// Go to previous page in webview if it is possible to go back
|
||||
if (this.backHistory()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// If not, then invoke behavior of super class
|
||||
else {
|
||||
this.activityState = ACTIVITY_EXITING;
|
||||
@@ -1437,4 +1404,47 @@ public class DroidGap extends Activity implements CordovaInterface {
|
||||
return this.bound;
|
||||
}
|
||||
|
||||
protected Dialog splashDialog;
|
||||
|
||||
/**
|
||||
* Removes the Dialog that displays the splash screen
|
||||
*/
|
||||
public void removeSplashScreen() {
|
||||
if (splashDialog != null) {
|
||||
splashDialog.dismiss();
|
||||
splashDialog = null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Shows the splash screen over the full Activity
|
||||
*/
|
||||
protected void showSplashScreen(int time) {
|
||||
// Get reference to display
|
||||
Display display = getWindowManager().getDefaultDisplay();
|
||||
|
||||
// Create the layout for the dialog
|
||||
LinearLayout root = new LinearLayout(this);
|
||||
root.setMinimumHeight(display.getHeight());
|
||||
root.setMinimumWidth(display.getWidth());
|
||||
root.setOrientation(LinearLayout.VERTICAL);
|
||||
root.setBackgroundColor(this.getIntegerProperty("backgroundColor", Color.BLACK));
|
||||
root.setLayoutParams(new LinearLayout.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT,
|
||||
ViewGroup.LayoutParams.FILL_PARENT, 0.0F));
|
||||
root.setBackgroundResource(this.splashscreen);
|
||||
|
||||
// Create and show the dialog
|
||||
splashDialog = new Dialog(this, android.R.style.Theme_Translucent_NoTitleBar);
|
||||
splashDialog.setContentView(root);
|
||||
splashDialog.setCancelable(false);
|
||||
splashDialog.show();
|
||||
|
||||
// Set Runnable to remove splash screen just in case
|
||||
final Handler handler = new Handler();
|
||||
handler.postDelayed(new Runnable() {
|
||||
public void run() {
|
||||
removeSplashScreen();
|
||||
}
|
||||
}, time);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -410,7 +410,7 @@ public class FileTransfer extends Plugin {
|
||||
*/
|
||||
public JSONObject download(String source, String target) throws IOException {
|
||||
try {
|
||||
File file = new File(target);
|
||||
File file = getFileFromPath(target);
|
||||
|
||||
// create needed directories
|
||||
file.getParentFile().mkdirs();
|
||||
@@ -421,6 +421,14 @@ public class FileTransfer extends Plugin {
|
||||
URL url = new URL(source);
|
||||
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
|
||||
connection.setRequestMethod("GET");
|
||||
|
||||
//Add cookie support
|
||||
String cookie = CookieManager.getInstance().getCookie(source);
|
||||
if(cookie != null)
|
||||
{
|
||||
connection.setRequestProperty("cookie", cookie);
|
||||
}
|
||||
|
||||
connection.connect();
|
||||
|
||||
Log.d(LOG_TAG, "Download file:" + url);
|
||||
@@ -480,4 +488,17 @@ public class FileTransfer extends Plugin {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a File object from the passed in path
|
||||
*
|
||||
* @param path
|
||||
* @return
|
||||
*/
|
||||
private File getFileFromPath(String path) {
|
||||
if (path.startsWith("file://")) {
|
||||
return new File(path.substring(7));
|
||||
} else {
|
||||
return new File(path);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -142,8 +142,7 @@ public class FileUtils extends Plugin {
|
||||
return new PluginResult(status, obj);
|
||||
}
|
||||
else if (action.equals("getMetadata")) {
|
||||
JSONObject obj = getMetadata(args.getString(0));
|
||||
return new PluginResult(status, obj);
|
||||
return new PluginResult(status, getMetadata(args.getString(0)));
|
||||
}
|
||||
else if (action.equals("getFileMetadata")) {
|
||||
JSONObject obj = getFileMetadata(args.getString(0));
|
||||
@@ -764,21 +763,17 @@ public class FileUtils extends Plugin {
|
||||
* Look up metadata about this entry.
|
||||
*
|
||||
* @param filePath to entry
|
||||
* @return a Metadata object
|
||||
* @return a long
|
||||
* @throws FileNotFoundException
|
||||
* @throws JSONException
|
||||
*/
|
||||
private JSONObject getMetadata(String filePath) throws FileNotFoundException, JSONException {
|
||||
private long getMetadata(String filePath) throws FileNotFoundException {
|
||||
File file = createFileObject(filePath);
|
||||
|
||||
if (!file.exists()) {
|
||||
throw new FileNotFoundException("Failed to find file in getMetadata");
|
||||
}
|
||||
|
||||
JSONObject metadata = new JSONObject();
|
||||
metadata.put("modificationTime", file.lastModified());
|
||||
|
||||
return metadata;
|
||||
return file.lastModified();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -978,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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -58,7 +58,7 @@ public class NetworkManager extends Plugin {
|
||||
public static final String LTE = "lte";
|
||||
public static final String UMB = "umb";
|
||||
public static final String HSPA_PLUS = "hspa+";
|
||||
// return types
|
||||
// return type
|
||||
public static final String TYPE_UNKNOWN = "unknown";
|
||||
public static final String TYPE_ETHERNET = "ethernet";
|
||||
public static final String TYPE_WIFI = "wifi";
|
||||
@@ -89,7 +89,7 @@ public class NetworkManager extends Plugin {
|
||||
*/
|
||||
public void setContext(CordovaInterface ctx) {
|
||||
super.setContext(ctx);
|
||||
this.sockMan = (ConnectivityManager) ctx.getSystemService(Context.CONNECTIVITY_SERVICE);
|
||||
this.sockMan = (ConnectivityManager) ctx.getSystemService(Context.CONNECTIVITY_SERVICE);
|
||||
this.connectionCallbackId = null;
|
||||
|
||||
// We need to listen to connectivity events to update navigator.connection
|
||||
@@ -98,7 +98,7 @@ public class NetworkManager extends Plugin {
|
||||
if (this.receiver == null) {
|
||||
this.receiver = new BroadcastReceiver() {
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
updateConnectionInfo((NetworkInfo) intent.getParcelableExtra(ConnectivityManager.EXTRA_NETWORK_INFO));
|
||||
}
|
||||
};
|
||||
@@ -117,7 +117,7 @@ public class NetworkManager extends Plugin {
|
||||
*/
|
||||
public PluginResult execute(String action, JSONArray args, String callbackId) {
|
||||
PluginResult.Status status = PluginResult.Status.INVALID_ACTION;
|
||||
String result = "Unsupported Operation: " + action;
|
||||
String result = "Unsupported Operation: " + action;
|
||||
|
||||
if (action.equals("getConnectionInfo")) {
|
||||
this.connectionCallbackId = callbackId;
|
||||
@@ -137,8 +137,7 @@ public class NetworkManager extends Plugin {
|
||||
* @return T=returns value
|
||||
*/
|
||||
public boolean isSynch(String action) {
|
||||
// All methods take a while, so always use async
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -182,7 +181,7 @@ public class NetworkManager extends Plugin {
|
||||
// If we are not connected to any network set type to none
|
||||
if (!info.isConnected()) {
|
||||
type = TYPE_NONE;
|
||||
}
|
||||
}
|
||||
else {
|
||||
type = getType(info);
|
||||
}
|
||||
@@ -212,7 +211,7 @@ public class NetworkManager extends Plugin {
|
||||
*/
|
||||
private String getType(NetworkInfo info) {
|
||||
if (info != null) {
|
||||
String type = info.getTypeName();
|
||||
String type = info.getTypeName();
|
||||
|
||||
if (type.toLowerCase().equals(WIFI)) {
|
||||
return TYPE_WIFI;
|
||||
|
||||
@@ -233,7 +233,7 @@ public class Notification extends Plugin {
|
||||
|
||||
// First button
|
||||
if (fButtons.length > 0) {
|
||||
dlg.setPositiveButton(fButtons[0],
|
||||
dlg.setNegativeButton(fButtons[0],
|
||||
new AlertDialog.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
dialog.dismiss();
|
||||
@@ -255,7 +255,7 @@ public class Notification extends Plugin {
|
||||
|
||||
// Third button
|
||||
if (fButtons.length > 2) {
|
||||
dlg.setNegativeButton(fButtons[2],
|
||||
dlg.setPositiveButton(fButtons[2],
|
||||
new AlertDialog.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
dialog.dismiss();
|
||||
|
||||
23
framework/src/org/apache/cordova/SplashScreen.java
Normal file
23
framework/src/org/apache/cordova/SplashScreen.java
Normal file
@@ -0,0 +1,23 @@
|
||||
package org.apache.cordova;
|
||||
|
||||
import org.apache.cordova.api.Plugin;
|
||||
import org.apache.cordova.api.PluginResult;
|
||||
import org.json.JSONArray;
|
||||
|
||||
public class SplashScreen extends Plugin {
|
||||
|
||||
@Override
|
||||
public PluginResult execute(String action, JSONArray args, String callbackId) {
|
||||
PluginResult.Status status = PluginResult.Status.OK;
|
||||
String result = "";
|
||||
|
||||
if (action.equals("hide")) {
|
||||
((DroidGap)this.ctx).removeSplashScreen();
|
||||
}
|
||||
else {
|
||||
status = PluginResult.Status.INVALID_ACTION;
|
||||
}
|
||||
return new PluginResult(status, result);
|
||||
}
|
||||
|
||||
}
|
||||
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
|
||||
|
||||
@@ -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>
|
||||
|
||||
23
test/README.md
Executable file
23
test/README.md
Executable file
@@ -0,0 +1,23 @@
|
||||
## Android Native Tests ##
|
||||
|
||||
These tests are designed to verify Android native features and other Android specific features.
|
||||
|
||||
Before running the tests, they need to be set up.
|
||||
|
||||
1. Copy the version of cordova-x.y.z.js into assets/www directory
|
||||
2. Edit assets/www/cordova.js to reference the correct version
|
||||
3. Copy cordova-x.y.z.jar into libs directory
|
||||
|
||||
To run from command line:
|
||||
|
||||
4. Build by entering "ant debug install"
|
||||
5. Run tests by clicking on "CordovaTest" icon on device
|
||||
|
||||
To run from Eclipse:
|
||||
|
||||
4. Import Android project into Eclipse
|
||||
5. Ensure Project properties "Java Build Path" includes the lib/cordova-x.y.z.jar
|
||||
6. Create run configuration if not already created
|
||||
7. Run tests
|
||||
|
||||
|
||||
17
test/ant.properties
Executable file
17
test/ant.properties
Executable file
@@ -0,0 +1,17 @@
|
||||
# This file is used to override default values used by the Ant build system.
|
||||
#
|
||||
# This file must be checked in Version Control Systems, as it is
|
||||
# integral to the build system of your project.
|
||||
|
||||
# This file is only used by the Ant script.
|
||||
|
||||
# You can use this to override default values such as
|
||||
# 'source.dir' for the location of your java source folder and
|
||||
# 'out.dir' for the location of your output folder.
|
||||
|
||||
# You can also use it define how the release builds are signed by declaring
|
||||
# the following properties:
|
||||
# 'key.store' for the location of your keystore and
|
||||
# 'key.alias' for the name of the key to use.
|
||||
# The password will be asked during the build when you use the 'release' target.
|
||||
|
||||
@@ -15,8 +15,9 @@
|
||||
</div>
|
||||
<div id="info">
|
||||
<h4>Page 3</h4>
|
||||
Press the 3 buttons below. You should stay on same page. (NOTE: IS THIS CORRECT? - DOESN'T SEEM TO WORK.)<br>
|
||||
Press "backbutton". You should go to Page 2.
|
||||
Press the 3 buttons below. You should stay on same page.<br>
|
||||
Press "backbutton" 4 times. This will go back to #test3, #test2, #test1, then return to previous Page 2.<br>
|
||||
(NOTE: IS THIS CORRECT BEHAVIOR?)
|
||||
</div>
|
||||
<a href="sample3.html#test1" class="btn large">page3#test1</a>
|
||||
<a href="sample3.html#test2" class="btn large">page3#test2</a>
|
||||
|
||||
@@ -79,15 +79,15 @@
|
||||
</h4>
|
||||
</div>
|
||||
<div id="info">
|
||||
<h4>Press "Home" button, then return to this app to see pause/resume.<br>
|
||||
There shouldn't be any "Running" entries between pause and resume.</h4>
|
||||
Press "Home" button, then return to this app to see pause/resume.<br>
|
||||
There shouldn't be any "Running" entries between pause and resume.<br>
|
||||
</div>
|
||||
<div id="info">
|
||||
<h4>Info for event testing:</h4>
|
||||
<div id="status"></div>
|
||||
</div>
|
||||
|
||||
<a href="index2.html" class="btn large" >Load new page</a>
|
||||
<!-- a href="index2.html" class="btn large" >Load new page</a -->
|
||||
<a href="javascript:" class="btn large" onclick="clearStatus();">Clear status</a>
|
||||
|
||||
<script>
|
||||
|
||||
@@ -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) {
|
||||
@@ -3516,8 +3593,9 @@ function Device() {
|
||||
this.cordova = null;
|
||||
|
||||
var me = this;
|
||||
this.getInfo(
|
||||
function(info) {
|
||||
|
||||
channel.onCordovaReady.subscribeOnce(function() {
|
||||
me.getInfo(function(info) {
|
||||
me.available = true;
|
||||
me.platform = info.platform;
|
||||
me.version = info.version;
|
||||
@@ -3525,11 +3603,11 @@ function Device() {
|
||||
me.uuid = info.uuid;
|
||||
me.cordova = info.cordova;
|
||||
channel.onCordovaInfoReady.fire();
|
||||
},
|
||||
function(e) {
|
||||
},function(e) {
|
||||
me.available = false;
|
||||
utils.alert("[ERROR] Error initializing Cordova: " + e);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -3591,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) {
|
||||
@@ -3648,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) {
|
||||
@@ -3686,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) {
|
||||
@@ -4068,7 +4146,7 @@ module.exports = {
|
||||
completeQuery:completeQuery
|
||||
};
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
// file: lib/common/plugin/battery.js
|
||||
define("cordova/plugin/battery", function(require, exports, module) {
|
||||
@@ -4160,7 +4238,7 @@ var battery = new Battery();
|
||||
|
||||
module.exports = battery;
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
// file: lib/common/plugin/capture.js
|
||||
define("cordova/plugin/capture", function(require, exports, module) {
|
||||
@@ -4237,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) {
|
||||
@@ -4255,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");
|
||||
@@ -4278,7 +4356,7 @@ var exec = require('cordova/exec'),
|
||||
}
|
||||
|
||||
// Get heading
|
||||
exec(win, fail, "Compass", "getHeading", []);
|
||||
exec(win, fail, "Compass", "getHeading", [options]);
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -4288,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") {
|
||||
@@ -4306,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;
|
||||
},
|
||||
|
||||
@@ -4323,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) {
|
||||
@@ -4394,7 +4483,7 @@ var contacts = {
|
||||
|
||||
module.exports = contacts;
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
// file: lib/common/plugin/geolocation.js
|
||||
define("cordova/plugin/geolocation", function(require, exports, module) {
|
||||
@@ -4493,7 +4582,7 @@ var geolocation = {
|
||||
|
||||
module.exports = geolocation;
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
// file: lib/common/plugin/network.js
|
||||
define("cordova/plugin/network", function(require, exports, module) {
|
||||
@@ -4502,46 +4591,47 @@ var exec = require('cordova/exec'),
|
||||
channel = require('cordova/channel');
|
||||
|
||||
var NetworkConnection = function () {
|
||||
this.type = null;
|
||||
this._firstRun = true;
|
||||
this._timer = null;
|
||||
this.timeout = 500;
|
||||
this.type = null;
|
||||
this._firstRun = true;
|
||||
this._timer = null;
|
||||
this.timeout = 500;
|
||||
|
||||
var me = this;
|
||||
var me = this;
|
||||
|
||||
this.getInfo(
|
||||
function (info) {
|
||||
me.type = info;
|
||||
if (info === "none") {
|
||||
// set a timer if still offline at the end of timer send the offline event
|
||||
me._timer = setTimeout(function(){
|
||||
cordova.fireDocumentEvent("offline");
|
||||
me._timer = null;
|
||||
}, me.timeout);
|
||||
} else {
|
||||
// If there is a current offline event pending clear it
|
||||
if (me._timer !== null) {
|
||||
clearTimeout(me._timer);
|
||||
me._timer = null;
|
||||
}
|
||||
cordova.fireDocumentEvent("online");
|
||||
channel.onCordovaReady.subscribeOnce(function() {
|
||||
me.getInfo(function (info) {
|
||||
me.type = info;
|
||||
if (info === "none") {
|
||||
// set a timer if still offline at the end of timer send the offline event
|
||||
me._timer = setTimeout(function(){
|
||||
cordova.fireDocumentEvent("offline");
|
||||
me._timer = null;
|
||||
}, me.timeout);
|
||||
} else {
|
||||
// If there is a current offline event pending clear it
|
||||
if (me._timer !== null) {
|
||||
clearTimeout(me._timer);
|
||||
me._timer = null;
|
||||
}
|
||||
cordova.fireDocumentEvent("online");
|
||||
}
|
||||
|
||||
// should only fire this once
|
||||
if (me._firstRun) {
|
||||
me._firstRun = false;
|
||||
channel.onCordovaConnectionReady.fire();
|
||||
}
|
||||
},
|
||||
function (e) {
|
||||
// If we can't get the network info we should still tell Cordova
|
||||
// to fire the deviceready event.
|
||||
if (me._firstRun) {
|
||||
me._firstRun = false;
|
||||
channel.onCordovaConnectionReady.fire();
|
||||
}
|
||||
console.log("Error initializing Network Connection: " + e);
|
||||
});
|
||||
// should only fire this once
|
||||
if (me._firstRun) {
|
||||
me._firstRun = false;
|
||||
channel.onCordovaConnectionReady.fire();
|
||||
}
|
||||
},
|
||||
function (e) {
|
||||
// If we can't get the network info we should still tell Cordova
|
||||
// to fire the deviceready event.
|
||||
if (me._firstRun) {
|
||||
me._firstRun = false;
|
||||
channel.onCordovaConnectionReady.fire();
|
||||
}
|
||||
console.log("Error initializing Network Connection: " + e);
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -4552,12 +4642,12 @@ var NetworkConnection = function () {
|
||||
*/
|
||||
NetworkConnection.prototype.getInfo = function (successCallback, errorCallback) {
|
||||
// Get info
|
||||
exec(successCallback, errorCallback, "Network Status", "getConnectionInfo", []);
|
||||
exec(successCallback, errorCallback, "NetworkStatus", "getConnectionInfo", []);
|
||||
};
|
||||
|
||||
module.exports = new NetworkConnection();
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
// file: lib/common/plugin/notification.js
|
||||
define("cordova/plugin/notification", function(require, exports, module) {
|
||||
@@ -4618,7 +4708,7 @@ module.exports = {
|
||||
}
|
||||
};
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
// file: lib/common/plugin/requestFileSystem.js
|
||||
define("cordova/plugin/requestFileSystem", function(require, exports, module) {
|
||||
@@ -4663,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) {
|
||||
@@ -4709,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) {
|
||||
@@ -4818,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>');
|
||||
|
||||
@@ -21,12 +21,13 @@
|
||||
</span>, Color Depth: <span id="colorDepth"></span></h4>
|
||||
</div>
|
||||
<div id="info">
|
||||
Loading Google Maps should be successful.<br>
|
||||
Some reason loading Page 2 & Cordova page replaces current page. (ERROR?)
|
||||
Press the two buttons:<br>
|
||||
1. Google Maps should display in iframe.<br>
|
||||
2. Page 2 replaces current page.<br>
|
||||
(NOTE: THIS BEHAVIOR IS WRONG - AND NEEDS TO BE FIXED IN FUTURE RELEASE.)
|
||||
</div>
|
||||
<iframe id="iframe" src="" width="100%" height="200px"></iframe>
|
||||
<iframe id="iframe" src="" width="90%" height="200px"></iframe>
|
||||
<a href="javascript:" class="btn large" onclick="loadUrl('http://maps.google.com/maps?output=embed');">Google Maps</a>
|
||||
<a href="javascript:" class="btn large" onclick="loadUrl('index2.html');">Page 2</a>
|
||||
<a href="javascript:" class="btn large" onclick="loadUrl('file:///android_asset/www/lifecycle/index.html');">Cordova page</a>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -17,7 +17,8 @@
|
||||
</span>, Color Depth: <span id="colorDepth"></span></h4>
|
||||
</div>
|
||||
<div id="info">
|
||||
This is displaying a Cordova page inside iframe. The info above should be filled out.
|
||||
This should display a Cordova page inside an iframe. The info above should be filled out.
|
||||
(NOTE: THIS DOES NOT WORK AND NEEDS TO BE FIXED IN FUTURE RELEASE.)
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -24,8 +24,11 @@
|
||||
<h4>UUID: <span id="uuid"> </span>, Name: <span id="name"> </span></h4>
|
||||
<h4>Width: <span id="width"> </span>, Height: <span id="height">
|
||||
</span>, Color Depth: <span id="colorDepth"></span></h4>
|
||||
<h4>Cordova Version: <span id="cordova"> </span></h4>
|
||||
</div>
|
||||
|
||||
<div id="info">
|
||||
<h4>Run each of the tests below:</h4>
|
||||
</div>
|
||||
<button class="btn large" onclick="startActivity('org.apache.cordova.test.jqmtabbackbutton');">Backbutton jQM tab</button>
|
||||
<button class="btn large" onclick="startActivity('org.apache.cordova.test.backbuttonmultipage');">Backbutton with multiple pages</button>
|
||||
<button class="btn large" onclick="startActivity('org.apache.cordova.test.errorurl');">Error URL</button>
|
||||
|
||||
@@ -79,8 +79,17 @@
|
||||
</h4>
|
||||
</div>
|
||||
<div id="info">
|
||||
<h4>Press "Home" button, then return to this app to see pause/resume.<br>
|
||||
There should be "Running" entries between pause and resume since app continues to run in the background.</h4>
|
||||
<h4>Test 1</h4>
|
||||
Press "Home" button, then return to this app to see pause/resume.<br>
|
||||
There should be "Running" entries between pause and resume since app continues to run in the background.
|
||||
<h4>Test 2</h4>
|
||||
Press "Load new page" button to load a new Cordova page.<br>
|
||||
When returning, you should see
|
||||
<ul>
|
||||
<li>Page2: onunload</li>
|
||||
<li>Page1: onload</li>
|
||||
<li>Page1: Running</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div id="info">
|
||||
<h4>Info for event testing:</h4>
|
||||
|
||||
@@ -79,7 +79,13 @@
|
||||
</h4>
|
||||
</div>
|
||||
<div id="info">
|
||||
<h4>Press "Back" button to return to Page 1.</h4>
|
||||
You should see<br>
|
||||
<ul>
|
||||
<li>Page1: onunload</li>
|
||||
<li>Page2: onload</li>
|
||||
<li>Page2: Running</li>
|
||||
</ul>
|
||||
Press "backbutton" to return to Page 1.
|
||||
</div>
|
||||
<div id="info">
|
||||
<h4>Info for event testing:</h4>
|
||||
|
||||
@@ -6,6 +6,10 @@ var deviceInfo = function() {
|
||||
document.getElementById("width").innerHTML = screen.width;
|
||||
document.getElementById("height").innerHTML = screen.height;
|
||||
document.getElementById("colorDepth").innerHTML = screen.colorDepth;
|
||||
var el = document.getElementById("cordova");
|
||||
if (el) {
|
||||
el.innerHTML = device.cordova;
|
||||
}
|
||||
};
|
||||
|
||||
var getLocation = function() {
|
||||
|
||||
@@ -18,8 +18,9 @@
|
||||
</div>
|
||||
<div id="info">
|
||||
Loading Page 2 should be successful.<br>
|
||||
Loading Page 3 should be in web browser.
|
||||
Loading Page 2 with target=_blank should be in web browser? (THIS DOESN'T HAPPEN.) https://issues.apache.org/jira/browse/CB-362
|
||||
Loading Page 3 should be in web browser.<br>
|
||||
Loading Page 2 with target=_blank should be in web browser? <br>
|
||||
(THIS DOESN'T HAPPEN.) https://issues.apache.org/jira/browse/CB-362
|
||||
</div>
|
||||
<a href="index2.html" class="btn large">Page 2</a>
|
||||
<a href="http://www.google.com" class="btn large">Page 3</a>
|
||||
|
||||
@@ -37,6 +37,7 @@
|
||||
</span>, Color Depth: <span id="colorDepth"></span></h4>
|
||||
</div>
|
||||
<div id="info">
|
||||
Press buttons below to test. You should see an alert with results displayed.
|
||||
</div>
|
||||
<a href="javascript:" class="btn large" onclick="XHR('file:///android_asset/www/xhr/index.html')">Load file://</a>
|
||||
<a href="javascript:" class="btn large" onclick="XHR('http://www.google.com');">Load Google</a>
|
||||
|
||||
85
test/build.xml
Executable file
85
test/build.xml
Executable file
@@ -0,0 +1,85 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project name="tests" default="help">
|
||||
|
||||
<!-- The local.properties file is created and updated by the 'android' tool.
|
||||
It contains the path to the SDK. It should *NOT* be checked into
|
||||
Version Control Systems. -->
|
||||
<property file="local.properties" />
|
||||
|
||||
<!-- The ant.properties file can be created by you. It is only edited by the
|
||||
'android' tool to add properties to it.
|
||||
This is the place to change some Ant specific build properties.
|
||||
Here are some properties you may want to change/update:
|
||||
|
||||
source.dir
|
||||
The name of the source directory. Default is 'src'.
|
||||
out.dir
|
||||
The name of the output directory. Default is 'bin'.
|
||||
|
||||
For other overridable properties, look at the beginning of the rules
|
||||
files in the SDK, at tools/ant/build.xml
|
||||
|
||||
Properties related to the SDK location or the project target should
|
||||
be updated using the 'android' tool with the 'update' action.
|
||||
|
||||
This file is an integral part of the build system for your
|
||||
application and should be checked into Version Control Systems.
|
||||
|
||||
-->
|
||||
<property file="ant.properties" />
|
||||
|
||||
<!-- The project.properties file is created and updated by the 'android'
|
||||
tool, as well as ADT.
|
||||
|
||||
This contains project specific properties such as project target, and library
|
||||
dependencies. Lower level build properties are stored in ant.properties
|
||||
(or in .classpath for Eclipse projects).
|
||||
|
||||
This file is an integral part of the build system for your
|
||||
application and should be checked into Version Control Systems. -->
|
||||
<loadproperties srcFile="project.properties" />
|
||||
|
||||
<!-- quick check on sdk.dir -->
|
||||
<fail
|
||||
message="sdk.dir is missing. Make sure to generate local.properties using 'android update project' or to inject it through an env var"
|
||||
unless="sdk.dir"
|
||||
/>
|
||||
|
||||
|
||||
<!-- extension targets. Uncomment the ones where you want to do custom work
|
||||
in between standard targets -->
|
||||
<!--
|
||||
<target name="-pre-build">
|
||||
</target>
|
||||
<target name="-pre-compile">
|
||||
</target>
|
||||
|
||||
/* This is typically used for code obfuscation.
|
||||
Compiled code location: ${out.classes.absolute.dir}
|
||||
If this is not done in place, override ${out.dex.input.absolute.dir} */
|
||||
<target name="-post-compile">
|
||||
</target>
|
||||
-->
|
||||
|
||||
<!-- Import the actual build file.
|
||||
|
||||
To customize existing targets, there are two options:
|
||||
- Customize only one target:
|
||||
- copy/paste the target into this file, *before* the
|
||||
<import> task.
|
||||
- customize it to your needs.
|
||||
- Customize the whole content of build.xml
|
||||
- copy/paste the content of the rules files (minus the top node)
|
||||
into this file, replacing the <import> task.
|
||||
- customize to your needs.
|
||||
|
||||
***********************
|
||||
****** IMPORTANT ******
|
||||
***********************
|
||||
In all cases you must update the value of version-tag below to read 'custom' instead of an integer,
|
||||
in order to avoid having your file be overridden by tools such as "android update project"
|
||||
-->
|
||||
<!-- version-tag: 1 -->
|
||||
<import file="${sdk.dir}/tools/ant/build.xml" />
|
||||
|
||||
</project>
|
||||
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.
@@ -9,7 +9,7 @@
|
||||
<plugin name="Camera" value="org.apache.cordova.CameraLauncher"/>
|
||||
<plugin name="Contacts" value="org.apache.cordova.ContactManager"/>
|
||||
<plugin name="File" value="org.apache.cordova.FileUtils"/>
|
||||
<plugin name="Network Status" value="org.apache.cordova.NetworkManager"/>
|
||||
<plugin name="NetworkStatus" value="org.apache.cordova.NetworkManager"/>
|
||||
<plugin name="Notification" value="org.apache.cordova.Notification"/>
|
||||
<plugin name="Storage" value="org.apache.cordova.Storage"/>
|
||||
<plugin name="Temperature" value="org.apache.cordova.TempListener"/>
|
||||
|
||||
@@ -1,3 +1,21 @@
|
||||
/*
|
||||
Licensed to the Apache Software Foundation (ASF) under one
|
||||
or more contributor license agreements. See the NOTICE file
|
||||
distributed with this work for additional information
|
||||
regarding copyright ownership. The ASF licenses this file
|
||||
to you under the Apache License, Version 2.0 (the
|
||||
"License"); you may not use this file except in compliance
|
||||
with the License. You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing,
|
||||
software distributed under the License is distributed on an
|
||||
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
KIND, either express or implied. See the License for the
|
||||
specific language governing permissions and limitations
|
||||
under the License.
|
||||
*/
|
||||
package org.apache.cordova.test;
|
||||
|
||||
import org.apache.cordova.api.LOG;
|
||||
|
||||
@@ -1,3 +1,21 @@
|
||||
/*
|
||||
Licensed to the Apache Software Foundation (ASF) under one
|
||||
or more contributor license agreements. See the NOTICE file
|
||||
distributed with this work for additional information
|
||||
regarding copyright ownership. The ASF licenses this file
|
||||
to you under the Apache License, Version 2.0 (the
|
||||
"License"); you may not use this file except in compliance
|
||||
with the License. You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing,
|
||||
software distributed under the License is distributed on an
|
||||
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
KIND, either express or implied. See the License for the
|
||||
specific language governing permissions and limitations
|
||||
under the License.
|
||||
*/
|
||||
package org.apache.cordova.test;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
@@ -1,3 +1,21 @@
|
||||
/*
|
||||
Licensed to the Apache Software Foundation (ASF) under one
|
||||
or more contributor license agreements. See the NOTICE file
|
||||
distributed with this work for additional information
|
||||
regarding copyright ownership. The ASF licenses this file
|
||||
to you under the Apache License, Version 2.0 (the
|
||||
"License"); you may not use this file except in compliance
|
||||
with the License. You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing,
|
||||
software distributed under the License is distributed on an
|
||||
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
KIND, either express or implied. See the License for the
|
||||
specific language governing permissions and limitations
|
||||
under the License.
|
||||
*/
|
||||
package org.apache.cordova.test;
|
||||
|
||||
import android.os.Bundle;
|
||||
|
||||
@@ -1,3 +1,21 @@
|
||||
/*
|
||||
Licensed to the Apache Software Foundation (ASF) under one
|
||||
or more contributor license agreements. See the NOTICE file
|
||||
distributed with this work for additional information
|
||||
regarding copyright ownership. The ASF licenses this file
|
||||
to you under the Apache License, Version 2.0 (the
|
||||
"License"); you may not use this file except in compliance
|
||||
with the License. You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing,
|
||||
software distributed under the License is distributed on an
|
||||
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
KIND, either express or implied. See the License for the
|
||||
specific language governing permissions and limitations
|
||||
under the License.
|
||||
*/
|
||||
package org.apache.cordova.test;
|
||||
|
||||
import android.os.Bundle;
|
||||
@@ -9,7 +27,7 @@ public class background extends DroidGap {
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
super.init(new FixWebView(this), new CordovaWebViewClient(this), new CordovaChromeClient(this));
|
||||
//super.init(new FixWebView(this), new CordovaWebViewClient(this), new CordovaChromeClient(this));
|
||||
super.setBooleanProperty("keepRunning", false);
|
||||
super.loadUrl("file:///android_asset/www/background/index.html");
|
||||
}
|
||||
|
||||
@@ -1,3 +1,21 @@
|
||||
/*
|
||||
Licensed to the Apache Software Foundation (ASF) under one
|
||||
or more contributor license agreements. See the NOTICE file
|
||||
distributed with this work for additional information
|
||||
regarding copyright ownership. The ASF licenses this file
|
||||
to you under the Apache License, Version 2.0 (the
|
||||
"License"); you may not use this file except in compliance
|
||||
with the License. You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing,
|
||||
software distributed under the License is distributed on an
|
||||
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
KIND, either express or implied. See the License for the
|
||||
specific language governing permissions and limitations
|
||||
under the License.
|
||||
*/
|
||||
package org.apache.cordova.test;
|
||||
|
||||
import android.os.Bundle;
|
||||
|
||||
@@ -1,3 +1,21 @@
|
||||
/*
|
||||
Licensed to the Apache Software Foundation (ASF) under one
|
||||
or more contributor license agreements. See the NOTICE file
|
||||
distributed with this work for additional information
|
||||
regarding copyright ownership. The ASF licenses this file
|
||||
to you under the Apache License, Version 2.0 (the
|
||||
"License"); you may not use this file except in compliance
|
||||
with the License. You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing,
|
||||
software distributed under the License is distributed on an
|
||||
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
KIND, either express or implied. See the License for the
|
||||
specific language governing permissions and limitations
|
||||
under the License.
|
||||
*/
|
||||
package org.apache.cordova.test;
|
||||
|
||||
import android.os.Bundle;
|
||||
|
||||
@@ -1,3 +1,21 @@
|
||||
/*
|
||||
Licensed to the Apache Software Foundation (ASF) under one
|
||||
or more contributor license agreements. See the NOTICE file
|
||||
distributed with this work for additional information
|
||||
regarding copyright ownership. The ASF licenses this file
|
||||
to you under the Apache License, Version 2.0 (the
|
||||
"License"); you may not use this file except in compliance
|
||||
with the License. You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing,
|
||||
software distributed under the License is distributed on an
|
||||
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
KIND, either express or implied. See the License for the
|
||||
specific language governing permissions and limitations
|
||||
under the License.
|
||||
*/
|
||||
package org.apache.cordova.test;
|
||||
|
||||
import android.os.Bundle;
|
||||
|
||||
@@ -1,3 +1,21 @@
|
||||
/*
|
||||
Licensed to the Apache Software Foundation (ASF) under one
|
||||
or more contributor license agreements. See the NOTICE file
|
||||
distributed with this work for additional information
|
||||
regarding copyright ownership. The ASF licenses this file
|
||||
to you under the Apache License, Version 2.0 (the
|
||||
"License"); you may not use this file except in compliance
|
||||
with the License. You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing,
|
||||
software distributed under the License is distributed on an
|
||||
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
KIND, either express or implied. See the License for the
|
||||
specific language governing permissions and limitations
|
||||
under the License.
|
||||
*/
|
||||
package org.apache.cordova.test;
|
||||
|
||||
import android.os.Bundle;
|
||||
|
||||
@@ -1,3 +1,21 @@
|
||||
/*
|
||||
Licensed to the Apache Software Foundation (ASF) under one
|
||||
or more contributor license agreements. See the NOTICE file
|
||||
distributed with this work for additional information
|
||||
regarding copyright ownership. The ASF licenses this file
|
||||
to you under the Apache License, Version 2.0 (the
|
||||
"License"); you may not use this file except in compliance
|
||||
with the License. You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing,
|
||||
software distributed under the License is distributed on an
|
||||
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
KIND, either express or implied. See the License for the
|
||||
specific language governing permissions and limitations
|
||||
under the License.
|
||||
*/
|
||||
package org.apache.cordova.test;
|
||||
|
||||
import android.os.Bundle;
|
||||
|
||||
@@ -1,3 +1,21 @@
|
||||
/*
|
||||
Licensed to the Apache Software Foundation (ASF) under one
|
||||
or more contributor license agreements. See the NOTICE file
|
||||
distributed with this work for additional information
|
||||
regarding copyright ownership. The ASF licenses this file
|
||||
to you under the Apache License, Version 2.0 (the
|
||||
"License"); you may not use this file except in compliance
|
||||
with the License. You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing,
|
||||
software distributed under the License is distributed on an
|
||||
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
KIND, either express or implied. See the License for the
|
||||
specific language governing permissions and limitations
|
||||
under the License.
|
||||
*/
|
||||
package org.apache.cordova.test;
|
||||
|
||||
import android.os.Bundle;
|
||||
|
||||
@@ -1,3 +1,21 @@
|
||||
/*
|
||||
Licensed to the Apache Software Foundation (ASF) under one
|
||||
or more contributor license agreements. See the NOTICE file
|
||||
distributed with this work for additional information
|
||||
regarding copyright ownership. The ASF licenses this file
|
||||
to you under the Apache License, Version 2.0 (the
|
||||
"License"); you may not use this file except in compliance
|
||||
with the License. You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing,
|
||||
software distributed under the License is distributed on an
|
||||
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
KIND, either express or implied. See the License for the
|
||||
specific language governing permissions and limitations
|
||||
under the License.
|
||||
*/
|
||||
package org.apache.cordova.test;
|
||||
|
||||
import android.os.Bundle;
|
||||
|
||||
@@ -1,3 +1,21 @@
|
||||
/*
|
||||
Licensed to the Apache Software Foundation (ASF) under one
|
||||
or more contributor license agreements. See the NOTICE file
|
||||
distributed with this work for additional information
|
||||
regarding copyright ownership. The ASF licenses this file
|
||||
to you under the Apache License, Version 2.0 (the
|
||||
"License"); you may not use this file except in compliance
|
||||
with the License. You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing,
|
||||
software distributed under the License is distributed on an
|
||||
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
KIND, either express or implied. See the License for the
|
||||
specific language governing permissions and limitations
|
||||
under the License.
|
||||
*/
|
||||
package org.apache.cordova.test;
|
||||
|
||||
import android.os.Bundle;
|
||||
|
||||
@@ -1,3 +1,21 @@
|
||||
/*
|
||||
Licensed to the Apache Software Foundation (ASF) under one
|
||||
or more contributor license agreements. See the NOTICE file
|
||||
distributed with this work for additional information
|
||||
regarding copyright ownership. The ASF licenses this file
|
||||
to you under the Apache License, Version 2.0 (the
|
||||
"License"); you may not use this file except in compliance
|
||||
with the License. You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing,
|
||||
software distributed under the License is distributed on an
|
||||
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
KIND, either express or implied. See the License for the
|
||||
specific language governing permissions and limitations
|
||||
under the License.
|
||||
*/
|
||||
package org.apache.cordova.test;
|
||||
|
||||
import android.os.Bundle;
|
||||
|
||||
@@ -1,3 +1,21 @@
|
||||
/*
|
||||
Licensed to the Apache Software Foundation (ASF) under one
|
||||
or more contributor license agreements. See the NOTICE file
|
||||
distributed with this work for additional information
|
||||
regarding copyright ownership. The ASF licenses this file
|
||||
to you under the Apache License, Version 2.0 (the
|
||||
"License"); you may not use this file except in compliance
|
||||
with the License. You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing,
|
||||
software distributed under the License is distributed on an
|
||||
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
KIND, either express or implied. See the License for the
|
||||
specific language governing permissions and limitations
|
||||
under the License.
|
||||
*/
|
||||
package org.apache.cordova.test;
|
||||
|
||||
import android.os.Bundle;
|
||||
|
||||
@@ -1,3 +1,21 @@
|
||||
/*
|
||||
Licensed to the Apache Software Foundation (ASF) under one
|
||||
or more contributor license agreements. See the NOTICE file
|
||||
distributed with this work for additional information
|
||||
regarding copyright ownership. The ASF licenses this file
|
||||
to you under the Apache License, Version 2.0 (the
|
||||
"License"); you may not use this file except in compliance
|
||||
with the License. You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing,
|
||||
software distributed under the License is distributed on an
|
||||
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
KIND, either express or implied. See the License for the
|
||||
specific language governing permissions and limitations
|
||||
under the License.
|
||||
*/
|
||||
package org.apache.cordova.test;
|
||||
|
||||
import android.os.Bundle;
|
||||
|
||||
@@ -1,12 +1,51 @@
|
||||
/*
|
||||
Licensed to the Apache Software Foundation (ASF) under one
|
||||
or more contributor license agreements. See the NOTICE file
|
||||
distributed with this work for additional information
|
||||
regarding copyright ownership. The ASF licenses this file
|
||||
to you under the Apache License, Version 2.0 (the
|
||||
"License"); you may not use this file except in compliance
|
||||
with the License. You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing,
|
||||
software distributed under the License is distributed on an
|
||||
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
KIND, either express or implied. See the License for the
|
||||
specific language governing permissions and limitations
|
||||
under the License.
|
||||
*/
|
||||
package org.apache.cordova.test;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.webkit.WebView;
|
||||
|
||||
import org.apache.cordova.*;
|
||||
import org.apache.cordova.api.LOG;
|
||||
|
||||
public class whitelist extends DroidGap {
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
super.init(new WebView(this), new TestViewClient(this), new CordovaChromeClient(this));
|
||||
super.loadUrl("file:///android_asset/www/whitelist/index.html");
|
||||
}
|
||||
|
||||
/**
|
||||
* This class can be used to override the GapViewClient and receive notification of webview events.
|
||||
*/
|
||||
public class TestViewClient extends CordovaWebViewClient {
|
||||
|
||||
public TestViewClient(DroidGap arg0) {
|
||||
super(arg0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldOverrideUrlLoading(WebView view, String url) {
|
||||
LOG.d("whitelist", "shouldOverrideUrlLoading(" + url + ")");
|
||||
LOG.d("whitelist", "originalUrl=" + view.getOriginalUrl());
|
||||
return super.shouldOverrideUrlLoading(view, url);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,21 @@
|
||||
/*
|
||||
Licensed to the Apache Software Foundation (ASF) under one
|
||||
or more contributor license agreements. See the NOTICE file
|
||||
distributed with this work for additional information
|
||||
regarding copyright ownership. The ASF licenses this file
|
||||
to you under the Apache License, Version 2.0 (the
|
||||
"License"); you may not use this file except in compliance
|
||||
with the License. You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing,
|
||||
software distributed under the License is distributed on an
|
||||
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
KIND, either express or implied. See the License for the
|
||||
specific language governing permissions and limitations
|
||||
under the License.
|
||||
*/
|
||||
package org.apache.cordova.test;
|
||||
|
||||
import android.os.Bundle;
|
||||
|
||||
Reference in New Issue
Block a user