Oprava po přejmenování tagů (#9)

Fix camel case

Fix sample video and XML parser

Remove extra chromosomes

Reviewed-on: #9
Co-Authored-By: Emil Miler <emil.miler@pedf.cuni.cz>
Co-Committed-By: Emil Miler <emil.miler@pedf.cuni.cz>
master
Emil Miler 4 years ago committed by David Zálešák
parent 426fd2bf96
commit a0406b44da

@ -1,8 +1,8 @@
class Comment { class Comment {
constructor(start, end, tittle, text) { constructor(start, end, title, text) {
this.start = start; this.start = start;
this.end = end; this.end = end;
this.tittle = tittle; this.title = title;
this.text = []; this.text = [];
for (let i = 0; i < text.length; i++) { for (let i = 0; i < text.length; i++) {

@ -26,7 +26,7 @@ class Controller {
init(videoToLoad) { init(videoToLoad) {
this.loadXml(videoToLoad).then( this.loadXml(videoToLoad).then(
function (v) { function (v) {
this.view.drawCommentTittles(v); this.view.drawCommentTitles(v);
this.addEventListeners(); this.addEventListeners();
this.view.drawCommentsToVideo(v); this.view.drawCommentsToVideo(v);
}.bind(this) }.bind(this)

@ -11,10 +11,10 @@ class Model {
for (let i = 0; i < comment.length; i++) { for (let i = 0; i < comment.length; i++) {
let start = comment[i].getElementsByTagName("start")[0].innerHTML; let start = comment[i].getElementsByTagName("start")[0].innerHTML;
let end = comment[i].getElementsByTagName("end")[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"); 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; return this.comments;

@ -21,7 +21,7 @@ class View {
); */ ); */
} }
drawCommentTittles(comments) { drawCommentTitles(comments) {
let aside = document.getElementsByTagName("aside")[0]; let aside = document.getElementsByTagName("aside")[0];
for (let i = 0; i < comments.length; i++) { for (let i = 0; i < comments.length; i++) {
@ -49,11 +49,11 @@ class View {
comment.appendChild(time); comment.appendChild(time);
let commentTittle = document.createElement("div"); let commentTitle = document.createElement("div");
commentTittle.setAttribute("class", "commentText"); commentTitle.setAttribute("class", "commentText");
commentTittle.innerHTML = comments[i].tittle; commentTitle.innerHTML = comments[i].title;
comment.appendChild(commentTittle); comment.appendChild(commentTitle);
aside.appendChild(comment); aside.appendChild(comment);

@ -3,15 +3,13 @@
<comment> <comment>
<start>12</start> <start>12</start>
<end>15</end> <end>15</end>
<text>Toto je testovací poznámka</text> <title>Toto je testovací poznámka</title>
<fulltext>Toto je dlouhý text, který bude zobrazen ve videu dole a bude moci obsahovat markdown</fulltext> <text>Toto je dlouhý text, který bude zobrazen ve videu dole a bude moci obsahovat markdown</text>
</comment> </comment>
<comment> <comment>
<start>19</start> <start>19</start>
<end>25</end> <end>25</end>
<text>Toto je testovací poznámka</text> <title>Toto je testovací poznámka</title>
<fulltext>Toto je dlouhý text, který bude zobrazen ve videu dole a bude moci obsahovat markdown</fulltext> <text>Toto je dlouhý text, který bude zobrazen ve videu dole a bude moci obsahovat markdown</text>
</comment> </comment>
</video> </video>