km0 3 years ago
commit 2b9ee47ac7

@ -1,5 +1,6 @@
const reference = document.getElementById("reference"); const reference = document.getElementById("reference");
const contributionsList = document.getElementById("contributions"); const contributionsList = document.getElementById("contributions");
const trackList = document.getElementById("trackList");
const pagedjs = document.createElement("script"); const pagedjs = document.createElement("script");
pagedjs.src = "https://unpkg.com/pagedjs/dist/paged.polyfill.js"; pagedjs.src = "https://unpkg.com/pagedjs/dist/paged.polyfill.js";
@ -28,6 +29,7 @@ function populateContributions(contributions) {
contributions.sort((a, b) => a.order - b.order); contributions.sort((a, b) => a.order - b.order);
contributions.forEach((contribution) => { contributions.forEach((contribution) => {
contributionsList.appendChild(createSection(contribution)); contributionsList.appendChild(createSection(contribution));
createIndexSection(contribution);
}); });
} }
@ -54,6 +56,26 @@ function atlasLink() {
} }
} }
function createIndexSection(contribution) {
let table = document.createElement("table");
let title = document.createElement("h4");
title.innerHTML = contribution.title;
contribution.audio.forEach((track) => {
console.log(track);
// let row = document.createElement("tr");
// let col1 = document.createElement("td");
// let col2 = document.createElement("td");
// col1.setAttribute("class", "symbol");
// col2.setAttribute("class", "filename");
// col2.innerHTML = track;
// row.appendChild(col1);
// row.appendChild(col2);
// table.appendChild(row);
});
trackList.appendChild(title);
trackList.appendChild(table);
}
function printViewToggle() { function printViewToggle() {
var printview = document.getElementById("printview"); var printview = document.getElementById("printview");
if (!printview) { if (!printview) {

@ -123,12 +123,13 @@
</g> </g>
</g> </g>
</svg> </svg>
<!-- structure placeholder -->
<div class="info"> <div class="info">
<div class="title">Title</div> <div class="title">Title</div>
<div class="filename">Filename.mp3</div> <div class="filename">Filename.mp3</div>
<div class="position">04:35</div> <div class="position">04:35</div>
</div> </div>
<!-- --------------------- -->
</div> </div>
<div class="libretto" contenteditable="true"> <div class="libretto" contenteditable="true">
<header class="cover"> <header class="cover">
@ -155,8 +156,17 @@
</header> </header>
<!-- <section class="vocabulary"></section> --> <!-- <section class="vocabulary"></section> -->
<section class="index"> <section class="index" id="index">
<h2>Index</h2> <h2>Index</h2>
<div class="tracklist" id="trackList"></div>
<!-- table structure below -->
<!-- <table class="tracks" id="tracks-ref">
<caption class="title"></caption>
<tr class="track">
<td class="symbol"></td>
<td class="filename"></td>
</tr>
</table> -->
</section> </section>
<div class="contributions" id="contributions"></div> <div class="contributions" id="contributions"></div>

@ -64,6 +64,11 @@
.libretto { .libretto {
overflow-y: hidden; overflow-y: hidden;
overflow-x: hidden;
}
.libretto > *{
border-bottom: none;
} }
@ -86,7 +91,7 @@
.contribution li{ .contribution li{
column-span: none; column-span: none;
}*/ }*/
.content p, .content h2 { .content p, .content h2 {
margin: default; margin: default;

Loading…
Cancel
Save