1
|
#IF !REPO_QUERY_LOADED
|
2
|
#DEFINE REPO_QUERY_LOADED
|
3
|
<!--
|
4
|
SPDX-License-Identifier: GPL-3.0-or-later OR CC-BY-SA-4.0
|
5
|
|
6
|
Show available repositories and allow querying them for resources.
|
7
|
|
8
|
This file is part of Haketilo.
|
9
|
|
10
|
Copyright (C) 2022 Wojtek Kosior <koszko@koszko.org>
|
11
|
|
12
|
File is dual-licensed. You can choose either GPLv3+, CC BY-SA or both.
|
13
|
|
14
|
This program is free software: you can redistribute it and/or modify
|
15
|
it under the terms of the GNU General Public License as published by
|
16
|
the Free Software Foundation, either version 3 of the License, or
|
17
|
(at your option) any later version.
|
18
|
|
19
|
This program is distributed in the hope that it will be useful,
|
20
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
21
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
22
|
GNU General Public License for more details.
|
23
|
|
24
|
You should have received a copy of the GNU General Public License
|
25
|
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
26
|
|
27
|
I, Wojtek Kosior, thereby promise not to sue for violation of this file's
|
28
|
licenses. Although I request that you do not make use of this code in a
|
29
|
proprietary program, I am not going to enforce this in court.
|
30
|
-->
|
31
|
|
32
|
<!--
|
33
|
This is not a standalone page. This file is meant to be imported into other
|
34
|
HTML code.
|
35
|
-->
|
36
|
|
37
|
#INCLUDE html/install.html
|
38
|
|
39
|
#LOADCSS html/reset.css
|
40
|
#LOADCSS html/base.css
|
41
|
<style>
|
42
|
.repo_query_top_text {
|
43
|
text-align: center;
|
44
|
padding: 0.4em;
|
45
|
text-overflow: ellipsis;
|
46
|
overflow: hidden;
|
47
|
}
|
48
|
.repo_queried_url {
|
49
|
text-decoration: underline;
|
50
|
white-space: nowrap;
|
51
|
}
|
52
|
|
53
|
.repo_query_repo_li {
|
54
|
margin: 0;
|
55
|
background-color:#dadada;
|
56
|
}
|
57
|
.repo_query_repo_li > .repo_query_entry {
|
58
|
padding: 0.2em;
|
59
|
}
|
60
|
.repo_query_repo_li > .repo_query_results_list {
|
61
|
background-color: #f0f0f0;
|
62
|
}
|
63
|
|
64
|
.repo_query_info_div {
|
65
|
margin: 0.5em;
|
66
|
}
|
67
|
|
68
|
.repo_query_result_li {
|
69
|
margin: 0;
|
70
|
padding: 0.2em;
|
71
|
}
|
72
|
.repo_query_result_li:nth-child(2n) {
|
73
|
background-color:#dadada;
|
74
|
}
|
75
|
|
76
|
.repo_query_entry {
|
77
|
display: flex;
|
78
|
align-items: center;
|
79
|
}
|
80
|
.repo_query_entry_info {
|
81
|
display: grid;
|
82
|
grid-template-columns: auto;
|
83
|
flex: 1 1 auto;
|
84
|
min-width: 0;
|
85
|
}
|
86
|
|
87
|
.repo_query_entry_info > * {
|
88
|
white-space: nowrap;
|
89
|
overflow: hidden;
|
90
|
text-overflow: ellipsis;
|
91
|
padding-bottom: 0.1em;
|
92
|
}
|
93
|
.repo_query_entry button {
|
94
|
white-space: nowrap;
|
95
|
}
|
96
|
|
97
|
.repo_query_mapping_id {
|
98
|
font-size: 80%;
|
99
|
font-style: italic;
|
100
|
}
|
101
|
|
102
|
.repo_query_bottom_buttons {
|
103
|
margin: 1em;
|
104
|
text-align: center;
|
105
|
}
|
106
|
</style>
|
107
|
<template>
|
108
|
<span id="repo_query_private_mode_error", data-template="main_span">
|
109
|
Due to bug <a href="">#115</a> it is currently impossible to install
|
110
|
scripts through the popup when in Private Browsing mode. You can instead
|
111
|
perform the installation after navigating to the website in a non-private
|
112
|
window. Scripts you install there shall affect websites browsed in Private
|
113
|
Mode as well.
|
114
|
</span>
|
115
|
<div id="repo_query" data-template="main_div">
|
116
|
<div data-template="repos_list_container">
|
117
|
<div class="repo_query_top_text", data-template="top_text">
|
118
|
Browsing custom resources for:
|
119
|
<span data-template="url_span" class="repo_queried_url"></span>
|
120
|
</div>
|
121
|
<ul data-template="repos_list"></ul>
|
122
|
<div class="repo_query_bottom_buttons">
|
123
|
<button data-template="cancel_but">Cancel</button>
|
124
|
</div>
|
125
|
</div>
|
126
|
<div data-template="install_view_container" class="hide">
|
127
|
<!-- Install view will be dynamically inserted here. -->
|
128
|
</div>
|
129
|
</div>
|
130
|
|
131
|
<li id="repo_query_single_repo" data-template="main_li"
|
132
|
class="repo_query_repo_li">
|
133
|
<div class="top_line"></div>
|
134
|
<div class="repo_query_entry">
|
135
|
<div class="repo_query_entry_info">
|
136
|
<label data-template="repo_url_label"></label>
|
137
|
</div>
|
138
|
<span class="repo_query_buttons">
|
139
|
<button data-template="show_results_but">
|
140
|
Show results
|
141
|
</button>
|
142
|
<button data-template="hide_results_but" class="hide">
|
143
|
Hide results
|
144
|
</button>
|
145
|
</span>
|
146
|
</div>
|
147
|
<div data-template="list_container" class="hide repo_query_results_list">
|
148
|
<div data-template="info_div" class="repo_query_info_div">
|
149
|
Querying repository...
|
150
|
</div>
|
151
|
<ul data-template="results_list" class="hide"></ul>
|
152
|
</div>
|
153
|
</li>
|
154
|
|
155
|
<li id="repo_query_single_result" data-template="main_li"
|
156
|
class="repo_query_entry repo_query_result_li">
|
157
|
<div class="repo_query_entry_info">
|
158
|
<span data-template="mapping_name"></span>
|
159
|
<span data-template="mapping_id" class="repo_query_mapping_id"></span>
|
160
|
</div>
|
161
|
<span><button data-template="install_but">More...</button></span>
|
162
|
</li>
|
163
|
</template>
|
164
|
#ENDIF
|