You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ripple.apache.org by gt...@apache.org on 2013/03/11 16:11:06 UTC
[8/50] [abbrv] git commit: use Blob instead of deprecated BlobBuilder,
fix a bug with cordova File.write
use Blob instead of deprecated BlobBuilder, fix a bug with cordova File.write
Project: http://git-wip-us.apache.org/repos/asf/incubator-ripple/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ripple/commit/b4d69e41
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ripple/tree/b4d69e41
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ripple/diff/b4d69e41
Branch: refs/heads/master
Commit: b4d69e41960fa84698ab912ae19d6f2577f02098
Parents: bfb59e1
Author: Maxime Biais <ma...@gmail.com>
Authored: Wed Jan 23 10:43:14 2013 +0100
Committer: Maxime Biais <ma...@gmail.com>
Committed: Wed Jan 23 10:43:14 2013 +0100
----------------------------------------------------------------------
lib/client/platform/cordova/2.0.0/bridge/file.js | 7 +++----
1 files changed, 3 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ripple/blob/b4d69e41/lib/client/platform/cordova/2.0.0/bridge/file.js
----------------------------------------------------------------------
diff --git a/lib/client/platform/cordova/2.0.0/bridge/file.js b/lib/client/platform/cordova/2.0.0/bridge/file.js
index bd23d97..51cc872 100644
--- a/lib/client/platform/cordova/2.0.0/bridge/file.js
+++ b/lib/client/platform/cordova/2.0.0/bridge/file.js
@@ -240,15 +240,14 @@ module.exports = {
text = args[1],
position = args[2],
sourcepath,
- BB = window.BlobBuilder || window.WebKitBlobBuilder,
- bb = new BB();
+ blob;
// Format source path
sourcepath = ((file.fullPath ? file.fullPath : '') + file.name);
sourcepath = cleanPath(sourcepath);
// Create a blob for the text to be written
- bb.append(text);
+ blob = new Blob([text]);
// Get the FileEntry, create if necessary
fs.root.getFile(sourcepath, {create: true}, function (entry) {
@@ -264,7 +263,7 @@ module.exports = {
if (position && position > 0) {
writer.seek(position);
}
- writer.write(bb.getBlob('text/plain'));
+ writer.write(blob);
}, function (err) {
if (fail) fail(err.code);
});