}
}
- $result = pg_query("SELECT * FROM ttrss_feeds ORDER by title");
+ $result = pg_query("SELECT
+ id,title,feed_url,substring(last_updated,1,16) as last_updated
+ FROM
+ ttrss_feeds ORDER by title");
print "<p><table width=\"100%\" class=\"prefFeedList\" id=\"prefFeedList\">";
print "<tr class=\"title\">
- <td>Select</td><td>Title</td><td>Link</td><td>Last Updated</td></tr>";
+ <td> </td><td>Select</td><td>Title</td><td>Link</td><td>Last Updated</td></tr>";
$lnum = 0;
print "<tr class=\"$class\" id=\"FEEDR-$feed_id\">";
+ $icon_file = ICONS_DIR . "/$feed_id.ico";
+
+ if (file_exists($icon_file) && filesize($icon_file) > 0) {
+ $feed_icon = "<img width=\"16\" height=\"16\"
+ src=\"" . ICONS_URL . "/$feed_id.ico\">";
+ } else {
+ $feed_icon = " ";
+ }
+ print "<td align='center'>$feed_icon</td>";
+
print "<td><input onclick='toggleSelectRow(this);'
type=\"checkbox\" id=\"FRCHK-".$line["id"]."\"></td>";
+
print "<td><a href=\"javascript:editFeed($feed_id);\">" .
$line["title"] . "</td>";
print "<td><a href=\"javascript:editFeed($feed_id);\">" .
function updateFeedList() {
- if (xmlhttp.readyState != 4 && xmlhttp.readyState != 0) {
+ if (!xmlhttp_ready(xmlhttp)) {
printLockingError();
return
}
function addFeed() {
- if (xmlhttp.readyState != 4 && xmlhttp.readyState != 0) {
+ if (!xmlhttp_ready(xmlhttp)) {
printLockingError();
return
}
// notify("Editing feed...");
- if (xmlhttp.readyState != 4 && xmlhttp.readyState != 0) {
+ if (!xmlhttp_ready(xmlhttp)) {
printLockingError();
return
}
function readSelectedFeeds() {
- if (xmlhttp.readyState != 4 && xmlhttp.readyState != 0) {
+ if (!xmlhttp_ready(xmlhttp)) {
printLockingError();
return
}
function unreadSelectedFeeds() {
- if (xmlhttp.readyState != 4 && xmlhttp.readyState != 0) {
+ if (!xmlhttp_ready(xmlhttp)) {
printLockingError();
return
}
function removeSelectedFeeds() {
- if (xmlhttp.readyState != 4 && xmlhttp.readyState != 0) {
+ if (!xmlhttp_ready(xmlhttp)) {
printLockingError();
return
}
function feedEditCancel() {
- if (xmlhttp.readyState != 4 && xmlhttp.readyState != 0) {
+ if (!xmlhttp_ready(xmlhttp)) {
printLockingError();
return
}
function feedEditSave(feed) {
- if (xmlhttp.readyState != 4 && xmlhttp.readyState != 0) {
+ if (!xmlhttp_ready(xmlhttp)) {
printLockingError();
return
}
if (xmlhttp.readyState == 4) {
container.innerHTML=xmlhttp.responseText;
-// var feedtu = document.getElementById("FEEDTU");
-// if (feedtu) {
-// total_unread = feedtu.innerHTML;
-// update_title();
-// }
-
if (first_run) {
scheduleFeedUpdate(false);
first_run = false;
} else {
notify("");
- }
- }
+ }
+ }
}
function viewfeed_callback() {
}
function refetch_callback() {
+
if (xmlhttp_rpc.readyState == 4) {
notify("All feeds updated");
-
var container = document.getElementById('feeds');
-
container.innerHTML = xmlhttp_rpc.responseText;
-
document.title = "Tiny Tiny RSS";
-
- //updateFeedList(true, false);
- }
+ }
}
function scheduleFeedUpdate(force) {
query_str = query_str + "updateAllFeeds";
}
- if (xmlhttp_rpc.readyState == 4 || xmlhttp_rpc.readyState == 0) {
+ if (xmlhttp_ready(xmlhttp_rpc)) {
xmlhttp_rpc.open("GET", query_str, true);
xmlhttp_rpc.onreadystatechange=refetch_callback;
xmlhttp_rpc.send(null);
} else {
printLockingError();
- }
+ }
}
function updateFeedList(silent, fetch) {
-
+
if (silent != true) {
notify("Loading feed list...");
}
if (fetch) query_str = query_str + "&fetch=yes";
- if (xmlhttp.readyState == 4 || xmlhttp.readyState == 0) {
+ if (xmlhttp_ready(xmlhttp)) {
xmlhttp.open("GET", query_str, true);
xmlhttp.onreadystatechange=feedlist_callback;
xmlhttp.send(null);
function catchupPage(feed) {
- if (xmlhttp.readyState != 4 && xmlhttp.readyState != 0) {
+ if (!xmlhttp_ready(xmlhttp)) {
printLockingError();
return
}
function catchupAllFeeds() {
- if (xmlhttp.readyState != 4 && xmlhttp.readyState != 0) {
+ if (!xmlhttp_ready(xmlhttp)) {
printLockingError();
return
}
return;
}
- if (xmlhttp.readyState != 4 && xmlhttp.readyState != 0) {
+ if (!xmlhttp_ready(xmlhttp)) {
printLockingError();
return
}
enableHotkeys();
- if (xmlhttp_view.readyState != 4 && xmlhttp_view.readyState != 0) {
+ if (!xmlhttp_ready(xmlhttp_view)) {
printLockingError();
return
}
}
total_unread--;
-
- update_title();
}
cleanSelectedHeadlines();
xmlhttp_view.onreadystatechange=view_callback;
xmlhttp_view.send(null);
+
}
function timeout() {
-
scheduleFeedUpdate(true);
-
setTimeout("timeout()", 1800*1000);
-
}
function resetSearch() {
}
function search(feed) {
-
-// if (xmlhttp.readyState != 4 && xmlhttp.readyState != 0) {
-// printLockingError();
-// return
-// }
-
-// notify("Search: " + feed + ", " + sender.value)
-
-/* document.getElementById('headlines').innerHTML='Loading headlines, please wait...';
- document.getElementById('content').innerHTML=' ';
-
- xmlhttp.open("GET", "backend.php?op=viewfeed&feed=" + param_escape(feed) +
- "&search=" + param_escape(sender.value) + "&subop=search", true);
- xmlhttp.onreadystatechange=viewfeed_callback;
- xmlhttp.send(null); */
-
viewfeed(feed, 0, "");
-
-}
-
-function update_title() {
- //document.title = "Tiny Tiny RSS (" + total_unread + " unread)";
}
function localPiggieFunction(enable) {
if (enable) {
var query_str = "backend.php?op=feeds&subop=piggie";
- if (xmlhttp.readyState == 4 || xmlhttp.readyState == 0) {
+ if (xmlhttp_ready(xmlhttp)) {
xmlhttp.open("GET", query_str, true);
xmlhttp.onreadystatechange=feedlist_callback;
function init() {
- if (!xmlhttp) {
+
+ // IE kludge
+
+ if (xmlhttp && !xmlhttp_rpc) {
+ xmlhttp_rpc = xmlhttp;
+ xmlhttp_view = xmlhttp;
+ }
+
+ if (!xmlhttp || !xmlhttp_rpc || !xmlhttp_view) {
document.getElementById("headlines").innerHTML =
"<b>Fatal error:</b> This program needs XmlHttpRequest " +
"to function properly. Your browser doesn't seem to support it.";