You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by lo...@apache.org on 2013/05/07 17:14:22 UTC
[35/50] [abbrv] webworks commit: Updating cordova.blackberry10.js
Updating cordova.blackberry10.js
Project: http://git-wip-us.apache.org/repos/asf/cordova-blackberry/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-blackberry/commit/5c848dfe
Tree: http://git-wip-us.apache.org/repos/asf/cordova-blackberry/tree/5c848dfe
Diff: http://git-wip-us.apache.org/repos/asf/cordova-blackberry/diff/5c848dfe
Branch: refs/heads/future
Commit: 5c848dfeab1e47583ae2b0f73d1306c52d3a76c6
Parents: 7093c3e
Author: Bryan Higgins <bh...@blackberry.com>
Authored: Fri Apr 19 11:07:14 2013 -0400
Committer: Bryan Higgins <bh...@blackberry.com>
Committed: Fri May 3 10:13:31 2013 -0400
----------------------------------------------------------------------
blackberry10/javascript/cordova.blackberry10.js | 44 +++++++----------
1 files changed, 18 insertions(+), 26 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-blackberry/blob/5c848dfe/blackberry10/javascript/cordova.blackberry10.js
----------------------------------------------------------------------
diff --git a/blackberry10/javascript/cordova.blackberry10.js b/blackberry10/javascript/cordova.blackberry10.js
index b94f2c9..286891b 100644
--- a/blackberry10/javascript/cordova.blackberry10.js
+++ b/blackberry10/javascript/cordova.blackberry10.js
@@ -1,8 +1,8 @@
// Platform: blackberry10
-// commit 57999a27c82207cdb0c73f6395d14d18fb1b4170
+// commit dd02e6c9cd4121910c714e798f84fad2dc072879
-// File generated at :: Wed Apr 17 2013 11:51:51 GMT-0400 (EDT)
+// File generated at :: Fri Apr 19 2013 11:54:58 GMT-0400 (EDT)
/*
Licensed to the Apache Software Foundation (ASF) under one
@@ -1964,40 +1964,32 @@ FileReader.prototype.abort = function() {
return this.nativeReader.abort();
};
+function read(method, context, file, encoding) {
+ if (file.fullPath) {
+ fileUtils.getEntryForURI(file.fullPath, function (entry) {
+ entry.nativeEntry.file(function (nativeFile) {
+ context.nativeReader[method].call(context.nativeReader, nativeFile, encoding);
+ }, context.onerror);
+ }, context.onerror);
+ } else {
+ context.nativeReader[method](file, encoding);
+ }
+}
+
FileReader.prototype.readAsText = function(file, encoding) {
- var that = this;
- fileUtils.getEntryForURI(file.fullPath, function (entry) {
- entry.nativeEntry.file(function (nativeFile) {
- that.nativeReader.readAsText(nativeFile, encoding);
- }, that.onerror);
- }, that.onerror);
+ read("readAsText", this, file, encoding);
};
FileReader.prototype.readAsDataURL = function(file) {
- var that = this;
- fileUtils.getEntryForURI(file.fullPath, function (entry) {
- entry.nativeEntry.file(function (nativeFile) {
- that.nativeReader.readAsDataURL(nativeFile);
- }, that.onerror);
- }, that.onerror);
+ read("readAsDataURL", this, file);
};
FileReader.prototype.readAsBinaryString = function(file) {
- var that = this;
- fileUtils.getEntryForURI(file.fullPath, function (entry) {
- entry.nativeEntry.file(function (nativeFile) {
- that.nativeReader.readAsBinaryString(nativeFile);
- }, that.onerror);
- }, that.onerror);
+ read("readAsBinaryString", this, file);
};
FileReader.prototype.readAsArrayBuffer = function(file) {
- var that = this;
- fileUtils.getEntryForURI(file.fullPath, function (entry) {
- entry.nativeEntry.file(function (nativeFile) {
- that.nativeReader.readAsArrayBuffer(nativeFile);
- }, that.onerror);
- }, that.onerror);
+ read("readAsArrayBuffer", this, file);
};
window.FileReader = FileReader;