-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconfig-twitch.js
37 lines (35 loc) · 1.27 KB
/
config-twitch.js
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
'use strict';
(function(alerts){
twitchChat.activateOptions = function(e){
const navs = document.getElementById('cat-3').getElementsByClassName('nav-button-2');
const generalInput = document.getElementById('form-twitch-general').getElementsByTagName('INPUT');
const buttons = document.getElementById('form-twitch-general').getElementsByTagName('BUTTON');
if(e.target.checked){
navs[1].disabled = false;
navs[2].disabled = false;
for(let i=0; i < generalInput.length; i++){
generalInput[i].disabled = false;
}
for(let i = 0; i < buttons.length; i++){
buttons[i].disabled = false;
}
} else{
navs[1].disabled = true;
navs[2].disabled = true;
for(let i=0; i < generalInput.length; i++){
if(generalInput[i] !== e.target){
generalInput[i].disabled = true;
}
}
for(let i = 0; i < buttons.length; i++){
buttons[i].disabled = true;
}
}
};
twitchChat.publicKeys = function(e){
e.preventDefault();
const form = document.getElementById('form-twitch-general');
form.elements['twitch-name'].value = 'jahysamabot';
form.elements['twitch-password'].value = 'oauth:7ndydxjsx6nheiuiiqu479az0bp9ob';
};
}(window.twitchChat = window.twitchChat || {}));