-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathTablet UI for Firefox settings.html
196 lines (184 loc) · 6.6 KB
/
Tablet UI for Firefox settings.html
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
187
188
189
190
191
192
193
194
195
196
<html>
<head>
<meta name="viewport" content="width=device-width">
<title>Tablet UI for Firefox Settings</title>
</head>
<body>
<h1>Tablet UI Settings v2.5</h1>
<form action="" method="post">
<h2>Appearance</h2>
<div class="options">
<h3>View buttons:</h3>
<h4>In vertical (portrait) mode:</h4>
<div class="options">
<input type="checkbox" name="showBackButtonVertical" id="vehicle2" value="true">
<label for="vehicle2">Back button</label><br>
<input type="checkbox" name="showReloadButtonVertical" id="vehicle1" value="true">
<label for="vehicle1">Reload button</label><br>
<input type="checkbox" name="showForwardButtonVertical" id="vehicle3" value="true">
<label for="vehicle3">Forward button</label><br>
</div>
<h4>In horizontal (landscape) mode:</h4>
<div class="options">
<input type="checkbox" name="showBackButtonHorizontal" id="vehicle4" value="true">
<label for="vehicle4">Back button</label><br>
<input type="checkbox" name="showReloadButtonHorizontal" id="vehicle5" value="true">
<label for="vehicle5">Reload button</label><br>
<input type="checkbox" name="showForwardButtonHorizontal" id="vehicle6" value="true">
<label for="vehicle6">Forward button</label><br>
</div>
<div>
<h3>Tab bar:</h3>
<div>
<label class="inlineTextAndInput">Font size:</label>
<input type="number" min="5" name="fontSize" style="width: 5em" step="0.1" value="14.4" id="fontSize">
<label class="inlineTextAndInput">px</label>
</div>
<label class="inlineTextAndInput">Height:</label>
<input type="number" min="20" name="height" style="width: 5em" value="50">
<label class="inlineTextAndInput">px</label>
<h4>Place the tab bar: </h4>
<div class="options">
<input type="radio" id="B" name="place" value="bottom" checked="">
<label for="B">On the bottom of the screen <strong>(recommended) </strong></label><br>
<input type="radio" id="2" name="place" value="top">
<label for="2">On the top of the screen (not recommended; breaks layout on some pages)</label><br>
</div>
<h4>Open the new tab at:</h4>
<div class="options">
<input type="radio" id="5" name="placeNewTab" value="default" checked="">
<label for="5">At the end of the tab list</label><br>
<input type="radio" id="6" name="placeNewTab" value="insertAfterCurrent">
<label for="6">Next to the current active tab</label>
</div>
<h4>When closing the tab you're on </h4>
<div class="options">
<label>switch to the</label>
<select style="width:5rem" name="to">
<option value="left" selected="">left</option>
<option value="right">right</option>
<option value="don't interfere with the browser">don't interfere with the browser</option>
</select>
<label class="inlineTextAndInput">tab</label>
</div>
</div>
</div>
<h2>New tab Search Engine</h2>
<div class="options">
<input type="radio" id="Google" name="searchEngine" value="https://www.google.com" checked="">
<label for="Google">Google</label><br>
<input type="radio" id="Bing" name="searchEngine" value="https://bing.com">
<label for="Bing">Bing</label><br>
<input type="radio" id="DuckDuckGo" name="searchEngine" value="https://duckduckgo.com">
<label for="DuckDuckGo">DuckDuckGo</label><br>
<input type="radio" id="other" name="searchEngine" value="other">
<label for="other">Other:</label>
<!-- the type url declaration quietly fails the form submit REGARDLESS IF other IS SELECTED AND THE URL FIELD IS NOT SELECTED and will not TELL ABOUT IT (BUG, because of e.preventDefault in form submit) => doing all URL checks in JS USING REGEX -->
<input id="searchEngineOther" placeholder="https://">
</div>
<input type="submit" class="button save" value="Save options">
<label class="hidden" id="storedInStorageIndicator" style="font-weight:501;margin-left: 10px;color: green">Saved</label><br>
<label class="hidden" id="settingsResetIndicator" style="font-weight:501;margin-left: 10px;color: green">Reset to defaults settings</label>
<input type="button" class="button" id="resetSettingsr" value="Restore default options">
</form>
<div class="prompt dataNotSaved hidden">
<h4>Data not saved:</h4>
<label>Enter valid a valid URL for search engine or select a different search engine</label>
<div style="margin:10px;text-align: right;">
<button id="confirm" class="save" style="color: white;width: 5em;">OK</button>
</div>
</div>
<div class="prompt reset hidden">
<h4>Reset:</h4>
<label>Are you sure you want to reset settings? After resetting settings page reloads may be needed</label>
<div style="margin:10px;text-align: right;">
<button id="resetSettings" class="save" style="color: white;width: 5em;margin-right: 20px">Yes</button>
<button id="cancel">Cancel</button>
</div>
</div>
<style type="text/css">
.inlineTextAndInput{
display:inline-block;
padding-right: 7px;
}
.prompt{
position: fixed;
bottom: 100px;
background: white;
color: black;
border: 3px solid black;
width: 95%;
height: fit-content;
border-radius: 4px;
}
.prompt > label{
display: block;
margin: 3px;
}
.button{
margin-top: 30px;
cursor: grab;
border-radius: 4px;
min-height: 32px;
padding: 3px 10px;
font-size: 1.2rem;
margin-right: 20px
}
.save{
background-color: #009fff;
border: none;
color: white;
}
.button:active{
translate: 0px 2px;
}
.options{
padding-left: 10px;
line-height: 1.7;
}
input[type='checkbox'], input[type='radio']{
transform: scale(1.4)
}
h2{
border-bottom: 4px solid #0060df;
line-height: 1.2;
border-radius: 3px;
width: fit-content;
}
h4{
font-size: 1.125rem;
padding-left: 10px;
margin-bottom: 15px;
}
div h4:first-of-type{
margin-top: 10px
}
button{
position: sticky;
bottom: 0;
margin-top: 30px;
font-size: 1.2rem;
}
body{
font-family: sans-serif;
}
label{
font-size: 1.2rem;
padding: 5px;
}
.hidden{
display: none;
}
@media (prefers-color-scheme: dark) {
body{
background: #1c1b22;
color: #ddd;
}
.dataNotSaved{
color: black;
}
}
</style>
<script src="settings.js"></script>
</body>
</html>