You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by he...@apache.org on 2014/04/25 22:14:35 UTC
[1/5] git commit: CB-6396 [Firefox OS] Adding basic support
Repository: cordova-plugin-inappbrowser
Updated Branches:
refs/heads/master be9034ff6 -> 6ee35a09c
CB-6396 [Firefox OS] Adding basic support
Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/commit/51879d8e
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/tree/51879d8e
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/diff/51879d8e
Branch: refs/heads/master
Commit: 51879d8e2f2a9b9209022774ada265164abdc620
Parents: 9399ed3
Author: Piotr Zalewa <pi...@zalewa.info>
Authored: Fri Apr 4 12:16:01 2014 +0200
Committer: Piotr Zalewa <pi...@zalewa.info>
Committed: Fri Apr 4 12:16:01 2014 +0200
----------------------------------------------------------------------
doc/index.md | 11 ++++
plugin.xml | 9 +++
src/firefoxos/InAppBrowserProxy.js | 108 ++++++++++++++++++++++++++++++++
3 files changed, 128 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/blob/51879d8e/doc/index.md
----------------------------------------------------------------------
diff --git a/doc/index.md b/doc/index.md
index 5201927..ebc4734 100644
--- a/doc/index.md
+++ b/doc/index.md
@@ -30,6 +30,17 @@ and can't access Cordova APIs.
cordova plugin add org.apache.cordova.inappbrowser
+### Firefox OS
+
+Create __www/manifest.webapp__ as described in
+[Manifest Docs](https://developer.mozilla.org/en-US/Apps/Developing/Manifest).
+Add relevant permisions.
+
+ "permissions": {
+ "browser": {}
+ }
+
+
## window.open
Opens a URL in a new `InAppBrowser` instance, the current browser
http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/blob/51879d8e/plugin.xml
----------------------------------------------------------------------
diff --git a/plugin.xml b/plugin.xml
index 13adc8d..0d52960 100644
--- a/plugin.xml
+++ b/plugin.xml
@@ -137,5 +137,14 @@
</js-module>
</platform>
+ <!-- firefoxos -->
+ <platform name="firefoxos">
+ <js-module src="www/inappbrowser.js" name="inappbrowser">
+ <clobbers target="window.open" />
+ </js-module>
+ <js-module src="src/firefoxos/InAppBrowserProxy.js" name="InAppBrowserProxy">
+ <merges target="" />
+ </js-module>
+ </platform>
</plugin>
http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/blob/51879d8e/src/firefoxos/InAppBrowserProxy.js
----------------------------------------------------------------------
diff --git a/src/firefoxos/InAppBrowserProxy.js b/src/firefoxos/InAppBrowserProxy.js
new file mode 100644
index 0000000..fc2388b
--- /dev/null
+++ b/src/firefoxos/InAppBrowserProxy.js
@@ -0,0 +1,108 @@
+/*
+ *
+ * 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.
+ *
+*/
+
+// https://developer.mozilla.org/en-US/docs/WebAPI/Browser
+
+var cordova = require('cordova'),
+ channel = require('cordova/channel'),
+ modulemapper = require('cordova/modulemapper');
+
+var origOpenFunc = modulemapper.getOriginalSymbol(window, 'window.open');
+var browserWrap;
+
+var IABExecs = {
+
+ close: function (win, lose) {
+ if (browserWrap) {
+ browserWrap.parentNode.removeChild(browserWrap);
+ browserWrap = null;
+ }
+ },
+
+ /*
+ * Reveal browser if opened hidden
+ */
+ show: function (win, lose) {
+ console.error('[FirefoxOS] show not implemented');
+ },
+
+ open: function (win, lose, args) {
+ var strUrl = args[0],
+ target = args[1],
+ features = args[2],
+ url,
+ elem;
+
+ if (target === '_system') {
+ origOpenFunc.apply(window, [strUrl, '_blank']);
+ } else if (target === '_blank') {
+ var browserElem = document.createElement('iframe');
+ browserElem.setAttribute('mozbrowser', true);
+ // make this loaded in its own child process
+ browserElem.setAttribute('remote', true);
+ browserElem.setAttribute('src', strUrl);
+ if (browserWrap) {
+ document.body.removeChild(browserWrap);
+ }
+ browserWrap = document.createElement('div');
+ browserWrap.style.position = 'absolute';
+ browserWrap.style.backgroundColor = 'rgba(0,0,0,0.75)';
+ browserWrap.style.color = 'rgba(235,235,235,1.0)';
+ browserWrap.style.width = window.innerWidth + 'px';
+ browserWrap.style.height = window.innerHeight + 'px';
+ browserWrap.style.padding = '10px,0,0,0';
+ browserElem.style.position = 'absolute';
+ browserElem.style.top = '60px';
+ browserElem.style.left = '0px';
+ browserElem.style.height = (window.innerHeight - 60) + 'px';
+ browserElem.style.width = browserWrap.style.width;
+
+ browserWrap.addEventListener('click', function () {
+ setTimeout(function () {
+ IAB.close();
+ }, 0);
+ }, false);
+ var p = document.createElement('p');
+ p.appendChild(document.createTextNode('close'));
+ // TODO: make all buttons - ← → ×
+ p.style.paddingTop = '10px';
+ p.style.textAlign = 'center';
+ browserWrap.appendChild(p);
+ browserWrap.appendChild(browserElem);
+ document.body.appendChild(browserWrap);
+ // assign browser element to browserWrap for future
+ // reference
+ browserWrap.browser = browserElem;
+ } else {
+ window.location = strUrl;
+ }
+ },
+ injectScriptCode: function (code, bCB) {
+ console.error('[FirefoxOS] injectScriptCode not implemented');
+ },
+ injectScriptFile: function (file, bCB) {
+ console.error('[FirefoxOS] injectScriptFile not implemented');
+ }
+};
+
+module.exports = IABExecs;
+
+require('cordova/firefoxos/commandProxy').add('InAppBrowser', module.exports);
[3/5] git commit: refactoring fixed
Posted by he...@apache.org.
refactoring fixed
Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/commit/88f330ab
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/tree/88f330ab
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/diff/88f330ab
Branch: refs/heads/master
Commit: 88f330abd804365170c20ef26fd705e4eb378d45
Parents: c14871d
Author: Piotr Zalewa <pi...@zalewa.info>
Authored: Wed Apr 9 15:16:52 2014 +0200
Committer: Piotr Zalewa <pi...@zalewa.info>
Committed: Wed Apr 9 15:16:52 2014 +0200
----------------------------------------------------------------------
src/firefoxos/InAppBrowserProxy.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/blob/88f330ab/src/firefoxos/InAppBrowserProxy.js
----------------------------------------------------------------------
diff --git a/src/firefoxos/InAppBrowserProxy.js b/src/firefoxos/InAppBrowserProxy.js
index fc2388b..8ee3736 100644
--- a/src/firefoxos/InAppBrowserProxy.js
+++ b/src/firefoxos/InAppBrowserProxy.js
@@ -77,7 +77,7 @@ var IABExecs = {
browserWrap.addEventListener('click', function () {
setTimeout(function () {
- IAB.close();
+ IABExecs.close();
}, 0);
}, false);
var p = document.createElement('p');
[5/5] git commit: merged apache/dev
Posted by he...@apache.org.
merged apache/dev
Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/commit/6ee35a09
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/tree/6ee35a09
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/diff/6ee35a09
Branch: refs/heads/master
Commit: 6ee35a09cad72ee7a02ef552d2ef97cadc587039
Parents: cc5b0ce be9034f
Author: Piotr Zalewa <pi...@zalewa.info>
Authored: Wed Apr 23 11:05:10 2014 -0400
Committer: Piotr Zalewa <pi...@zalewa.info>
Committed: Wed Apr 23 11:05:10 2014 -0400
----------------------------------------------------------------------
RELEASENOTES.md | 14 +++
doc/index.md | 2 +
plugin.xml | 28 ++++-
src/amazon/InAppChromeClient.java | 18 ++++
src/android/InAppChromeClient.java | 18 ++++
src/blackberry10/README.md | 18 ++++
src/ios/CDVInAppBrowser.h | 10 +-
src/ios/CDVInAppBrowser.m | 77 ++++++++++++--
src/wp/InAppBrowser.cs | 183 +++++++++++++++++++++++++-------
www/inappbrowser.js | 2 +
www/windows8/InAppBrowserProxy.js | 2 +-
11 files changed, 323 insertions(+), 49 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/blob/6ee35a09/doc/index.md
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/blob/6ee35a09/plugin.xml
----------------------------------------------------------------------
[4/5] git commit: Merge pull request #2 from zalun/close-button-fix
Posted by he...@apache.org.
Merge pull request #2 from zalun/close-button-fix
CB-6396 Fix refactoring typo
Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/commit/cc5b0ce5
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/tree/cc5b0ce5
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/diff/cc5b0ce5
Branch: refs/heads/master
Commit: cc5b0ce5a38105b21703b245c890ebe277f8752a
Parents: c14871d 88f330a
Author: Piotr Zalewa <pi...@zalewa.info>
Authored: Wed Apr 9 15:18:36 2014 +0200
Committer: Piotr Zalewa <pi...@zalewa.info>
Committed: Wed Apr 9 15:18:36 2014 +0200
----------------------------------------------------------------------
src/firefoxos/InAppBrowserProxy.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
[2/5] git commit: Merge pull request #1 from
zalun/add-firefoxos-plugin
Posted by he...@apache.org.
Merge pull request #1 from zalun/add-firefoxos-plugin
CB-6396 [Firefox OS] Adding basic support
Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/commit/c14871da
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/tree/c14871da
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/diff/c14871da
Branch: refs/heads/master
Commit: c14871da953e399eec1cffe27fe750041df8c683
Parents: 9399ed3 51879d8
Author: Gert-Jan Braas <br...@steckelfisch.nl>
Authored: Mon Apr 7 17:06:54 2014 +0200
Committer: Gert-Jan Braas <br...@steckelfisch.nl>
Committed: Mon Apr 7 17:06:54 2014 +0200
----------------------------------------------------------------------
doc/index.md | 11 ++++
plugin.xml | 9 +++
src/firefoxos/InAppBrowserProxy.js | 108 ++++++++++++++++++++++++++++++++
3 files changed, 128 insertions(+)
----------------------------------------------------------------------