optional support for showing content in an iframe

This commit is contained in:
Andrew Dolgov 2005-09-05 10:09:10 +01:00
parent 7e63d5e429
commit 70830c87c9
6 changed files with 42 additions and 8 deletions

2
TODO
View File

@ -9,4 +9,4 @@ Mysterious Future
- Gmail-like labels for feed categories (needs UI thinking) - Gmail-like labels for feed categories (needs UI thinking)
- support for "starred" posts (+ maybe Starred label) - support for "starred" posts (+ maybe Starred label)
- global search - global search
- optional three column layout

View File

@ -186,11 +186,23 @@
$result = pg_query("UPDATE ttrss_entries SET unread = false,last_read = NOW() WHERE id = '$id'"); $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, $result = pg_query("SELECT title,link,content,feed_id,comments,
(SELECT icon_url FROM ttrss_feeds WHERE id = feed_id) as icon_url (SELECT icon_url FROM ttrss_feeds WHERE id = feed_id) as icon_url
FROM ttrss_entries FROM ttrss_entries
WHERE id = '$id'"); 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) { if ($result) {
$line = pg_fetch_assoc($result); $line = pg_fetch_assoc($result);
@ -226,6 +238,10 @@
print "</table>"; print "</table>";
} }
if ($addheader) {
print "</body></html>";
}
} }
if ($op == "viewfeed") { if ($op == "viewfeed") {

View File

@ -22,6 +22,9 @@
define(ENABLE_PREFS_CATCHUP_UNCATCHUP, false); define(ENABLE_PREFS_CATCHUP_UNCATCHUP, false);
// enable "Mark as read/unread" buttons in preferences dialog // enable "Mark as read/unread" buttons in preferences dialog
define(ENABLE_CONTENT_IFRAME, true);
// show article in an iframe to mitigate scrolling UI issues
?> ?>

View File

@ -375,4 +375,10 @@ div.expPane {
margin : 15px; margin : 15px;
} }
iframe.contentFrame {
width : 100%;
border-width : 0px;
padding : 0px;
margin : 0px;
height : 100%;
}

View File

@ -423,11 +423,16 @@ function view(id,feed_id) {
active_post_id = id; active_post_id = id;
xmlhttp_view.open("GET", "backend.php?op=view&id=" + param_escape(id), true); var content = document.getElementById("content-frame");
xmlhttp_view.onreadystatechange=view_callback;
xmlhttp_view.send(null);
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() { function timeout() {
@ -615,4 +620,6 @@ function init() {
updateFeedList(false, false); updateFeedList(false, false);
document.onkeydown = hotkey_handler; document.onkeydown = hotkey_handler;
setTimeout("timeout()", 1800*1000); setTimeout("timeout()", 1800*1000);
var content = document.getElementById("content");
} }

View File

@ -46,7 +46,9 @@
</td> </td>
</tr> </tr>
<td class="content" id="content" valign="top"> <td class="content" id="content" valign="top">
&nbsp; <? if (ENABLE_CONTENT_IFRAME) { ?>
<iframe id="content-frame" class="contentFrame">
<? } ?>
</td> </td>
</tr> </tr>
<tr> <tr>