forked from openlp/openlp
Fix problem with the outline alignment when the theme is using Justify.
bzr-revno: 1829 Fixes: https://launchpad.net/bugs/859950
This commit is contained in:
commit
4949f88f28
@ -113,10 +113,10 @@ sup {
|
|||||||
document.getElementById('lyricsmain').style.visibility = lyrics;
|
document.getElementById('lyricsmain').style.visibility = lyrics;
|
||||||
document.getElementById('image').style.visibility = lyrics;
|
document.getElementById('image').style.visibility = lyrics;
|
||||||
outline = document.getElementById('lyricsoutline')
|
outline = document.getElementById('lyricsoutline')
|
||||||
if(outline!=null)
|
if(outline != null)
|
||||||
outline.style.visibility = lyrics;
|
outline.style.visibility = lyrics;
|
||||||
shadow = document.getElementById('lyricsshadow')
|
shadow = document.getElementById('lyricsshadow')
|
||||||
if(shadow!=null)
|
if(shadow != null)
|
||||||
shadow.style.visibility = lyrics;
|
shadow.style.visibility = lyrics;
|
||||||
document.getElementById('footer').style.visibility = lyrics;
|
document.getElementById('footer').style.visibility = lyrics;
|
||||||
}
|
}
|
||||||
@ -129,10 +129,28 @@ sup {
|
|||||||
var match = /-webkit-text-fill-color:[^;\"]+/gi;
|
var match = /-webkit-text-fill-color:[^;\"]+/gi;
|
||||||
if(timer != null)
|
if(timer != null)
|
||||||
clearTimeout(timer);
|
clearTimeout(timer);
|
||||||
|
/*
|
||||||
|
QtWebkit bug with outlines and justify causing outline alignment
|
||||||
|
problems. (Bug 859950) Surround each word with a <span> to workaround,
|
||||||
|
but only in this scenario.
|
||||||
|
*/
|
||||||
|
var txt = document.getElementById('lyricsmain');
|
||||||
|
if(window.getComputedStyle(txt).textAlign == 'justify'){
|
||||||
|
var outline = document.getElementById('lyricsoutline');
|
||||||
|
if(outline != null)
|
||||||
|
txt = outline;
|
||||||
|
if(window.getComputedStyle(txt).webkitTextStrokeWidth != '0px'){
|
||||||
|
newtext = newtext.replace(/(\s| )+(?![^<]*>)/g,
|
||||||
|
function(match) {
|
||||||
|
return '</span>' + match + '<span>';
|
||||||
|
});
|
||||||
|
newtext = '<span>' + newtext + '</span>';
|
||||||
|
}
|
||||||
|
}
|
||||||
text_fade('lyricsmain', newtext);
|
text_fade('lyricsmain', newtext);
|
||||||
text_fade('lyricsoutline', newtext);
|
text_fade('lyricsoutline', newtext);
|
||||||
text_fade('lyricsshadow', newtext.replace(match, ""));
|
text_fade('lyricsshadow', newtext.replace(match, ''));
|
||||||
if(text_opacity()==1) return;
|
if(text_opacity() == 1) return;
|
||||||
timer = setTimeout(function(){
|
timer = setTimeout(function(){
|
||||||
show_text(newtext);
|
show_text(newtext);
|
||||||
}, 100);
|
}, 100);
|
||||||
@ -149,18 +167,18 @@ sup {
|
|||||||
slides) still looks pretty and is zippy.
|
slides) still looks pretty and is zippy.
|
||||||
*/
|
*/
|
||||||
var text = document.getElementById(id);
|
var text = document.getElementById(id);
|
||||||
if(text==null) return;
|
if(text == null) return;
|
||||||
if(!transition){
|
if(!transition){
|
||||||
text.innerHTML = newtext;
|
text.innerHTML = newtext;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(newtext==text.innerHTML){
|
if(newtext == text.innerHTML){
|
||||||
text.style.opacity = parseFloat(text.style.opacity) + 0.3;
|
text.style.opacity = parseFloat(text.style.opacity) + 0.3;
|
||||||
if(text.style.opacity>0.7)
|
if(text.style.opacity > 0.7)
|
||||||
text.style.opacity = 1;
|
text.style.opacity = 1;
|
||||||
} else {
|
} else {
|
||||||
text.style.opacity = parseFloat(text.style.opacity) - 0.3;
|
text.style.opacity = parseFloat(text.style.opacity) - 0.3;
|
||||||
if(text.style.opacity<=0.1){
|
if(text.style.opacity <= 0.1){
|
||||||
text.innerHTML = newtext;
|
text.innerHTML = newtext;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -172,7 +190,7 @@ sup {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function show_text_complete(){
|
function show_text_complete(){
|
||||||
return (text_opacity()==1);
|
return (text_opacity() == 1);
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
</head>
|
</head>
|
||||||
|
Loading…
Reference in New Issue
Block a user