From 70830c87c950e9c7b4267372acaedd8d0f9b7d58 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Mon, 5 Sep 2005 10:09:10 +0100 Subject: [PATCH] optional support for showing content in an iframe --- TODO | 2 +- backend.php | 16 ++++++++++++++++ config.php-dist | 5 ++++- tt-rss.css | 8 +++++++- tt-rss.js | 15 +++++++++++---- tt-rss.php | 4 +++- 6 files changed, 42 insertions(+), 8 deletions(-) diff --git a/TODO b/TODO index d86acab7a..7459b5f8a 100644 --- 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 diff --git a/backend.php b/backend.php index 03c7bb07a..89e517160 100644 --- a/backend.php +++ b/backend.php @@ -186,11 +186,23 @@ $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 " + + Tiny Tiny RSS : Article $id + + + "; + } + if ($result) { $line = pg_fetch_assoc($result); @@ -226,6 +238,10 @@ print ""; } + + if ($addheader) { + print ""; + } } if ($op == "viewfeed") { diff --git a/config.php-dist b/config.php-dist index e441a94be..0860c8f7f 100644 --- a/config.php-dist +++ b/config.php-dist @@ -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 + ?> diff --git a/tt-rss.css b/tt-rss.css index f2c15c64c..3c3dae031 100644 --- a/tt-rss.css +++ b/tt-rss.css @@ -375,4 +375,10 @@ div.expPane { margin : 15px; } - +iframe.contentFrame { + width : 100%; + border-width : 0px; + padding : 0px; + margin : 0px; + height : 100%; +} diff --git a/tt-rss.js b/tt-rss.js index 53360f813..de262f91c 100644 --- 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"); } diff --git a/tt-rss.php b/tt-rss.php index 338b3efc8..e4efe330b 100644 --- a/tt-rss.php +++ b/tt-rss.php @@ -46,7 +46,9 @@ -   + +