|
|
|
@ -27,6 +27,7 @@ class Controller {
|
|
|
|
|
this.loadXml(videoToLoad).then(
|
|
|
|
|
function (v) {
|
|
|
|
|
this.view.drawCommentsText(v);
|
|
|
|
|
this.addEventListeners();
|
|
|
|
|
this.view.drawCommentsToVideo(v);
|
|
|
|
|
}.bind(this)
|
|
|
|
|
);
|
|
|
|
@ -79,6 +80,26 @@ class Controller {
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
addEventListeners() {
|
|
|
|
|
let comments = document.getElementsByClassName("comment");
|
|
|
|
|
|
|
|
|
|
for (let i = 0; i < comments.length; i++) {
|
|
|
|
|
comments[i].addEventListener(
|
|
|
|
|
"mouseover",
|
|
|
|
|
function () {
|
|
|
|
|
this.view.commentHover(comments[i].firstChild);
|
|
|
|
|
}.bind(this)
|
|
|
|
|
);
|
|
|
|
|
comments[i].addEventListener(
|
|
|
|
|
"mouseout",
|
|
|
|
|
function () {
|
|
|
|
|
if (!comments[i].classList.contains("activeComment"))
|
|
|
|
|
this.view.commentHover(comments[i].firstChild, false);
|
|
|
|
|
}.bind(this)
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async loadVideo(v) {
|
|
|
|
|
let video = document.getElementById("video");
|
|
|
|
|
|
|
|
|
|