cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agri...@apache.org
Subject [27/50] js commit: [all] modulemapper refactor for InAppBrowser.
Date Tue, 12 Feb 2013 19:33:07 GMT
[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/3427c50e
Tree: http://git-wip-us.apache.org/repos/asf/cordova-js/tree/3427c50e
Diff: http://git-wip-us.apache.org/repos/asf/cordova-js/diff/3427c50e

Branch: refs/heads/symbolmapping
Commit: 3427c50ea0137786e6149c62efc07b427de2ee17
Parents: 13af0c0
Author: Andrew Grieve <agrieve@chromium.org>
Authored: Fri Jan 25 11:12:04 2013 -0500
Committer: Andrew Grieve <agrieve@chromium.org>
Committed: Tue Feb 12 13:44:50 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/3427c50e/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/3427c50e/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/3427c50e/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/3427c50e/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/3427c50e/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/3427c50e/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/3427c50e/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/3427c50e/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/3427c50e/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');


Mime
View raw message