-
Notifications
You must be signed in to change notification settings - Fork 6
/
play.html
66 lines (58 loc) · 1.52 KB
/
play.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
---
layout: main
---
<!-- You're the man now dog -->
<script src="/js/intercooler.js" type="text/javascript"></script>
<script>
$(function(){
$("#template-select").change(function(){
var option = $(this).find("option:selected").first();
if(option.data('code')) {
$("#script").val(option.data('code'));
}
})
})
</script>
<div class="page-header">
<h2>Have A Play</h2>
</div>
<h4>
Enter A Gosu Program
</h4>
<p>
or select a template <select id="template-select">
<option></option>
<option data-code="print('hello world')">Hello World</option>
<option data-code="for(i in 1..50) {
print(i)
}">For Loop</option>
<option data-code="class MyClass {
function spoon() : String {
return 'Spoon!'
}
}
print(new MyClass().spoon())">Simple Class</option>
</select>
</p>
<p>
<textarea name="script" class="form-control" id="script">
1 + 1
</textarea>
</p>
<p>
<button class="btn btn-primary"
ic-include="#script"
ic-target="#results"
ic-indicator="#eval-indicator"
ic-get-from="https://gosu-eval-service.herokuapp.com/eval">
<i class="fa fa-play"></i> Evaluate
</button>
<button onclick="$('#script').val(''); $('#results').text(''); " class="btn btn-warning"><i class="fa fa-rotate-left"></i> Clear</button>
</p>
<hr/>
<h4>Results <span id="eval-indicator" class="text-info" style="display:none"><i class="fa fa-spinner fa-spin"></i> Evaluating...</span> </h4>
<div class="well">
<div id="results">
3. No wait! 2!
</div>
</div>