-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathindex.html
95 lines (80 loc) · 3.35 KB
/
index.html
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
<!DOCTYPE html>
<html>
<head>
<title>Terminal</title>
<link rel="stylesheet" type="text/css" href="terminal.css" />
<script src="//code.jquery.com/jquery-1.11.0.min.js"></script>
<script src="//espruino.github.io/EspruinoTools/espruino.js"></script>
<script src="//espruino.github.io/EspruinoTools/core/utils.js"></script>
<script src="//espruino.github.io/EspruinoTools/core/config.js"></script>
<!--<script src="EspruinoTools/core/serial_audio.js"></script> -->
<script src="//espruino.github.io/EspruinoTools/core/serial_audio.js"></script>
<script src="//espruino.github.io/EspruinoTools/core/terminal.js"></script>
<script src="//espruino.github.io/EspruinoTools/core/codeWriter.js"></script>
<script src="//espruino.github.io/EspruinoTools/core/modules.js"></script>
<script src="//espruino.github.io/EspruinoTools/core/env.js"></script>
<script src="//espruino.github.io/EspruinoTools/core/flasher.js"></script>
<script src="//espruino.github.io/EspruinoTools/plugins/boardJSON.js"></script>
<script src="//espruino.github.io/EspruinoTools/plugins/versionChecker.js"></script>
<script src="//espruino.github.io/EspruinoTools/plugins/minify.js"></script>
<script src="//espruino.github.io/EspruinoTools/plugins/assembler.js"></script>
<script src="//espruino.github.io/EspruinoTools/plugins/getGitHub.js"></script>
<script>
$(function() {
/*Espruino.Core.Terminal.setInputDataHandler(function(d) {
Espruino.Core.Terminal.outputDataHandler(d);
});*/
Espruino.Core.Terminal.grabSerialPort();
/*Espruino.Core.Serial.setSoundDebugFunction(function (d,d2) {
var c = document.getElementById("can");
var ctx = c.getContext("2d");
ctx.clearRect(0,0,c.width,c.height);
function z(y) { return 128 - y*256; }
ctx.beginPath();
ctx.moveTo(0,z(d2[0]));
for (var i=0;i<d2.length;i++)
ctx.lineTo(i*c.width / d2.length,z(d2[i]));
ctx.strokeStyle="#8080FF";
ctx.stroke();
ctx.beginPath();
ctx.moveTo(0,z(d[0]));
for (var i=0;i<d.length;i++)
ctx.lineTo(i*c.width / d.length,z(d[i]));
ctx.strokeStyle="#000000";
ctx.stroke();
});*/
Espruino.Core.Serial.open("", function() {
}, function() {
});
// This code grabs our code and sends it to Espruino
setInterval(function() {
var code = document.cookie.match(/(^|;)[ ]*code=([^;]*)/);
if (code && code[2]) {
var codeToWrite = window.atob(code[2]);
document.cookie = "code=";
Espruino.Core.CodeWriter.writeToEspruino(codeToWrite);
}
}, 500);
// checkboxes for settings
$(".polarity").change(function() {
Espruino.Core.Serial.setSoundPolarity(
$("#rxPolarity").is(':checked') ? 1 : -1,
$("#txPolarity").is(':checked') ? 1 : -1
);
});
});
</script>
</head>
<body>
<!--<canvas id="can" width="1024" height="256" style="position:absolute;left:0px;right:0px;top:0px;height:256px;"></canvas>
<div class="editor--terminal" style="position:absolute;left:0px;right:0px;top:256px;bottom:0px;">-->
<div class="editor--terminal" style="position:absolute;left:0px;right:0px;top:0px;bottom:0px;">
<div class="editor__canvas">
</div>
</div>
<div style="position:absolute;top:0px;right:0px;color:white;">
<input type="checkbox" class="polarity" id="rxPolarity">RX Polarity<br/>
<input type="checkbox" class="polarity" id="txPolarity">TX Polarity<br/>
</div>
</body>
</html>