-
Notifications
You must be signed in to change notification settings - Fork 1
/
create_channel.js
55 lines (51 loc) · 2.53 KB
/
create_channel.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
// This allows the Javascript code inside this block to only run when the page
// has finished loading in the browser.
var username = "admin"
$( document ).ready(function() {
console.log(document.getElementById("inputChannelName"));
var btn = document.getElementById("CreateChannelSubmit");
btn.onclick = function(){
console.log(document.getElementById("inputChannelName"));
var inputChannelName = document.getElementById("inputChannelName");
var inputLink = document.getElementById("inputLink");
var inputSong = document.getElementById("inputSong");
var inputSinger = document.getElementById("inputSinger");
console.log($('input[name=Live]:checked').val());
window.parent.postMessage({action: $('input[name=Live]:checked').val(),
Live: $('input[name=Live]:checked').val(),
Private: $('input[name=Private]:checked').val(),
inputChannelName: inputChannelName.value,
title: inputChannelName.value,
inputLink: inputLink.value,
inputSong: inputSong.value,
inputSinger: inputSinger.value,
type: "CreateChannel"}, "*");
};
var LiveOptionBtn = document.getElementById("LiveOptionBtn");
LiveOptionBtn.onclick = function(){
var LiveOptionHelpBlock = document.getElementById("LiveOptionHelpBlock");
LiveOptionHelpBlock.innerHTML = "In LIVE Channel, you can see other's cam and chat with them in real-time.";
}
var NonliveOptionBtn = document.getElementById("NonliveOptionBtn");
NonliveOptionBtn.onclick = function(){
var NonliveOptionHelpBlock = document.getElementById("LiveOptionHelpBlock");
NonliveOptionHelpBlock.innerHTML = "In NON-LIVE Channel, you can't interact in real-time, but you can see other's video comments and chat with them in non real-time.";
}
});
(function() {
'use strict';
window.addEventListener('load', function() {
// Fetch all the forms we want to apply custom Bootstrap validation styles to
var forms = document.getElementsByClassName('needs-validation');
// Loop over them and prevent submission
var validation = Array.prototype.filter.call(forms, function(form) {
form.addEventListener('submit', function(event) {
if (form.checkValidity() === false) {
event.preventDefault();
event.stopPropagation();
}
form.classList.add('was-validated');
}, false);
});
}, false);
})();