-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
222 lines (176 loc) · 8.53 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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
<!doctype html>
<html>
<head>
<title>tsumego.js</title>
<link href="favicon.ico" rel="icon" type="image/x-icon" />
<!-- RSVP is a polyfill for Promise which is missing in IE/Edge. -->
<script src="libs/rsvp-latest.js"></script>
<!-- IE/Edge doesn't support lots of stuff from ES 6 -->
<script src="libs/es6-polyfill.js"></script>
<!-- Facebook's polyfill for ES 6 generators. -->
<script src="libs/regenerator-runtime.js"></script>
<!-- Google's polyfill for the innerHTML property of SVG elements. -->
<script src="libs/innersvg.js"></script>
<!-- It's used in the directory to hash SGF. -->
<script src="libs/md5.js"></script>
<!-- jQuery mainly for Semantic UI, but it's now used by this app too. -->
<script src="libs/jquery-3.0.0.js"></script>
<!-- DCNN to evaluate tsumego -->
<script src="dcnn.js"></script>
<!-- The tsumego solver. -->
<script>
var mode = (/\bmode=(\w+)\b/.exec(location.search) || [])[1];
var sources = { es5: 'tsumego.es5.js', es6: 'tsumego.es6.js', dev: 'tsumego.js' };
if (!mode) {
try {
// check if es6 generators are supported:
// the es6 version is about 1.5x faster
new Function('!function*(){}');
mode = 'es6';
} catch (_) {
mode = 'es5';
}
}
var src = sources[mode];
var tag = '\x3cscript src="' + src + '"\x3e\x3c/script\x3e';
console.log('mode = ' + mode + '; src = ' + src);
document.write(tag);
</script>
<!-- Semantic UI -->
<link type="text/css" href="libs/semantic-ui/semantic.css" rel="stylesheet" />
<script src="libs/semantic-ui/semantic.js"></script>
<!-- Stuff for this app. -->
<link type="text/css" href="styles/styles.css" rel="stylesheet" />
<script src="app.js"></script>
<script>
$(document).ready(function () {
$('.menu .item').tab({ history: false });
$('.ui.buttons.toggle > .ui.button').click(function (event) {
if ($(this).hasClass('active'))
$(this).removeClass('active');
else
$(this).addClass('active').siblings().removeClass('active');
});
});
</script>
</head>
<body class="editor">
<div id="grid" class="ui grid">
<div id="goban-area" class="workspace ui column">
<div class="ui pointing secondary menu">
<a class="active item" data-tab="board">Board</a>
<a class="item" data-tab="sgf" id="tab-sgf-header">SGF</a>
<a class="item" data-tab="svg" id="tab-svg-header">SVG</a>
<a class="item" data-tab="dir" id="tab-dir-header">Directory</a>
</div>
<div class="ui active tab" data-tab="board">
<div class="tsumego"></div>
</div>
<div class="ui tab" data-tab="sgf">
<pre contenteditable="true" id="sgf"></pre>
</div>
<div class="ui tab" data-tab="svg">
<pre contenteditable="true" id="svg"></pre>
</div>
<div class="ui tab" data-tab="dir">
<div id="directory-container">
<div class="ui segment" id="directory">
<div class="ui icon transparent input">
<input type="text" placeholder="Search...">
<i class="circular search link icon"></i>
</div>
<div class="ui vertical menu"></div>
</div>
</div>
</div>
</div>
<div id="right-panel" class="ui column">
<div class="ui big icon vertical buttons" id="dbg-panel">
<button class="ui icon button" id="dbg-run" title="Run" style="color:#21BA45">
<i class="play icon"></i>
</button>
<button class="ui icon button" id="dbg-into" title="Step into">
<i class="play level down icon"></i>
</button>
<button class="ui icon button" id="dbg-next" title="Step over">
<i class="right mail forward icon"></i>
</button>
<button class="ui icon button" id="dbg-undo" title="Step out">
<i class="right undo icon"></i>
</button>
<button class="ui icon button" id="dbg-stop" title="Stop" style="color:#d01919">
<i class="right stop icon"></i>
</button>
<button class="ui icon button" id="dbg-bp" title="Breakpoint">
<i class="stop circle outline icon"></i>
</button>
</div>
<div id="solver-panel">
<div class="ui big icon vertical buttons">
<button class="ui icon button" id="solve-b" title="Solve for black Shift+Click finds all correct moves Ctrl+Click builds a proof tree">
<i class="play icon" style="color:black"></i>
</button>
<button class="ui icon button" id="solve-w" title="Solve for white Shift+Click finds all correct moves Ctrl+Click builds a proof tree">
<i class="play icon" style="color:white"></i>
</button>
<button class="ui icon button" id="undo" title="Undo the last move">
<i class="right undo icon"></i>
</button>
</div>
</div>
<div id="tool">
<div class="ui big icon vertical buttons toggle">
<button data-value="AB" data-key="B" class="ui icon button" title="Add a black stone (B + Click)">
<i class="ui circle icon" style="color:black"></i>
</button>
<button data-value="AW" data-key="W" class="ui icon button" title="Add a white stone (W + Click)">
<i class="ui circle icon" style="color:white"></i>
</button>
<button data-value="XX" data-key="X" class="ui icon button" title="Remove a stone (X + Click)">
<i class="ui erase icon"></i>
</button>
<button data-value="MA" data-key="T" class="ui icon button" title="Select the target to capture or save (T + Click)">
<i class="ui selected radio icon"></i>
</button>
<button data-value="SQ" data-key="S" class="ui icon button" title="Adds a stub to the outer wall (S + Click)">
<i class="ui square icon"></i>
</button>
</div>
</div>
<div>
<div class="ui big icon vertical buttons">
<button class="ui icon button" id="flipc" title="Invert stone colors">
<i class="right refresh icon"></i>
</button>
<button class="ui icon button" id="erase" title="Erase board">
<i class="recycle icon" style="color:red"></i>
</button>
<button class="ui icon button" id="download" title="Download SGF">
<i class="download icon" style="color:green"></i>
</button>
<button class="ui icon button" id="dcnn" title="Evaluate with DCNN">
<i class="bug icon" style="color:blue"></i>
</button>
</div>
</div>
<div id="km">
<div class="ui big vertical buttons toggle">
<button data-value="-1" class="ui icon button" title="W is the ko master">
<i class="ui thin circle icon"></i>
</button>
<button data-value="0" class="ui icon button" title="Neither side has ko treats">
<i class="ui adjust icon"></i>
</button>
<button data-value="+1" class="ui icon button" title="B is the ko master">
<i class="ui circle icon"></i>
</button>
</div>
</div>
</div>
<div class="row" id="footer">
<div class="ui column" id="comment"></div>
<div class="ui column" id="coords"></div>
</div>
</div>
</body>
</html>