From: Andrew Dolgov Date: Tue, 6 Oct 2009 08:58:57 +0000 (+0400) Subject: move inline player generation code into separate function; disable support for native... X-Git-Tag: 1.3.4~42 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=51682b23305e9e6c613c74b4b2bcbcd24a8e906f;p=tt-rss.git move inline player generation code into separate function; disable support for native html5 player due to unsolved usability reasons (closes #246) --- diff --git a/functions.php b/functions.php index b0904c1f..32a5b2ec 100644 --- a/functions.php +++ b/functions.php @@ -4519,6 +4519,42 @@ return vsprintf(__(array_shift($args)), $args); } + function format_inline_player($link, $url, $ctype) { + + $entry = ""; + + if (($ctype == __("audio/mpeg")) && (get_pref($link, "ENABLE_FLASH_PLAYER")) ) { + + $entry .= " + "; + } + + /* + + if (substr($ctype,0,6)=="audio/" || $ctype=="application/ogg" || $ctype=="application/x-ogg") { + $entry .= " "; + if (($ctype == __("audio/mpeg")) && + (get_pref($link, "ENABLE_FLASH_PLAYER")) ) { + $entry .= "".__('Switch to Flash Player').""; + $entry .= ""; + } + } elseif (substr($ctype,0,6)=="video/") { + $entry .= ""; + } */ + + + + return $entry; + } + function outputArticleXML($link, $id, $feed_id, $mark_as_read = true, $zoom_mode = false) { @@ -4706,26 +4742,9 @@ $filename = substr($url, strrpos($url, "/")+1); - $entry = ""; - - if (substr($ctype,0,6)=="audio/" || $ctype=="application/ogg" || $ctype=="application/x-ogg") { - $entry .= " "; - if (($ctype == __("audio/mpeg")) && - (get_pref($link, "ENABLE_FLASH_PLAYER")) ) { - $entry .= "".__('Switch to Flash Player').""; - $entry .= ""; - } - } elseif (substr($ctype,0,6)=="video/") { - $entry .= ""; - } + $entry = format_inline_player($link, $url, $ctype); - $entry .= "" . + $entry .= " " . $filename . " (" . $ctype . ")" . ""; array_push($entries_html, $entry); @@ -5275,26 +5294,9 @@ $filename = substr($url, strrpos($url, "/")+1); - $entry = ""; - - if (substr($ctype,0,6)=="audio/" || $ctype=="application/ogg" || $ctype=="application/x-ogg") { - $entry .= " "; - if (($ctype == __("audio/mpeg")) && - (get_pref($link, "ENABLE_FLASH_PLAYER")) ) { - $entry .= "".__('Switch to Flash Player').""; - $entry .= ""; - } - } elseif (substr($ctype,0,6)=="video/") { - $entry .= ""; - } + $entry = format_inline_player($link, $url, $ctype); - $entry .= "" . + $entry .= " " . $filename . " (" . $ctype . ")" . ""; array_push($entries_html, $entry); diff --git a/viewfeed.js b/viewfeed.js index 429412ba..227aa87a 100644 --- a/viewfeed.js +++ b/viewfeed.js @@ -278,7 +278,7 @@ function render_article(article) { fi.innerHTML = article; - article.evalScripts(); +// article.evalScripts(); } catch (e) { exception_error("render_article", e);