Return-Path: X-Original-To: apmail-cordova-commits-archive@www.apache.org Delivered-To: apmail-cordova-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E31EA1124F for ; Thu, 18 Sep 2014 23:53:12 +0000 (UTC) Received: (qmail 48111 invoked by uid 500); 18 Sep 2014 23:53:12 -0000 Delivered-To: apmail-cordova-commits-archive@cordova.apache.org Received: (qmail 47965 invoked by uid 500); 18 Sep 2014 23:53:12 -0000 Mailing-List: contact commits-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cordova.apache.org Delivered-To: mailing list commits@cordova.apache.org Received: (qmail 47878 invoked by uid 99); 18 Sep 2014 23:53:12 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 18 Sep 2014 23:53:12 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 73F74A1C680; Thu, 18 Sep 2014 23:53:12 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: purplecabbage@apache.org To: commits@cordova.apache.org Date: Thu, 18 Sep 2014 23:53:14 -0000 Message-Id: In-Reply-To: <509e2334226744729ea8403976e67f8e@git.apache.org> References: <509e2334226744729ea8403976e67f8e@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [03/10] git commit: Update code from remote apache repository Update code from remote apache repository 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/e5d07f14 Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/tree/e5d07f14 Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/diff/e5d07f14 Branch: refs/heads/master Commit: e5d07f14e8419dea67ec6c13d9f18a096f20a939 Parents: 8633863 f866e0e Author: SomaticIT Authored: Fri Jul 11 17:05:24 2014 +0200 Committer: SomaticIT Committed: Fri Jul 11 17:05:24 2014 +0200 ---------------------------------------------------------------------- CONTRIBUTING.md | 37 + NOTICE | 5 + README.md | 25 +- RELEASENOTES.md | 78 +- doc/de/index.md | 320 ++++++++ doc/es/index.md | 320 ++++++++ doc/fr/index.md | 320 ++++++++ doc/index.md | 310 ++++++++ doc/it/index.md | 320 ++++++++ doc/ja/index.md | 320 ++++++++ doc/ko/index.md | 320 ++++++++ doc/pl/index.md | 299 +++++++ doc/ru/index.md | 320 ++++++++ doc/zh/index.md | 320 ++++++++ docs/inappbrowser.md | 427 ---------- docs/window.open.md | 100 --- plugin.xml | 138 +++- src/amazon/InAppBrowser.java | 769 +++++++++++++++++++ src/amazon/InAppChromeClient.java | 146 ++++ src/android/InAppBrowser.java | 403 +++++----- src/android/InAppBrowserDialog.java | 54 ++ src/android/InAppChromeClient.java | 33 +- .../res/drawable-hdpi/ic_action_next_item.png | Bin 0 -> 593 bytes .../drawable-hdpi/ic_action_previous_item.png | Bin 0 -> 599 bytes .../res/drawable-hdpi/ic_action_remove.png | Bin 0 -> 438 bytes .../res/drawable-mdpi/ic_action_next_item.png | Bin 0 -> 427 bytes .../drawable-mdpi/ic_action_previous_item.png | Bin 0 -> 438 bytes .../res/drawable-mdpi/ic_action_remove.png | Bin 0 -> 328 bytes .../res/drawable-xhdpi/ic_action_next_item.png | Bin 0 -> 727 bytes .../drawable-xhdpi/ic_action_previous_item.png | Bin 0 -> 744 bytes .../res/drawable-xhdpi/ic_action_remove.png | Bin 0 -> 536 bytes .../res/drawable-xxhdpi/ic_action_next_item.png | Bin 0 -> 1021 bytes .../drawable-xxhdpi/ic_action_previous_item.png | Bin 0 -> 1038 bytes .../res/drawable-xxhdpi/ic_action_remove.png | Bin 0 -> 681 bytes src/blackberry10/README.md | 18 + src/firefoxos/InAppBrowserProxy.js | 171 +++++ src/ios/CDVInAppBrowser.h | 51 +- src/ios/CDVInAppBrowser.m | 314 ++++++-- src/ubuntu/InAppBrowser.qml | 69 ++ src/ubuntu/close.png | Bin 0 -> 461 bytes src/ubuntu/inappbrowser.cpp | 106 +++ src/ubuntu/inappbrowser.h | 61 ++ src/wp/InAppBrowser.cs | 288 ++++++- test/.DS_Store | Bin 6148 -> 0 bytes test/cordova-incl.js | 70 -- test/inappbrowser/index.html | 258 ------- test/inappbrowser/inject.css | 21 - test/inappbrowser/inject.html | 43 -- test/inappbrowser/inject.js | 20 - test/inappbrowser/local.html | 51 -- test/inappbrowser/local.pdf | Bin 8568 -> 0 bytes test/index.html | 65 -- test/main.js | 163 ---- test/master.css | 164 ---- www/InAppBrowser.js | 14 +- www/windows8/InAppBrowserProxy.js | 2 +- 56 files changed, 5617 insertions(+), 1716 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/blob/e5d07f14/plugin.xml ---------------------------------------------------------------------- diff --cc plugin.xml index 0bb6616,9c47e0b..4f146dd --- a/plugin.xml +++ b/plugin.xml @@@ -7,14 -26,18 +26,18 @@@ Cordova InAppBrowser Plugin Apache 2.0 cordova,in,app,browser,inappbrowser + https://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser.git + https://issues.apache.org/jira/browse/CB/component/12320641 + + + - + - - - - + - - ++ ++ @@@ -22,11 -45,58 +45,58 @@@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + - + + + + @@@ -74,13 -162,18 +162,29 @@@ - + - - - - - ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ + + + + + + + + + + + - + + http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/blob/e5d07f14/www/InAppBrowser.js ---------------------------------------------------------------------- diff --cc www/InAppBrowser.js index 5da53fd,0000000..3535b6f mode 100644,000000..100644 --- a/www/InAppBrowser.js +++ b/www/InAppBrowser.js @@@ -1,94 -1,0 +1,98 @@@ +/* + * + * 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 exec = require('cordova/exec'); +var channel = require('cordova/channel'); +var modulemapper = require('cordova/modulemapper'); ++var urlutil = require('cordova/urlutil'); + +function InAppBrowser() { + this.channels = { + 'loadstart': channel.create('loadstart'), + 'loadstop' : channel.create('loadstop'), + 'loaderror' : channel.create('loaderror'), + 'exit' : channel.create('exit') + }; +} + +InAppBrowser.prototype = { + _eventHandler: function (event) { + if (event.type in this.channels) { + this.channels[event.type].fire(event); + } + }, + close: function (eventname) { + exec(null, null, "InAppBrowser", "close", []); + }, + show: function (eventname) { + exec(null, null, "InAppBrowser", "show", []); + }, + addEventListener: function (eventname,f) { + if (eventname in this.channels) { + this.channels[eventname].subscribe(f); + } + }, + removeEventListener: function(eventname, f) { + if (eventname in this.channels) { + this.channels[eventname].unsubscribe(f); + } + }, + + executeScript: function(injectDetails, cb) { + if (injectDetails.code) { + exec(cb, null, "InAppBrowser", "injectScriptCode", [injectDetails.code, !!cb]); + } else if (injectDetails.file) { + exec(cb, null, "InAppBrowser", "injectScriptFile", [injectDetails.file, !!cb]); + } else { + throw new Error('executeScript requires exactly one of code or file to be specified'); + } + }, + + insertCSS: function(injectDetails, cb) { + if (injectDetails.code) { + exec(cb, null, "InAppBrowser", "injectStyleCode", [injectDetails.code, !!cb]); + } else if (injectDetails.file) { + exec(cb, null, "InAppBrowser", "injectStyleFile", [injectDetails.file, !!cb]); + } else { + throw new Error('insertCSS requires exactly one of code or file to be specified'); + } + } +}; + +module.exports = function(strUrl, strWindowName, strWindowFeatures) { - var iab = new InAppBrowser(); - var cb = function(eventname) { - iab._eventHandler(eventname); - }; - + // Don't catch calls that write to existing frames (e.g. named iframes). + if (window.frames && window.frames[strWindowName]) { + var origOpenFunc = modulemapper.getOriginalSymbol(window, 'open'); + return origOpenFunc.apply(window, arguments); + } + ++ strUrl = urlutil.makeAbsolute(strUrl); ++ var iab = new InAppBrowser(); ++ var cb = function(eventname) { ++ iab._eventHandler(eventname); ++ }; ++ ++ strWindowFeatures = strWindowFeatures || ""; ++ + exec(cb, cb, "InAppBrowser", "open", [strUrl, strWindowName, strWindowFeatures]); + return iab; +}; +