forked from purescript/trypurescript
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
164 lines (141 loc) · 6.42 KB
/
index.html
File metadata and controls
164 lines (141 loc) · 6.42 KB
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
<!DOCTYPE HTML>
<html>
<head>
<title>Try PureScript!</title>
<meta content="text/html;charset=utf-8" http-equiv="Content-Type">
<meta content="utf-8" http-equiv="encoding">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="icon" type="image/png" href="./img/favicon_clear-16.png" sizes="16x16">
<link rel="icon" type="image/png" href="./img/favicon_clear-32.png" sizes="32x32">
<link rel="icon" type="image/png" href="./img/favicon_clear-256.png" sizes="256x256">
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/lz-string/1.4.4/lz-string.min.js"></script>
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/underscore.js/1.8.3/underscore-min.js"></script>
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/jquery/1.12.4/jquery.js"></script>
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/ace/1.1.01/ace.js" charset="utf-8"></script>
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/ace/1.1.01/mode-haskell.js"></script>
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/ace/1.1.01/theme-dawn.js"></script>
<link rel="stylesheet" type="text/css" href="//fonts.googleapis.com/css?family=Roboto:300,600">
<link rel="stylesheet" type="text/css" href="//fonts.googleapis.com/css?family=Roboto+Slab:300,600">
<link rel="stylesheet" type="text/css" href="css/index.css">
</head>
<body>
<div id="wrapper">
<div id="body">
<ul id="menu">
<a id="home_link" class="menu-item" href="/" title="Try PureScript!">
<img src="img/favicon-white.svg" width="40" height="40">
</a><li class="menu-item menu-dropdown no-mobile">
<label title="Select a view mode">View Mode</label>
<ul id="view_mode">
<li>
<input type="radio" name="view_mode" value="sidebyside" id="view_sidebyside" checked="true">
<label for="view_sidebyside" title="Show the code and output side by side">Side-by-side</label>
</li>
<li>
<input type="radio" name="view_mode" value="code" id="view_code">
<label for="view_code" title="Show only the code">Code</label>
</li>
<li>
<input type="radio" name="view_mode" value="output" id="view_output">
<label for="view_output" title="Show only the output">Output</label>
</li>
<li class="view_gist_li">
<a class="view_gist" target="trypurs_gist">
<label title="Open the original gist in a new window">Gist</label>
</a>
</li>
</ul>
</li><li class="menu-item view_gist_li mobile-only">
<a class="view_gist" target="trypurs_gist">
<label title="Open the original gist in a new window">View Gist</label>
</a>
<!-- TODO: uncomment the below once https://github.com/purescript/trypurescript/issues/118 is resolved -->
<!-- </li><li class="menu-item no-mobile"> -->
<!-- <label id="gist_save" name="save_gist" title="Save file as a Gist">Share</label> -->
</li><li class="menu-item no-mobile">
<label id="compile_label" name="compile_label" title="Compile Now">Compile</label>
</li><li class="menu-item nowrap no-mobile">
<input id="auto_compile" name="auto_compile" title="Toggle auto-compliation of the file on code changes" value="auto_compile" type="checkbox" checked="true">
<label id="auto_compile_label" for="auto_compile" title="Compile on code changes">Auto-Compile</label>
</li><li class="menu-item nowrap">
<input id="showjs" name="showjs" title="Show resulting JavaScript code instead of output" value="showjs" type="checkbox">
<label id="showjs_label" for="showjs" title="Show resulting JavaScript code instead of output">Show JS</label>
</li><li class="menu-item">
<a id="helplink" href="https://github.com/purescript/trypurescript/blob/master/README.md" target="trypurs_readme">
<label id="help" title="Learn more about Try PureScript">Help</label>
</a>
</li>
</ul>
<div class="mobile-only mobile-banner">
Your screen size is too small. Code editing has been disabled.
</div>
<div id="editor_view" data-view-mode="sidebyside">
<div id="column1" class="no-mobile">
<div id="code">
</div>
<textarea name="code" id="code_textarea" style="display: none;"></textarea>
</div>
<div class="separator">
</div>
<div id="column2_wrapper">
<div id="column2"></div>
<div id="loading"></div>
</div>
</div>
</div>
</div>
<script type="text/javascript">
$.ajaxSetup({
dataType: 'text'
});
var editor, cleanupActions = [];
editor = ace.edit('code');
editor.renderer.setShowGutter(true);
editor.setFontSize(13);
editor.setShowPrintMargin(false);
var session = editor.getSession();
session.setMode('ace/mode/haskell');
session.setOptions({
tabSize: 2,
useSoftTabs: true
});
function setEditorContent(value) {
session.setValue(value);
}
function onEditorChanged(callback, millis) {
session.on('change', _.debounce(function() {
callback(session.getValue());
}, millis));
}
function cleanUpMarkers() {
for (var i = 0; i < cleanupActions.length; i++) {
cleanupActions[i]();
}
cleanupActions = [];
}
function setAnnotations(annotations) {
editor.session.setAnnotations(annotations);
}
function addMarker(type, startLine, startColumn, endLine, endColumn) {
if (startLine === endLine && endColumn <= startColumn) {
// Make sure the range is at least one character wide.
if (startColumn > 0) {
startColumn = endColumn - 1;
} else {
endColumn = startColumn + 1;
}
}
// Add an error marker
var range = new(ace.require("ace/range").Range)
(startLine - 1, startColumn - 1, endLine - 1, endColumn - 1);
var marker = editor.session.addMarker(range, type, "text", true);
cleanupActions.push((function(marker) {
return function() {
editor.session.removeMarker(marker);
};
})(marker));
}
</script>
<script type="text/javascript" src="js/index.js"></script>
</body>
</html>