This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
6 changed files with
15 additions and
17 deletions
|
|
|
@ -1,8 +1,8 @@
|
|
|
|
|
class Comment {
|
|
|
|
|
constructor(start, end, tittle, text) {
|
|
|
|
|
constructor(start, end, title, text) {
|
|
|
|
|
this.start = start;
|
|
|
|
|
this.end = end;
|
|
|
|
|
this.tittle = tittle;
|
|
|
|
|
this.title = title;
|
|
|
|
|
this.text = [];
|
|
|
|
|
|
|
|
|
|
for (let i = 0; i < text.length; i++) {
|
|
|
|
|
|
|
|
@ -26,7 +26,7 @@ class Controller {
|
|
|
|
|
init(videoToLoad) {
|
|
|
|
|
this.loadXml(videoToLoad).then(
|
|
|
|
|
function (v) {
|
|
|
|
|
this.view.drawCommentTittles(v);
|
|
|
|
|
this.view.drawCommentTitles(v);
|
|
|
|
|
this.addEventListeners();
|
|
|
|
|
this.view.drawCommentsToVideo(v);
|
|
|
|
|
}.bind(this)
|
|
|
|
|
|
|
|
@ -11,10 +11,10 @@ class Model {
|
|
|
|
|
for (let i = 0; i < comment.length; i++) {
|
|
|
|
|
let start = comment[i].getElementsByTagName("start")[0].innerHTML;
|
|
|
|
|
let end = comment[i].getElementsByTagName("end")[0].innerHTML;
|
|
|
|
|
let tittle = comment[i].getElementsByTagName("tittle")[0].innerHTML;
|
|
|
|
|
let title = comment[i].getElementsByTagName("title")[0].innerHTML;
|
|
|
|
|
let text = comment[i].getElementsByTagName("text");
|
|
|
|
|
|
|
|
|
|
this.comments.push(new Comment(start, end, tittle, text));
|
|
|
|
|
this.comments.push(new Comment(start, end, title, text));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return this.comments;
|
|
|
|
|
|
|
|
@ -21,7 +21,7 @@ class View {
|
|
|
|
|
); */
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
drawCommentTittles(comments) {
|
|
|
|
|
drawCommentTitles(comments) {
|
|
|
|
|
let aside = document.getElementsByTagName("aside")[0];
|
|
|
|
|
|
|
|
|
|
for (let i = 0; i < comments.length; i++) {
|
|
|
|
@ -49,11 +49,11 @@ class View {
|
|
|
|
|
|
|
|
|
|
comment.appendChild(time);
|
|
|
|
|
|
|
|
|
|
let commentTittle = document.createElement("div");
|
|
|
|
|
commentTittle.setAttribute("class", "commentText");
|
|
|
|
|
commentTittle.innerHTML = comments[i].tittle;
|
|
|
|
|
let commentTitle = document.createElement("div");
|
|
|
|
|
commentTitle.setAttribute("class", "commentText");
|
|
|
|
|
commentTitle.innerHTML = comments[i].title;
|
|
|
|
|
|
|
|
|
|
comment.appendChild(commentTittle);
|
|
|
|
|
comment.appendChild(commentTitle);
|
|
|
|
|
|
|
|
|
|
aside.appendChild(comment);
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -3,15 +3,13 @@
|
|
|
|
|
<comment>
|
|
|
|
|
<start>12</start>
|
|
|
|
|
<end>15</end>
|
|
|
|
|
<text>Toto je testovací poznámka</text>
|
|
|
|
|
<fulltext>Toto je dlouhý text, který bude zobrazen ve videu dole a bude moci obsahovat markdown</fulltext>
|
|
|
|
|
|
|
|
|
|
<title>Toto je testovací poznámka</title>
|
|
|
|
|
<text>Toto je dlouhý text, který bude zobrazen ve videu dole a bude moci obsahovat markdown</text>
|
|
|
|
|
</comment>
|
|
|
|
|
<comment>
|
|
|
|
|
<start>19</start>
|
|
|
|
|
<end>25</end>
|
|
|
|
|
<text>Toto je testovací poznámka</text>
|
|
|
|
|
<fulltext>Toto je dlouhý text, který bude zobrazen ve videu dole a bude moci obsahovat markdown</fulltext>
|
|
|
|
|
|
|
|
|
|
<title>Toto je testovací poznámka</title>
|
|
|
|
|
<text>Toto je dlouhý text, který bude zobrazen ve videu dole a bude moci obsahovat markdown</text>
|
|
|
|
|
</comment>
|
|
|
|
|
</video>
|
|
|
|
|
</video>
|
|
|
|
|