Compare commits

..

3 Commits

Author SHA1 Message Date
Steven Gill
4d4d479b3c [CB-5010] Updated version and RELEASENOTES.md for release 0.2.3 2013-10-09 15:27:18 -07:00
Steven Gill
3d8b04f982 [CB-4915] Incremented plugin version on dev branch. 2013-09-26 15:26:55 -07:00
Carlos Santana
12bc5d7d8b [CB-4926] Fixes inappbrowser plugin loading for windows8 2013-09-26 13:53:33 -04:00
3 changed files with 38 additions and 32 deletions

View File

@@ -32,3 +32,7 @@
* Rename CHANGELOG.md -> RELEASENOTES.md * Rename CHANGELOG.md -> RELEASENOTES.md
* [CB-4792] Added keepCallback to the show function. * [CB-4792] Added keepCallback to the show function.
* [CB-4752] Incremented plugin version on dev branch. * [CB-4752] Incremented plugin version on dev branch.
### 0.2.3 (Oct 9, 2013)
* [CB-4915] Incremented plugin version on dev branch.
* [CB-4926] Fixes inappbrowser plugin loading for windows8

View File

@@ -2,7 +2,7 @@
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0" <plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
id="org.apache.cordova.inappbrowser" id="org.apache.cordova.inappbrowser"
version="0.2.2"> version="0.2.3">
<name>InAppBrowser</name> <name>InAppBrowser</name>
<description>Cordova InAppBrowser Plugin</description> <description>Cordova InAppBrowser Plugin</description>
<license>Apache 2.0</license> <license>Apache 2.0</license>

View File

@@ -1,4 +1,4 @@
cordova.define("org.apache.cordova.inappbrowser.InAppBrowserProxy", function(require, exports, module) { /* /*
* *
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file * or more contributor license agreements. See the NOTICE file
@@ -19,7 +19,8 @@ cordova.define("org.apache.cordova.inappbrowser.InAppBrowserProxy", function(req
* *
*/ */
/*global Windows:true */ /*jslint sloppy:true */
/*global Windows:true, require, document, setTimeout, window, module */
@@ -30,27 +31,29 @@ var browserWrap;
var IAB = { var IAB = {
close: function (win,lose) { close: function (win, lose) {
if (browserWrap) { if (browserWrap) {
browserWrap.parentNode.removeChild(browserWrap); browserWrap.parentNode.removeChild(browserWrap);
browserWrap = null; browserWrap = null;
} }
}, },
show: function (win,lose) { show: function (win, lose) {
/* empty block, ran out of bacon?
if (browserWrap) { if (browserWrap) {
} }*/
}, },
open: function (win,lose,args) { open: function (win, lose, args) {
var strUrl = args[0]; var strUrl = args[0],
var target = args[1]; target = args[1],
var features = args[2]; features = args[2],
url,
elem;
if (target == "_system") { if (target === "_system") {
var url = new Windows.Foundation.Uri(strUrl) url = new Windows.Foundation.Uri(strUrl);
Windows.System.Launcher.launchUriAsync(url); Windows.System.Launcher.launchUriAsync(url);
} } else if (target === "_blank") {
else if (target == "_blank") {
if (!browserWrap) { if (!browserWrap) {
browserWrap = document.createElement("div"); browserWrap = document.createElement("div");
browserWrap.style.position = "absolute"; browserWrap.style.position = "absolute";
@@ -64,28 +67,27 @@ var IAB = {
setTimeout(function () { setTimeout(function () {
IAB.close(); IAB.close();
}, 0); }, 0);
} };
document.body.appendChild(browserWrap); document.body.appendChild(browserWrap);
} }
var elem = document.createElement("iframe"); elem = document.createElement("iframe");
elem.style.width = (window.innerWidth - 80)+ "px"; elem.style.width = (window.innerWidth - 80) + "px";
elem.style.height = (window.innerHeight - 80) + "px"; elem.style.height = (window.innerHeight - 80) + "px";
elem.style.borderWidth = "0px"; elem.style.borderWidth = "0px";
elem.name = "targetFrame"; elem.name = "targetFrame";
elem.src = strUrl; elem.src = strUrl;
window.addEventListener("resize", function () { window.addEventListener("resize", function () {
if (browserWrap && elem) { if (browserWrap && elem) {
elem.style.width = (window.innerWidth - 80) + "px"; elem.style.width = (window.innerWidth - 80) + "px";
elem.style.height = (window.innerHeight - 80) + "px"; elem.style.height = (window.innerHeight - 80) + "px";
} }
}); });
browserWrap.appendChild(elem); browserWrap.appendChild(elem);
} } else {
else {
window.location = strUrl; window.location = strUrl;
} }
@@ -93,12 +95,12 @@ var IAB = {
}, },
injectScriptCode:function(code, bCB) { injectScriptCode: function (code, bCB) {
// "(function(d) { var c = d.createElement('script'); c.src = %@; d.body.appendChild(c); })(document)" // "(function(d) { var c = d.createElement('script'); c.src = %@; d.body.appendChild(c); })(document)"
}, },
injectScriptFile:function(file, bCB) { injectScriptFile: function (file, bCB) {
} }
}; };
@@ -106,4 +108,4 @@ var IAB = {
module.exports = IAB; module.exports = IAB;
require("cordova/windows8/commandProxy").add("InAppBrowser",module.exports); require("cordova/windows8/commandProxy").add("InAppBrowser", module.exports);