-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgo-playground.html
62 lines (49 loc) · 1.63 KB
/
go-playground.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
<!DOCTYPE HTML>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>Example using the genuine playground.js file</title>
<link type="text/css" href="http://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/2.3.2/css/bootstrap.min.css" rel="stylesheet"/>
<link type="text/css" href="http://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/2.3.2/css/bootstrap-responsive.min.css" rel="stylesheet"/>
</head>
<body>
<div class="container-fluid">
<div class="row-fluid">
<div class="span12">
<h1>Using playground.js</h1>
<p>You can use the genuine playground.js script :</p>
<textarea id="code" name="code" style="width: 100%; font-family: monospace;" rows="12">
package main
import "time"
func main() {
println("One")
timer := time.NewTimer(time.Second * 2)
<- timer.C
println("Timer expired")
}
</textarea>
<p>
<input type="button" id="run" class="btn btn-primary" value="Execute" />
<input type="button" id="fmt" class="btn btn-info" value="Format" />
</p>
<div id="output"></div>
<script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/2.3.2/js/bootstrap.min.js"></script>
<script type="text/javascript" src="/js/playground.js"></script>
<script type="text/javascript">
$(function() {
//Initialize Go playground
playground({
'codeEl': '#code',
'outputEl': '#output',
'runEl': '#run',
'fmtEl': '#fmt'
});
});
</script>
</div>
</div>
</div>
</body>
</html>