Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
amethystnetwork-dev
GitHub Repository: amethystnetwork-dev/Incognito
Path: blob/main/static/script/community.js
918 views
1
/**
2
* Incognito
3
*
4
* This program is free software: you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License as published by
6
* the Free Software Foundation, either version 3 of the License, or
7
* (at your option) any later version.
8
*
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
13
*
14
* You should have received a copy of the GNU General Public License
15
* along with this program. If not, see <https://www.gnu.org/licenses/>.
16
*/
17
18
/*
19
_____ _ _ _
20
| __ \ | | | | | |
21
| |__) | ___ _ __ | |_ ___ __| | | |__ _ _
22
| ___/ / _ \ | '__| | __| / _ \ / _` | | '_ \ | | | |
23
| | | (_) | | | | |_ | __/ | (_| | | |_) | | |_| |
24
|_| \___/ |_| \__| \___| \__,_| |_.__/ \__, |
25
__/ |
26
|___/
27
_ _ _ _ _ _ _
28
/\ | | | | | | | \ | | | | | |
29
/ \ _ __ ___ ___ | |_ | |__ _ _ ___ | |_ | \| | ___ | |_ __ __ ___ _ __ | | __
30
/ /\ \ | '_ ` _ \ / _ \ | __| | '_ \ | | | | / __| | __| | . ` | / _ \ | __| \ \ /\ / / / _ \ | '__| | |/ /
31
/ ____ \ | | | | | | | __/ | |_ | | | | | |_| | \__ \ | |_ | |\ | | __/ | |_ \ V V / | (_) | | | | <
32
/_/ \_\ |_| |_| |_| \___| \__| |_| |_| \__, | |___/ \__| |_| \_| \___| \__| \_/\_/ \___/ |_| |_|\_\
33
__/ |
34
|___/
35
*/
36
37
var invite_code;
38
async function community(app) {
39
app.search.title.style.display = 'block';
40
app.search.title.textContent = 'Community';
41
app.search.input.style.display = 'none';
42
43
if(!invite_code) {
44
const res = await app.bare.fetch('https://cdn.jsdelivr.net/gh/amethystnetwork-dev/.github/meta/discord.json');
45
const json = await res.json();
46
invite_code = json.invite_code;
47
}
48
49
app.main.support = app.createElement(
50
'div',
51
[
52
app.createElement('section', [
53
app.createElement('p', `You are being taken to the Amethyst Network discord server (discord.gg/${invite_code}).`, {
54
style: {
55
'margin-bottom': '0'
56
}
57
}),
58
app.createElement('p', `Are you sure you want to <a href="https://discord.gg/${invite_code}">proceed</a>?`, {
59
style: {
60
'margin-bottom': '0'
61
}
62
}),
63
], {
64
class: 'data-section'
65
}),
66
67
]);
68
app.search.back.style.display = 'inline';
69
app.search.back.href = '#';
70
};
71
72
export { community };
73
74