Project

General

Profile

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

haketilo / html / options.html @ 659f532e

1
<!doctype html>
2
<!--
3
    Copyright (C) 2021 Wojtek Kosior
4

    
5
    This code is dual-licensed under:
6
    - Asshole license 1.0,
7
    - GPLv3 or (at your option) any later version
8

    
9
    "dual-licensed" means you can choose the license you prefer.
10

    
11
    This code is released under a permissive license because I disapprove of
12
    copyright and wouldn't be willing to sue a violator. Despite not putting
13
    this code under copyleft (which is also kind of copyright), I do not want
14
    it to be made proprietary. Hence, the permissive alternative to GPL is the
15
    Asshole license 1.0 that allows me to call you an asshole if you use it.
16
    This means you're legally ok regardless of how you utilize this code but if
17
    you make it into something nonfree, you're an asshole.
18

    
19
    You should have received a copy of both GPLv3 and Asshole license 1.0
20
    together with this code. If not, please see:
21
    - https://www.gnu.org/licenses/gpl-3.0.en.html
22
    - https://koszko.org/asshole-license.txt
23
  -->
24
<html>
25
  <head>
26
    <meta charset="utf-8"/>
27
    <title>Myext options</title>
28
    <style>
29
      input[type="checkbox"], input[type="radio"], .hide, .popup.hide {
30
	  display: none;
31
      }
32

    
33
      /* pages list */
34
      #page_components_ul {
35
	  max-height: 80vh;
36
	  overflow-y: auto;
37
      }
38
      #page_components_ul li.dragover_li {
39
	  border-top: 2px solid blue;
40
      }
41
      #page_components_ul li {
42
	  border-top: 2px solid white;
43
      }
44
      li[draggable=true] * {
45
	  pointer-events: none;
46
      }
47
      li[draggable=true] label,
48
      li[draggable=true] button {
49
	  pointer-events: auto;
50
      }
51

    
52
      /* tabbed view */
53
      #show_pages:not(:checked) ~ #pages,
54
      #show_bags:not(:checked) ~ #bags,
55
      #show_scripts:not(:checked) ~ #scripts {
56
	  display: none;
57
      }
58

    
59
      #show_pages:checked ~ #pages_lbl,
60
      #show_bags:checked ~ #bags_lbl,
61
      #show_scripts:checked ~ #scripts_lbl {
62
	  border-left: 2px solid green;
63
	  border-right: 2px solid green;
64
      }
65

    
66
      body > div {
67
	  border-top: 2px solid green;
68
      }
69

    
70
      .tab_head {
71
	  display: inline-block;
72
      }
73

    
74
      /* popup window with list of selectable components */
75
      .popup {
76
	  position: fixed;
77
	  width: 100vw;
78
	  height: 100vh;
79
	  left: 0;
80
	  top: 0;
81
	  background-color: rgba(0,0,0,0.4);
82
	  z-index: 1;
83
	  overflow: auto;
84
	  vertical-align: center;
85
	  horizontal-align: center;
86
      }
87

    
88
      .popup_frame {
89
	  background-color: white;
90
	  width: 50vw;
91
      }
92

    
93
      input[type="radio"]:not(:checked)+.import_window_content {
94
	  display: none;
95
      }
96
    </style>
97
  </head>
98
  <body>
99
    <!-- The invisible div below is for elements that will be cloned. -->
100
    <div class="hide">
101
      <li id="item_li_template">
102
	<span></span>
103
	<button> Edit </button>
104
	<button> Remove </button>
105
	<button> Export </button>
106
      </li>
107
      <li id="bag_component_li_template">
108
	<span></span>
109
	<button> Remove </button>
110
      </li>
111
      <li id="chbx_component_li_template">
112
	<input type="checkbox" style="display: inline;"></input>
113
	<span></span>
114
      </li>
115
      <li id="radio_component_li_template">
116
	<input type="radio" style="display: inline;" name="page_components"></input>
117
	<span></span>
118
      </li>
119
      <li id="import_li_template">
120
	<span></span>
121
	<input type="checkbox" style="display: inline;" checked></input>
122
	<span></span>
123
      </li>
124
    </div>
125

    
126
    <input type="radio" name="tabs" id="show_pages" checked></input>
127
    <input type="radio" name="tabs" id="show_bags"></input>
128
    <input type="radio" name="tabs" id="show_scripts"></input>
129
    <label for="show_pages" id="pages_lbl"
130
	   class="tab_head"> Pages </label>
131
    <label for="show_bags" id="bags_lbl"
132
	   class="tab_head"> Bags </label>
133
    <label for="show_scripts" id="scripts_lbl"
134
	   class="tab_head"> Scripts </label>
135

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

    
158
    <div id="bags">
159
      <ul id="bags_ul">
160
	<li id="work_bag_li" class="hide">
161
	  <label for="bag_name_field"> Name: </label>
162
	  <input id="bag_name_field"></input>
163
	  <ul id="bag_components_ul">
164
	    <li id="empty_bag_component_li" class="hide"></li>
165
	  </ul>
166
	  <button id="select_bag_components_but">
167
	    Add scripts
168
	  </button>
169
	  <br/>
170
	  <button id="save_bag_but"> Save </button>
171
	  <button id="discard_bag_but"> Cancel </button>
172
	</li>
173
      </ul>
174
      <button id="add_bag_but" type="button"> Add bag </button>
175
    </div>
176

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

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

    
201
    <div id="chbx_components_window" class="hide popup" position="absolute">
202
      <div class="popup_frame">
203
	<ul id="chbx_components_ul">
204

    
205
	</ul>
206
	<button id="commit_bag_components_but"> Add </button>
207
	<button id="cancel_bag_components_but"> Cancel </button>
208
      </div>
209
    </div>
210

    
211
    <div id="radio_components_window" class="hide popup" position="absolute">
212
      <div class="popup_frame">
213
	<ul id="radio_components_ul">
214

    
215
	  <li id="radio_component_none_li">
216
	    <input id="radio_component_none_input" type="radio" style="display: inline;" name="page_components"></input>
217
	    <span>(None)</span>
218
	  </li>
219
	</ul>
220
	<button id="commit_page_components_but"> Choose </button>
221
	<button id="cancel_page_components_but"> Cancel </button>
222
      </div>
223
    </div>
224

    
225
    <div id="import_window" class="hide popup" position="absolute">
226
      <div class="popup_frame">
227
	<h2> Settings import </h2>
228
	<input id="import_loading_radio" type="radio" name="import_window_content"></input>
229
	<span class="import_window_content"> Loading... </span>
230
	<input id="import_failed_radio" type="radio" name="import_window_content"></input>
231
	<div class="import_window_content">
232
	  <span> Bad file :( </span>
233
	  <pre id="bad_file_errormsg"></pre>
234
	  <button id="import_failok_but"> OK </button>
235
	</div>
236
	<input id="import_selection_radio" type="radio" name="import_window_content"></input>
237
	<div class="import_window_content">
238
	  <button id="check_all_import_but"> Check all </button>
239
	  <button id="uncheck_all_import_but"> Uncheck all </button>
240
	  <button id="uncheck_colliding_import_but"> Uncheck existing </button>
241
	  <ul id="import_ul">
242
	  </ul>
243
	  <button id="commit_import_but"> OK </button>
244
	  <button id="cancel_import_but"> Cancel </button>
245
	</div>
246
      </div>
247
    </div>
248

    
249
    <a id="file_downloader" class="hide"></a>
250
    <form id="file_opener_form" style="visibility: hidden;">
251
      <input type="file" id="file_opener"></input>
252
    </form>
253

    
254
    <script src="/common/connection_types.js"></script>
255
    <script src="/common/stored_types.js"></script>
256
    <script src="/common/once.js"></script>
257
    <script src="/common/browser.js"></script>
258
    <script src="/common/storage_client.js"></script>
259
    <script src="./options_main.js"></script>
260
  </body>
261
</html>
(3-3/4)