Project

General

Profile

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

haketilo / html / options.html @ 792fbe18

1
<!doctype html>
2
<!--
3
    Copyright (C) 2021 Wojtek Kosior
4
    Copyright (C) 2021 Nicholas Johnson
5
    Redistribution terms are gathered in the `copyright' file.
6
  -->
7
<html>
8
  <head>
9
    <meta charset="utf-8"/>
10
    <title>Hachette options</title>
11
    <link type="text/css" rel="stylesheet" href="base.css" />
12
    <style>
13
      /* pages list */
14
      #page_components_ul {
15
	  max-height: 80vh;
16
	  overflow-y: auto;
17
      }
18
      #page_components_ul li.dragover_li {
19
	  border-top: 2px solid blue;
20
      }
21
      #page_components_ul li {
22
	  border-top: 2px solid white;
23
      }
24
      li[draggable=true] * {
25
	  pointer-events: none;
26
      }
27
      li[draggable=true] label,
28
      li[draggable=true] button {
29
	  pointer-events: auto;
30
      }
31

    
32
      /* tabbed view */
33
      #show_repos:not(:checked) ~ #repos,
34
      #show_pages:not(:checked) ~ #pages,
35
      #show_bags:not(:checked) ~ #bags,
36
      #show_scripts:not(:checked) ~ #scripts {
37
	  display: none;
38
      }
39

    
40
      #show_repos:checked ~ #repos_lbl,
41
      #show_pages:checked ~ #pages_lbl,
42
      #show_bags:checked ~ #bags_lbl,
43
      #show_scripts:checked ~ #scripts_lbl {
44
	  background: #4CAF50;
45
          color: white;
46
      }
47

    
48
      body > div {
49
	  border-top: 6px solid #4CAF50;
50
      }
51

    
52
      .tab_head {
53
	  display: inline-block;
54
      }
55

    
56
      /* popup window with list of selectable components */
57
      .popup {
58
	  position: fixed;
59
	  width: 100vw;
60
	  height: 100vh;
61
	  left: 0;
62
	  top: 0;
63
	  background-color: rgba(0,0,0,0.4);
64
	  z-index: 1;
65
	  overflow: auto;
66
	  vertical-align: center;
67
	  horizontal-align: center;
68
      }
69

    
70
      .popup_frame {
71
	  background-color: white;
72
	  width: 50vw;
73
      }
74

    
75
      input[type="radio"]:not(:checked)+.import_window_content {
76
	  display: none;
77
      }
78
    </style>
79
  </head>
80
  <body>
81
    <!-- The invisible div below is for elements that will be cloned. -->
82
    <div class="hide">
83
      <li id="item_li_template">
84
	<span></span>
85
	<button> Edit </button>
86
	<button> Remove </button>
87
	<button> Export </button>
88
      </li>
89
      <li id="bag_component_li_template">
90
	<span></span>
91
	<button> Remove </button>
92
      </li>
93
      <li id="chbx_component_li_template">
94
	<input type="checkbox" style="display: inline;"></input>
95
	<span></span>
96
      </li>
97
      <li id="radio_component_li_template">
98
	<input type="radio" style="display: inline;" name="page_components"></input>
99
	<span></span>
100
      </li>
101
    </div>
102

    
103
    <!-- Mind the show_*s ids below - their format is assumed in js code -->
104
    <input type="radio" name="tabs" id="show_repos"></input>
105
    <input type="radio" name="tabs" id="show_pages" checked></input>
106
    <input type="radio" name="tabs" id="show_bags"></input>
107
    <input type="radio" name="tabs" id="show_scripts"></input>
108
    <label for="show_repos" id="repos_lbl"
109
	   class="tab_head"> Repos </label>
110
    <label for="show_pages" id="pages_lbl"
111
	   class="tab_head"> Pages </label>
112
    <label for="show_bags" id="bags_lbl"
113
	   class="tab_head"> Bags </label>
114
    <label for="show_scripts" id="scripts_lbl"
115
	   class="tab_head"> Scripts </label>
116

    
117
    <div id="repos">
118
      <ul id="repos_ul">
119
	<li id="work_repo_li" class="hide">
120
	  <label for="repo_url_field">URL: </label>
121
	  <input id="repo_url_field"></input>
122
	  <br/>
123
	  <button id="save_repo_but" type="button"> Save </button>
124
	  <button id="discard_repo_but" type="button"> Cancel </button>
125
	</li>
126
      </ul>
127
      <button id="add_repo_but" type="button"> Add repository </button>
128
    </div>
129

    
130
    <div id="pages">
131
      <ul id="pages_ul">
132
	<li id="work_page_li" class="hide">
133
	  <label for="page_url_field">URL: </label>
134
	  <input id="page_url_field"></input>
135
	  <br/>
136
	  <label>Payload: </label>
137
	  <span id="page_payload"></span>
138
	  <button id="select_page_components_but">
139
	    Choose payload
140
	  </button>
141
	  <br/>
142
	  <input id="page_allow_chbx" type="checkbox" style="display: inline;"></input>
143
	  <label for="page_allow_chbx">Allow native scripts</label>
144
	  <br/>
145
	  <button id="save_page_but" type="button"> Save </button>
146
	  <button id="discard_page_but" type="button"> Cancel </button>
147
	</li>
148
      </ul>
149
      <button id="add_page_but" type="button"> Add page </button>
150
    </div>
151

    
152
    <div id="bags">
153
      <ul id="bags_ul">
154
	<li id="work_bag_li" class="hide">
155
	  <label for="bag_name_field"> Name: </label>
156
	  <input id="bag_name_field"></input>
157
	  <ul id="bag_components_ul">
158
	    <li id="empty_bag_component_li" class="hide"></li>
159
	  </ul>
160
	  <button id="select_bag_components_but">
161
	    Add scripts
162
	  </button>
163
	  <br/>
164
	  <button id="save_bag_but"> Save </button>
165
	  <button id="discard_bag_but"> Cancel </button>
166
	</li>
167
      </ul>
168
      <button id="add_bag_but" type="button"> Add bag </button>
169
    </div>
170

    
171
    <div id="scripts">
172
      <ul id="scripts_ul">
173
	<li id="work_script_li" class="hide">
174
	  <label for="script_name_field"> Name: </label>
175
	  <input id="script_name_field"></input>
176
	  <br/>
177
	  <label for="script_url_field"> URL: </label>
178
	  <input id="script_url_field"></input>
179
	  <br/>
180
	  <label for="script_sha256_field"> sha256: </label>
181
	  <input id="script_sha256_field"></input>
182
	  <br/>
183
	  <label for="script_contents_field"> contents: </label>
184
	  <textarea id="script_contents_field" rows="20" cols="80"></textarea>
185
	  <br/>
186
	  <button id="save_script_but"> Save </button>
187
	  <button id="discard_script_but"> Cancel </button>
188
	</li>
189
      </ul>
190
      <button id="add_script_but" type="button"> Add script </button>
191
    </div>
192

    
193
    <button id="import_but" style="margin-top: 40px;"> Import </button>
194

    
195
    <div id="chbx_components_window" class="hide popup" position="absolute">
196
      <div class="popup_frame">
197
	<ul id="chbx_components_ul">
198

    
199
	</ul>
200
	<button id="commit_bag_components_but"> Add </button>
201
	<button id="cancel_bag_components_but"> Cancel </button>
202
      </div>
203
    </div>
204

    
205
    <div id="radio_components_window" class="hide popup" position="absolute">
206
      <div class="popup_frame">
207
	<ul id="radio_components_ul">
208

    
209
	  <li id="radio_component_none_li">
210
	    <input id="radio_component_none_input" type="radio" style="display: inline;" name="page_components"></input>
211
	    <span>(None)</span>
212
	  </li>
213
	</ul>
214
	<button id="commit_page_components_but"> Choose </button>
215
	<button id="cancel_page_components_but"> Cancel </button>
216
      </div>
217
    </div>
218

    
219
    <div id="import_window" class="hide popup" position="absolute">
220
      <div class="popup_frame">
221
	<IMPORT html/import_frame.html />
222
      </div>
223
    </div>
224

    
225
    <a id="file_downloader" class="hide"></a>
226
    <form id="file_opener_form" style="visibility: hidden;">
227
      <input type="file" id="file_opener"></input>
228
    </form>_OPTIONSSCRIPTS_
229
  </body>
230
</html>
(7-7/8)