These functions read and interpret assets-source data read from the lineup. Open Read Assets from Lineup for test assets.
function sources(topic) { const action = 'requestSourceData' return new Promise(resolve => { let fn = event => { let {data} = event if (!data.action == action) return window.removeEventListener('message', fn) resolve(data.sources) } window.addEventListener('message', fn) window.parent.postMessage({action, topic},"*") }) }
We expect sources to be return with the closest first. We reverse this when we want entries in left to right order.
async function sequence() { let all = await sources('assets') let result = [all[0].panel] for (let pane of all.reverse()) { for (let folder in pane.assetsData) { for (let twin in pane.assetsData[folder]) { let route = `${twin}/${folder}` let files = pane.assetsData[folder][twin] result.push({route, files}) } } } let json = JSON.stringify(result,null,2) output.innerHTML = `<pre>${json}</pre>` }
sequence()
We show the first of many identical panel details.
//wiki.ralfbarkow.ch/assets/pages/snippet-template/basicjs.html?snippet-template HEIGHT 600