blob: 9cde3991629726ac9db7e45b5185899adb6c1f47 (
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
|
/* Config */
const config = {
advanced: false,
showAdvancedMessage: "Show Settings",
hideAdvancedMessage: "Hide Settings",
links: {
website: 'https://returnyoutubedislike.com',
github: 'https://github.com/Anarios/return-youtube-dislike',
discord: 'https://discord.gg/mYnESY4Md5'
},
};
/* Links */
document.getElementById('link_website').addEventListener('click', () => {
chrome.tabs.create({url: config.links.website});
});
document.getElementById('link_github').addEventListener('click', () => {
chrome.tabs.create({url: config.links.github});
});
document.getElementById('link_discord').addEventListener('click', () => {
chrome.tabs.create({url: config.links.discord});
});
/* Advanced Toggle */
const advancedToggle = document.getElementById('advancedToggle');
advancedToggle.addEventListener('click', () => {
const adv = document.getElementById('advancedSettings');
if (config.advanced) {
adv.style.display = "none";
advancedToggle.innerHTML = config.showAdvancedMessage;
config.advanced = false;
} else {
adv.style.display = "block";
advancedToggle.innerHTML = config.hideAdvancedMessage;
config.advanced = true;
}
});
/* popup-script.js
document.querySelector('#login')
.addEventListener('click', function () {
chrome.runtime.sendMessage({ message: 'get_auth_token' });
});
document.querySelector("#log_off").addEventListener("click", function () {
chrome.runtime.sendMessage({ message: "log_off" });
});
*/
|