blob: 23b47a3f3a95d237e9c530996afa3be574c536eb [file] [log] [blame]
<!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"> <!-- 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">
<style>
table {
width: 100%;
border: 1px solid white;
}
th, td {
width: 25%;
text-align: center;
vertical-align: top;
border: 1px solid gray;
}
.highlight-w {
color: white;
}
#stage.theme .small{
width:50px;
padding:1.2em 0;
}
input[type=text] {
width: 70%;
height: 30px;
}
.btn-dismiss {
width: 20%;
height: 30px;
}
#error {
color: red;
}
</style>
<script>
window.onerror = function(err,fn,ln) {alert("ERROR:" + err + ", " + fn + ":" + ln);};
</script>
<script type="text/javascript" charset="utf-8" src="../cordova-incl.js"></script>
<script type="text/javascript" charset="utf-8">
var deviceReady = false;
var keyboardPlugin = null;
/**
* Function called when page has finished loading.
*/
function init() {
document.addEventListener("deviceready", function() {
deviceReady = true;
keyboardPlugin = window.Keyboard; // for now, before plugin re-factor
if (keyboardPlugin == null) {
var msg = 'The plugin org.apache.cordova.keyboard was not found. Check that you have it installed.';
alert(msg);
}
}, false);
window.setTimeout(function() {
if (!deviceReady) {
var msg = 'Error: Apache Cordova did not initialize. Demo will not run correctly.';
alert(msg);
}
},1000);
}
function setShrinkView_hideFormAccessoryBar_andDisableScrollingInShrinkView(shrinkView, hideFormAccessoryBar, disableScrollingInShrinkView)
{
keyboardPlugin.shrinkView(shrinkView);
document.getElementById("shrinkView-arg").innerHTML = shrinkView;
keyboardPlugin.hideFormAccessoryBar(hideFormAccessoryBar);
document.getElementById("hideFormAccessoryBar-arg").innerHTML = hideFormAccessoryBar;
keyboardPlugin.disableScrollingInShrinkView(disableScrollingInShrinkView);
document.getElementById("disableScrollingInShrinkView-arg").innerHTML = disableScrollingInShrinkView;
}
</script>
</head>
<body onload="init();" id="stage" class="theme">
<h1>Keyboard (iOS)</h1>
<br />
<div>
<input type="text" placeholder="touch to see keyboard" /><button class="btn-dismiss">dismiss</button>
</div>
<h1>isVisible</h1>
<br />
<div class="btn large" onclick="alert('Keyboard.isVisible: ' + Keyboard.isVisible);">Keyboard.isVisible</div>
<h1>API Tests</h1>
<br />
<div>
The current state is highlighted below in the list. Touch a test <span class="highlight-w">"#" button</span> in the table, then touch a textfield (available at the top and bottom of the page) to see the results.
</div>
<ul>
<li>shrinkView(<span id="shrinkView-arg" class="highlight-w">false</span>)</li>
<li>hideFormAccessoryBar(<span id="hideFormAccessoryBar-arg" class="highlight-w">false</span>)</li>
<li>disableScrollingInShrinkView(<span id="disableScrollingInShrinkView-arg" class="highlight-w">false</span>)</li>
</ul>
<!-- &#x2717; is X, &#10004; is check-mark -->
<table>
<tr>
<th>Test #</th>
<th>shrinkView</th>
<th>hideForm&hellip;</th>
<th>disableScrolling&hellip;</th>
</tr>
<tr>
<td class="highlight-w">
<div class="btn small" onclick="setShrinkView_hideFormAccessoryBar_andDisableScrollingInShrinkView(false, false, false)">1</div>
</td>
<td>&#x2717;</td>
<td>&#x2717;</td>
<td>&#x2717;</td>
</tr>
<tr>
<td class="highlight-w">
<div class="btn small" onclick="setShrinkView_hideFormAccessoryBar_andDisableScrollingInShrinkView(false, false, true)">2</div>
</td>
<td>&#x2717;</td>
<td>&#x2717;</td>
<td class="highlight-w">&#10004;</td>
</tr>
<tr>
<td class="highlight-w">
<div class="btn small" onclick="setShrinkView_hideFormAccessoryBar_andDisableScrollingInShrinkView(false, true, true)">3</div>
</td>
<td>&#x2717;</td>
<td class="highlight-w">&#10004;</td>
<td class="highlight-w">&#10004;</td>
</tr>
<tr>
<td class="highlight-w">
<div class="btn small" onclick="setShrinkView_hideFormAccessoryBar_andDisableScrollingInShrinkView(false, true, false)">4</div>
</td>
<td>&#x2717;</td>
<td class="highlight-w">&#10004;</td>
<td>&#x2717;</td>
</tr>
<tr>
<td class="highlight-w">
<div class="btn small" onclick="setShrinkView_hideFormAccessoryBar_andDisableScrollingInShrinkView(true, false, false)">5</div>
</td>
<td class="highlight-w">&#10004;</td>
<td>&#x2717;</td>
<td>&#x2717;</td>
</tr>
<tr>
<td class="highlight-w">
<div class="btn small" onclick="setShrinkView_hideFormAccessoryBar_andDisableScrollingInShrinkView(true, false, true)">6</div>
</td>
<td class="highlight-w">&#10004;</td>
<td>&#x2717;</td>
<td class="highlight-w">&#10004;</td>
</tr>
<tr>
<td class="highlight-w">
<div class="btn small" onclick="setShrinkView_hideFormAccessoryBar_andDisableScrollingInShrinkView(true, true, true)">7</div>
</td>
<td class="highlight-w">&#10004;</td>
<td class="highlight-w">&#10004;</td>
<td class="highlight-w">&#10004;</td>
</tr>
<tr>
<td class="highlight-w">
<div class="btn small" onclick="setShrinkView_hideFormAccessoryBar_andDisableScrollingInShrinkView(true, true, false)">8</div>
</td>
<td class="highlight-w">&#10004;</td>
<td class="highlight-w">&#10004;</td>
<td>&#x2717;</td>
</tr>
</table>
<br />
<div>
<input type="text" placeholder="touch to see keyboard" /><button class="btn-dismiss">dismiss</button>
</div>
<br />
<div class="backBtn" onclick="backHome();">Back</div>
</body>
</html>