]> git.wh0rd.org Git - tt-rss.git/commitdiff
optional support for showing content in an iframe
authorAndrew Dolgov <fox@bah.spb.su>
Mon, 5 Sep 2005 09:09:10 +0000 (10:09 +0100)
committerAndrew Dolgov <fox@bah.spb.su>
Mon, 5 Sep 2005 09:09:10 +0000 (10:09 +0100)
TODO
backend.php
config.php-dist
tt-rss.css
tt-rss.js
tt-rss.php

diff --git a/TODO b/TODO
index d86acab7a8b8f0fa8f1b1e3a9ece69258c179905..7459b5f8a0a89096e11a7f80479b215bfdc0d2df 100644 (file)
--- a/TODO
+++ b/TODO
@@ -9,4 +9,4 @@ Mysterious Future
 - Gmail-like labels for feed categories (needs UI thinking)
 - support for "starred" posts (+ maybe Starred label)
 - global search
-
+- optional three column layout
index 03c7bb07af0acfbb0df4a2eb02d6327321edf4e7..89e517160f9e86127d357dc137f6a14f5f35eff1 100644 (file)
 
                $result = pg_query("UPDATE ttrss_entries SET unread = false,last_read = NOW() WHERE id = '$id'");
 
+               $addheader = $_GET["addheader"];
+
                $result = pg_query("SELECT title,link,content,feed_id,comments,
                        (SELECT icon_url FROM ttrss_feeds WHERE id = feed_id) as icon_url 
                        FROM ttrss_entries
                        WHERE   id = '$id'");
 
+               if ($addheader) {
+                       
+               print "<html>
+                       <head>
+                               <title>Tiny Tiny RSS : Article $id</title>
+                               <link rel=\"stylesheet\" href=\"tt-rss.css\" type=\"text/css\">
+                               <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">
+                       </head><body>";
+               }
+
                if ($result) {
 
                        $line = pg_fetch_assoc($result);
                        print "</table>";        
 
                }
+
+               if ($addheader) {
+                       print "</body></html>";
+               }
        }
 
        if ($op == "viewfeed") {
index e441a94bee09df1d620e9bcde1463202d60524f3..0860c8f7f577710f2dd22b5839b46380d73152b6 100644 (file)
@@ -22,6 +22,9 @@
        
        define(ENABLE_PREFS_CATCHUP_UNCATCHUP, false);
        // enable "Mark as read/unread" buttons in preferences dialog
-       
+
+       define(ENABLE_CONTENT_IFRAME, true);
+       // show article in an iframe to mitigate scrolling UI issues
+
 ?>
 
index f2c15c64ce930a2fce6b075fe3e8746ec3599c85..3c3dae03175b9247290b51d352ad025350b05253 100644 (file)
@@ -375,4 +375,10 @@ div.expPane {
        margin : 15px;
 }
 
-
+iframe.contentFrame {
+       width : 100%;
+       border-width : 0px;
+       padding : 0px;
+       margin : 0px;
+       height : 100%;
+}
index 53360f813465b9a59ea4244027c90239c7e59067..de262f91c5056138c6711adf60fe000cbe370d4a 100644 (file)
--- a/tt-rss.js
+++ b/tt-rss.js
@@ -423,11 +423,16 @@ function view(id,feed_id) {
 
        active_post_id = id;
 
-       xmlhttp_view.open("GET", "backend.php?op=view&id=" + param_escape(id), true);
-       xmlhttp_view.onreadystatechange=view_callback;
-       xmlhttp_view.send(null);
-
+       var content = document.getElementById("content-frame");
 
+       if (content) {
+               content.src = "backend.php?op=view&addheader=true&id=" + param_escape(id);
+               markHeadline(active_post_id);
+       } else {
+               xmlhttp_view.open("GET", "backend.php?op=view&id=" + param_escape(id), true);
+               xmlhttp_view.onreadystatechange=view_callback;
+               xmlhttp_view.send(null);
+       }
 }
 
 function timeout() {
@@ -615,4 +620,6 @@ function init() {
        updateFeedList(false, false);
        document.onkeydown = hotkey_handler;
        setTimeout("timeout()", 1800*1000);
+
+       var content = document.getElementById("content");
 }
index 338b3efc8d614d7efbc0452c121cb4846b6dfb63..e4efe330b2e6e07fb90c20e1a87e4b8dcb647922 100644 (file)
@@ -46,7 +46,9 @@
        </td>
 </tr>
        <td class="content" id="content" valign="top">
-               &nbsp;
+               <? if (ENABLE_CONTENT_IFRAME) { ?>
+               <iframe id="content-frame" class="contentFrame">                
+               <? } ?>
        </td>
 </tr>
 <tr>