]> git.sesse.net Git - ultimatescore/blobdiff - score.js
Add support for pictures in lower thirds (only used by the quick lower thirds).
[ultimatescore] / score.js
index a479778d29df616f3304b927af6a653ccc8d8cf1..5f8771cf6301d6370a0d8089eb25a2be94ab6c1d 100644 (file)
--- a/score.js
+++ b/score.js
@@ -107,10 +107,16 @@ function showlowerthird()
        g = document.getElementById('lowerthird-subheading-content');
        f.style.paddingTop = Math.round((f.clientHeight - g.clientHeight) / 2) + 'px';
 
+       f = document.getElementById('lowerthird-picture');
+       g = document.getElementById('lowerthird-picture-content');
+       f.style.paddingTop = Math.round((f.clientHeight - g.clientHeight) / 2) + 'px';
+
        document.getElementById('lowerthird-headline').className = 'lowerthird-headline lowerthird-headline-animate-in';
        document.getElementById('lowerthird-headline-content').className = 'lowerthird-headline-content lowerthird-headline-content-animate-in';
        document.getElementById('lowerthird-subheading').className = 'lowerthird-subheading lowerthird-subheading-animate-in';
        document.getElementById('lowerthird-subheading-content').className = 'lowerthird-subheading-content lowerthird-subheading-content-animate-in';
+       document.getElementById('lowerthird-picture').className = 'lowerthird-picture lowerthird-picture-animate-in';
+       document.getElementById('lowerthird-picture-content').className = 'lowerthird-picture-content lowerthird-picture-content-animate-in';
        lowerthird_visible = true;
 }
 
@@ -118,6 +124,13 @@ function setandshowlowerthird()
 {
        document.getElementById('lowerthird-headline-content').innerHTML = state['text1'];
        document.getElementById('lowerthird-subheading-content').innerHTML = state['text2'];
+       var img = document.getElementById('lowerthird-img');
+       if (state['image'] === undefined) {
+               img.style.display = 'none';
+       } else {
+               img.src = state['image'];       
+               img.style.display = 'inline';
+       }
        showlowerthird();
 }
 
@@ -128,6 +141,8 @@ function hidelowerthird()
        document.getElementById('lowerthird-headline-content').className = 'lowerthird-headline-content lowerthird-headline-content-animate-out';
        document.getElementById('lowerthird-subheading').className = 'lowerthird-subheading lowerthird-subheading-animate-out';
        document.getElementById('lowerthird-subheading-content').className = 'lowerthird-subheading-content lowerthird-subheading-content-animate-out';
+       document.getElementById('lowerthird-picture').className = 'lowerthird-picture lowerthird-picture-hidden lowerthird-picture-animate-out';
+       document.getElementById('lowerthird-picture-content').className = 'lowerthird-picture-content lowerthird-picture-content-animate-out';
        lowerthird_visible = false;
 }