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
|
</style>
|
93
|
</head>
|
94
|
<body>
|
95
|
<!-- The invisible div below is for elements that will be cloned. -->
|
96
|
<div style="display: none;">
|
97
|
<li id="item_li_template">
|
98
|
<span></span>
|
99
|
<button> Edit </button>
|
100
|
<button> Remove </button>
|
101
|
</li>
|
102
|
<li id="bag_component_li_template">
|
103
|
<span></span>
|
104
|
<button> Remove </button>
|
105
|
</li>
|
106
|
<li id="chbx_component_li_template">
|
107
|
<input type="checkbox" style="display: inline;"></input>
|
108
|
<span></span>
|
109
|
</li>
|
110
|
<li id="radio_component_li_template">
|
111
|
<input type="radio" style="display: inline;" name="page_components"></input>
|
112
|
<span></span>
|
113
|
</li>
|
114
|
</div>
|
115
|
|
116
|
<input type="radio" name="tabs" id="show_pages" checked></input>
|
117
|
<input type="radio" name="tabs" id="show_bags"></input>
|
118
|
<input type="radio" name="tabs" id="show_scripts"></input>
|
119
|
<label for="show_pages" id="pages_lbl"
|
120
|
class="tab_head"> Pages </label>
|
121
|
<label for="show_bags" id="bags_lbl"
|
122
|
class="tab_head"> Bags </label>
|
123
|
<label for="show_scripts" id="scripts_lbl"
|
124
|
class="tab_head"> Scripts </label>
|
125
|
|
126
|
<div id="pages">
|
127
|
<ul id="pages_ul">
|
128
|
<li id="work_page_li" class="hide">
|
129
|
<label for="page_url_field">URL: </label>
|
130
|
<input id="page_url_field"></input>
|
131
|
<br/>
|
132
|
<label>Payload: </label>
|
133
|
<span id="page_payload"></span>
|
134
|
<button id="select_page_components_but">
|
135
|
Choose payload
|
136
|
</button>
|
137
|
<br/>
|
138
|
<input id="page_allow_chbx" type="checkbox" style="display: inline;"></input>
|
139
|
<label for="page_allow_chbx">Allow native scripts</label>
|
140
|
<br/>
|
141
|
<button id="save_page_but" type="button"> Save </button>
|
142
|
<button id="discard_page_but" type="button"> Cancel </button>
|
143
|
</li>
|
144
|
</ul>
|
145
|
<button id="add_page_but" type="button"> Add page </button>
|
146
|
</div>
|
147
|
|
148
|
<div id="bags">
|
149
|
<ul id="bags_ul">
|
150
|
<li id="work_bag_li" class="hide">
|
151
|
<label for="bag_name_field"> Name: </label>
|
152
|
<input id="bag_name_field"></input>
|
153
|
<ul id="bag_components_ul">
|
154
|
<li id="empty_bag_component_li" class="hide"></li>
|
155
|
</ul>
|
156
|
<button id="select_bag_components_but">
|
157
|
Add scripts
|
158
|
</button>
|
159
|
<br/>
|
160
|
<button id="save_bag_but"> Save </button>
|
161
|
<button id="discard_bag_but"> Cancel </button>
|
162
|
</li>
|
163
|
</ul>
|
164
|
<button id="add_bag_but" type="button"> Add bag </button>
|
165
|
</div>
|
166
|
|
167
|
<div id="scripts">
|
168
|
<ul id="scripts_ul">
|
169
|
<li id="work_script_li" class="hide">
|
170
|
<label for="script_name_field"> Name: </label>
|
171
|
<input id="script_name_field"></input>
|
172
|
<br/>
|
173
|
<label for="script_url_field"> URL: </label>
|
174
|
<input id="script_url_field"></input>
|
175
|
<br/>
|
176
|
<label for="script_sha256_field"> sha256: </label>
|
177
|
<input id="script_sha256_field"></input>
|
178
|
<br/>
|
179
|
<label for="script_contents_field"> contents: </label>
|
180
|
<textarea id="script_contents_field" rows="20" cols="80"></textarea>
|
181
|
<br/>
|
182
|
<button id="save_script_but"> Save </button>
|
183
|
<button id="discard_script_but"> Cancel </button>
|
184
|
</li>
|
185
|
</ul>
|
186
|
<button id="add_script_but" type="button"> Add script </button>
|
187
|
</div>
|
188
|
|
189
|
<div id="chbx_components_window" class="hide popup" position="absolute">
|
190
|
<div class="popup_frame">
|
191
|
<ul id="chbx_components_ul">
|
192
|
|
193
|
</ul>
|
194
|
<button id="commit_bag_components_but"> Add </button>
|
195
|
<button id="cancel_bag_components_but"> Cancel </button>
|
196
|
</div>
|
197
|
</div>
|
198
|
|
199
|
<div id="radio_components_window" class="hide popup" position="absolute">
|
200
|
<div class="popup_frame">
|
201
|
<ul id="radio_components_ul">
|
202
|
|
203
|
<li id="radio_component_none_li">
|
204
|
<input id="radio_component_none_input" type="radio" style="display: inline;" name="page_components"></input>
|
205
|
<span>(None)</span>
|
206
|
</li>
|
207
|
</ul>
|
208
|
<button id="commit_page_components_but"> Choose </button>
|
209
|
<button id="cancel_page_components_but"> Cancel </button>
|
210
|
</div>
|
211
|
</div>
|
212
|
|
213
|
<script src="/common/connection_types.js"></script>
|
214
|
<script src="/common/stored_types.js"></script>
|
215
|
<script src="/common/once.js"></script>
|
216
|
<script src="/common/browser.js"></script>
|
217
|
<script src="/common/storage_client.js"></script>
|
218
|
<script src="./options_main.js"></script>
|
219
|
</body>
|
220
|
</html>
|