optional support for showing content in an iframe
This commit is contained in:
parent
7e63d5e429
commit
70830c87c9
2
TODO
2
TODO
|
@ -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
|
||||||
|
|
16
backend.php
16
backend.php
|
@ -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") {
|
||||||
|
|
|
@ -23,5 +23,8 @@
|
||||||
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
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
|
|
@ -375,4 +375,10 @@ div.expPane {
|
||||||
margin : 15px;
|
margin : 15px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
iframe.contentFrame {
|
||||||
|
width : 100%;
|
||||||
|
border-width : 0px;
|
||||||
|
padding : 0px;
|
||||||
|
margin : 0px;
|
||||||
|
height : 100%;
|
||||||
|
}
|
||||||
|
|
15
tt-rss.js
15
tt-rss.js
|
@ -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");
|
||||||
}
|
}
|
||||||
|
|
|
@ -46,7 +46,9 @@
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<td class="content" id="content" valign="top">
|
<td class="content" id="content" valign="top">
|
||||||
|
<? if (ENABLE_CONTENT_IFRAME) { ?>
|
||||||
|
<iframe id="content-frame" class="contentFrame">
|
||||||
|
<? } ?>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
|
Loading…
Reference in New Issue