mirror of
https://github.com/apache/cordova-android.git
synced 2025-02-20 23:56:20 +08:00
Merge branch 'master' of github.com:phonegap/phonegap-android
This commit is contained in:
commit
0dc64d2aa7
@ -162,13 +162,26 @@ FileReader.DONE = 2;
|
||||
FileReader.prototype.abort = function() {
|
||||
this.readyState = FileReader.DONE;
|
||||
|
||||
// set error
|
||||
var error = new FileError();
|
||||
error.code = error.ABORT_ERR;
|
||||
this.error = error;
|
||||
|
||||
// If error callback
|
||||
if (typeof this.onerror == "function") {
|
||||
var evt = File._createEvent("error", this);
|
||||
this.onerror(evt);
|
||||
}
|
||||
// If abort callback
|
||||
if (typeof this.onabort == "function") {
|
||||
var evt = File._createEvent("abort", this);
|
||||
this.onabort(evt);
|
||||
}
|
||||
|
||||
// TODO: Anything else to do? Maybe sent to native?
|
||||
// If load end callback
|
||||
if (typeof this.onloadend == "function") {
|
||||
var evt = File._createEvent("loadend", this);
|
||||
this.onloadend(evt);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
@ -208,15 +221,15 @@ FileReader.prototype.readAsText = function(file, encoding) {
|
||||
// Save result
|
||||
me.result = r;
|
||||
|
||||
// DONE state
|
||||
me.readyState = FileReader.DONE;
|
||||
|
||||
// If onload callback
|
||||
if (typeof me.onload == "function") {
|
||||
var evt = File._createEvent("load", me);
|
||||
me.onload(evt);
|
||||
}
|
||||
|
||||
// DONE state
|
||||
me.readyState = FileReader.DONE;
|
||||
|
||||
// If onloadend callback
|
||||
if (typeof me.onloadend == "function") {
|
||||
var evt = File._createEvent("loadend", me);
|
||||
@ -235,15 +248,15 @@ FileReader.prototype.readAsText = function(file, encoding) {
|
||||
// Save error
|
||||
me.error = e;
|
||||
|
||||
// DONE state
|
||||
me.readyState = FileReader.DONE;
|
||||
|
||||
// If onerror callback
|
||||
if (typeof me.onerror == "function") {
|
||||
var evt = File._createEvent("error", me);
|
||||
me.onerror(evt);
|
||||
}
|
||||
|
||||
// DONE state
|
||||
me.readyState = FileReader.DONE;
|
||||
|
||||
// If onloadend callback
|
||||
if (typeof me.onloadend == "function") {
|
||||
var evt = File._createEvent("loadend", me);
|
||||
@ -289,15 +302,15 @@ FileReader.prototype.readAsDataURL = function(file) {
|
||||
// Save result
|
||||
me.result = r;
|
||||
|
||||
// DONE state
|
||||
me.readyState = FileReader.DONE;
|
||||
|
||||
// If onload callback
|
||||
if (typeof me.onload == "function") {
|
||||
var evt = File._createEvent("load", me);
|
||||
me.onload(evt);
|
||||
}
|
||||
|
||||
// DONE state
|
||||
me.readyState = FileReader.DONE;
|
||||
|
||||
// If onloadend callback
|
||||
if (typeof me.onloadend == "function") {
|
||||
var evt = File._createEvent("loadend", me);
|
||||
@ -316,15 +329,15 @@ FileReader.prototype.readAsDataURL = function(file) {
|
||||
// Save error
|
||||
me.error = e;
|
||||
|
||||
// DONE state
|
||||
me.readyState = FileReader.DONE;
|
||||
|
||||
// If onerror callback
|
||||
if (typeof me.onerror == "function") {
|
||||
var evt = File._createEvent("error", me);
|
||||
me.onerror(evt);
|
||||
}
|
||||
|
||||
// DONE state
|
||||
me.readyState = FileReader.DONE;
|
||||
|
||||
// If onloadend callback
|
||||
if (typeof me.onloadend == "function") {
|
||||
var evt = File._createEvent("loadend", me);
|
||||
|
@ -175,6 +175,7 @@ public class FileUtils extends Plugin {
|
||||
String line;
|
||||
while ((line = reader.readLine()) != null) {
|
||||
data.append(line);
|
||||
data.append('\n');
|
||||
}
|
||||
return data.toString();
|
||||
}
|
||||
|
@ -22,7 +22,7 @@ public class PluginResult {
|
||||
|
||||
public PluginResult(Status status, String message) {
|
||||
this.status = status.ordinal();
|
||||
this.message = "'" + message + "'";
|
||||
this.message = JSONObject.quote(message);
|
||||
}
|
||||
|
||||
public PluginResult(Status status, JSONArray message) {
|
||||
|
Loading…
Reference in New Issue
Block a user