cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tim...@apache.org
Subject spec commit: [CB-2600] - fix for old blackberry
Date Thu, 21 Mar 2013 23:11:15 GMT
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 <timkim@apche.org>
Authored: Thu Mar 21 16:06:50 2013 -0700
Committer: timkim <timkim@apche.org>
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) {


Mime
View raw message