Project

General

Profile

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

haketilo / html / settings.html @ 1f9ccef9

1
<!DOCTYPE html>
2
<!--
3
    SPDX-License-Identifier: GPL-3.0-or-later OR CC-BY-SA-4.0
4

    
5
    Haketilo's settings page
6

    
7
    This file is part of Haketilo.
8

    
9
    Copyright (C) 2022 Wojtek Kosior <koszko@koszko.org>
10

    
11
    File is dual-licensed. You can choose either GPLv3+, CC BY-SA or both.
12

    
13
    This program is free software: you can redistribute it and/or modify
14
    it under the terms of the GNU General Public License as published by
15
    the Free Software Foundation, either version 3 of the License, or
16
    (at your option) any later version.
17

    
18
    This program is distributed in the hope that it will be useful,
19
    but WITHOUT ANY WARRANTY; without even the implied warranty of
20
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21
    GNU General Public License for more details.
22

    
23
    You should have received a copy of the GNU General Public License
24
    along with this program.  If not, see <https://www.gnu.org/licenses/>.
25

    
26
    I, Wojtek Kosior, thereby promise not to sue for violation of this file's
27
    licenses. Although I request that you do not make use of this code in a
28
    proprietary program, I am not going to enforce this in court.
29
  -->
30
<html>
31
  <head>
32
    <meta charset="utf-8"/>
33
    <title>Haketilo options</title>
34
#LOADCSS html/reset.css
35
#LOADCSS html/base.css
36
#LOADCSS html/grid.css
37
    <style>
38
      .full_page_msg {
39
	  margin: auto;
40
	  padding: 1em;
41
	  max-width: 800px;
42
      }
43
      .full_page_msg p {
44
	  margin-bottom: 1em;
45
      }
46

    
47
      /* Style top menu items. */
48
      #tab_heads>* {
49
	  background-color: #70AF70;
50
	  font-size: 115%;
51
	  padding: 0.6em;
52
	  display: inline-block;
53
	  cursor: pointer;
54
	  margin: 0.25em 0 0 0;
55
      }
56
      body {
57
	  /* 0.25em margin + 1em height + 2*0.6em padding, multiple font size */
58
	  --heading-height: calc(2.45em * 1.15);
59
	  --tab-content-height: calc(100vh - var(--heading-height));
60
      }
61
      #tab_heads>:hover {
62
	  box-shadow: 0 6px 8px 0 rgba(0,0,0,0.24), 0 17px 50px 0 rgba(0,0,0,0.19);
63
      }
64
      #tab_heads>.active_head {
65
	  background-color: #65A065;
66
	  color: #222;
67
	  box-shadow: none;
68
	  cursor: default;
69
      }
70

    
71
      /* Style the top menu itself. */
72
      #tab_heads {
73
	  -moz-user-select: none;
74
	  user-select: none;
75
	  background-color: #e0e0e0;
76
      }
77
      #top_menu_line {
78
	  position: absolute;
79
	  width: 100vw;
80
	  z-index: 1;
81
      }
82

    
83
      /* Style content */
84
      body {
85
	  --content-max-width: 1000px;
86
	  height: 100vh;
87
	  overflow-x: hidden;
88
	  overflow-y: hidden;
89
      }
90
      div.tab {
91
	  display: none;
92
      }
93
      div.tab.active_tab {
94
	  display: block;
95
      }
96

    
97
      /* Style the Script blocking and Repositories tabs. */
98
      #blocking_list_container, #allowing_list_container,
99
      #default_policy_dialog, #blocking_dialog_container,
100
      #repos_list_container, #repos_dialog_container {
101
	  padding: 0.8em 0.4em 0.4em 0.4em;
102
      }
103
      #blocking_editable_container, #blocking_dialog_container,
104
      #repos_list_container, #repos_dialog_container {
105
	  max-width: var(--content-max-width);
106
	  margin: 0 auto;
107
      }
108
      #blocking_editable_container {
109
	  /* Leave space for default policy dialog and headings. */
110
	  --content-height: calc(var(--tab-content-height) - 3em);
111
      }
112

    
113
      /* Pass height information to html in all tabs. */
114
      .tab {
115
	  --content-height: var(--tab-content-height);
116
      }
117
    </style>
118
  </head>
119
  <body>
120
    <!-- Those contain just templates, we can include them at the top -->
121
#INCLUDE html/dialog.html
122
#INCLUDE html/item_list.html
123
#INCLUDE html/item_preview.html
124
#INCLUDE html/text_entry_list.html
125
#INCLUDE html/payload_create.html
126
    <div id="loader" class="full_page_msg">
127
      <p>
128
	Loading settings page...
129
      </p>
130
    </div>
131
    <div id="indexeddb_error" class="hide full_page_msg">
132
      <p>
133
	Cannot display settings page.
134
      </p>
135
      <p>
136
	Haketilo could not access IndexedDB. IndexedDB is an in-browser
137
	database in which Haketilo stores all its configuration. Without it, the
138
	settings page is non-operational.
139
      <p>
140
    </div>
141
#IF MOZILLA
142
    <div id="private_mode_error" class="hide full_page_msg">
143
      <p>
144
	The settings page could not be displayed in a private window.
145
      </p>
146
      <p>
147
	Due to bug <a href="https://hydrillabugs.koszko.org/issues/115">#115</a>
148
	it is currently impossible to access Haketilo settings when in Private
149
	Browsing mode. You can instead open this settings page in a non-private
150
	window. Changes you make there shall affect websites browsed in Private
151
	Mode as well.
152
      </p>
153
    </div>
154
#ENDIF
155
    <div id="main_view" class="hide">
156
      <ul id="tab_heads">
157
	<li id="blocking_head"> Blocking </li>
158
	<li id="mappings_head"> Mappings </li>
159
	<li id="resources_head"> Resources </li>
160
	<li id="new_payload_head" class="active_head"> New payload </li>
161
	<li id="repos_head"> Repositories </li>
162
      </ul>
163
      <div id="top_menu_line" class="top_line"></div>
164
      <div id="blocking_tab" class="tab">
165
	<div id="blocking_editable_container" class="grid_2">
166
	  <div id="blocking_list_container">
167
	    <h3>Block scripts on</h3>
168
	  </div>
169
	  <div id="allowing_list_container">
170
	    <h3>Allow scripts on</h3>
171
	  </div>
172
	  <div id="default_policy_dialog" class="grid_col_both text_center">
173
#INCLUDE html/default_blocking_policy.html
174
	  </div>
175
	</div>
176
	<div id="blocking_dialog_container" class="hide"></div>
177
      </div>
178
      <div id="mappings_tab" class="tab"></div>
179
      <div id="resources_tab" class="tab"></div>
180
      <div id="new_payload_tab" class="tab active_tab"></div>
181
      <div id="repos_tab" class="tab">
182
	<div id="repos_list_container"></div>
183
	<div id="repos_dialog_container" class="hide"></div>
184
      </div>
185
    </div>
186
#LOADJS html/settings.js
187
  </body>
188
</html>
(25-25/28)