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 Wed, 27 Mar 2013 20:40:17 GMT
Updated Branches:
  refs/heads/2.6.x e17a27bc5 -> c00970f02


[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/c00970f0
Tree: http://git-wip-us.apache.org/repos/asf/cordova-mobile-spec/tree/c00970f0
Diff: http://git-wip-us.apache.org/repos/asf/cordova-mobile-spec/diff/c00970f0

Branch: refs/heads/2.6.x
Commit: c00970f023917dd47cf31dd2aac3fba62023e748
Parents: e17a27b
Author: timkim <timkim@apche.org>
Authored: Thu Mar 21 16:06:50 2013 -0700
Committer: timkim <timkim@apche.org>
Committed: Wed Mar 27 13:39: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/c00970f0/cordova.js
----------------------------------------------------------------------
diff --git a/cordova.js b/cordova.js
index 3d00979..c8017d6 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