Return-Path: X-Original-To: apmail-cordova-commits-archive@www.apache.org Delivered-To: apmail-cordova-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 65164F0E0 for ; Thu, 21 Mar 2013 23:11:15 +0000 (UTC) Received: (qmail 79329 invoked by uid 500); 21 Mar 2013 23:11:15 -0000 Delivered-To: apmail-cordova-commits-archive@cordova.apache.org Received: (qmail 79307 invoked by uid 500); 21 Mar 2013 23:11:15 -0000 Mailing-List: contact commits-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: callback-dev@cordova.apache.org Delivered-To: mailing list commits@cordova.apache.org Received: (qmail 79298 invoked by uid 99); 21 Mar 2013 23:11:15 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 21 Mar 2013 23:11:15 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 0E96F52A6F; Thu, 21 Mar 2013 23:11:15 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: timkim@apache.org To: commits@cordova.apache.org Message-Id: <276dc79812c5482cb9ffc41df447e8cb@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: spec commit: [CB-2600] - fix for old blackberry Date: Thu, 21 Mar 2013 23:11:15 +0000 (UTC) Updated Branches: refs/heads/cb-2600-fix [created] 429a447f2 [CB-2600] - fix for old blackberry Project: http://git-wip-us.apache.org/repos/asf/cordova-mobile-spec/repo Commit: http://git-wip-us.apache.org/repos/asf/cordova-mobile-spec/commit/429a447f Tree: http://git-wip-us.apache.org/repos/asf/cordova-mobile-spec/tree/429a447f Diff: http://git-wip-us.apache.org/repos/asf/cordova-mobile-spec/diff/429a447f Branch: refs/heads/cb-2600-fix Commit: 429a447f215af9ff79369b8a734d53d651720df9 Parents: 64e9bba Author: timkim Authored: Thu Mar 21 16:06:50 2013 -0700 Committer: timkim Committed: Thu Mar 21 16:06:50 2013 -0700 ---------------------------------------------------------------------- cordova.js | 11 +++++++++-- 1 files changed, 9 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cordova-mobile-spec/blob/429a447f/cordova.js ---------------------------------------------------------------------- diff --git a/cordova.js b/cordova.js index 86e06ce..875b20c 100644 --- a/cordova.js +++ b/cordova.js @@ -41,13 +41,20 @@ if (PLAT) { var xhr = new XMLHttpRequest(); xhr.open("GET", platformCordovaPath, false); xhr.onreadystatechange = function() { + if (this.readyState == this.DONE && this.responseText.length > 0) { - cordovaPath = platformCordovaPath; + if(parseInt(this.status) >= 400){ + cordovaPath = versionCordovaPath; + }else{ + cordovaPath = platformCordovaPath; + } } }; xhr.send(null); } - catch(e){} // access denied! + catch(e){ + cordovaPath = versionCordovaPath; + } // access denied! } if (!window._doNotWriteCordovaScript) {