Project

General

Profile

Download (10.3 KB) Statistics
| Branch: | Tag: | Revision:

haketilo / html / options.html @ 544c6df3

1
<!doctype html>
2
<!--
3
    Copyright (C) 2021 Wojtek Kosior
4
    Redistribution terms are gathered in the `copyright' file.
5
  -->
6
<html>
7
  <head>
8
    <meta charset="utf-8"/>
9
    <title>Hachette options</title>
10
    <link type="text/css" rel="stylesheet" href="reset.css" />
11
    <link type="text/css" rel="stylesheet" href="base.css" />
12
    <style>
13
      body {
14
	  background-color: #f0f0f0;
15
	  color: #555;
16
	  overflow: auto;
17
	  width: 100%;
18
      }
19

    
20
      /* tabbed view */
21
      #show_repos:not(:checked) ~ #repos,
22
      #show_pages:not(:checked) ~ #pages,
23
      #show_bags:not(:checked) ~ #bags,
24
      #show_scripts:not(:checked) ~ #scripts {
25
	  display: none;
26
      }
27

    
28
      #show_repos:checked ~ div #repos_lbl,
29
      #show_pages:checked ~ div #pages_lbl,
30
      #show_bags:checked ~ div #bags_lbl,
31
      #show_scripts:checked ~ div #scripts_lbl {
32
	  background: #4CAF50;
33
          color: white;
34
      }
35

    
36
      #tab_heads>* {
37
	  font-size: 130%;
38
	  padding: 10px;
39
	  display: inline-block;
40
	  -moz-user-select: none;
41
	  user-select: none;
42
      }
43

    
44
      #import_but {
45
	  font: unset;
46
	  font-size: 130%;
47
	  float: right;
48
	  margin: 0;
49
	  border-radius: 0;
50
      }
51

    
52
      #tab_heads::after {
53
	  display: block;
54
	  height: 8px;
55
	  content: "";
56
	  background: linear-gradient(#555, transparent);
57
      }
58

    
59
      div.tab {
60
	  min-width: 50vw;
61
	  width: fit-content;
62
	  padding-left: 6px;
63
      }
64

    
65
      /* popup window with list of selectable components */
66
      .popup {
67
	  position: fixed;
68
	  width: 100vw;
69
	  height: 100vh;
70
	  left: 0;
71
	  top: 0;
72
	  background-color: rgba(60,60,60,0.4);
73
	  z-index: 1;
74
	  overflow: auto;
75
	  vertical-align: center;
76
	  horizontal-align: center;
77
      }
78

    
79
      .popup_frame {
80
	  background-color: #f0f0f0;
81
	  margin: 5vh auto;
82
	  padding: 15px;
83
	  border: solid #333 4px;
84
	  border-radius: 15px;
85
	  width: -moz-fit-content;
86
	  width: fit-content;
87
      }
88

    
89
      div.ul_container {
90
	  background-color: #f0f0f0;
91
	  width: -moz-fit-content;
92
	  width: fit-content;
93
	  margin: 6px 0;
94
      }
95

    
96
      div.ul_container::after, div.ul_container::before {
97
	  display: block;
98
	  height: 6px;
99
	  content: "";
100
	  background: linear-gradient(transparent, #555);
101
      }
102

    
103
      div.ul_container::after {
104
	  background: linear-gradient(#555, transparent);
105
      }
106

    
107
      .work_li div.ul_container::before {
108
	  background: linear-gradient(#e0f0f0, #555);
109
      }
110

    
111
      .work_li div.ul_container::after {
112
	  background: linear-gradient(#555, #e0f0f0);
113
      }
114

    
115
      div.ul_container>.always_scrollbar{
116
	  border-left: solid #454 8px;
117
	  max-height: 80vh;
118
	  overflow-y: scroll;
119
      }
120

    
121
      div.ul_container table {
122
	  border-collapse: unset;
123
      }
124

    
125
      div.ul_container, div.ul_container>*, div.ul_container table>tbody {
126
	  width: -moz-min-content;
127
	  width: min-content;
128
      }
129

    
130
      div.ul_container div.ul_container>.always_scrollbar,
131
      .popup_frame div.ul_container>.always_scrollbar {
132
	  max-height: 60vh;
133
      }
134

    
135
      .popup_frame div.ul_container table {
136
	  min-width: 30vw;
137
      }
138

    
139
      .popup_frame div.ul_container {
140
	  margin: 0 auto;
141
      }
142

    
143
      tr:nth-child(odd) {
144
	  background-color: #e5e5e5;
145
      }
146

    
147
      td {
148
	  vertical-align: middle;
149
	  min-width: fit-content;
150
	  min-width: -moz-fit-content;
151
	  width: 1%;
152
      }
153

    
154
      tr>td:first-child {
155
	  padding: 3px 10px 6px;
156
	  max-width: 70vw;
157
	  overflow: hidden;
158
	  width: 100%;
159
	  white-space: nowrap;
160
      }
161

    
162
      tr.work_li>td:first-child {
163
	  padding-right: 0;
164
	  max-width: unset;
165
      }
166

    
167
      tr.work_li>td>div {
168
	  background-color: #e0f0f0;
169
	  border-left: solid #454 5px;
170
	  border-right: solid #454 2px;
171
	  padding: 5px 10px;
172
      }
173

    
174
      .form_grid {
175
	  display: grid;
176
	  grid-template-columns: auto auto;
177
      }
178

    
179
      .form_grid>label {
180
	  grid-column: 1 / span 1;
181
	  margin-right: 10px;
182
      }
183

    
184
      .form_grid label {
185
	  line-height: 34px; /* center text vertically */
186
      }
187

    
188
      .form_grid>input, .form_grid>span {
189
	  grid-column: 2 / span 1;
190
      }
191

    
192
      .form_grid>label[for="script_contents_field"],
193
      .form_grid>* {
194
	  grid-column: 1 / span 2;
195
      }
196

    
197
      .form_grid>textarea {
198
	  min-width: 70vw;
199
	  resize: none;
200
      }
201

    
202
      td>div.button {
203
	  margin-right: 4px;
204
      }
205

    
206
      input[type="radio"]:not(:checked)+.import_window_content {
207
	  display: none;
208
      }
209
    </style>
210
  </head>
211
  <body>
212
    <template>
213
      <tr id="item_li">
214
	<td></td>
215
	<td><div class="button"> Edit </div></td>
216
	<td><div class="button"> Remove </div></td>
217
	<td><div class="button"> Export </div></td>
218
      </tr>
219
      <tr id="bag_component_li">
220
	<td></td>
221
	<td><div class="button"> Remove </div></td>
222
      </tr>
223
      <tr id="chbx_component_li">
224
	<td>
225
	  <input type="checkbox" style="display: inline;"></input>
226
	  <span></span>
227
	</td>
228
      </tr>
229
      <tr id="radio_component_li">
230
	<td>
231
	  <input type="radio" style="display: inline;" name="page_components"></input>
232
	  <span></span>
233
	</td>
234
      </tr>
235
    </template>
236

    
237
    <!-- Mind the show_*s ids below - their format is assumed in js code -->
238
    <input type="radio" name="tabs" id="show_repos"></input>
239
    <input type="radio" name="tabs" id="show_pages" checked></input>
240
    <input type="radio" name="tabs" id="show_bags"></input>
241
    <input type="radio" name="tabs" id="show_scripts"></input>
242
    <div id="tab_heads">
243
      <label for="show_repos" id="repos_lbl"> Repos </label>
244
      <label for="show_pages" id="pages_lbl"> Pages </label>
245
      <label for="show_bags" id="bags_lbl"> Bags </label>
246
      <label for="show_scripts" id="scripts_lbl"> Scripts </label>
247
      <button id="import_but" style="margin-left: 40px;"> Import </button>
248
    </div>
249
    <div id="repos" class="tab">
250
      <div class="ul_container">
251
	<div>
252
	  <table>
253
	    <tbody id="repos_ul">
254
	      <tr id="work_repo_li" class="hide work_li">
255
		<td colspan="4">
256
		  <div class="form_grid">
257
		    <label for="repo_url_field">URL: </label>
258
		    <input id="repo_url_field"></input>
259
		    <div>
260
		      <button id="save_repo_but" type="button"> Save </button>
261
		      <button id="discard_repo_but" type="button"> Cancel </button>
262
		    </div>
263
		  </div>
264
		</td>
265
	      </tr>
266
	    </tbody>
267
	  </table>
268
	</div>
269
      </div>
270
      <button id="add_repo_but" type="button"> Add repository </button>
271
    </div>
272
    <div id="pages" class="tab">
273
      <div class="ul_container">
274
	<div>
275
	  <table>
276
	    <tbody id="pages_ul">
277
	      <tr id="work_page_li" class="hide work_li">
278
		<td colspan="4">
279
		  <div class="form_grid">
280
		    <label for="page_url_field">URL: </label>
281
		    <input id="page_url_field"></input>
282
		    <label>Payload: </label>
283
		    <span>
284
		      <span id="page_payload"></span>
285
		      <button id="select_page_components_but">
286
			Choose payload
287
		      </button>
288
		    </span>
289
		    <div>
290
		      <input id="page_allow_chbx" type="checkbox" style="display: inline;"></input>
291
		      <label for="page_allow_chbx">Allow native scripts</label>
292
		    </div>
293
		    <div>
294
		      <button id="save_page_but" type="button"> Save </button>
295
		      <button id="discard_page_but" type="button"> Cancel </button>
296
		    </div>
297
		  </div>
298
		</td>
299
	      </tr>
300
	    </tbody>
301
	  </table>
302
	</div>
303
      </div>
304
      <button id="add_page_but" type="button"> Add page </button>
305
    </div>
306
    <div id="bags" class="tab">
307
      <div class="ul_container">
308
	<div>
309
	  <table>
310
	    <tbody id="bags_ul">
311
	      <tr id="work_bag_li" class="hide work_li">
312
		<td colspan="4">
313
		  <div class="form_grid">
314
		    <label for="bag_name_field"> Name: </label>
315
		    <input id="bag_name_field"></input>
316
		    <div class="ul_container">
317
		      <div>
318
			<table>
319
			  <tbody id="bag_components_ul">
320
			    <tr id="empty_bag_component_li" class="hide"></tr>
321
			  </tbody>
322
			</table>
323
		      </div>
324
		    </div>
325
		    <div>
326
		      <button id="select_bag_components_but">
327
			Add scripts
328
		      </button>
329
		    </div>
330
		    <div>
331
		      <button id="save_bag_but"> Save </button>
332
		      <button id="discard_bag_but"> Cancel </button>
333
		    </div>
334
		  </div>
335
		</td>
336
	      </tr>
337
	    </tbody>
338
	  </table>
339
	</div>
340
      </div>
341
      <button id="add_bag_but" type="button"> Add bag </button>
342
    </div>
343
    <div id="scripts" class="tab">
344
      <div class="ul_container">
345
	<div>
346
	  <table>
347
	    <tbody id="scripts_ul">
348
	      <tr id="work_script_li" class="hide work_li">
349
		<td colspan="4">
350
		  <div class="form_grid">
351
		    <label for="script_name_field"> Name: </label>
352
		    <input id="script_name_field"></input>
353
		    <label for="script_url_field"> URL: </label>
354
		    <input id="script_url_field"></input>
355
		    <label for="script_sha256_field"> SHA256: </label>
356
		    <input id="script_sha256_field"></input>
357
		    <aside>
358
		      Note: URL and SHA256 are ignored if script text is provided.
359
		    </aside>
360
		    <label for="script_contents_field"> contents: </label>
361
		    <textarea id="script_contents_field" rows="20" cols="80"></textarea>
362
		    <div>
363
		      <button id="save_script_but"> Save </button>
364
		      <button id="discard_script_but"> Cancel </button>
365
		    </div>
366
		  </div>
367
		</td>
368
	      </tr>
369
	    </tbody>
370
	  </table>
371
	</div>
372
      </div>
373
      <button id="add_script_but" type="button"> Add script </button>
374
    </div>
375

    
376
    <div id="chbx_components_window" class="hide popup" position="absolute">
377
      <div class="popup_frame">
378
	<div class="ul_container">
379
	  <div>
380
	    <table>
381
	      <tbody id="chbx_components_ul">
382
	      </tbody>
383
	    </table>
384
	  </div>
385
	</div>
386
	<button id="commit_bag_components_but"> Add </button>
387
	<button id="cancel_bag_components_but"> Cancel </button>
388
      </div>
389
    </div>
390

    
391
    <div id="radio_components_window" class="hide popup" position="absolute">
392
      <div class="popup_frame">
393
	<div class="ul_container">
394
	  <div class="always_scrollbar">
395
	    <table>
396
	      <tbody id="radio_components_ul">
397
		<tr id="radio_component_none_li">
398
		  <td>
399
		    <input id="radio_component_none_input" type="radio" style="display: inline;" name="page_components"></input>
400
		    <span>(None)</span>
401
		  </td>
402
		</tr>
403
	      </tbody>
404
	    </table>
405
	  </div>
406
	</div>
407
	<button id="commit_page_components_but"> Choose </button>
408
	<button id="cancel_page_components_but"> Cancel </button>
409
      </div>
410
    </div>
411

    
412
    <div id="import_window" class="hide popup" position="absolute">
413
      <div class="popup_frame">
414
	<IMPORT html/import_frame.html />
415
      </div>
416
    </div>
417

    
418
    <a id="file_downloader" class="hide"></a>
419
    <form id="file_opener_form" style="visibility: hidden;">
420
      <input type="file" id="file_opener"></input>
421
    </form>_OPTIONSSCRIPTS_
422
  </body>
423
</html>
(7-7/9)