Files
phonegap-plugins/iPhone/Torch/index.html
2011-05-27 23:32:36 -07:00

34 lines
1.3 KiB
HTML
Executable File

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no;" />
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<!-- If you application is targeting iOS BEFORE 4.0 you MUST put json2.js from http://www.JSON.org/json2.js into your www directory and include it here -->
<script type="text/javascript" charset="utf-8" src="phonegap.0.9.5.1.min.js"></script>
<script type="text/javascript" charset="utf-8" src="Torch.js"></script>
<script type="text/javascript" charset="utf-8">
function onBodyLoad()
{
document.addEventListener("deviceready", onDeviceReady, false);
}
function onDeviceReady()
{
setInterval(function() {
document.getElementById("on").innerHTML = window.plugins.torch.isOn? "ON" : "OFF";
}, 500);
}
</script>
</head>
<body onload="onBodyLoad()">
<h1 style="font-family:Helvetica Neue">TORCH</h1>
<div>torch is: <span id="on"></span></div>
<button style="background-color:lightgreen;width:100%;height:40px;margin-top:50px;" onclick=" window.plugins.torch.turnOn()">ON</button>
<button style="background-color:red;width:100%;height:40px;margin-top:100px;" onclick=" window.plugins.torch.turnOff()">OFF</button>
</body>
</html>