-
Notifications
You must be signed in to change notification settings - Fork 13
/
index.html
232 lines (182 loc) · 6.42 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
<!doctype html>
<html lang="en-US">
<head>
<meta charset="utf-8">
<title>View and export Hypothesis annotations</title>
<link rel="stylesheet" href="https://jonudell.info/hlib/hlib.css">
<script src="https://jonudell.info/hlib/hlib3.bundle.js" charset="utf-8"></script>
<style>
body {
margin-top: 20px;
}
*[is="edit-or-save-icon"] {
cursor: pointer;
}
subject-user-tokens-editor {
margin-bottom: 8px;
}
svg {
fill:#582108b5;
}
#container {
display: flex;
flex-direction: row;
width: 100%;
}
#leftbarContainer {
width: 18em;
display: flex;
flex-direction: column;
}
#iframeContainer {
width: 100%;
}
#iframe {
width: 100%;
height: 100%;
border-style: none;
margin-left: -20px;
}
#buttonsContainer {
display: flex;
flex-direction: row;
justify-content: flex-end;
}
.formContainer {
margin-top: 12px;
}
.facets, .settings {
border-style: solid;
border-width: thin;
padding-left: 1em;
padding-right: 2px;
border-color: lightgray;
margin-bottom: 20px;
background-color: #efeeeb4f
}
.formField {
margin-bottom: 8px;
}
.formLabel {
font-size: smaller;
color: #36180a
}
.formMessage {
font-size: smaller;
font-weight: normal;
}
.help {
font-size: smaller;
margin-top:12px;
}
.editOrSaveIcon {
font-size: x-small;
width: 1em;
height: 1em;
}
.icon-floppy, .icon-pencil {
margin-left: -14px;
}
.subjectUserTokensDisplay, .controlledTagsDisplay {
font-size: smaller;
}
.subjectUserTokensInput, .controlledTagsInput {
width: 90%;
position: relative;
}
.subjectUserTokensInput {
height: 8em;
}
.controlledTagsInput {
height: 2em;
}
</style>
</head>
<body>
<div id="svgDefs"></div>
<div id="container">
<div id="leftbarContainer">
<div id="buttonsContainer">
<div>
<button id="buttonHTML" title="view or download search results as HTML" onclick="getHTML()">HTML</button>
</div>
<div>
<button title="view or download search results as CSV" onclick="getCSV()">CSV</button>
</div>
<div>
<button title="view or download search results as JSON" onclick="getJSON()">JSON</button>
</div>
</div>
<div class="formContainer">
<div class="facets">
<form autocomplete="off">
<div class="formField" id="userContainer"></div>
</form>
<div class="formField" id="groupContainer"></div>
<div class="formField" id="urlContainer"></div>
<div class="formField" id="wildcard_uriContainer"></div>
<div class="formField" id="tagContainer"></div>
<div class="formField" id="anyContainer"></div>
</div>
<div class="settings">
<div class="formField" id="maxContainer"></div>
<div class="formField">
<span class="formMessage">sort top-level annotations by</span>
<select id="sortBy">
<option>recency</option>
<option>document location</option>
</select>
</div>
<div class="formField" id="expandedContainer"></div>
<div class="formField" id="searchRepliesContainer"></div>
<div class="formField" id="exactTagSearchContainer"></div>
<div class="formField" id="addQuoteContextContainer"></div>
<div is="subject-user-tokens-editor" class="formField" state="viewing">
<div class="formLabel"></div>
<span is="edit-or-save-icon"></span>
<div class="subjectUserTokensDisplay"></div>
</div>
<div is="controlled-tags-editor" class="formField" state="viewing">
<div class="formLabel"></div>
<span is="edit-or-save-icon"></span>
<div class="controlledTagsDisplay"></div>
</div>
<div class="formField" id="tokenContainer"></div>
<div class="tokenReset"><a title="click to reset">reset API token</a></div>
</div>
</div>
</div>
<div id="iframeContainer">
<iframe id="iframe" src=""></iframe>
</div>
</div>
<p class="help">
Fill in your Hypothesis API token to access your private groups and annotations.
Click HTML, CSV, or JSON to search for matching Hypothesis annotations and display them
in one of those formats.
Click <svg style="display:inline;height:12px;width:12px;margin-left:0;cursor:default" class="icon-floppy"><use xlink:href="#icon-floppy"></use></svg> to save the current HTML, CSV, or JSON view.
Fill in one or more <i>facets</i> to filter results. The facets are
<b>username</b>, <b>group</b>, <b>url</b> (or <b>wildcard_uri</b>), <b>tag</b>, and <b>any</b>.
If you need more than 50 results, set <b>max</b> to a larger number.
If you specify no facets other than the default group All, you'll get recent Hypothesis
annotations and replies in any group you're authorized to see.
Click <svg style="display:inline;height:12px;width:12px;cursor:default" class="icon-external-link"><use xlink:href="#icon-external-link"></use></svg> to launch the Hypothesis thread viewer/editor.
Use <i>exactTagSearch</i> to match tags exactly.
Use <i>addQuoteContext</i> to show the prefix and suffix captured with each highlight.
Results are grouped by URL, ordered by most-recently-updated annotation for each URL, and displayed as threads.
Use <i>subject user tokens</i> to enable in-place editing of annotations by users who
have shared their tokens with you, and <i>controlled tags</i> to constrain the choices for the first
tag belonging to each in-situ-editable annotation.
Support: <a href="https://github.com/judell/facet">https://github.com/judell/facet</a>.
Icons by way of https://www.svgrepo.com licensed under https://creativecommons.org/licenses/by/4.0/.
More <a href="https://jonudell.info/h/tools.html">Hypothesis tools</a>.
</p>
<script src="./index.js"></script>
<script>
setTimeout(_ => {
hlib.manageTokenDisplayAndReset()
hlib.getById('buttonHTML').click()
}, 400)
</script>
</body>
</html>