hmml_to_html.c: Mock hiding filtered markers [#21]
This commit is contained in:
parent
4f9df6795e
commit
6d812975b2
|
@ -103,13 +103,22 @@
|
|||
<div class="player_container">
|
||||
<div class="video_container" data-videoId="ug5WkCROkOk"></div>
|
||||
<div class="markers_container riscy">
|
||||
<div data-timestamp="60" class="marker authored cat_hardware research" data-ref="https://en.wikipedia.org/wiki/Logic_gate,0-7356-0505-X">
|
||||
<div class="content"><span class="timecode">1:00</span><span class="author" style="color: hsl(257, 87%, 26%);">insofaras</span> Some text referring to <a href="https://handmade.network/m/zilarrezko" target="blank" style="color: hsl(83, 75%, 26%); text-decoration: none">Zilarrezko</a> about this thing<sup>1</sup> regarding circuit design he saw in Code<sup>2</sup><span class="categories"><div class="category hardware"></div></span></div>
|
||||
<div data-timestamp="12" class="marker cat_rendering cat_hardware">
|
||||
<div class="content"><span class="timecode">0:12</span>Basic test with a little longer text<span class="categories"><div class="category rendering"></div><div class="category hardware"></div></span></div>
|
||||
<div class="progress faded">
|
||||
<div class="content"><span class="timecode">1:00</span><span class="author" style="color: hsl(257, 87%, 26%);">insofaras</span> Some text referring to <a href="https://handmade.network/m/zilarrezko" target="blank" style="color: hsl(83, 75%, 26%); text-decoration: none">Zilarrezko</a> about this thing<sup>1</sup> regarding circuit design he saw in Code<sup>2</sup><span class="categories"><div class="category hardware"></div></span></div>
|
||||
<div class="content"><span class="timecode">0:12</span>Basic test with a little longer text<span class="categories"><div class="category rendering"></div><div class="category hardware"></div></span></div>
|
||||
</div>
|
||||
<div class="progress main">
|
||||
<div class="content"><span class="timecode">1:00</span><span class="author" style="color: hsl(257, 87%, 26%);">insofaras</span> Some text referring to <a href="https://handmade.network/m/zilarrezko" target="blank" style="color: hsl(83, 75%, 26%); text-decoration: none">Zilarrezko</a> about this thing<sup>1</sup> regarding circuit design he saw in Code<sup>2</sup><span class="categories"><div class="category hardware"></div></span></div>
|
||||
<div class="content"><span class="timecode">0:12</span>Basic test with a little longer text<span class="categories"><div class="category rendering"></div><div class="category hardware"></div></span></div>
|
||||
</div>
|
||||
</div>
|
||||
<div data-timestamp="60" class="marker authored cat_rendering cat_hardware research" data-ref="https://en.wikipedia.org/wiki/Logic_gate,0-7356-0505-X">
|
||||
<div class="content"><span class="timecode">1:00</span><span class="author" style="color: hsl(257, 87%, 26%);">insofaras</span> Some text referring to <a href="https://handmade.network/m/zilarrezko" target="blank" style="color: hsl(83, 75%, 26%); text-decoration: none">Zilarrezko</a> about this thing<sup>1</sup> regarding circuit design he saw in Code<sup>2</sup><span class="categories"><div class="category rendering"></div><div class="category hardware"></div></span></div>
|
||||
<div class="progress faded">
|
||||
<div class="content"><span class="timecode">1:00</span><span class="author" style="color: hsl(257, 87%, 26%);">insofaras</span> Some text referring to <a href="https://handmade.network/m/zilarrezko" target="blank" style="color: hsl(83, 75%, 26%); text-decoration: none">Zilarrezko</a> about this thing<sup>1</sup> regarding circuit design he saw in Code<sup>2</sup><span class="categories"><div class="category rendering"></div><div class="category hardware"></div></span></div>
|
||||
</div>
|
||||
<div class="progress main">
|
||||
<div class="content"><span class="timecode">1:00</span><span class="author" style="color: hsl(257, 87%, 26%);">insofaras</span> Some text referring to <a href="https://handmade.network/m/zilarrezko" target="blank" style="color: hsl(83, 75%, 26%); text-decoration: none">Zilarrezko</a> about this thing<sup>1</sup> regarding circuit design he saw in Code<sup>2</sup><span class="categories"><div class="category rendering"></div><div class="category hardware"></div></span></div>
|
||||
</div>
|
||||
</div>
|
||||
<div data-timestamp="176" class="marker" data-ref="α">
|
||||
|
@ -222,34 +231,59 @@ filterModeElement.addEventListener("click", function(ev) {
|
|||
}
|
||||
});
|
||||
|
||||
var filterTopics = document.querySelectorAll(".filter_topics > .filter_content");
|
||||
var filterTopics = document.querySelectorAll(".filter_content");
|
||||
for (var i = 0; i < filterTopics.length; ++i)
|
||||
{
|
||||
filterTopics[i].addEventListener("click", function(ev) {
|
||||
// NOTE(matt): Useful test
|
||||
// if(this.parentNode.className == "filter_topics")
|
||||
|
||||
var selectedCategory = this.childNodes[1].classList[2];
|
||||
|
||||
var categorisedMarkers = document.querySelectorAll("." + selectedCategory);
|
||||
if(!(this.classList.contains("off")))
|
||||
{
|
||||
//console.log(this);
|
||||
this.classList.add("off");
|
||||
for (var j = 0; j < categorisedMarkers.length; ++j)
|
||||
{
|
||||
//console.log(categorisedMarkers[j]);
|
||||
{
|
||||
//console.log("Disabling %s", selectedCategory);
|
||||
categorisedMarkers[j].classList.add("off");
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
this.classList.remove("off");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
var filterMedia = document.querySelectorAll(".filter_media > .filter_content");
|
||||
for (var i = 0; i < filterMedia.length; ++i)
|
||||
{
|
||||
filterMedia[i].addEventListener("click", function(ev) {
|
||||
|
||||
if(!(this.classList.contains("off")))
|
||||
for (var j = 0; j < categorisedMarkers.length; ++j)
|
||||
{
|
||||
this.classList.add("off");
|
||||
//console.log("Enabling %s", selectedCategory);
|
||||
categorisedMarkers[j].classList.remove("off");
|
||||
}
|
||||
}
|
||||
|
||||
var testMarkers = document.querySelectorAll(".cat_" + selectedCategory);
|
||||
for(var k = 0; k < testMarkers.length; ++k)
|
||||
{
|
||||
var Skipping = 1;
|
||||
var testCategories = testMarkers[k].querySelectorAll(".category");
|
||||
for(var l = 0; l < testCategories.length; ++l)
|
||||
{
|
||||
if(!(testCategories[l].classList.contains("off")))
|
||||
{
|
||||
var Skipping = 0;
|
||||
}
|
||||
}
|
||||
if(Skipping)
|
||||
{
|
||||
testMarkers[k].classList.add("skip");
|
||||
}
|
||||
else
|
||||
{
|
||||
this.classList.remove("off");
|
||||
testMarkers[k].classList.remove("skip");
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue