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:04 UTC

[42/50] [abbrv] git commit: Handle cordova.js for 2.5+

Handle cordova.js for 2.5+

Fixes: #731

The way modules load has changed for 2.5. This fixes that.

HACKS: We should really think of starting to use platform
versioning for cordova as our init script is starting to look a little
ugly.


Project: http://git-wip-us.apache.org/repos/asf/incubator-ripple/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ripple/commit/66be7543
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ripple/tree/66be7543
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ripple/diff/66be7543

Branch: refs/heads/master
Commit: 66be754319fa582c82db1332a1f2f2135eb7a397
Parents: f9d89b4
Author: Gord Tanner <gt...@gmail.com>
Authored: Tue Feb 26 17:53:42 2013 -0800
Committer: Gord Tanner <gt...@gmail.com>
Committed: Tue Feb 26 17:53:42 2013 -0800

----------------------------------------------------------------------
 lib/client/platform/cordova/2.0.0/spec.js |   21 ++++++++++++++-------
 1 files changed, 14 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ripple/blob/66be7543/lib/client/platform/cordova/2.0.0/spec.js
----------------------------------------------------------------------
diff --git a/lib/client/platform/cordova/2.0.0/spec.js b/lib/client/platform/cordova/2.0.0/spec.js
index 8466278..9e90f17 100644
--- a/lib/client/platform/cordova/2.0.0/spec.js
+++ b/lib/client/platform/cordova/2.0.0/spec.js
@@ -66,16 +66,23 @@ module.exports = {
 
                 var builder = cordova.require('cordova/builder'),
                     allTheThings = win,
-                    base = cordova.require('cordova/common'),
                     iosPlugin;
 
-                //HACK: Overwrite all the things, handles when cordova.js executes before we start booting
-                if (builder.build) {
-                    builder.build(base.objects).intoAndClobber(allTheThings);
-                } else {
-                    //Support for cordova 2.3 and onward
-                    builder.buildIntoAndClobber(base.objects, allTheThings);
+                //HACK: We should really start using platform versions for this
+                try {
+                    var base = cordova.require('cordova/common');
+                    //HACK: Overwrite all the things, handles when cordova.js executes before we start booting
+                    if (builder.build) {
+                        builder.build(base.objects).intoAndClobber(allTheThings);
+                    } else {
+                        //Support for cordova 2.3 and onward
+                        builder.buildIntoAndClobber(base.objects, allTheThings);
+                    }
                 }
+                catch (e) {
+                    //HACK: Support for cordova 2.5+ .. this is not the module you are looking for
+                }
+
                 cordova.require('cordova/channel').onNativeReady.fire();
                 //  DIRTY HACK: once cordova is cleaned up, we do not
                 //  need this.