-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathworksheet.html
204 lines (184 loc) · 9.89 KB
/
worksheet.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
<!DOCTYPE html>
<!--
~ This file is part of gorilla-repl. Copyright (C) 2014-, Jony Hudson.
~
~ gorilla-repl is licenced to you under the MIT licence. See the file LICENCE.txt for full details.
-->
<html id="document">
<head>
<link rel="shortcut icon" href="favicon.ico"/>
<link href='http://fonts.googleapis.com/css?family=Arvo:400,700,400italic,700italic|Lora:400,700,400italic,700italic' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="jslib/codemirror-4.5/lib/codemirror.css"/>
<link rel="stylesheet" href="css/codemirror-hint.css"/>
<link rel="stylesheet" href="css/worksheet.css"/>
<link rel="stylesheet" href="css/gorilla.css"/>
<link rel="stylesheet" href="css/output.css"/>
<script type="text/javascript"
src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_SVG-full.js&delayStartupUntil=configured"></script>
<script type="text/javascript" src="jslib/marked/marked.min.js"></script>
<script type="text/javascript" src="jslib/jquery/jquery-1.10.2.min.js"></script>
<script type="text/javascript" src="jslib/underscore/underscore.min.js"></script>
<script type="text/javascript" src="jslib/knockoutjs/knockout-3.0.0.min.js"></script>
<script type="text/javascript" src="jslib/codemirror-4.5/lib/codemirror.js"></script>
<script type="text/javascript" src="jslib/codemirror-4.5/addon/edit/closebrackets.js"></script>
<script type="text/javascript" src="jslib/codemirror-4.5/addon/edit/matchbrackets.js"></script>
<script type="text/javascript" src="jslib/codemirror-4.5/addon/runmode/runmode.js"></script>
<script type="text/javascript" src="jslib/codemirror-4.5/addon/runmode/colorize.js"></script>
<script type="text/javascript" src="jslib/codemirror-4.5/addon/hint/show-hint.js"></script>
<script type="text/javascript" src="jslib/codemirror-4.5/mode/clojure/clojure.js"></script>
<script type="text/javascript" src="jslib/codemirror-4.5/mode/markdown/markdown.js"></script>
<script type="text/javascript" src="jslib/codemirror-4.5/mode/xml/xml.js"></script>
<script type="text/javascript" src="jslib/d3/d3.v3.min.js"></script>
<script type="text/javascript" src="jslib/d3/d3.geo.projection.min.js"></script>
<script type="text/javascript" src="jslib/vega/vega.1.3.3.min.js"></script>
<script type="text/javascript" src="jslib/uuid/uuid.core.js"></script>
<script type="text/javascript" src="jslib/mousetrap/mousetrap.min.js"></script>
<script type="text/javascript" src="js/eventbus.js"></script>
<script type="text/javascript" src="js/commandProcessor.js"></script>
<script type="text/javascript" src="js/repl-ws.js"></script>
<script type="text/javascript" src="js/utils.js"></script>
<script type="text/javascript" src="js/worksheetParser.js"></script>
<script type="text/javascript" src="js/codemirrorVM.js"></script>
<script type="text/javascript" src="js/completions.js"></script>
<script type="text/javascript" src="js/mathJaxViewer.js"></script>
<script type="text/javascript" src="js/outputViewer.js"></script>
<script type="text/javascript" src="js/renderer.js"></script>
<script type="text/javascript" src="js/segment.js"></script>
<script type="text/javascript" src="js/worksheet.js"></script>
<script type="text/javascript" src="js/palette.js"></script>
<script type="text/javascript" src="js/saveDialog.js"></script>
<script type="text/javascript" src="js/codeDialog.js"></script>
<script type="text/javascript" src="js/docViewer.js"></script>
<script type="text/javascript" src="js/main.js"></script>
<title data-bind="text: title">Gorilla REPL</title>
</head>
<body>
<!-- The page stub -->
<div class="status" data-bind="visible: (status() !== '')"><h3 data-bind="html: status">Loading ...</h3></div>
<div class="menu-icon" data-bind="click: handleMenuClick">☰</div>
<div data-bind="template: {name: 'palette-template', data: palette}"></div>
<div data-bind="template: {name: 'code-dialog-template', data: codeDialog}"></div>
<div data-bind="template: {name: 'save-template', data: saveDialog}"></div>
<div data-bind="template: {name: 'doc-template', data: docViewer}"></div>
<div id="contents">
<div class="segment container-segment">
<div class="container-children">
<div data-bind="template: {name: 'segment-template', foreach: worksheet().segments()}">
</div>
</div>
</div>
</div>
<div class="scroll-pad"></div>
<!-- Templates -->
<script type="text/html" id="palette-template">
<div class="modal-overlay" data-bind="visible: shown, click: handleOverlayClick"></div>
<div class="modal" data-bind="visible: shown">
<h3 data-bind="text: caption"></h3>
<div class="modal-content">
<input type="text"
data-bind="hasFocus: focused, value: filterText, valueUpdate: 'input', event: {keydown: handleKeyPress}"/>
<div class="palette-items">
<ul data-bind="foreach: items">
<li data-bind="click: $parent.handleItemClick, attr: {id: ('palette-item-' + $index())}">
<div class="palette-item"
data-bind="html: desc, css: {highlight: ($index() == $parent.highlight())}">
</div>
<!--<div class="command-shortcut" data-bind="text: kb"></div>-->
</li>
</ul>
</div>
</div>
</div>
</script>
<script type="text/html" id="save-template">
<div class="modal-overlay" data-bind="visible: shown, click: handleOverlayClick"></div>
<div class="modal" data-bind="visible: shown">
<h3>Filename (relative to project directory):</h3>
<div class="modal-content">
<input type="text" data-bind="hasFocus: focused, value: filename, valueUpdate: 'input', event: {keydown: handleKeyPress}"/>
<div><div class="modal-button" data-bind="click: handleCancelClick">Cancel</div>
<div class="modal-button highlight" data-bind="click: handleOKClick">OK</div>
</div>
</div>
</div>
</script>
<script type="text/html" id="code-dialog-template">
<div class="modal-overlay" data-bind="visible: shown, click: handleOverlayClick"></div>
<div class="modal" data-bind="visible: shown">
<h3 data-bind="text: caption"></h3>
<div class="modal-content">
<div class="message" data-bind="html: message"></div>
<div class='last-chance'>
<textarea class="last-chance"
data-bind="hasFocus: focused, value: contents, event: {keydown: handleKeyPress}"></textarea>
</div>
<div>
<div class="modal-button highlight" data-bind="text: okButtonText, click: handleOKClick"></div>
</div>
</div>
</div>
</script>
<script type="text/html" id="doc-template">
<div class="doc-viewer" data-bind="visible: shown">
<div class="doc-viewer-content">
<div data-bind="html: doc"></div>
</div>
</div>
</script>
<script type="text/html" id="segment-template">
<div data-bind="template: {name: renderTemplate}"></div>
</script>
<script type="text/html" id="stacktrace-template">
<div class="exception"><span class="exception-header" data-bind="text: heading"></span>
<span data-bind="text: value.class"></span> (<span data-bind="text: value.message"></span>)</div>
<ul data-bind="foreach: value.stacktrace">
<li data-bind="css: {'java-stackframe': type === 'java', 'clj-stackframe': type === 'clj', 'tooling-stackframe': flags.indexOf('tooling') >= 0}">
<!-- ko if: type === "clj" -->
<span data-bind="text: fn"></span>
- <span data-bind="text: ns" class="stackframe-ns"></span>
- <span data-bind="text: '(' + file + ':' + line + ')'" class="stackframe-fileloc"></span>
<!-- /ko -->
<!-- ko if: type === "java" -->
<span data-bind="text: method"></span>
- <span data-bind="text: '(' + file + ':' + line + ')'" class="stackframe-fileloc"></span>
<!-- /ko -->
</li>
</ul>
</script>
<script type="text/html" id="code-segment-template">
<div class="segment code running"
data-bind="css: {selected: active(), running: runningIndicator}, attr: {id: id}">
<div class="segment-main">
<textarea class="codeTextArea mousetrap" data-bind="codemirror: content"></textarea>
</div>
<div class="error-text" data-bind="text: errorText, visible: errorText() !== ''"></div>
<!-- ko if: stackTrace() !== null -->
<div class="stack-trace" data-bind="with: stackTrace">
<!-- ko if: cause !== null -->
<div data-bind="template: {name: 'stacktrace-template', data: {value: cause, heading: 'An exception was caused by: '}}"></div>
<!-- /ko -->
<div data-bind="template: {name: 'stacktrace-template', data: {value: exception, heading: 'Exception thrown: '}}"></div>
</div>
<!-- /ko -->
<div class="console-text" data-bind="visible: consoleText() !== ''">
<pre><code data-bind="html: consoleText"></code></pre>
</div>
<div class="output"
data-bind="visible: (output() != ''), outputViewer: output, segmentID: id">
</div>
<div class="segment-footer"></div>
</div>
</script>
<script type="text/html" id="free-segment-template">
<div class="segment free" data-bind="css: {selected: active()}, attr: {id: id}, click: handleClick">
<div class="segment-main">
<div class="free-preview" data-bind="mathJaxViewer: renderedContent, visible: !markupVisible()"></div>
<div class="free-markup" data-bind="visible: markupVisible">
<textarea data-bind="codemirror: content"></textarea>
</div>
</div>
<div class="segment-footer"></div>
</div>
</script>
</body>
</html>