-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
251 lines (236 loc) · 11.1 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
249
250
251
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>jqVis</title>
<link rel="stylesheet" href="css/bootstrap.css">
<link rel="stylesheet" href="css/highlight.css">
<link rel="stylesheet" href="css/font-awesome.min.css">
<link rel="stylesheet" href="./node_modules/bootstrap-toggle/css/bootstrap-toggle.min.css">
<script type="text/javascript">
delete module.exports
const jQuery = require('jquery');
const $ = jQuery;
bootstrap = require('bootstrap');
$(function () { require('./window.js'); });
</script>
<script src="./node_modules/bootstrap-toggle/js/bootstrap-toggle.min.js"></script>
<style type="text/css">
.alert {
display: none;
position: absolute;
z-index: 1000;
}
#query-editor {
width: 100%;
height: 20ex;
resize: vertical;
}
.query-editor-grip
{
cursor: ns-resize;
height: 1ex;
position: relative;
width: 100%;
}
.query-editor-grip::after
{
bottom: -1ex;
color: var(--secondary);
content: '⋯';
font-weight: bold;
position: absolute;
text-align: center;
width: 100%;
z-index: 100;
}
.bg-shaded {
background-color: #e1e1e1 !important;
}
.loading .action-send
{
display: none;
}
.action-loading
{
display: none;
}
.loading .action-loading
{
display: initial;
}
.dismiss-alert
{
font-weight: bold;
cursor: pointer;
}
.result-actions
{
display: inline;
/*display: none;*/
}
/* FIXES old module bootstrap-toggle */
.btn-default
{
color: #212529;
background-color: #f8f9fa;
border-color: #f8f9fa;
}
</style>
</head>
<body class="bg-shaded">
<div class="shadow mb-3 px-3 border-bottom bg-light">
<div class="form-group pt-3 pl-3">
<div class="row">
<label class="col-sm-auto col-form-label text-secondary font-weight-bold px-0" for="input-file">JSON file:</label>
<div class="col-sm">
<div class="row">
<div class="col pr-1">
<input type="text" class="form-control" id="file-name" name="file-name" placeholder="Select JSON file…">
</div>
<div class="col-auto pl-1">
<button type="submit" class="btn btn-primary form-control" id="select-file">Select File</button>
</div>
</div>
</div>
</div>
</div>
<form id="query-form">
<div class="form-group">
<label class="text-secondary font-weight-bold">Query:</label>
<a class="badge badge-info font-weight-bold" href="https://stedolan.github.io/jq/manual/" target="_blank">?</a>
<div id="query-editor" class="border-bottom-0"></div>
<div class="query-editor-grip border-top border-bottom" for="#query-editor"></div>
</div>
<div class="form-group">
<div class="form-check-inline">
<input id="flags-compact-output" type="checkbox" class="form-check-input" name="flags[compact-output]">
<label for="flags-compact-output" class="form-check-label">Compact output</label>
</div>
<div class="form-check-inline">
<input id="flags-slurp" type="checkbox" class="form-check-input" name="flags[slurp]">
<label for="flags-slurp" class="form-check-label">Slurp</label>
</div>
<div class="form-check-inline">
<input id="flags-raw-output" type="checkbox" class="form-check-input" name="flags[raw-output]">
<label for="flags-raw-output" class="form-check-label">Raw output</label>
</div>
<a class="btn btn-sm btn-link dropdown-toggle" data-toggle="collapse" href="#more-flags" role="button" aria-expanded="false" aria-controls="more-flags">More flags…</a>
<div class="collapse card mt-2" id="more-flags">
<div class="form-group m-2 ml-3">
<div class="form-check-inline">
<input id="flags-sort-keys" type="checkbox" class="form-check-input" name="flags[sort-keys]">
<label for="flags-sort-keys" class="form-check-label">Sort keys</label>
</div>
<div class="form-check-inline">
<input id="flags-ascii-output" type="checkbox" class="form-check-input" name="flags[ascii-output]">
<label for="flags-ascii-output" class="form-check-label">ASCII output</label>
</div>
<div class="form-check-inline">
<input id="flags-join-output" type="checkbox" class="form-check-input" name="flags[join-output]">
<label for="flags-join-output" class="form-check-label">Join raw output</label>
</div>
<div class="form-check-inline">
<input id="flags-exit-status" type="checkbox" class="form-check-input" name="flags[exit-status]">
<label for="flags-exit-status" class="form-check-label">Exit with status</label>
</div>
</div>
</div>
</div>
<div class="form-group">
<input type="submit" class="action-send btn btn-primary form-control" value="Send">
<div class="action-loading">
<div class="row mx-n2">
<div class="col-auto px-2">
<button class="btn btn-primary form-control" type="button" disabled="">
<span class="spinner-border spinner-border-sm" role="status" aria-hidden="true"></span>
<span class="sr-only">Loading...</span>
</button>
</div>
<div class="col px-2">
<button class="action-cancel btn btn-danger form-control" type="button">
Cancel JQ process
</button>
</div>
</div>
</div>
</div>
</form>
<div class="form-group pl-3">
<form id="save-form">
<div class="row">
<div class="col-auto px-0 pr-3">
<div class="dropdown">
<button type="button" class="btn btn-secondary form-control dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Load query
</button>
<div class="dropdown-menu" id="saved-queries" aria-labelledby="dropdownMenuButton"></div>
</div>
</div>
<input type="text" id="save-name" class="form-control col-sm" placeholder="Name to save query under…">
<div class="col-auto">
<input type="submit" class="btn btn-secondary form-control" value="Save">
</div>
<div class="col-auto pl-0">
<div class="dropdown">
<button type="button" class="btn btn-outline-danger form-control dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Delete query
</button>
<div class="dropdown-menu" id="saved-queries-delete" aria-labelledby="dropdownMenuButton"></div>
</div>
</div>
</div>
</form>
</div>
</div>
<div class="px-3">
<div class="alert alert-danger" role="alert">
<div class="row">
<div id="alert-message" class="col-auto"></div>
<div class="dismiss-alert col-auto">×</div>
</div>
</div>
<label class="text-secondary font-weight-bold">Result:</label>
<span class="result-actions btn-toolbar mx-2" role="toolbar" aria-label="Result actions">
<span class="btn-group mx-1" role="group" aria-label="Store result actions">
<button type="button" class="btn btn-primary" id="copy-result-button" title="Copy result to clipboard" disabled="">
<i class="fa fa-clipboard" aria-hidden="true"></i>
<span class="sr-only">Copy result to clipboard</span>
</button>
<button type="button" class="btn btn-primary" id="save-result-button" title="Save result to file" disabled="">
<i class="fa fa-floppy-o" aria-hidden="true"></i>
<span class="sr-only">Save result to file</span>
</button>
</span>
<span class="btn-group mx-1" role="group" aria-label="New window actions">
<button type="button" class="btn btn-secondary" id="new-window" title="Duplicate window">
<i class="fa fa-plus-circle" aria-hidden="true"></i>
<span class="sr-only">Duplicate window</span>
</button>
<button type="button" class="btn btn-secondary" id="act-on-result" title="Act on result" disabled="">
<i class="fa fa-external-link" aria-hidden="true"></i>
<span class="sr-only">Act on result</span>
</button>
</span>
<span class="btn-group mx-1" role="group" aria-label="Clear result actions">
<button type="button" class="btn btn-outline-danger" id="clear-result-button" title="Clear result" disabled="">
<i class="fa fa-trash" aria-hidden="true"></i>
<span class="sr-only">Clear result</span>
</button>
</span>
<span class="btn-group mx-1" role="group" aria-label="Hide result actions">
<label class="mb-0">
<input type="checkbox" id="hide-result-toggle"
data-toggle="toggle"
data-on="Hidden"
data-off="Hide result"
data-onstyle="danger"
data-offstyle="secondary">
</label>
</span>
</span>
<pre class="card mt-3"><code id="output" class="json card-body"></code></pre>
</div>
</body>
</html>