show text info

This commit is contained in:
j 2021-10-11 14:50:19 +01:00
parent 8b531011ce
commit f211375bbe
3 changed files with 24 additions and 7 deletions

View file

@ -7,11 +7,17 @@
h1 {
margin: 4px;
margin-top: 32px;
margin-bottom: 64px;
font-size: 24px;
letter-spacing: 1px;
font-weight: bold;
}
h2 {
margin: 4px;
}
.intro {
margin: 4px;
margin-bottom: 64px;
}
.player {
position: absolute;
display: none;

View file

@ -105,6 +105,19 @@ function timeupdate(event) {
}
}
function formatInfo(config, ascroll) {
var h1 = document.createElement('h1')
h1.innerHTML = config.title
ascroll.appendChild(h1)
var h2 = document.createElement('h2')
h2.innerHTML = config.byline
ascroll.appendChild(h2)
var div = document.createElement('div')
div.classList.add('intro')
div.innerHTML = config.body
ascroll.appendChild(div)
}
function loadItem(config) {
pandoraAPI('get', {id: config.item, keys: [
'id', 'title', 'layers', 'hue', 'saturation', 'lightness'
@ -122,10 +135,8 @@ function loadItem(config) {
video.addEventListener('timeupdate', timeupdate)
ascroll.appendChild(video)
var h1 = document.createElement('h1')
var first
h1.innerHTML = response.data.title
ascroll.appendChild(h1)
formatInfo(config, ascroll)
response.data.layers[layer].forEach(annotation => {
if (config.user && annotation.user != config.user) {
@ -168,10 +179,8 @@ function loadEdit(config) {
video.addEventListener('timeupdate', timeupdate)
ascroll.appendChild(video)
var h1 = document.createElement('h1')
var first
h1.innerHTML = response.data.name
ascroll.appendChild(h1)
formatInfo(config, ascroll)
response.data.clips.forEach(clip => {
clip.layers[layer].forEach(annotation => {

View file

@ -52,5 +52,7 @@ class Text(models.Model):
def json(self):
data = {}
data['title'] = self.title
data['byline'] = self.byline
data['body'] = self.body
data.update(self.data)
return json.dumps(data)