From 9324c2c24f4b3ee7e5e26e577775985d7bd84f99 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Mon, 22 Jun 2009 16:50:17 +0400 Subject: [PATCH] rework appearance of audio/video tags patch --- functions.js | 42 +++++++++++++++++++++++------------------- functions.php | 12 ++++++------ tt-rss.css | 1 + 3 files changed, 30 insertions(+), 25 deletions(-) diff --git a/functions.js b/functions.js index 5c1b26a59..81cadfe08 100644 --- a/functions.js +++ b/functions.js @@ -2134,25 +2134,29 @@ function truncate_string(s, length) { return tmp; } function switchToFlash(e) { - var targ = e; - if (!e) var e = window.event; - if (e.target) targ = e.target; - else if (e.srcElement) targ = e.srcElement; - if (targ.nodeType == 3) // defeat Safari bug - targ = targ.parentNode; - - //targ is the link that was clicked - var audioTag=targ; - do { - audioTag=audioTag.previousSibling; - } while(audioTag && audioTag.nodeType != 1) - - var flashPlayer = audioTag.getElementsByTagName('div')[0]; - targ.parentNode.insertBefore(flashPlayer,targ); - targ.parentNode.removeChild(targ); - audioTag.parentNode.removeChild(audioTag); - - return false; + try { + var targ = e; + if (!e) var e = window.event; + if (e.target) targ = e.target; + else if (e.srcElement) targ = e.srcElement; + if (targ.nodeType == 3) // defeat Safari bug + targ = targ.parentNode; + + //targ is the link that was clicked + var audioTag=targ; + do { + audioTag=audioTag.previousSibling; + } while(audioTag && audioTag.nodeType != 1) + + var flashPlayer = audioTag.getElementsByTagName('span')[0]; + targ.parentNode.insertBefore(flashPlayer,targ); + targ.parentNode.removeChild(targ); + audioTag.parentNode.removeChild(audioTag); + + return false; + } catch (e) { + exception_error("switchToFlash", e); + } } function html5AudioOrFlash(type) { var audioTag = document.createElement('audio'); diff --git a/functions.php b/functions.php index da1326be2..aeca92362 100644 --- a/functions.php +++ b/functions.php @@ -4709,12 +4709,12 @@ $entry .= ""; + $entry .= " "; if (($ctype == __("audio/mpeg")) && (get_pref($link, "ENABLE_FLASH_PLAYER")) ) { - $entry .= "".__('Switch to Flash Player')."
"; + $entry .= "".__('Switch to Flash Player').""; $entry .= ""; } } elseif (substr($ctype,0,6)=="video/") { @@ -5263,12 +5263,12 @@ $entry .= ""; + $entry .= " "; if (($ctype == __("audio/mpeg")) && (get_pref($link, "ENABLE_FLASH_PLAYER")) ) { - $entry .= "".__('Switch to Flash Player')."
"; + $entry .= "".__('Switch to Flash Player').""; $entry .= ""; } } elseif (substr($ctype,0,6)=="video/") { diff --git a/tt-rss.css b/tt-rss.css index 3946d6fcb..d12e286a2 100644 --- a/tt-rss.css +++ b/tt-rss.css @@ -2193,3 +2193,4 @@ optgroup { option { color : black; } +