Remove version check and js tidyups

This commit is contained in:
Jonathan Corwin 2011-12-08 19:24:25 +00:00
parent 44eb1fb024
commit 15d5b97075
1 changed files with 22 additions and 20 deletions

View File

@ -130,22 +130,24 @@ 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. */ QtWebkit bug with outlines and justify causing outline alignment
if(webkitvers<=534.3){ problems. (Bug 859950) Surround each word with a <span> to workaround,
but only in this scenario.
*/
var txt = document.getElementById('lyricsmain'); var txt = document.getElementById('lyricsmain');
if(window.getComputedStyle(txt).textAlign == 'justify'){ if(window.getComputedStyle(txt).textAlign == 'justify'){
var outline = document.getElementById('lyricsoutline'); var outline = document.getElementById('lyricsoutline');
if(outline != null) if(outline != null)
txt = outline; txt = outline;
if(window.getComputedStyle(txt).webkitTextStrokeWidth!="0px"){ if(window.getComputedStyle(txt).webkitTextStrokeWidth != '0px'){
newtext = '<span>' + newtext.replace(/[ ](?![^<]*>)/g, "</span> <span>") + '</span>'; newtext = '<span>' + newtext.replace(/[ ](?![^<]*>)/g,
} '</span> <span>') + '</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);