1
|
/**
|
2
|
* SPDX-License-Identifier: Apache-2.0
|
3
|
*
|
4
|
* Copyright © 2021 jahoti <jahoti@tilde.team>
|
5
|
* Copyright 2022 Wojtek Kosior <koszko@koszko.org>
|
6
|
*
|
7
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
8
|
* you may not use this file except in compliance with the License.
|
9
|
* You may obtain a copy of the License at
|
10
|
*
|
11
|
* http://www.apache.org/licenses/LICENSE-2.0
|
12
|
*
|
13
|
* Unless required by applicable law or agreed to in writing, software
|
14
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
15
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
16
|
* See the License for the specific language governing permissions and
|
17
|
* limitations under the License.
|
18
|
*
|
19
|
* I, Wojtek Kosior, thereby promise not to sue for violation of this file's
|
20
|
* license. Although I request that you do not make use of this code in a way
|
21
|
* incompliant with the license, I am not going to enforce this in court.
|
22
|
*/
|
23
|
|
24
|
/* Make cookie notice closable. */
|
25
|
const to_rem = document.querySelectorAll(".cc-policy-overlay, .cc-policy");
|
26
|
|
27
|
for (const cc_button of document.querySelectorAll(".cc-policy .cc-buttons"))
|
28
|
cc_button.addEventListener("click", () => to_rem.forEach(n => n.remove()));
|
29
|
|
30
|
/* Make country selection popup closable. */
|
31
|
const langbox_remover = () => document.getElementById("langbox").remove();
|
32
|
|
33
|
const link_selector = ".country_flag a[onclick], .country_button a[onclick]";
|
34
|
for (const a of document.querySelectorAll(link_selector))
|
35
|
a.addEventListener("click", langbox_remover);
|