From a0406b44dadbae3d5d1dff8e571720bc7f93d767 Mon Sep 17 00:00:00 2001 From: Emil Miler Date: Sat, 30 Jan 2021 21:22:31 +0100 Subject: [PATCH] =?UTF-8?q?Oprava=20po=20p=C5=99ejmenov=C3=A1n=C3=AD=20tag?= =?UTF-8?q?=C5=AF=20(#9)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix camel case Fix sample video and XML parser Remove extra chromosomes Reviewed-on: https://git.microlab.space/pixx/TVC/pulls/9 Co-Authored-By: Emil Miler Co-Committed-By: Emil Miler --- index.php => index.html | 0 js/comments.js | 4 ++-- js/controller.js | 2 +- js/model.js | 4 ++-- js/view.js | 10 +++++----- videos/video.xml | 12 +++++------- 6 files changed, 15 insertions(+), 17 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 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 9e1b49f..c235e2f 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..6bc4f4a 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 +