Skip to content

Commit

Permalink
updates to style and code
Browse files Browse the repository at this point in the history
  • Loading branch information
dcnb committed Aug 23, 2024
1 parent d67667f commit fc7cc40
Show file tree
Hide file tree
Showing 15 changed files with 604 additions and 422 deletions.
4 changes: 3 additions & 1 deletion _includes/index/objects.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{%- assign templates = site.data[site.metadata] | where_exp: 'item','item.parentid == nil ' | map: "display_template" -%}
{%- assign types = "image;audio;video;pdf;panorama;record;compound_object;multiple" | split: ";" -%}
{%- assign types = "image;audio;video;pdf;panorama;record;compound_object;multiple;transcript" | split: ";" -%}
<div class="card mb-3" >
<div class="card-body">
<h2 class="card-title h5">Objects</h2>
Expand All @@ -25,6 +25,8 @@ <h2 class="card-title h5">Objects</h2>
<a class="text-dark" href="{{ 'compound%20object' | prepend: '/browse.html#' | relative_url }}">Compound Object{% if count > 1 %}s{% endif %} <svg class="bi icon-sprite text-body" fill="currentColor" aria-hidden="true"><use xlink:href="{{ '/assets/lib/cb-icons.svg' | relative_url }}#icon-compound-object"/></svg></a><br>
{% when 'multiple' %}
<a class="text-dark" href="{{ 'multiple' | prepend: '/browse.html#' | relative_url }}">Multiple{% if count > 1 %}s{% endif %} <svg class="bi icon-sprite text-body" fill="currentColor" aria-hidden="true"><use xlink:href="{{ '/assets/lib/cb-icons.svg' | relative_url }}#icon-multiple"/></svg></a><br>
{% when 'transcript' %}
<a class="text-dark" href="{{ 'transcript' | prepend: '/browse.html#' | relative_url }}">Transcript{% if count > 1 %}s{% endif %} <svg class="bi icon-sprite text-body" fill="currentColor" aria-hidden="true"><use xlink:href="{{ '/assets/lib/cb-icons.svg' | relative_url }}#icon-audio"/></svg></a><br>
{% else %}
<a class="text-dark" href="{{ 'file' | prepend: '/browse.html#' | relative_url }}">File{% if count > 1 %}s{% endif %} <svg class="bi icon-sprite text-body" fill="currentColor" aria-hidden="true"><use xlink:href="{{ '/assets/lib/cb-icons.svg' | relative_url }}#icon-default"/></svg></a><br>
{%- endcase -%}
Expand Down
21 changes: 21 additions & 0 deletions _includes/transcript/index/viz-overview.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{% assign viz-height = include.height | default: '400px' %}
<div style="height:{{ viz-height }}; width:100%;">
{% for transcript in site.data.transcripts %}
{% assign height_integer = forloop.length %}
{% assign height_float = height_integer | times: 1.0 %}
{% if viz-height contains "%" %}{% assign viz-integer = viz-height | replace: "%","" %}{% assign viz-height-measure = "%" %}
{% elsif viz-height contains "px" %}{% assign viz-integer = viz-height | replace: "px","" %}{% assign viz-height-measure = "px" %}
{% else %}{% assign viz-integer = viz-height %}{% assign viz-height-measure = "px" %}{% endif %}
{% assign rect-height = 100 | divided_by: height_float %}
{%assign transcript-name = transcript[0] %}
{% assign transcript_item = items | where_exp: 'item', 'item.objectid == transcript-name' | first %}
<div id="{{transcript-name}}viz" class="vizdiv" style="height:{{rect-height}}%">
<a href="{{ '/subjects.html' | relative_url }}"><svg class="chart {{transcript-name}}" width="100%" height="100%" style="overflow: visible">
{% for item in transcript[1] %}
{% assign my_integer = forloop.length %}
{% assign my_float = my_integer | times: 1.0 %}
{% assign rect-width = 100 | divided_by: my_float %}
<rect x="{{forloop.index0 | times: rect-width }}%" y="0" width="{{rect-width}}%" height="100%" data-bs-toggle="tooltip" data-bs-placement="top" class="{{item.tags | downcase | replace: ';', ' '}}" title=" {% if item.tags %}(Subjects: {{ item.tags | replace: ';', ', ' }}){%endif%}"></rect>
{%endfor%}</svg></a>
</div>{%endfor%}
</div>
84 changes: 84 additions & 0 deletions _includes/transcript/item/transcript.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
<div id="transcript">
<div class="my-2 row px-3 mt-4">
<div class="vizdiv w-100">
<h2>Transcript</h2>
<p class="my-2 meta ">Topics:</h4>
<svg id="colorViz" class="chart" width="100%" height="100px" style="overflow: visible">
{% for item in items %}
{% assign my_integer = forloop.length %}
{% assign my_float = my_integer | times: 1.0 %}
{% assign rect-width = 100 | divided_by: my_float %}
<a onclick="scrollToLine('{{page.objectid}}{{ forloop.index0 }}');" style="cursor:pointer">
<rect id="rect{{-forloop.index0-}}" x="{{forloop.index0 | times: rect-width }}%" y="20" width="{{rect-width}}%"
height="50" data-bs-toggle="tooltip" data-bs-placement="top" class="{%- assign tags = item.tags | split: ";" |
compact | where_exp: 'item' , 'item != " "' %}{% for tag in tags %}{{tag | slugify }} {% endfor %}"
title="{{ item.words | default: '...' }}{% if item.tags %} (Subjects: {{ item.tags | replace: ';', ', ' }}){%endif%}">
</rect>
</a>{%endfor%}</svg>
</div>
</div>
{% include /transcript/style/visualization-filter-legend.html %}
<div id="filters-content" class="pe-md-5">
<div class="row my-3 sticky-top bg-white border-bottom border-left border-right d-print-none py-3 w-md-75" id="filters-search" style="z-index: 0;">
<div class="col {% unless site.data.filters %}d-none{% endunless %}">
<select id="filters" title="Filter by Topic" aria-label="Topic filtering dropdown select option" class="filters py-1 form-select border border-primary" onchange="filterLines(this.value)">
<option value="all" class="reset" selected="selected reset">Filter by Topic</option>
{% assign filters = site.data.filters %}
{% for filter in filters %}
{% assign tag = filter.tag | slugify %}
{%if uniqueSubjects contains tag %}<option value="{{ tag }}">{{filter.description | capitalize}}
({{filter.tag}})</option>{%endif%}
{% endfor %}
</select>
</div>
<div class="col">
<div id="transcriptsearch" class="bg-lightr">
<div class="row">
<div class="col-md-6">
<div class="input-group fs-5 mt-0 mt-md-0">
<input type="text" class="form-control border border-primary py-1" placeholder="Search..." aria-label="Search"
aria-describedby="goButton" id="quicksearch">
<div class="input-group-append">
<button class=" rounded-right border border-primary btn btn-primary p-1" type="submit"
title="Search" alt="Search" id="goButton"
onclick="var searchval = document.getElementById('quicksearch').value; searchLines(searchval);">Go</button>
</div>
</div>
</div>
<div class="col-md-6">
<button class="reset btn btn-sm btn-primary input-group-text float-end float-md-none mt-2 mt-md-0" onclick="vizFilter('all');">Reset
Filters</button>
</div>
</div>
</div>
</div>
<div id="filtersearch" class="col-12 d-none mt-3">
<h5 id="linecount" class="d-none small ms-3"><span id="numberof"></span></h5>

<select class="w-100 col-md-8 mb-2 form-select p-2 border border-primary" id="searchResults" onchange="scrollToLine(this.value);">

</select>
</div>
<div id="filter-tab" class="d-none filter-tab col-4 col-lg-2 text-center justify-content-end bg-primary text-white small px-1 py-1">
<span id="hide-filters-text">Hide Filters &#9650;</span>
<span id="show-filters-text">Show Filters &#9660;</span>
</div>
</div>

<div id="contents-container" class="pe-5">
{% for item in items %}
{% assign prev_index = forloop.index0 | times: 1 | minus: 1 %}
{% assign prev_speaker = items[prev_index].speaker %}
{% assign mod = forloop.index0 | plus: 1 | modulo: 5 %}
<div id="{{page.objectid}}{{ forloop.index0 }}" class="{%- assign tags = item.tags | split: ";" | compact | where_exp: 'item' , 'item != " "' %}{% for tag in tags %}{{tag | slugify }} {% endfor %}row line py-1">
<p class="words col-md-10 col-lg-8 col-print-12 pr-0">
{% unless item.speaker == prev_speaker %}{%if item.speaker %}<span class="fw-bold pe-3 pb-3">{{item.speaker |
remove: ":"}}: </span>{% endif %}{% endunless %}{{item.words}}
</p>
<div class="col-12 col-md-2 timestamp mb-3 small text-center">{%if item.timestamp%}{% if av %}{% capture avlink %}transcript/timestamp/{{av | downcase }}.html{% endcapture %}<a href="{% include {{avlink}} %}">{{item.timestamp}}</a>{% else %}{{item.timestamp}}{% endif %}{% endif %}
</div>
</div>
{% endfor %}
</div>
</div>
</div>
39 changes: 0 additions & 39 deletions _includes/transcript/js/docready-js.html

This file was deleted.

20 changes: 0 additions & 20 deletions _includes/transcript/js/docready-viz-js.html
Original file line number Diff line number Diff line change
@@ -1,20 +0,0 @@
<script>
(function(){
// init bootstrap tooltips
var tooltipTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"]'))
var tooltipList = tooltipTriggerList.map(function (tooltipTriggerEl) {
return new bootstrap.Tooltip(tooltipTriggerEl)
})

let url = new URL(window.location);
let params = url.searchParams;
var codeFilter = url.searchParams.get('filter');

if(codeFilter) {
// code to be executed if a filter is contained in the url
vizFilter(codeFilter);
}
else{
};
})();
</script>
17 changes: 0 additions & 17 deletions _includes/transcript/js/scroll-to-top-js.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,33 +9,16 @@
console.log("height is" + topheight);
document.getElementById("scroll-to-top").style.display = "block";
triggerElement.setAttribute('style', 'margin-top:' + topheight + 'px');
document.getElementById('object-meta').classList.add('iframe-wrapper');
}
//BOTTOM
else {
document.getElementById("scroll-to-top").style.display = "none";
document.getElementById('object-meta').classList.remove('iframe-wrapper');
triggerElement.removeAttribute('style');

}
}

// When the user scrolls down from the top of the document, show the button
/* window.onscroll = function () {
if (document.body.scrollTop > 1000 || document.documentElement.scrollTop > 500) {
document.getElementById("scroll-to-top").style.display = "block";
document.getElementById('object-meta').classList.add('iframe-wrapper');

} else {
document.getElementById("scroll-to-top").style.display = "none";
document.getElementById('object-meta').classList.remove('iframe-wrapper');
}
}*/
// scroll to top function
function scrollToTop() {
window.scroll({
Expand Down
Loading

0 comments on commit fc7cc40

Please sign in to comment.