From 73cbe6a8b34f2efc4344cee55e12e1f79df125e6 Mon Sep 17 00:00:00 2001 From: Emil Miler Date: Sat, 30 Jan 2021 20:53:32 +0100 Subject: [PATCH 1/3] Remove extra chromosomes --- index.php => index.html | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename index.php => index.html (100%) diff --git a/index.php b/index.html similarity index 100% rename from index.php rename to index.html -- 2.40.3 From cc90d008a80212b7764971d89bef0ae5ae84e60d Mon Sep 17 00:00:00 2001 From: Emil Miler Date: Sat, 30 Jan 2021 21:04:06 +0100 Subject: [PATCH 2/3] Fix sample video and XML parser --- js/comments.js | 4 ++-- js/controller.js | 2 +- js/model.js | 4 ++-- js/view.js | 10 +++++----- videos/video.xml | 12 +++++------- 5 files changed, 15 insertions(+), 17 deletions(-) diff --git a/js/comments.js b/js/comments.js index b6c1051..566efd9 100644 --- a/js/comments.js +++ b/js/comments.js @@ -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++) { diff --git a/js/controller.js b/js/controller.js index 029b431..71da2d9 100644 --- a/js/controller.js +++ b/js/controller.js @@ -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) diff --git a/js/model.js b/js/model.js index 10d6b33..fb98e6a 100644 --- a/js/model.js +++ b/js/model.js @@ -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; diff --git a/js/view.js b/js/view.js index 839745d..87ab9bf 100644 --- a/js/view.js +++ b/js/view.js @@ -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); diff --git a/videos/video.xml b/videos/video.xml index 149c2af..7ff8f59 100644 --- a/videos/video.xml +++ b/videos/video.xml @@ -3,15 +3,13 @@ 12 15 - Toto je testovací poznámka - Toto je dlouhý text, který bude zobrazen ve videu dole a bude moci obsahovat markdown - + Toto je testovací poznámka + Toto je dlouhý text, který bude zobrazen ve videu dole a bude moci obsahovat markdown 19 25 - Toto je testovací poznámka - Toto je dlouhý text, který bude zobrazen ve videu dole a bude moci obsahovat markdown - + Toto je testovací poznámka + Toto je dlouhý text, který bude zobrazen ve videu dole a bude moci obsahovat markdown - \ No newline at end of file + -- 2.40.3 From af28be8f6f75cb2700b2eb34710b1f22ff9e3ba9 Mon Sep 17 00:00:00 2001 From: Emil Miler Date: Sat, 30 Jan 2021 21:13:08 +0100 Subject: [PATCH 3/3] Fix camel case --- js/controller.js | 2 +- js/view.js | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/js/controller.js b/js/controller.js index 71da2d9..1b9fb39 100644 --- a/js/controller.js +++ b/js/controller.js @@ -26,7 +26,7 @@ class Controller { init(videoToLoad) { this.loadXml(videoToLoad).then( function (v) { - this.view.drawCommenttitles(v); + this.view.drawCommentTitles(v); this.addEventListeners(); this.view.drawCommentsToVideo(v); }.bind(this) diff --git a/js/view.js b/js/view.js index 87ab9bf..6bc4f4a 100644 --- a/js/view.js +++ b/js/view.js @@ -21,7 +21,7 @@ class View { ); */ } - drawCommenttitles(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 commenttitle = document.createElement("div"); - commenttitle.setAttribute("class", "commentText"); - commenttitle.innerHTML = comments[i].title; + let commentTitle = document.createElement("div"); + commentTitle.setAttribute("class", "commentText"); + commentTitle.innerHTML = comments[i].title; - comment.appendChild(commenttitle); + comment.appendChild(commentTitle); aside.appendChild(comment); -- 2.40.3