static: generate queue + playlist sample data via javascript
This commit is contained in:
parent
3889391f1b
commit
8dbbc77b09
2 changed files with 36 additions and 181 deletions
|
@ -0,0 +1,34 @@
|
|||
document.addEventListener('DOMContentLoaded', function() {
|
||||
function fillTable(withPositionColumn, tableBodyElementName, numElements, playingIndex) {
|
||||
for (let i = 0; i < numElements; i++) {
|
||||
let trElem = "";
|
||||
let positionColumn = "";
|
||||
|
||||
if (i == playingIndex)
|
||||
trElem += `<tr class="playing">`;
|
||||
else
|
||||
trElem += `<tr>`;
|
||||
|
||||
if (withPositionColumn)
|
||||
positionColumn += `<td>${i + 1}</td>`
|
||||
|
||||
let exampleTableEntry =
|
||||
` \
|
||||
${trElem} \
|
||||
${positionColumn} \
|
||||
<td>T.E.E.D.</td> \
|
||||
<td>Garden (Calibre Remix)</td> \
|
||||
<td>undefined</td> \
|
||||
<td>undefined</td> \
|
||||
<td>06:01</td> \
|
||||
</tr> \
|
||||
`
|
||||
|
||||
tableBodyElement = document.getElementById(tableBodyElementName);
|
||||
tableBodyElement.innerHTML += exampleTableEntry;
|
||||
}
|
||||
}
|
||||
|
||||
fillTable(true, "queue-table-body", 8, 3);
|
||||
fillTable(false, "playlist-table-body", 15, -1);
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue