Return-Path: X-Original-To: apmail-incubator-callback-commits-archive@minotaur.apache.org Delivered-To: apmail-incubator-callback-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id CE3BC90B2 for ; Wed, 29 Feb 2012 04:33:12 +0000 (UTC) Received: (qmail 68796 invoked by uid 500); 29 Feb 2012 04:33:12 -0000 Delivered-To: apmail-incubator-callback-commits-archive@incubator.apache.org Received: (qmail 68699 invoked by uid 500); 29 Feb 2012 04:33:10 -0000 Mailing-List: contact callback-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: callback-dev@incubator.apache.org Delivered-To: mailing list callback-commits@incubator.apache.org Received: (qmail 68654 invoked by uid 99); 29 Feb 2012 04:33:09 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 29 Feb 2012 04:33:09 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.114] (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 29 Feb 2012 04:33:06 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 153154CDEF; Wed, 29 Feb 2012 04:32:45 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: bcurtis@apache.org To: callback-commits@incubator.apache.org X-Mailer: ASF-Git Admin Mailer Subject: [1/2] android commit: Updating cordova.android.js with File API fixes. Message-Id: <20120229043246.153154CDEF@tyr.zones.apache.org> Date: Wed, 29 Feb 2012 04:32:45 +0000 (UTC) X-Virus-Checked: Checked by ClamAV on apache.org Updated Branches: refs/heads/master d59344818 -> 3ebc1d71d Updating cordova.android.js with File API fixes. Project: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/commit/3ebc1d71 Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/tree/3ebc1d71 Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/diff/3ebc1d71 Branch: refs/heads/master Commit: 3ebc1d71df9fd42268c9b76a87dbc86ce1e38d52 Parents: f6503f8 Author: Bryce Curtis Authored: Tue Feb 28 22:32:30 2012 -0600 Committer: Bryce Curtis Committed: Tue Feb 28 22:32:30 2012 -0600 ---------------------------------------------------------------------- framework/assets/js/cordova.android.js | 27 ++++++++++++++++++++------- 1 files changed, 20 insertions(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/blob/3ebc1d71/framework/assets/js/cordova.android.js ---------------------------------------------------------------------- diff --git a/framework/assets/js/cordova.android.js b/framework/assets/js/cordova.android.js index 2a805b6..89ffd34 100755 --- a/framework/assets/js/cordova.android.js +++ b/framework/assets/js/cordova.android.js @@ -2264,7 +2264,10 @@ DirectoryEntry.prototype.getDirectory = function(path, options, successCallback, * @param {Function} errorCallback is called with a FileError */ DirectoryEntry.prototype.removeRecursively = function(successCallback, errorCallback) { - exec(successCallback, errorCallback, "File", "removeRecursively", [this.fullPath]); + var fail = function(code) { + errorCallback(new FileError(code)); + }; + exec(successCallback, fail, "File", "removeRecursively", [this.fullPath]); }; /** @@ -2326,7 +2329,10 @@ DirectoryReader.prototype.readEntries = function(successCallback, errorCallback) } successCallback(retVal); }; - exec(win, errorCallback, "File", "readEntries", [this.path]); + var fail = function(code) { + errorCallback(new FileError(code)); + }; + exec(win, fail, "File", "readEntries", [this.path]); }; module.exports = DirectoryReader; @@ -2373,8 +2379,10 @@ Entry.prototype.getMetadata = function(successCallback, errorCallback) { var metadata = new Metadata(lastModified); successCallback(metadata); }; - - exec(success, errorCallback, "File", "getMetadata", [this.fullPath]); + var fail = function(code) { + errorCallback(new FileError(code)); + }; + exec(success, fail, "File", "getMetadata", [this.fullPath]); }; /** @@ -2520,7 +2528,10 @@ Entry.prototype.remove = function(successCallback, errorCallback) { * @param errorCallback {Function} called with a FileError */ Entry.prototype.getParent = function(successCallback, errorCallback) { - exec(successCallback, errorCallback, "File", "getParent", [this.fullPath]); + var fail = function(code) { + errorCallback(new FileError(code)); + }; + exec(successCallback, fail, "File", "getParent", [this.fullPath]); }; module.exports = Entry; @@ -3740,7 +3751,6 @@ var NetworkConnection = function () { if (info === "none") { // set a timer if still offline at the end of timer send the offline event me._timer = setTimeout(function(){ - me.type = type; cordova.fireWindowEvent("offline"); me._timer = null; }, me.timeout); @@ -3957,7 +3967,10 @@ var requestFileSystem = function(type, size, successCallback, errorCallback) { errorCallback(new FileError(FileError.NOT_FOUND_ERR)); } }; - exec(success, errorCallback, "File", "requestFileSystem", [type, size]); + var fail = function(e) { + errorCallback(new FileError(e)); + }; + exec(success, fail, "File", "requestFileSystem", [type, size]); } };