-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathoptions.html
More file actions
186 lines (154 loc) · 4.42 KB
/
options.html
File metadata and controls
186 lines (154 loc) · 4.42 KB
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Tab Limiter Options</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="color-scheme" content="light dark">
<link
rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/@picocss/pico@2/css/pico.min.css"
>
<style>
body {
max-width: 500px;
margin: 0 auto;
}
.row {
display: flex;
align-items: center;
gap: 8px;
}
input[type="number"] {
width: 4em;
margin-bottom: 0;
}
.row input[type="text"] {
flex: 1;
margin-bottom: 0;
}
.row select {
width: auto;
margin-bottom: 0;
}
.row button {
margin-bottom: 0;
width: auto;
}
.num-stepper {
display: inline-flex;
align-items: stretch;
margin-bottom: 0;
}
.num-stepper input[type="number"] {
width: 2.2em;
text-align: center;
margin: 0;
padding-left: 5px;
padding-right: 5px;
border-radius: 0;
border-left: 0;
border-right: 0;
appearance: textfield;
-webkit-appearance: textfield;
}
.num-stepper input[type="number"]::-webkit-inner-spin-button,
.num-stepper input[type="number"]::-webkit-outer-spin-button {
display: none;
}
.num-stepper button {
margin: 0;
padding: 0 7px;
width: auto;
}
.num-stepper button:first-child {
border-top-right-radius: 0;
border-bottom-right-radius: 0;
}
.num-stepper button:last-child {
border-top-left-radius: 0;
border-bottom-left-radius: 0;
}
fieldset {
margin-top: 2em;
}
fieldset legend * {
margin: 0;
}
table {
margin-top: 0;
}
td, th {
padding-left: 10px;
padding-right: 10px;
}
tr td:first-child, tr th:first-child {
padding-left: 0
}
tr td:last-child, tr th:last-child {
text-align: right;
padding-right: 0
}
table select {
margin-bottom: 0;
width: auto;
}
table button {
margin-bottom: 0;
width: auto;
padding: 4px 10px;
}
[type=button] {
margin-bottom: 0;
}
</style>
<script src="options.js"></script>
</head>
<body>
<main class="container">
<h1>Tab Limiter</h1>
<div class="row">
<label for="total-limit" style="white-space: nowrap; margin: 0;">Global tab limit:</label>
<span id="total-limit"></span>
<span style="color: var(--pico-muted-color); font-size: 0.875em;">0 = unlimited</span>
</div>
<fieldset>
<legend>Global behavior:</legend>
<label><input type="radio" name="limit-action" id="action-block" value="block"> Block new tab</label>
<label><input type="radio" name="limit-action" id="action-close-oldest" value="close_oldest"> Close oldest
tab</label>
</fieldset>
<hr>
<fieldset>
<legend><h3>Add domain limit</h3></legend>
<form id="domain-form" class="row">
<input type="text" id="domain" name="domain" placeholder="example.com">
<div class="num-stepper">
<button type="button">−</button>
<input type="number" id="max-tabs" name="max-tabs" min="1" value="1">
<button type="button">+</button>
</div>
<button type="submit" style="width: auto; margin-bottom: 0;">+</button>
</form>
</fieldset>
<div id="domain-section" hidden>
<h2>Domains</h2>
<label>
<input type="checkbox" id="show-badge">
Show badge (tabs left for current domain)
</label>
<table>
<thead>
<tr>
<th>Domain</th>
<th>Max tabs</th>
<th>Behavior</th>
<th></th>
</tr>
</thead>
<tbody id="domain-list"></tbody>
</table>
</div>
</main>
</body>
</html>