Skip to content

Commit

Permalink
updated version to 2.6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
stevengill committed Apr 9, 2013
1 parent 69a49e4 commit 67d94ca
Show file tree
Hide file tree
Showing 26 changed files with 225 additions and 269 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.5.0
2.6.0
2 changes: 1 addition & 1 deletion lib/cordova-android/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.6.0rc1
2.6.0
Binary file modified lib/cordova-android/bin/templates/cordova/appinfo.jar
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta charset="utf-8" />
<meta name="format-detection" content="telephone=no" />
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height, target-densitydpi=device-dpi" />
<link rel="stylesheet" type="text/css" href="css/index.css" />
Expand All @@ -33,7 +33,7 @@ <h1>Apache Cordova</h1>
<p class="event received">Device is Ready</p>
</div>
</div>
<script type="text/javascript" src="cordova-2.6.0rc1.js"></script>
<script type="text/javascript" src="cordova-2.6.0.js"></script>
<script type="text/javascript" src="js/index.js"></script>
<script type="text/javascript">
app.initialize();
Expand Down
45 changes: 25 additions & 20 deletions lib/cordova-android/framework/assets/js/cordova.android.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// Platform: android

// commit 47593b2bc1dba9bf46545b1da24577f937966e12
// commit 125dca530923a44a8f44f68f5e1970cbdd4e7faf

// File generated at :: Thu Mar 21 2013 10:49:00 GMT-0700 (PDT)
// File generated at :: Mon Apr 01 2013 13:28:03 GMT-0700 (PDT)

/*
Licensed to the Apache Software Foundation (ASF) under one
Expand Down Expand Up @@ -6753,29 +6753,34 @@ window.cordova = require('cordova');
}

// Try to XHR the cordova_plugins.json file asynchronously.
var xhr = new context.XMLHttpRequest();
xhr.onreadystatechange = function() {
if (this.readyState != 4) { // not DONE
return;
}
try { // we commented we were going to try, so let us actually try and catch
var xhr = new context.XMLHttpRequest();
xhr.onreadystatechange = function() {
if (this.readyState != 4) { // not DONE
return;
}

// If the response is a JSON string which composes an array, call handlePluginsObject.
// If the request fails, or the response is not a JSON array, just call finishPluginLoading.
if (this.status == 200) {
var obj = JSON.parse(this.responseText);
if (obj && obj instanceof Array && obj.length > 0) {
handlePluginsObject(obj);
// If the response is a JSON string which composes an array, call handlePluginsObject.
// If the request fails, or the response is not a JSON array, just call finishPluginLoading.
if (this.status == 200) {
var obj = JSON.parse(this.responseText);
if (obj && obj instanceof Array && obj.length > 0) {
handlePluginsObject(obj);
} else {
finishPluginLoading();
}
} else {
finishPluginLoading();
}
} else {
finishPluginLoading();
}
};
xhr.open('GET', 'cordova_plugins.json', true); // Async
xhr.send();
};
xhr.open('GET', 'cordova_plugins.json', true); // Async
xhr.send();
}
catch(err) {
finishPluginLoading();
}
}(window));



})();
})();
2 changes: 1 addition & 1 deletion lib/cordova-android/framework/assets/www/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<html>
<head>
<title></title>
<script src="cordova-2.6.0rc1.js"></script>
<script src="cordova-2.6.0.js"></script>
</head>
<body>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -312,10 +312,12 @@ public void onActivityResult(int requestCode, int resultCode, Intent intent) {

// If sending filename back
else if (destType == FILE_URI || destType == NATIVE_URI) {
if (!this.saveToPhotoAlbum) {
uri = Uri.fromFile(new File(DirectoryManager.getTempDirectoryPath(this.cordova.getActivity()), System.currentTimeMillis() + ".jpg"));
if (this.saveToPhotoAlbum) {
Uri inputUri = getUriFromMediaStore();
//Just because we have a media URI doesn't mean we have a real file, we need to make it
uri = Uri.fromFile(new File(FileHelper.getRealPath(inputUri, this.cordova)));
} else {
uri = getUriFromMediaStore();
uri = Uri.fromFile(new File(DirectoryManager.getTempDirectoryPath(this.cordova.getActivity()), System.currentTimeMillis() + ".jpg"));
}

if (uri == null) {
Expand Down Expand Up @@ -444,7 +446,7 @@ else if (destType == FILE_URI || destType == NATIVE_URI) {
ExifHelper exif = new ExifHelper();
try {
if (this.encodingType == JPEG) {
exif.createInFile(resizePath);
exif.createInFile(FileHelper.getRealPath(uri, this.cordova));
exif.readExifData();
rotate = exif.getOrientation();
}
Expand All @@ -458,7 +460,7 @@ else if (destType == FILE_URI || destType == NATIVE_URI) {

// Restore exif data to file
if (this.encodingType == JPEG) {
exif.createOutFile(FileHelper.getRealPath(uri, this.cordova));
exif.createOutFile(resizePath);
exif.writeExifData();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Licensed to the Apache Software Foundation (ASF) under one
public class Device extends CordovaPlugin {
public static final String TAG = "Device";

public static String cordovaVersion = "2.6.0rc1"; // Cordova version
public static String cordovaVersion = "2.6.0"; // Cordova version
public static String platform = "Android"; // Device OS
public static String uuid; // Device UUID

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,21 @@ else if (action.equals("close")) {
pluginResult.setKeepCallback(false);
this.callbackContext.sendPluginResult(pluginResult);
}
else if (action.equals("injectScriptCode")) {
String source = args.getString(0);

org.json.JSONArray jsonEsc = new org.json.JSONArray();
jsonEsc.put(source);
String jsonRepr = jsonEsc.toString();
String jsonSourceString = jsonRepr.substring(1, jsonRepr.length()-1);
String scriptEnclosure = "(function(d){var c=d.createElement('script');c.type='text/javascript';c.innerText="
+ jsonSourceString
+ ";d.getElementsByTagName('head')[0].appendChild(c);})(document)";
this.inAppWebView.loadUrl("javascript:" + scriptEnclosure);

PluginResult pluginResult = new PluginResult(PluginResult.Status.OK);
this.callbackContext.sendPluginResult(pluginResult);
}
else {
status = PluginResult.Status.INVALID_ACTION;
}
Expand Down Expand Up @@ -445,7 +460,7 @@ public void onClick(View v) {

//Toggle whether this is enabled or not!
Bundle appSettings = cordova.getActivity().getIntent().getExtras();
boolean enableDatabase = appSettings.getBoolean("InAppBrowserStorageEnabled", true);
boolean enableDatabase = appSettings == null ? true : appSettings.getBoolean("InAppBrowserStorageEnabled", true);
if(enableDatabase)
{
String databasePath = cordova.getActivity().getApplicationContext().getDir("inAppBrowserDB", Context.MODE_PRIVATE).getPath();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ Licensed to the Apache Software Foundation (ASF) under one
import android.content.Intent;
import android.content.res.XmlResourceParser;

import android.util.Log;
import android.webkit.WebResourceResponse;

/**
Expand Down Expand Up @@ -213,6 +214,7 @@ public void startupPlugins() {
public boolean exec(String service, String action, String callbackId, String rawArgs) {
CordovaPlugin plugin = this.getPlugin(service);
if (plugin == null) {
Log.d(TAG, "exec() call to unknown plugin: " + service);
PluginResult cr = new PluginResult(PluginResult.Status.CLASS_NOT_FOUND_EXCEPTION);
app.sendPluginResult(cr, callbackId);
return true;
Expand Down
37 changes: 0 additions & 37 deletions lib/cordova-android/test/res/xml/cordova.xml

This file was deleted.

39 changes: 0 additions & 39 deletions lib/cordova-android/test/res/xml/plugins.xml

This file was deleted.

2 changes: 1 addition & 1 deletion lib/cordova-blackberry/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.5.0
2.6.0
2 changes: 1 addition & 1 deletion lib/cordova-blackberry/bin/templates/project/www/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.5.0
2.6.0
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ <h1>Apache Cordova</h1>
<p class="event received">Device is Ready</p>
</div>
</div>
<script type="text/javascript" src="cordova-2.5.0.js"></script>
<script type="text/javascript" src="cordova-2.6.0.js"></script>
<script type="text/javascript" src="js/index.js"></script>
<script type="text/javascript">
app.initialize();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public PluginResult execute(String action, JSONArray args, String callbackId) {
JSONObject device = new JSONObject();
device.put( FIELD_PLATFORM, "BlackBerry");
device.put( FIELD_UUID, new Integer( DeviceInfo.getDeviceId()) );
device.put( FIELD_CORDOVA, "2.5.0" );
device.put( FIELD_CORDOVA, "2.6.0" );
device.put( FIELD_MODEL, new String(DeviceInfo.getDeviceName()) );
device.put( FIELD_NAME, new String(DeviceInfo.getDeviceName()) );
device.put( FIELD_VERSION, new String(DeviceInfo.getSoftwareVersion()) );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ public class FileManager extends Plugin {
* @return A PluginResult object with a status and message.
*/
public PluginResult execute(String action, JSONArray args, String callbackId) {

// perform specified action
if (ACTION_READ_AS_TEXT.equals(action)) {
// get file path
Expand Down Expand Up @@ -547,11 +546,11 @@ protected static PluginResult requestFileSystem(int type, long size) {
protected static PluginResult resolveFileSystemURI(String uri) {
PluginResult result = null;
Entry entry = null;

try {
entry = getEntryFromURI(uri);
}
catch (IllegalArgumentException e) {
Logger.log(e.toString());
return new PluginResult(
PluginResult.Status.JSON_EXCEPTION,
ENCODING_ERR);
Expand All @@ -565,6 +564,7 @@ protected static PluginResult resolveFileSystemURI(String uri) {
result = new PluginResult(PluginResult.Status.OK,
entry.toJSONObject());
}

return result;
}

Expand Down Expand Up @@ -889,6 +889,13 @@ protected static Entry getEntryFromURI(String filePath)
throw new IllegalArgumentException("Invalid URI.");
}

//check for query string
int queryIndex = filePath.indexOf('?');
if (queryIndex > 0) {
path = filePath.substring(0, queryIndex); // discard the query string
Logger.log(FileManager.class.getName() + ": found query string when resolving URI = " + filePath.substring(queryIndex));
}

// create a file system entry
Entry entry = null;
if (path.startsWith(FileUtils.LOCAL_PROTOCOL)) {
Expand Down
Loading

0 comments on commit 67d94ca

Please sign in to comment.