diff options
author | Andrew Dolgov <[email protected]> | 2005-09-05 10:09:10 +0100 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2005-09-05 10:09:10 +0100 |
commit | 70830c87c950e9c7b4267372acaedd8d0f9b7d58 (patch) | |
tree | a26089c42e0bad6154ab6180937ab71d21585716 | |
parent | 7e63d5e429d107234457689552c18e233baae286 (diff) |
optional support for showing content in an iframe
-rw-r--r-- | TODO | 2 | ||||
-rw-r--r-- | backend.php | 16 | ||||
-rw-r--r-- | config.php-dist | 5 | ||||
-rw-r--r-- | tt-rss.css | 8 | ||||
-rw-r--r-- | tt-rss.js | 15 | ||||
-rw-r--r-- | tt-rss.php | 4 |
6 files changed, 42 insertions, 8 deletions
@@ -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 "<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); @@ -226,6 +238,10 @@ print "</table>"; } + + if ($addheader) { + print "</body></html>"; + } } 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%; +} @@ -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 @@ </td> </tr> <td class="content" id="content" valign="top"> - + <? if (ENABLE_CONTENT_IFRAME) { ?> + <iframe id="content-frame" class="contentFrame"> + <? } ?> </td> </tr> <tr> |