forked from ylh/tiddlymarker
-
Notifications
You must be signed in to change notification settings - Fork 1
/
options.html
264 lines (264 loc) · 10 KB
/
options.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
252
253
254
255
256
257
258
259
260
261
262
263
264
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>TiddlyMarker Settings</title>
<link rel="icon" href="icons/32.png">
<link rel="stylesheet" href="page.css">
<link rel="stylesheet" href="options.css">
</head>
<body>
<div hidden id="firstinstall" class="barmsg">
This appears to be your first install. Be sure to review these settings and set the configuration that best suits how you use your TiddlyWiki.
</div>
<div hidden id="update" class="barmsg">
There has been a major update. Make
</div>
<div id="main">
<h1><img id="tidstar" src="icons/52.png" alt="TiddlyMarker Logo" width="26" height="26"> TiddlyMarker Settings</h1>
<section>
<h2>General</h2>
<div>
<span><input disabled type="checkbox" autocomplete="off" id="quickmode"></span>
<label for="quickmode" class="greyout">Quick Mode</label>
</div>
<div>
<span></span>
<small class="quickmode greyout">One-click bookmarking. In the event of an error, click again to see what went wrong.</small>
</div>
<div>
<span><input disabled type="checkbox" autocomplete="off" id="careful"></span>
<label for="careful" class="greyout">Careful</label>
</div>
<div>
<span></span>
<small class="careful greyout">When clicking out of the popup instead of hitting Cancel, consider the bookmark unfinished.</small>
</div>
<div>
<span><input disabled type="checkbox" autocomplete="off" id="reqfav"></span>
<label for="reqfav" class="greyout">Use Favicons</label>
</div>
<div>
<span></span>
<small class="reqfav greyout">As there is no sensible way to access Firefox's favicon cache, favicons must be re-requested. If this raises privacy concerns, or you simply don't want to bloat your TW with excessive binary data, uncheck this.</small>
</div>
<div>
<span>
<select disabled autocomplete="off" id="savingmode">
<option value="download">Download</option>
<!--<option value="tabover">Tab-Over</option>!-->
<option value="webserver">Webserver</option>
</select>
</span>
<label for="savingmode" class="greyout">Saving Mode</label>
</div>
<div>
<span></span>
<dl class="savingmode greyout">
<div>
<dt>Download</dt>
<dd>Downloads a bookmark tiddler (or bookmark + favicon array) which may be imported by dragging into any TiddlyWiki.</dd>
</div>
<!--<div>
<dt>Tab-Over</dt>
<dd>If the specified destination TW is open, tab over to it; otherwise, open it. Import the appropriate tiddlers. If it was already open, tab back; if it was opened as a result of bookmarking, close it.</dd>
</div>!-->
<div>
<dt>Webserver</dt>
<dd>Directly adds the appropriate tiddlers to a Node.js TiddlyWiki.</dd>
</div>
</dl>
</div>
</section>
<!--<section id="tabover_prefs" class="greyout">
<h2>Tab-Over Mode</h2>
<div>
<span>
<input disabled type="text" autocomplete="off" id="taburi">
</span>
<label for="taburi" class="greyout">Search Prefix</label>
</div>
<div>
<span></span>
<small class="taburi greyout">This mode acts on the first tab found whose URL begins with this. In the event that no such tab is found, it opens a tab with the prefix as the full URL.</small>
</div>
<div>
<span>
<input disabled type="checkbox" autocomplete="off" id="closedone">
</span>
<label for="closedone" class="greyout">Close When Done</label>
</div>
<div>
<span></span>
<small class="closedone greyout">When no open tab is found, close it after attempting to save.</small>
</div>
</section>!-->
<section id="webserver_prefs" class="greyout">
<h2>Webserver Mode</h2>
<div>
<span>
<input disabled type="text" autocomplete="off" id="address">
</span>
<label for="address" class="greyout">Server Address</label>
</div>
<div>
<span>
<input disabled type="checkbox" autocomplete="off" id="auth">
</span>
<label for="auth" class="greyout">Authentication</label>
</div>
<div>
<span></span>
<div id="authsub">
<div>
<label for="username" class="greyout">Username: </label>
<span>
<input disabled type="text" autocomplete="off" id="username">
</span>
</div>
<div>
<label for="password" class="greyout">Password: </label>
<span>
<input disabled type="password" autocomplete="off" id="password">
</span>
</div>
</div>
</div>
<div>
<span>
<input disabled type="checkbox" autocomplete="off" id="safety">
</span>
<label for="safety" class="greyout">Safety</label>
</div>
<div>
<span></span>
<small class="safety greyout">
By default, this add-on will complain if you attempt to authenticate or upload over cleartext to a Node.js TiddlyWiki that is not on localhost. If your TiddlyWiki lives on another box on the LAN, or you really don't care, you can turn this off.
</small>
</div>
</section>
<section>
<h2>Advanced</h2>
<div>
<span>
<input disabled type="button" autocomplete="off" id="reset_bookmark_fmt" value="Reset">
</span>
<span class="bookmark_fmt greyout">
Bookmark Tiddler Format
</span>
</div>
<div>
<span></span>
<div>
<pre class="bookmark_fmt greyout">let bookmark_fmt = (rawtitle, title, url, icon) => {</pre>
<textarea disabled autocomplete="off" id="bookmark_fmt" rows="1"></textarea>
<pre class="bookmark_fmt greyout">}</pre>
<dl class="bookmark_fmt greyout">
<div>
<dt><code>rawtitle</code></dt>
<dd>Full <code><title></code> of the page</dd>
</div>
<div>
<dt><code>title</code></dt>
<dd>By default or in Quick Mode, <code>rawtitle</code> scrubbed of any <code>| [ ] { }</code>;<br>
otherwise, the title entered into the popup</dd>
</div>
<div>
<dt><code>url</code></dt>
<dd>URL of the page</dd>
</div>
<div>
<dt><code>icon</code></dt>
<dd>Output of <code>icon_fmt</code> below; <code>undefined</code> if Use Favicons is unchecked or there is no favicon found</dd>
</div>
</dl>
<p class="bookmark_fmt greyout"><small><i>Be sure to follow the <a href="https://tiddlywiki.com/static/TiddlyWeb%2520JSON%2520tiddler%2520format.html">TiddlyWeb JSON tiddler format</a> rather than the standard. In the case of the <i>Download</i> or <i>Tab-Over</i> modes, the generated tiddler(s) will automatically be converted to the standard format; it's just more straightforward to go this way around than the other.</i></small></p>
<p class="bookmark_fmt greyout"><small><i>In the <i>Webserver</i> saving mode, the returned JSON from this function will have its <i><code>.title</code></i> taken and URL encoded for the server API route. Lack of a <i><code>title</code></i> will cause an error in <b>any</b> mode; consider this your only sanity check.</i></small></p>
</div>
</div>
<div>
<span>
<input disabled type="checkbox" autocomplete="off" id="favicon_separate">
</span>
<label for="favicon_separate" class="greyout">Separate Favicon</label>
</div>
<div>
<span></span>
<small class="favicon_separate greyout">
When checked, the output of <code>icon_fmt</code> is presumed to be a full-fledged tiddler that is also downloaded or sent. When unchecked, the output of <code>icon_fmt</code> is only used as the <code>icon</code> parameter of <code>bookmark_fmt</code>.
</small>
</div>
<div>
<span>
<input disabled type="button" autocomplete="off" id="reset_favicon_fmt" value="Reset">
</span>
<span class="favicon_fmt greyout">
Favicon Format
</span>
</div>
<div>
<span></span>
<div>
<pre class="favicon_fmt greyout">let icon_fmt = (data, hash, mime, datauri, ext) => {</pre>
<textarea disabled autocomplete="off" id="favicon_fmt" rows="1"></textarea>
<pre class="favicon_fmt greyout">}</pre>
<dl class="favicon_fmt greyout">
<div>
<dt><code>data</code></dt>
<dd>Image data as a string, base64, or plaintext in the case of SVG; note how binary tiddlers are represented
</div>
<div>
<dt><code>hash</code></dt>
<dd>SHA-1 sum of <code>data</code>; suggested as favicon tiddler title</dd>
</div>
<div>
<dt><code>mime</code></dt>
<dd>Inferred media type</dd>
</div>
<div>
<dt><code>datauri</code></dt>
<dd>Full data URI constructed from <code>data</code> and <code>mime</code>.
</div>
<div>
<dt><code>ext</code></dt>
<dd>Plausible extension according to <code>mime</code></dd>
</div>
</dl>
<p class="favicon_fmt greyout"><small><i>When using <i>Separate Favicon</i>, notes about <i><code>.title</code></i> apply as above.</i></small></p>
</div>
</div>
</section>
<section>
<h2>Settings</h2>
<div>
<span>
<input type="checkbox" autocomplete="off" id="textarea_tabs">
</span>
<span>
<label for="textarea_tabs">Insert tab characters in textareas</label>
</span>
</div>
<div>
<span></span>
<small class="textarea_tabs">Textareas being <code>bookmark_fmt</code> and <code>icon_fmt</code> above. For accessibility reasons, it's best that this is on a manual switch.</small>
</div>
<div>
<span>
<input disabled type="button" autocomplete="off" id="reset_all" value="Reset">
</span>
<span>
<input disabled type="checkbox" autocomplete="off" id="unlock_reset">
<label for="unlock_reset" class="greyout">Reset All</label>
</span>
</div>
<div>
<span></span>
<small class="unlock_reset greyout">Irreversible. Check the box to indicate that you are mindful of what you are doing.</small>
</div>
</section>
</div>
<script src="storage.js"></script>
<script src="util.js"></script>
<script src="options.js"></script>
</body>
</html>