-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
executable file
·33 lines (28 loc) · 1.34 KB
/
index.html
File metadata and controls
executable file
·33 lines (28 loc) · 1.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<!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>