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/01/29 20:07:52 UTC

[26/37] js commit: [all] modulemapper refactor for InAppBrowser.

[all] modulemapper refactor for InAppBrowser.

https://issues.apache.org/jira/browse/CB-2227


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

Branch: refs/heads/symbolmapping
Commit: 716677471b86055acca0e34128921680ed23a85c
Parents: f7e7db8
Author: Andrew Grieve <ag...@chromium.org>
Authored: Fri Jan 25 11:12:04 2013 -0500
Committer: Andrew Grieve <ag...@chromium.org>
Committed: Mon Jan 28 19:56:47 2013 -0500

----------------------------------------------------------------------
 lib/android/platform.js                            |    3 --
 lib/android/plugin/inappbrowser/symbols.js         |   24 +++++++++++++++
 lib/blackberry/plugin/qnx/InAppBrowser.js          |    7 ++--
 .../plugin/qnx/inappbrowser/bbsymbols.js           |   24 +++++++++++++++
 lib/blackberry/plugin/qnx/platform.js              |    5 ---
 lib/common/common.js                               |    3 --
 lib/common/plugin/InAppBrowser.js                  |    2 -
 lib/ios/platform.js                                |    3 --
 lib/ios/plugin/inappbrowser/symbols.js             |   24 +++++++++++++++
 9 files changed, 76 insertions(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-js/blob/71667747/lib/android/platform.js
----------------------------------------------------------------------
diff --git a/lib/android/platform.js b/lib/android/platform.js
index 0231229..263ee20 100644
--- a/lib/android/platform.js
+++ b/lib/android/platform.js
@@ -108,9 +108,6 @@ module.exports = {
         },
         MediaError: { // exists natively on Android WebView on Android 4.x
             path: "cordova/plugin/MediaError"
-        },
-        open: {
-            path: "cordova/plugin/InAppBrowser"
         }
     },
     merges: {

http://git-wip-us.apache.org/repos/asf/cordova-js/blob/71667747/lib/android/plugin/inappbrowser/symbols.js
----------------------------------------------------------------------
diff --git a/lib/android/plugin/inappbrowser/symbols.js b/lib/android/plugin/inappbrowser/symbols.js
new file mode 100644
index 0000000..1b0866e
--- /dev/null
+++ b/lib/android/plugin/inappbrowser/symbols.js
@@ -0,0 +1,24 @@
+/*
+ * 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.
+ *
+*/
+
+
+var modulemapper = require('cordova/modulemapper');
+
+modulemapper.clobbers('cordova/plugin/InAppBrowser', 'open');

http://git-wip-us.apache.org/repos/asf/cordova-js/blob/71667747/lib/blackberry/plugin/qnx/InAppBrowser.js
----------------------------------------------------------------------
diff --git a/lib/blackberry/plugin/qnx/InAppBrowser.js b/lib/blackberry/plugin/qnx/InAppBrowser.js
index f6d4b24..e42a293 100644
--- a/lib/blackberry/plugin/qnx/InAppBrowser.js
+++ b/lib/blackberry/plugin/qnx/InAppBrowser.js
@@ -20,14 +20,15 @@
 */
 
 var cordova = require('cordova'),
-    core = require('cordova/plugin/InAppBrowser'),
+    modulemapper = require('cordova/modulemapper'),
+    origOpen = modulemapper.getOriginalSymbol(window, 'open'),
     browser = {
         close: function () { } //dummy so we don't have to check for undefined
     };
 
 var navigate = {
     "_blank": function (url, whitelisted) {
-        return core._orig.apply(null, [url, "_blank"]);
+        return origOpen(url, "_blank");
     },
 
     "_self": function (url, whitelisted) {
@@ -36,7 +37,7 @@ var navigate = {
             return window;
         }
         else {
-            return core._orig.apply(null, [url, "_blank"]);
+            return origOpen(url, "_blank");
         }
     },
 

http://git-wip-us.apache.org/repos/asf/cordova-js/blob/71667747/lib/blackberry/plugin/qnx/inappbrowser/bbsymbols.js
----------------------------------------------------------------------
diff --git a/lib/blackberry/plugin/qnx/inappbrowser/bbsymbols.js b/lib/blackberry/plugin/qnx/inappbrowser/bbsymbols.js
new file mode 100644
index 0000000..1b0866e
--- /dev/null
+++ b/lib/blackberry/plugin/qnx/inappbrowser/bbsymbols.js
@@ -0,0 +1,24 @@
+/*
+ * 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.
+ *
+*/
+
+
+var modulemapper = require('cordova/modulemapper');
+
+modulemapper.clobbers('cordova/plugin/InAppBrowser', 'open');

http://git-wip-us.apache.org/repos/asf/cordova-js/blob/71667747/lib/blackberry/plugin/qnx/platform.js
----------------------------------------------------------------------
diff --git a/lib/blackberry/plugin/qnx/platform.js b/lib/blackberry/plugin/qnx/platform.js
index 40d309f..a6daa03 100644
--- a/lib/blackberry/plugin/qnx/platform.js
+++ b/lib/blackberry/plugin/qnx/platform.js
@@ -40,10 +40,5 @@ module.exports = {
                 cordova.fireDocumentEvent("offline");
             });
         });
-    },
-    clobbers: {
-        open: {
-            path: "cordova/plugin/InAppBrowser"
-        }
     }
 };

http://git-wip-us.apache.org/repos/asf/cordova-js/blob/71667747/lib/common/common.js
----------------------------------------------------------------------
diff --git a/lib/common/common.js b/lib/common/common.js
index d5557e9..7dfe9af 100644
--- a/lib/common/common.js
+++ b/lib/common/common.js
@@ -39,9 +39,6 @@ module.exports = {
                 }
             }
         },
-        open : {
-            path: 'cordova/plugin/InAppBrowser'
-        },
         navigator: {
             children: {
                 notification: {

http://git-wip-us.apache.org/repos/asf/cordova-js/blob/71667747/lib/common/plugin/InAppBrowser.js
----------------------------------------------------------------------
diff --git a/lib/common/plugin/InAppBrowser.js b/lib/common/plugin/InAppBrowser.js
index 9b8bee1..400ee56 100644
--- a/lib/common/plugin/InAppBrowser.js
+++ b/lib/common/plugin/InAppBrowser.js
@@ -60,5 +60,3 @@ module.exports = function(strUrl, strWindowName, strWindowFeatures) {
     return iab;
 };
 
-//Export the original open so it can be used if needed
-module.exports._orig = window.open;

http://git-wip-us.apache.org/repos/asf/cordova-js/blob/71667747/lib/ios/platform.js
----------------------------------------------------------------------
diff --git a/lib/ios/platform.js b/lib/ios/platform.js
index ce7e5e0..eaa7cc0 100644
--- a/lib/ios/platform.js
+++ b/lib/ios/platform.js
@@ -33,9 +33,6 @@ module.exports = {
         },
         console: {
             path: 'cordova/plugin/ios/console'
-        },
-        open : {
-            path: 'cordova/plugin/InAppBrowser'
         }
     },
     merges:{

http://git-wip-us.apache.org/repos/asf/cordova-js/blob/71667747/lib/ios/plugin/inappbrowser/symbols.js
----------------------------------------------------------------------
diff --git a/lib/ios/plugin/inappbrowser/symbols.js b/lib/ios/plugin/inappbrowser/symbols.js
new file mode 100644
index 0000000..1b0866e
--- /dev/null
+++ b/lib/ios/plugin/inappbrowser/symbols.js
@@ -0,0 +1,24 @@
+/*
+ * 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.
+ *
+*/
+
+
+var modulemapper = require('cordova/modulemapper');
+
+modulemapper.clobbers('cordova/plugin/InAppBrowser', 'open');