aboutsummaryrefslogtreecommitdiff
path: root/html/repo_query.html
blob: 8692c3bd748a9a48f5b286b27e268dbf915436d5 (about) (plain)
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
#IF !REPO_QUERY_LOADED
#DEFINE REPO_QUERY_LOADED
<!--
    SPDX-License-Identifier: GPL-3.0-or-later OR CC-BY-SA-4.0

    Show available repositories and allow querying them for resources.

    This file is part of Haketilo.

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

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

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

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

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

    I, Wojtek Kosior, thereby promise not to sue for violation of this file's
    licenses. Although I request that you do not make use of this code in a
    proprietary program, I am not going to enforce this in court.
  -->

<!--
    This is not a standalone page. This file is meant to be imported into other
    HTML code.
  -->

#INCLUDE html/install.html

#LOADCSS html/reset.css
#LOADCSS html/base.css
<style>
  .repo_query_top_text {
      text-align: center;
      padding: 0.4em;
      text-overflow: ellipsis;
      overflow: hidden;
  }
  .repo_queried_url {
      text-decoration: underline;
      white-space: nowrap;
  }

  .repo_query_repo_li {
      margin: 0;
      background-color:#dadada;
  }
  .repo_query_repo_li > .repo_query_entry {
      padding: 0.2em;
  }
  .repo_query_repo_li > .repo_query_results_list {
      background-color: #f0f0f0;
  }

  .repo_query_info_div {
      margin: 0.5em;
  }

  .repo_query_result_li {
      margin: 0;
      padding: 0.2em;
  }
  .repo_query_result_li:nth-child(2n) {
      background-color:#dadada;
  }

  .repo_query_entry {
      display: flex;
      align-items: center;
  }
  .repo_query_entry_info {
      display: grid;
      grid-template-columns: auto;
      flex: 1 1 auto;
      min-width: 0;
  }

  .repo_query_entry_info > * {
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      padding-bottom: 0.1em;
  }
  .repo_query_entry button {
      white-space: nowrap;
  }

  .repo_query_mapping_id {
      font-size: 80%;
      font-style: italic;
  }

  .repo_query_bottom_buttons {
      margin: 1em;
      text-align: center;
  }
</style>
<template>
  <span id="repo_query_private_mode_error", data-template="main_span">
    Due to bug <a href="https://hydrillabugs.koszko.org/issues/115">#115</a> it
    is currently impossible to install scripts through the popup when in Private
    Browsing mode. You can instead perform the installation after navigating to
    the website in a non-private window. Scripts you install there shall affect
    websites browsed in Private Mode as well.
  </span>
  <div id="repo_query" data-template="main_div">
    <div data-template="repos_list_container">
      <div class="repo_query_top_text", data-template="top_text">
	Browsing custom resources for:
	<span data-template="url_span" class="repo_queried_url"></span>
      </div>
      <ul data-template="repos_list"></ul>
      <div class="repo_query_bottom_buttons">
	<button data-template="cancel_but">Cancel</button>
      </div>
    </div>
    <div data-template="install_view_container" class="hide">
      <!-- Install view will be dynamically inserted here. -->
    </div>
  </div>

  <li id="repo_query_single_repo" data-template="main_li"
      class="repo_query_repo_li">
    <div class="top_line"></div>
    <div class="repo_query_entry">
      <div class="repo_query_entry_info">
	<label data-template="repo_url_label"></label>
      </div>
      <span class="repo_query_buttons">
	<button data-template="show_results_but">
	  Show results
	</button>
	<button data-template="hide_results_but" class="hide">
	  Hide results
	</button>
      </span>
    </div>
    <div data-template="list_container" class="hide repo_query_results_list">
      <div data-template="info_div" class="repo_query_info_div">
	Querying repository...
      </div>
      <ul data-template="results_list" class="hide"></ul>
    </div>
  </li>

  <li id="repo_query_single_result" data-template="main_li"
      class="repo_query_entry repo_query_result_li">
    <div class="repo_query_entry_info">
      <span data-template="mapping_name"></span>
      <span data-template="mapping_id" class="repo_query_mapping_id"></span>
    </div>
    <span><button data-template="install_but">Install preview</button></span>
  </li>
</template>
#ENDIF