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/18 03:00:26 UTC
spec commit: Add User-Agent display and PDF test to InAppBrowser
Updated Branches:
refs/heads/master 654a3ef1f -> 09bfd9381
Add User-Agent display and PDF test to InAppBrowser
Project: http://git-wip-us.apache.org/repos/asf/cordova-mobile-spec/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-mobile-spec/commit/09bfd938
Tree: http://git-wip-us.apache.org/repos/asf/cordova-mobile-spec/tree/09bfd938
Diff: http://git-wip-us.apache.org/repos/asf/cordova-mobile-spec/diff/09bfd938
Branch: refs/heads/master
Commit: 09bfd9381e6b5bc03ad6c925030f4d8075dbe6a2
Parents: 654a3ef
Author: Andrew Grieve <ag...@chromium.org>
Authored: Thu Jan 17 20:59:11 2013 -0500
Committer: Andrew Grieve <ag...@chromium.org>
Committed: Thu Jan 17 20:59:11 2013 -0500
----------------------------------------------------------------------
inappbrowser/index.html | 10 ++++++++++
inappbrowser/local.html | 15 +++++++++++----
inappbrowser/local.pdf | Bin 0 -> 8568 bytes
index.html | 1 +
main.js | 1 +
5 files changed, 23 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-mobile-spec/blob/09bfd938/inappbrowser/index.html
----------------------------------------------------------------------
diff --git a/inappbrowser/index.html b/inappbrowser/index.html
index 05a4338..6a6d71e 100644
--- a/inappbrowser/index.html
+++ b/inappbrowser/index.html
@@ -42,6 +42,11 @@
deviceReady = true;
console.log("Device="+device.platform+" "+device.version);
}, false);
+ function updateUserAgent() {
+ document.getElementById("user-agent").textContent = navigator.userAgent;
+ }
+ updateUserAgent();
+ window.setInterval(updateUserAgent, 1500);
window.setTimeout(function() {
if (!deviceReady) {
alert("Error: Apache Cordova did not initialize. Demo will not run correctly.");
@@ -58,7 +63,9 @@
<div id="info">
Make sure http://www.google.com is white listed
Make sure http://www.apple.com is not in the white list
+ <h4>User-Agent: <span id="user-agent"> </span></h4>
</div>
+ <div onclick="backHome();">Back</div>
<h1>Local URL</h1>
<div class="btn large" onclick="window.open('local.html');">Default: CordovaWebView</div>
<div class="btn large" onclick="window.open('local.html', '_self');">Target=Self: CordovaWebView</div>
@@ -80,6 +87,9 @@
<div class="btn large" onclick="window.open('http://www.apple.com', '_blank');">Target=Blank: InAppBrowser</div>
<div class="btn large" onclick="window.open('http://www.apple.com', 'random_string');">Target=Random: InAppBrowser</div>
<div class="btn large" onclick="window.open('http://www.apple.com', 'random_string', 'location=no');">Target=Random, no location bar: InAppBrowser</div>
+ <h1>PDF URL</h1>
+ <div class="btn large" onclick="window.open('http://www.stluciadance.com/prospectus_file/sample.pdf');">Remote URL</div>
+ <div class="btn large" onclick="window.open('local.pdf', '_blank');">Local URL</div>
<h2> </h2><div class="backBtn" onclick="backHome();">Back</div>
</body>
</html>
http://git-wip-us.apache.org/repos/asf/cordova-mobile-spec/blob/09bfd938/inappbrowser/local.html
----------------------------------------------------------------------
diff --git a/inappbrowser/local.html b/inappbrowser/local.html
index 7e24aae..082d603 100644
--- a/inappbrowser/local.html
+++ b/inappbrowser/local.html
@@ -27,14 +27,21 @@
<meta http-equiv="Content-type" content="text/html; charset=utf-8"> <!-- ISO-8859-1 -->
<title>Cordova Mobile Spec</title>
<link rel="stylesheet" href="../master.css" type="text/css" media="screen" title="no title" charset="utf-8">
- <script type="text/javascript" charset="utf-8" src="../cordova.js"></script>
+ <script type="text/javascript" charset="utf-8" src="../cordova.js"></script>
</head>
<body id="stage" class="theme">
-
<h1>InAppBrowser - Local URL</h1>
<div id="info">
You have successfully loaded a local URL
- </div>
+ </div>
+ <div>User-Agent = <span id="u-a"></span></div>
<h2> </h2><div class="backBtn" onclick="backHome();">Back</div>
</body>
-</html>
+ <script>
+ function updateUserAgent() {
+ document.getElementById("u-a").textContent = navigator.userAgent;
+ }
+ updateUserAgent();
+ window.setInterval(updateUserAgent, 1500);
+ </script>
+</html>
http://git-wip-us.apache.org/repos/asf/cordova-mobile-spec/blob/09bfd938/inappbrowser/local.pdf
----------------------------------------------------------------------
diff --git a/inappbrowser/local.pdf b/inappbrowser/local.pdf
new file mode 100644
index 0000000..b54f1b7
Binary files /dev/null and b/inappbrowser/local.pdf differ
http://git-wip-us.apache.org/repos/asf/cordova-mobile-spec/blob/09bfd938/index.html
----------------------------------------------------------------------
diff --git a/index.html b/index.html
index 502450a..464ccf8 100644
--- a/index.html
+++ b/index.html
@@ -41,6 +41,7 @@
<h4>Model: <span id="model"> </span></h4>
<h4>Width: <span id="width"> </span>, Height: <span id="height">
</span>, Color Depth: <span id="colorDepth"></span></h4>
+ <h4>User-Agent: <span id="user-agent"> </span></h4>
</div>
<a href="autotest/index.html" class="btn large">Automatic Test</a>
<a href="accelerometer/index.html" class="btn large">Accelerometer</a>
http://git-wip-us.apache.org/repos/asf/cordova-mobile-spec/blob/09bfd938/main.js
----------------------------------------------------------------------
diff --git a/main.js b/main.js
index cc4d97d..66c1bd3 100644
--- a/main.js
+++ b/main.js
@@ -159,4 +159,5 @@ function init() {
// doesn't have a scroll button
// document.addEventListener("touchmove", preventBehavior, false);
document.addEventListener("deviceready", deviceInfo, true);
+ document.getElementById("user-agent").textContent = navigator.userAgent;
}