split output

This commit is contained in:
j 2018-05-09 17:03:57 +01:00
parent 6a18c14d42
commit 02bde095e4

View file

@ -29,11 +29,19 @@ function render() {
keys: ['title', 'layers']
}, function(result) {
var html = ''
var url = document.location.protocol + '//' + document.location.host + '/' + item + '/' + time[0] + ',' + time[1];
html += '<h1>' + result.data.title + ': ' + time[0] + ' - ' + time[1] + '</h1>'
html += '<img src="/' + item + '/240p'+in_+'.jpg">'
html += url + '<br><br>'
html += '<a href="' + url + '"><img src="/' + item + '/240p'+in_+'.jpg"></a><br>'
var current
Ox.sortBy(result.data.layers.keywords, 'value').forEach(function(keyword) {
if (keyword['in'] <= out && keyword['out'] >= in_) {
html += '<br>' + keyword['value'];
var section = keyword['value'].split(': ')[0]
if (section != current) {
current = section
html += '<br><b>' + section + ':</b><br>';
}
html += keyword['value'].split(': ')[1] + '<br>';
}
})
document.body.innerHTML = html;