-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
248 lines (214 loc) · 8.6 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
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
<!DOCTYPE html>
<html lang="en">
<head>
<title>INSPYER</title>
<meta charset="utf-8">
<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="css/base.css" rel="stylesheet">
<link rel="icon" type="image/png" href="gfx/icon.png">
</head>
<body>
<nav class="navbar navbar-default navbar-fixed-top">
<span class="navbar-brand"><a href="#">INSPYER</a></span>
<form id="load-box" class="navbar-form">
<div class="input-group">
<span class="input-group-btn">
<label class="btn btn-default btn-file">
Load <input type="file" id="input-tree" class="hidden" />
</label>
<label id="input-tree-meta-btn" class="btn btn-default btn-file disabled">
Meta <input type="file" id="input-tree-meta" class="hidden" disabled />
</label>
<button type="button" id="input-tree-reload" class="btn btn-default disabled" data-toggle="tooltip" data-placement="bottom" title="Reload">
<span class="glyphicon glyphicon-refresh"></span>
</button>
<button type="button" id="input-tree-reload-hard" class="btn btn-default disabled" data-toggle="tooltip" data-placement="bottom" title="Hard Reload">
<span class="glyphicon glyphicon-repeat"></span>
</button>
</span>
</div>
</form>
<div id="bookmark-box" class="navbar-form">
<div class="input-group">
<span class="input-group-btn">
<button id="bookmark-backward" class="btn btn-default">
<span class="glyphicon glyphicon-chevron-left"></span>
</button>
</span>
<div class="input-group-addon">
<span class="glyphicon glyphicon-star"></span>
</div>
<span class="input-group-btn">
<button id="bookmark-forward" class="btn btn-default">
<span class="glyphicon glyphicon-chevron-right"></span>
</button>
</span>
</div>
</div>
<div id="view-box" class="navbar-form">
<button id="view-path" class="btn btn-default" data-toggle="tooltip" data-placement="bottom" title="Toggle Node Path">
<span class="glyphicon glyphicon-tag"></span>
</button>
</div>
<form id="goto-box" class="navbar-form">
<div class="input-group">
<input type="text" class="form-control" placeholder="0-1-2-3" pattern=" *0(-(0|[1-9]\d*))* *" />
<span class="input-group-btn">
<button type="submit" class="btn btn-default" data-toggle="tooltip" data-placement="bottom" title="Goto">
<span class="glyphicon glyphicon-screenshot"></span>
</button>
</span>
</div>
</form>
<form id="search-box" class="navbar-form navbar-right">
<div class="input-group">
<span id="search-results" class="input-group-addon">0 / 0</span>
<input type="text" class="form-control" placeholder="Search..." />
<span class="input-group-btn">
<button id="search-box-stop" type="button" class="btn btn-default" style="display: none;">
<span class="glyphicon glyphicon-remove"></span>
</button>
<button id="search-box-backward" type="button" class="btn btn-default">
<span class="glyphicon glyphicon-chevron-left"></span>
</button>
<button id="search-box-forward" type="submit" class="btn btn-default">
<span class="glyphicon glyphicon-chevron-right"></span>
</button>
</span>
</div>
</form>
<div class="navbar-form navbar-right">
<button type="button" class="btn btn-default" data-toggle="modal" data-target="#more-dialog">
<span class="glyphicon glyphicon-menu-hamburger"></span>
</button>
</div>
</nav>
<div id="filename-box" style="display: none;">
<span class="glyphicon glyphicon-file"></span>
<span id="filename"></span>
</div>
<div id="message-box"></div>
<div id="tree"></div>
<div id="more-dialog" class="modal fade" tabindex="-1" role="dialog">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">More...</h4>
</div>
<div class="modal-body">
<h4>Settings</h4>
<label>
<input type="checkbox" id="settings-jqaas-enabled"> Use JSON web service
</label>
<h4>Hotkeys</h4>
<table class="table table-condensed">
<tr>
<td><kbd>Up</kbd></td>
<td>Select previous node on same level</td>
</tr>
<tr>
<td><kbd>Down</kbd></td>
<td>Select next node on same level</td>
</tr>
<tr>
<td><kbd>Left</kbd></td>
<td>Select parent node</td>
</tr>
<tr>
<td><kbd>Right</kbd></td>
<td>Expand and select first child node</td>
</tr>
<tr>
<td><kbd>Space</kbd></td>
<td>Open / close selected node</td>
</tr>
<tr>
<td><kbd>g</kbd></td>
<td>Scroll view to selected node</td>
</tr>
</table>
<hr />
<span class="node-header-type">Type</span>
<span class="node-header-value">Value</span>
<span class="node-header-variable">Variable</span>
<span class="node-header-meta">Meta Information</span>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary" data-dismiss="modal">
<span class="glyphicon glyphicon-piggy-bank"></span>
</button>
</div>
</div>
</div>
</div>
<div id="dropzone" style="display: none;"></div>
<script src="js/jquery.js"></script>
<script src="js/jquery.hotkeys.js"></script>
<script src="js/bootstrap.js"></script>
<script src="js/functional_utils.js"></script>
<script src="js/ajax.js"></script>
<script src="js/view_options.js"></script>
<script src="js/node.js"></script>
<script src="js/meta_analysis.js"></script>
<script src="js/goto.js"></script>
<script src="js/bookmarks.js"></script>
<script src="js/search.js"></script>
<script src="js/messages.js"></script>
<script src="js/select.js"></script>
<script src="js/dragndrop.js"></script>
<script src="js/page_logic.js"></script>
<!-- <script src="js/preloaded_data.js"></script> -->
<!-- <script src="js/preload.js"></script> -->
<!-- initialize -->
<script>
$(function() {
// tooltips
$('[data-toggle="tooltip"]').tooltip({trigger: 'hover'});
// INSPYER label
$('.navbar-brand').click(function(e) {
if (confirm('Do you really want to reload?')) {
location.reload();
}
});
});
</script>
<!-- Worker API requires an external file, but loading script later on is
not possible locally due to security reasons. A workaround is to have the
script embedded and create a Blob from the embedded code which will be
passed to the worker. Chaning the type of the script tag will prevent the
browser from executing the code right away -->
<script id="search-worker" type="javascript/worker">
function forAllNodes(tree, f, ref=undefined, address=[]) {
if (!ref) {
ref = tree['root'];
}
var node = tree[ref];
f(address, node, ref);
if (!node['Children']) {
return;
}
for (var i = 0; i < node['Children'].length; i++) {
forAllNodes(tree, f, node['Children'][i], address.concat([i]));
}
}
self.onmessage = function(e) {
var needle = new RegExp(e.data.needle, 'i');
console.info('Starting search for: ' + e.data.needle);
forAllNodes(e.data.tree, function(addr, node, ref) {
var match = false;
// check ref
match = match || ref.match(needle);
// check kind
match = match || node['Kind'].match(needle);
// check value
match = match || (node['Value'] && node['Value'].match(needle));
if (match) {
self.postMessage({finished: false, addr: addr});
}
});
console.info('Search finished');
self.postMessage({finished: true});
}
</script>
</body>
</html>