cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agri...@apache.org
Subject spec commit: CB-4330 Add test pages that change hashes
Date Mon, 23 Dec 2013 16:19:37 GMT
Updated Branches:
  refs/heads/master df7f8affa -> 0fd177b97


CB-4330 Add test pages that change hashes


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/0fd177b9
Tree: http://git-wip-us.apache.org/repos/asf/cordova-mobile-spec/tree/0fd177b9
Diff: http://git-wip-us.apache.org/repos/asf/cordova-mobile-spec/diff/0fd177b9

Branch: refs/heads/master
Commit: 0fd177b97e8bac15e524eeba6704c2244bb97af2
Parents: df7f8af
Author: Andrew Grieve <agrieve@chromium.org>
Authored: Mon Dec 23 11:19:09 2013 -0500
Committer: Andrew Grieve <agrieve@chromium.org>
Committed: Mon Dec 23 11:19:09 2013 -0500

----------------------------------------------------------------------
 inappbrowser/index.html |   3 ++
 inappbrowser/local.html |   3 +-
 misc/index.html         |   5 ++
 misc/page2.html         |  10 ++--
 misc/page3.html         | 107 +++++++++++++++++++++++++++++++++++++++++++
 5 files changed, 121 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-mobile-spec/blob/0fd177b9/inappbrowser/index.html
----------------------------------------------------------------------
diff --git a/inappbrowser/index.html b/inappbrowser/index.html
index 2bf72e0..f01d7ee 100644
--- a/inappbrowser/index.html
+++ b/inappbrowser/index.html
@@ -261,5 +261,8 @@
     <h1>Video tag</h1>
     <div class="btn large" onclick="doOpen('video.html', '_blank');">remote video</div>
     <h2> </h2><div class="backBtn" onclick="backHome();">Back</div>
+    <h1>Local with anchor tag</h1>
+    <div class="btn large" onclick="doOpen('local.html#anchor1', '_blank');">Anchor1</div>
+    <div class="btn large" onclick="doOpen('local.html#anchor2', '_blank');">Anchor2</div>
   </body>
 </html>

http://git-wip-us.apache.org/repos/asf/cordova-mobile-spec/blob/0fd177b9/inappbrowser/local.html
----------------------------------------------------------------------
diff --git a/inappbrowser/local.html b/inappbrowser/local.html
index 4fcfadc..ab58fed 100644
--- a/inappbrowser/local.html
+++ b/inappbrowser/local.html
@@ -30,7 +30,8 @@
   <body id="stage" class="theme">
     <h1>InAppBrowser - Local URL</h1>
     <div id="info">
-        You have successfully loaded a local URL
+        You have successfully loaded a local URL:
+        <script>document.write(location.href)</script>
       </div>
       <div>User-Agent = <span id="u-a"></span></div>
       <div><a href="http://www.google.com">Visit Google</a></div>

http://git-wip-us.apache.org/repos/asf/cordova-mobile-spec/blob/0fd177b9/misc/index.html
----------------------------------------------------------------------
diff --git a/misc/index.html b/misc/index.html
index 48f6424..2245ed9 100644
--- a/misc/index.html
+++ b/misc/index.html
@@ -72,6 +72,11 @@
     <!-- a href="http://handle.library.cornell.edu/control/authBasic/authTest/" class="btn
large">Basic Auth: test/this</a -->
     <a href="page2.html" class="btn large">Load a page with iframes</a>
     <a href="page2.html?me=test" class="btn large">Load page with query param</a>
+    <a href="page3.html#foo" class="btn large">Page with hash</a>
+    <a href="page3.html?hash1#gah" class="btn large">Page with hash change on load</a>
+    <a href="page3.html?hash2#gah" class="btn large">Page with hash replace on load</a>
+    <a href="page3.html?hash1&changeURL#gah" class="btn large">Page with replaceState
& hash change</a>
+    <a href="page3.html?iframe#gah" class="btn large">Page iframe hash change</a>
     <h2>Android Only</h2>
     <a href="geo:0,0?q=11400 Burnet Rd, Austin, TX" class="btn large">Map IBM</a>
     <a href="market://search?q=google" class="btn large">Search Android market</a>

http://git-wip-us.apache.org/repos/asf/cordova-mobile-spec/blob/0fd177b9/misc/page2.html
----------------------------------------------------------------------
diff --git a/misc/page2.html b/misc/page2.html
index 59dd6b9..6b4eba1 100644
--- a/misc/page2.html
+++ b/misc/page2.html
@@ -40,12 +40,7 @@
     <h1>Page2 App</h1>
     <h2>This is page 2 of a Apache Cordova app</h2>
     <div id="info">
-        <h4>Platform: <span id="platform">  </span></h4>
-        <h4>Version: <span id="version"> </span></h4>
-        <h4>UUID: <span id="uuid">  </span></h4>
-        <h4>Name: <span id="name"> </span></h4>
-        <h4>Width: <span id="width">  </span>,   Height: <span id="height">

-                   </span>, Color Depth: <span id="colorDepth"></span></h4>
+      loading...
      </div>
      about:blank
      <div class="iframe_container">
@@ -70,5 +65,8 @@
         console.log('loading iframe after timeout.');
         document.querySelector('#apacheiframe').src = 'http://apache.org';
     }, 2000);
+    document.addEventListener("deviceready", function() {
+        document.getElementById('info').textContent += '\nDevice is ready.';
+    }, false);
   </script>
 </html>

http://git-wip-us.apache.org/repos/asf/cordova-mobile-spec/blob/0fd177b9/misc/page3.html
----------------------------------------------------------------------
diff --git a/misc/page3.html b/misc/page3.html
new file mode 100644
index 0000000..2e79811
--- /dev/null
+++ b/misc/page3.html
@@ -0,0 +1,107 @@
+<!DOCTYPE html>
+<!--
+
+ 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.
+
+-->
+
+
+<html>
+  <head>
+    <meta name="viewport" content="width=device-width,height=device-height,user-scalable=no,maximum-scale=1.0,initial-scale=1.0"
/>
+    <meta http-equiv="Content-type" content="text/html; charset=utf-8">
+    <title>Cordova Mobile Spec</title>
+    <link rel="stylesheet" href="../master.css" type="text/css" media="screen" title="no
title" charset="utf-8">
+    <script>
+      console.log('Changing hash #1.');
+      if (location.search.indexOf('hash1') != -1) {
+        location.hash = 'a';
+      } else if (location.search.indexOf('hash2') != -1) {
+        location.replace('#replaced');
+      }
+      var hashCount = 0;
+      function changeHash() {
+        hashCount += 1;
+        if (hashCount % 1) {
+          location.hash = hashCount;
+        } else {
+          location.replace('#' + hashCount);
+        }
+      }
+      if (location.search.indexOf('changeURL') != -1) {
+        history.replaceState(null, null, 'fakepage.html');
+      }
+      function loadFrame() {
+        var ifr = document.createElement('iframe');
+        ifr.src="data:text/html;base64,PGh0bWw+";
+        document.body.appendChild(ifr);
+      }
+    </script>
+    <script type="text/javascript" charset="utf-8" src="../cordova-incl.js"></script>
+    <script type="text/javascript" charset="utf-8" src="../main.js"></script>
+  </head>
+  <body onload="init();" id="stage" class="theme">
+    <h1>Page2 App</h1>
+    <h2>This is page 2 of a Apache Cordova app</h2>
+    <div id="info">
+      loading...
+     </div>
+    <div id="info2">
+     </div>
+     <script>
+      if (location.search.indexOf('iframe') != -1) {
+        document.write('<iframe src="' + location.href.replace('iframe','hash1') + '"></iframe>');
+      }
+     </script>
+     <div><button onclick="changeHash()">changeHash()</button></div>
+     <div><button onclick="loadFrame()">loadFrame()</button></div>
+     <div><button class="backBtn" onclick="backHome();">Back</button></div>
+  </body>
+  <script>
+    setInterval(function() {
+      document.getElementById('info2').textContent = location.href;
+    }, 300);
+
+    document.addEventListener("deviceready", function() {
+        document.getElementById('info').innerHTML += '<br>Device is ready.';
+        console.log('device ready');
+    }, false);
+    window.onload = function() {
+        document.getElementById('info').innerHTML += '<br>got load event.';
+        console.log('got onload');
+    }
+  </script>
+  <script>
+    document.getElementById('info').innerHTML += '<br>Changing hash #2.';
+    console.log('Changing hash #2');
+    if (location.search.indexOf('hash1') != -1) {
+      location.hash = 'b';
+    } else if (location.search.indexOf('hash2') != -1) {
+      location.replace('#replaced2');
+    }
+    var hashCount = 0;
+    function changeHash() {
+      hashCount += 1;
+      if (hashCount % 1) {
+        location.hash = hashCount;
+      } else {
+        location.replace('#' + hashCount);
+      }
+    }
+  </script>
+</html>


Mime
View raw message