]> git.wh0rd.org Git - tt-rss.git/commitdiff
move inline player generation code into separate function; disable support for native...
authorAndrew Dolgov <fox@bah.org.ru>
Tue, 6 Oct 2009 08:58:57 +0000 (12:58 +0400)
committerAndrew Dolgov <fox@bah.org.ru>
Tue, 6 Oct 2009 08:58:57 +0000 (12:58 +0400)
functions.php
viewfeed.js

index b0904c1ffbd6446604d499f82ac54f249d078a58..32a5b2ec3d6a5c8b1516f5635a8e66d8fd104576 100644 (file)
                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 .= "<object type=\"application/x-shockwave-flash\" 
+                               data=\"extras/button/musicplayer.swf?song_url=$url\" 
+                               width=\"17\" height=\"17\"> 
+                                       <param name=\"movie\" value=\"extras/button/musicplayer.swf?song_url=$url\" /> </object>";  
+               }
+
+               /*
+
+               if (substr($ctype,0,6)=="audio/" || $ctype=="application/ogg" || $ctype=="application/x-ogg") {
+                       $entry .= "<audio controls=\"controls\"><source src=\"$url\" type=\"$ctype\" />";
+                       if (($ctype == __("audio/mpeg")) && 
+                               (get_pref($link, "ENABLE_FLASH_PLAYER")) ) { 
+                               $entry .= "<span><object type=\"application/x-shockwave-flash\" data=\"extras/button/musicplayer.swf?song_url=$url\" width=\"17\" height=\"17\"> <param name=\"movie\" value=\"extras/button/musicplayer.swf?song_url=$url\" /> </object></span>";
+                       }
+                       $entry .= "</audio> ";
+                       if (($ctype == __("audio/mpeg")) && 
+                               (get_pref($link, "ENABLE_FLASH_PLAYER")) ) {
+                               $entry .= "<a id='switchToFlashLink' href='#' onclick='return switchToFlash(this)'>".__('Switch to Flash Player')."</a>";       
+                               $entry .= "<script type='text/javascript'>html5AudioOrFlash('$ctype');</script>"; 
+                       }
+               } elseif (substr($ctype,0,6)=="video/") {
+                       $entry .= "<video controls=\"controls\"><source src=\"$url\" type=\"$ctype\" />";
+                       $entry .= "</video>";
+               } */
+
+
+
+               return $entry;
+       }
+
        function outputArticleXML($link, $id, $feed_id, $mark_as_read = true,
                $zoom_mode = false) {
 
 
                                        $filename = substr($url, strrpos($url, "/")+1);
 
-                                       $entry = ""; 
-                                       
-                                       if (substr($ctype,0,6)=="audio/" || $ctype=="application/ogg" || $ctype=="application/x-ogg") {
-                                               $entry .= "<audio controls=\"controls\"><source src=\"$url\" type=\"$ctype\" />";
-                                               if (($ctype == __("audio/mpeg")) && 
-                                                       (get_pref($link, "ENABLE_FLASH_PLAYER")) ) { 
-                                                       $entry .= "<span><object type=\"application/x-shockwave-flash\" data=\"extras/button/musicplayer.swf?song_url=$url\" width=\"17\" height=\"17\"> <param name=\"movie\" value=\"extras/button/musicplayer.swf?song_url=$url\" /> </object></span>";
-                                               }
-                                               $entry .= "</audio> ";
-                                               if (($ctype == __("audio/mpeg")) && 
-                                                       (get_pref($link, "ENABLE_FLASH_PLAYER")) ) {
-                                                       $entry .= "<a id='switchToFlashLink' href='#' onclick='return switchToFlash(this)'>".__('Switch to Flash Player')."</a>";       
-                                                       $entry .= "<script type='text/javascript'>html5AudioOrFlash('$ctype');</script>"; 
-                                               }
-                                       } elseif (substr($ctype,0,6)=="video/") {
-                                               $entry .= "<video controls=\"controls\"><source src=\"$url\" type=\"$ctype\" />";
-                                               $entry .= "</video>";
-                                       }
+                                       $entry = format_inline_player($link, $url, $ctype);
 
-                                       $entry .= "<a target=\"_blank\" href=\"" . htmlspecialchars($url) . "\">" .
+                                       $entry .= " <a target=\"_blank\" href=\"" . htmlspecialchars($url) . "\">" .
                                                $filename . " (" . $ctype . ")" . "</a>";
 
                                        array_push($entries_html, $entry);
 
                                        $filename = substr($url, strrpos($url, "/")+1);
 
-                                       $entry = ""; 
-                                       
-                                       if (substr($ctype,0,6)=="audio/" || $ctype=="application/ogg" || $ctype=="application/x-ogg") {
-                                               $entry .= "<audio controls=\"controls\"><source src=\"$url\" type=\"$ctype\" />";
-                                               if (($ctype == __("audio/mpeg")) && 
-                                                       (get_pref($link, "ENABLE_FLASH_PLAYER")) ) { 
-                                                       $entry .= "<span><object type=\"application/x-shockwave-flash\" data=\"extras/button/musicplayer.swf?song_url=$url\" width=\"17\" height=\"17\"> <param name=\"movie\" value=\"extras/button/musicplayer.swf?song_url=$url\" /> </object></span>";
-                                               }
-                                               $entry .= "</audio> ";
-                                               if (($ctype == __("audio/mpeg")) && 
-                                                       (get_pref($link, "ENABLE_FLASH_PLAYER")) ) {
-                                                       $entry .= "<a id='switchToFlashLink' href='#' onclick='return switchToFlash(this)'>".__('Switch to Flash Player')."</a>";       
-                                                       $entry .= "<script type='text/javascript'>html5AudioOrFlash('$ctype');</script>"; 
-                                               }
-                                       } elseif (substr($ctype,0,6)=="video/") {
-                                               $entry .= "<video controls=\"controls\"><source src=\"$url\" type=\"$ctype\" />";
-                                               $entry .= "</video>";
-                                       }
+                                       $entry = format_inline_player($link, $url, $ctype);
 
-                                       $entry .= "<a target=\"_blank\" href=\"" . htmlspecialchars($url) . "\">" .
+                                       $entry .= " <a target=\"_blank\" href=\"" . htmlspecialchars($url) . "\">" .
                                                $filename . " (" . $ctype . ")" . "</a>";
 
                                        array_push($entries_html, $entry);
index 429412ba465acb8c9b6f5a92b927f4675a80fafe..227aa87a50a21334ad49c02848728e9a39953968 100644 (file)
@@ -278,7 +278,7 @@ function render_article(article) {
                
                fi.innerHTML = article;
                
-               article.evalScripts();          
+//             article.evalScripts();          
 
        } catch (e) {
                exception_error("render_article", e);