You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ag...@apache.org on 2013/07/30 20:58:16 UTC

[09/13] js commit: [android] Move code from bootstrap-android.js into android/platform.js

[android] Move code from bootstrap-android.js into android/platform.js


Project: http://git-wip-us.apache.org/repos/asf/cordova-js/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-js/commit/5965f923
Tree: http://git-wip-us.apache.org/repos/asf/cordova-js/tree/5965f923
Diff: http://git-wip-us.apache.org/repos/asf/cordova-js/diff/5965f923

Branch: refs/heads/master
Commit: 5965f9234f5437717f533719fa57e7da16fe7bd3
Parents: f1d3b0b
Author: Andrew Grieve <ag...@chromium.org>
Authored: Tue Jul 30 11:47:37 2013 -0400
Committer: Andrew Grieve <ag...@chromium.org>
Committed: Tue Jul 30 11:47:37 2013 -0400

----------------------------------------------------------------------
 lib/android/platform.js          | 21 +++++++++++++++------
 lib/scripts/bootstrap-android.js | 29 -----------------------------
 2 files changed, 15 insertions(+), 35 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-js/blob/5965f923/lib/android/platform.js
----------------------------------------------------------------------
diff --git a/lib/android/platform.js b/lib/android/platform.js
index 231df7a..bf966c0 100644
--- a/lib/android/platform.js
+++ b/lib/android/platform.js
@@ -20,11 +20,20 @@
 */
 
 module.exports = {
-    id: "android",
-    initialize:function() {
-        var channel = require("cordova/channel"),
+    id: 'android',
+    bootstrap: function() {
+        var channel = require('cordova/channel'),
             cordova = require('cordova'),
-            exec = require('cordova/exec');
+            exec = require('cordova/exec'),
+            modulemapper = require('cordova/modulemapper');
+
+        // Tell the native code that a page change has occurred.
+        exec(null, null, 'PluginManager', 'startup', []);
+        // Tell the JS that the native side is ready.
+        channel.onNativeReady.fire();
+
+        // TODO: Extract this as a proper plugin.
+        modulemapper.clobbers('cordova/plugin/android/app', 'navigator.app');
 
         // Inject a listener for the backbutton on the document.
         var backButtonChannel = cordova.addDocumentEventHandler('backbutton');
@@ -40,8 +49,8 @@ module.exports = {
 
         // Let native code know we are all done on the JS side.
         // Native code will then un-hide the WebView.
-        channel.join(function() {
+        channel.onCordovaReady.subscribe(function() {
             exec(null, null, "App", "show", []);
-        }, [channel.onCordovaReady]);
+        });
     }
 };

http://git-wip-us.apache.org/repos/asf/cordova-js/blob/5965f923/lib/scripts/bootstrap-android.js
----------------------------------------------------------------------
diff --git a/lib/scripts/bootstrap-android.js b/lib/scripts/bootstrap-android.js
deleted file mode 100644
index 6cf1d80..0000000
--- a/lib/scripts/bootstrap-android.js
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-// Wire up the "App" plugin.
-// TODO: Extract this as a proper plugin.
-require('cordova/modulemapper').clobbers('cordova/plugin/android/app', 'navigator.app');
-// Tell the native code that a page change has occurred.
-require('cordova/exec')(null, null, 'PluginManager', 'startup', []);
-// Tell the JS that the native side is ready.
-require('cordova/channel').onNativeReady.fire();
-