From c01f40f4d9c8fae847ecec5a18ff52c0a15dd57b Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Thu, 9 Sep 2010 16:50:10 +0400 Subject: add experimental digest thingie (2) --- digest.php | 113 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 113 insertions(+) create mode 100644 digest.php (limited to 'digest.php') diff --git a/digest.php b/digest.php new file mode 100644 index 000000000..cfe16cfe4 --- /dev/null +++ b/digest.php @@ -0,0 +1,113 @@ + + + + + + Tiny Tiny Digest + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +
+ +
+

latest articles

+ + TODO + +
+
+ +
+

feeds

+ +
+
+ +
+

headlines

+ +
+
+ +
+ +
+ + + + -- cgit v1.2.3-54-g00ecf From b41c254984df3fcb9fc7db4bb5218f2391e62164 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Thu, 9 Sep 2010 19:02:12 +0400 Subject: small digest page improvements --- digest.css | 8 +++++ digest.js | 57 +++++++++++++++++++++++++++++--- digest.php | 1 - functions.php | 88 ++++++++++++++++++++++++++----------------------- modules/backend-rpc.php | 14 +++++--- 5 files changed, 115 insertions(+), 53 deletions(-) (limited to 'digest.php') diff --git a/digest.css b/digest.css index 5139114f0..62852adb0 100644 --- a/digest.css +++ b/digest.css @@ -126,6 +126,14 @@ a:hover { padding : 0px; } +#feeds ul#feeds-content li a { + color : #659a4c; +} + +#feeds ul#feeds-content li a:hover { + color : gray; +} + #headlines { padding : 5px; font-size : 14px; diff --git a/digest.js b/digest.js index 7bfd9df27..3d58ca95f 100644 --- a/digest.js +++ b/digest.js @@ -1,5 +1,19 @@ var last_feeds = []; +function view(feed_id) { + try { + + new Ajax.Request("backend.php", { + parameters: "backend.php?op=rpc&subop=digest-init&feed_id=" + feed_id, + onComplete: function(transport) { + digest_update(transport); + } }); + + } catch (e) { + exception_error("view", e); + } +} + function find_feed(feeds, feed_id) { try { for (var i = 0; i < feeds.length; i++) { @@ -14,16 +28,40 @@ function find_feed(feeds, feed_id) { } } +function get_feed_icon(feed) { + try { + if (feed.has_icon) + return 'icons/' + feed.id + '.ico'; + + if (feed.id == -1) + return 'images/mark_set.png'; + + if (feed.id == -2) + return 'images/pub_set.png'; + + if (feed.id == -3) + return 'images/fresh.png'; + + if (feed.id == -4) + return 'images/tag.png'; + + if (feed.id < -10) + return 'images/label.png'; + + } catch (e) { + exception_error("get_feed_icon", e); + } +} + function add_feed_entry(feed) { try { var icon_part = ""; - if (feed.has_icon) - icon_part = "zz"; + icon_part = ""; var tmp_html = "
  • " + icon_part + - feed.title + + "" + feed.title + "
    " + feed.unread + "
    " + "
  • "; @@ -34,8 +72,11 @@ function add_feed_entry(feed) { } } -function add_latest_entry(article) { +function add_latest_entry(article, feed) { try { + + + //$("latest-content").innerHTML += "bbb"; } catch (e) { exception_error("add_latest_entry", e); @@ -55,7 +96,7 @@ function add_headline_entry(article, feed) { "" + article.title + "" + "
    " + article.excerpt + "
    " + "
    " + feed.title + " " + " @ " + - article.updated + "
    " + + new Date(article.updated * 1000) + "" + ""; $("headlines-content").innerHTML += tmp_html; @@ -75,6 +116,8 @@ function digest_update(transport) { feeds = eval("(" + feeds.firstChild.nodeValue + ")"); + $('feeds-content').innerHTML = ""; + for (var i = 0; i < feeds.length; i++) { add_feed_entry(feeds[i]); } @@ -83,9 +126,13 @@ function digest_update(transport) { if (headlines) { headlines = eval("(" + headlines.firstChild.nodeValue + ")"); + $('headlines-content').innerHTML = ""; + for (var i = 0; i < headlines.length; i++) { add_headline_entry(headlines[i], find_feed(feeds, headlines[i].feed_id)); } + + $('headlines-content').innerHTML += "
  • More articles...
  • "; } } catch (e) { diff --git a/digest.php b/digest.php index cfe16cfe4..94489eb0b 100644 --- a/digest.php +++ b/digest.php @@ -39,7 +39,6 @@ - diff --git a/functions.php b/functions.php index 78e0d4f18..ce1a06a62 100644 --- a/functions.php +++ b/functions.php @@ -6653,51 +6653,9 @@ } function api_get_feeds($link, $cat_id, $unread_only, $limit, $offset) { - if ($limit) { - $limit_qpart = "LIMIT $limit OFFSET $offset"; - } else { - $limit_qpart = ""; - } - - if (!$cat_id) { - $result = db_query($link, "SELECT - id, feed_url, cat_id, title, ". - SUBSTRING_FOR_DATE."(last_updated,1,19) AS last_updated - FROM ttrss_feeds WHERE owner_uid = " . $_SESSION["uid"] . - " ORDER BY cat_id, title " . $limit_qpart); - } else { - $result = db_query($link, "SELECT - id, feed_url, cat_id, title, ". - SUBSTRING_FOR_DATE."(last_updated,1,19) AS last_updated - FROM ttrss_feeds WHERE - cat_id = '$cat_id' AND owner_uid = " . $_SESSION["uid"] . - " ORDER BY cat_id, title " . $limit_qpart); - } $feeds = array(); - while ($line = db_fetch_assoc($result)) { - - $unread = getFeedUnread($link, $line["id"]); - - $has_icon = feed_has_icon($line['id']); - - if ($unread || !$unread_only) { - - $row = array( - "feed_url" => $line["feed_url"], - "title" => $line["title"], - "id" => (int)$line["id"], - "unread" => (int)$unread, - "has_icon" => $has_icon, - "cat_id" => (int)$line["cat_id"], - "last_updated" => strtotime($line["last_updated"]) - ); - - array_push($feeds, $row); - } - } - /* Labels */ if (!$cat_id || $cat_id == -2) { @@ -6741,6 +6699,52 @@ } } + + /* Real feeds */ + + if ($limit) { + $limit_qpart = "LIMIT $limit OFFSET $offset"; + } else { + $limit_qpart = ""; + } + + if (!$cat_id) { + $result = db_query($link, "SELECT + id, feed_url, cat_id, title, ". + SUBSTRING_FOR_DATE."(last_updated,1,19) AS last_updated + FROM ttrss_feeds WHERE owner_uid = " . $_SESSION["uid"] . + " ORDER BY cat_id, title " . $limit_qpart); + } else { + $result = db_query($link, "SELECT + id, feed_url, cat_id, title, ". + SUBSTRING_FOR_DATE."(last_updated,1,19) AS last_updated + FROM ttrss_feeds WHERE + cat_id = '$cat_id' AND owner_uid = " . $_SESSION["uid"] . + " ORDER BY cat_id, title " . $limit_qpart); + } + + while ($line = db_fetch_assoc($result)) { + + $unread = getFeedUnread($link, $line["id"]); + + $has_icon = feed_has_icon($line['id']); + + if ($unread || !$unread_only) { + + $row = array( + "feed_url" => $line["feed_url"], + "title" => $line["title"], + "id" => (int)$line["id"], + "unread" => (int)$unread, + "has_icon" => $has_icon, + "cat_id" => (int)$line["cat_id"], + "last_updated" => strtotime($line["last_updated"]) + ); + + array_push($feeds, $row); + } + } + return $feeds; } diff --git a/modules/backend-rpc.php b/modules/backend-rpc.php index f8233a7cd..edf2ae2e4 100644 --- a/modules/backend-rpc.php +++ b/modules/backend-rpc.php @@ -979,13 +979,17 @@ } if ($subop == "digest-init") { + $feed_id = db_escape_string($_REQUEST['feed_id']); + + if (!$feed_id) $feed_id = -4; + print ""; $tmp_feeds = api_get_feeds($link, false, true, false, 0); $feeds = array(); foreach ($tmp_feeds as $f) { - if ($f['id'] > 0) array_push($feeds, $f); + if ($f['id'] > 0 || $f['id'] == -4) array_push($feeds, $f); } function feeds_sort_by_unread_rev($a, $b) { @@ -998,13 +1002,13 @@ return ($a < $b) ? 1 : -1; } -// uasort($feeds, 'feeds_sort_by_unread_rev'); -// $feeds = array_slice($feeds, 0, 10); + //uasort($feeds, 'feeds_sort_by_unread_rev'); + //$feeds = array_slice($feeds, 0, 10); print ""; - $headlines = api_get_headlines($link, -4, 20, 0, - '', true, true, false, "all_articles", "updated DESC"); + $headlines = api_get_headlines($link, $feed_id, 10, 0, + '', ($feed_id == -4), true, false, "all_articles", "updated DESC"); //function api_get_headlines($link, $feed_id, $limit, $offset, // $filter, $is_cat, $show_excerpt, $show_content, $view_mode) { -- cgit v1.2.3-54-g00ecf From c524d7e6825b9127630963ebb641af75387a34a3 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Fri, 10 Sep 2010 15:47:15 +0400 Subject: more digest page improvements --- digest.css | 4 ++++ digest.js | 3 ++- digest.php | 10 +++++----- 3 files changed, 11 insertions(+), 6 deletions(-) (limited to 'digest.php') diff --git a/digest.css b/digest.css index f82bd54cd..30009a68a 100644 --- a/digest.css +++ b/digest.css @@ -196,5 +196,9 @@ a:hover { #headlines ul#headlines-content div.info a { color : gray; + font-weight : bold; } +#headlines ul#headlines-content div.info a:hover { + color : #659a4c; +} diff --git a/digest.js b/digest.js index 01f96a54e..8b1a8f0ce 100644 --- a/digest.js +++ b/digest.js @@ -212,7 +212,8 @@ function add_headline_entry(article, feed) { article.excerpt + "" + "" + - "
    " + feed.title + " " + " @ " + + "
    " + + feed.title + " " + " @ " + new Date(article.updated * 1000) + "
    " + "
    "; diff --git a/digest.php b/digest.php index 94489eb0b..7b1bfd23d 100644 --- a/digest.php +++ b/digest.php @@ -64,11 +64,11 @@ - Tiny Tiny Digest +
    -
    +
    -

    feeds

    +

    -

    headlines

    +

    -- cgit v1.2.3-54-g00ecf From d5d5632952914611c0ddf93959034aa1e7d87c21 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sat, 11 Sep 2010 15:25:47 +0400 Subject: code cleanup --- digest.css | 5 +- digest.js | 188 +++++++++++++++++++++++++++++++++++++++------------------- digest.php | 2 +- functions.php | 1 - 4 files changed, 130 insertions(+), 66 deletions(-) (limited to 'digest.php') diff --git a/digest.css b/digest.css index b94044f98..b500a47e7 100644 --- a/digest.css +++ b/digest.css @@ -117,6 +117,7 @@ a:hover { #feeds ul#feeds-content li { margin : 0px 0px 2px 0px; padding : 2px; + clear : both; } #feeds ul#feeds-content li.selected { @@ -181,10 +182,6 @@ a:hover { clear : left; } -#headlines ul#headlines-content li:hover { - background : #fafafa; -} - #headlines ul#headlines-content a.title { font-weight : bold; font-size : 16px; diff --git a/digest.js b/digest.js index 0e567193f..38e2224bb 100644 --- a/digest.js +++ b/digest.js @@ -4,7 +4,23 @@ var _active_feed_id = false; var _active_feed_offset = false; var _update_timeout = false; -function mark_selected_feed(feed_id) { +function catchup_article(article_id, callback) { + try { + var query = "?op=rpc&subop=catchupSelected" + + "&cmode=0&ids=" + article_id; + + new Ajax.Request("backend.php", { + parameters: query, + onComplete: function(transport) { + if (callback) callback(transport); + } }); + + } catch (e) { + exception_error("catchup_article", e); + } +} + +function set_selected_feed(feed_id) { try { var feeds = $("feeds-content").getElementsByTagName("LI"); @@ -15,6 +31,8 @@ function mark_selected_feed(feed_id) { feeds[i].className = ""; } + _active_feed_id = feed_id; + } catch (e) { exception_error("mark_selected_feed", e); } @@ -36,14 +54,8 @@ function zoom(article_id) { } } - var query = "backend.php?op=rpc&subop=digest-mark&article_id=" + article_id; - - new Ajax.Request("backend.php", { - parameters: query, - onComplete: function(transport) { - window.clearTimeout(_update_timeout); - _update_timeout = window.setTimeout('update()', 1000); - } }); + catchup_article(article_id, + function() { update(); }); } catch (e) { exception_error("zoom", e); @@ -52,13 +64,6 @@ function zoom(article_id) { function load_more() { try { - var elem = $('MORE-PROMPT'); - - if (elem) { - elem.id = ''; - Element.hide(elem); - } - viewfeed(_active_feed_id, _active_feed_offset + 10); } catch (e) { exception_error("load_more", e); @@ -67,30 +72,42 @@ function load_more() { function update() { try { - viewfeed(_active_feed_id, _active_feed_offset); + console.log('updating feeds...'); + + window.clearTimeout(_update_timeout); + + new Ajax.Request("backend.php", { + parameters: "?op=rpc&subop=digest-init", + onComplete: function(transport) { + parse_feeds(transport); + set_selected_feed(_active_feed_id); + } }); + + _update_timeout = window.setTimeout('update()', 5*1000); } catch (e) { exception_error("update", e); } } -function view(article_id, dismiss_only) { +function remove_headline_entry(article_id) { try { var elem = $('A-' + article_id); - elem.id = ''; - - //new Effect.Fade(elem, {duration : 0.3}); + if (elem) { + elem.parentNode.removeChild(elem); + } - Element.hide(elem); + } catch (e) { + exception_error("remove_headline_entry", e); + } +} - var query = "backend.php?op=rpc&subop=digest-mark&article_id=" + article_id; +function view(article_id, dismiss_only) { + try { + remove_headline_entry(article_id); - new Ajax.Request("backend.php", { - parameters: query, - onComplete: function(transport) { - window.clearTimeout(_update_timeout); - _update_timeout = window.setTimeout('update()', 1000); - } }); + catchup_article(article_id, + function() { update(); }); return dismiss_only != true; } catch (e) { @@ -103,23 +120,21 @@ function viewfeed(feed_id, offset) { if (!feed_id) feed_id = _active_feed_id; - if (!offset) + if (!offset) { offset = 0; - else + } else { offset = _active_feed_offset + offset; + } var query = "backend.php?op=rpc&subop=digest-update&feed_id=" + feed_id + "&offset=" + offset; - console.log(query); - new Ajax.Request("backend.php", { parameters: query, onComplete: function(transport) { - digest_update(transport, feed_id); - _active_feed_id = feed_id; + parse_headlines(transport, offset == 0); + set_selected_feed(feed_id); _active_feed_offset = offset; - mark_selected_feed(feed_id); } }); } catch (e) { @@ -175,6 +190,8 @@ function get_feed_icon(feed) { if (feed.id < -10) return 'images/label.png'; + return 'images/blank_icon.gif'; + } catch (e) { exception_error("get_feed_icon", e); } @@ -199,24 +216,12 @@ function add_feed_entry(feed) { } } -function add_latest_entry(article, feed) { - try { - - - //$("latest-content").innerHTML += "bbb"; - - } catch (e) { - exception_error("add_latest_entry", e); - } -} - function add_headline_entry(article, feed) { try { var icon_part = ""; - if (article.has_icon) - icon_part = ""; + icon_part = ""; var tmp_html = "
  • " + icon_part + @@ -245,7 +250,66 @@ function add_headline_entry(article, feed) { } } -function digest_update(transport, feed_id) { +function parse_feeds(transport) { + try { + + var feeds = transport.responseXML.getElementsByTagName('feeds')[0]; + + if (feeds) { + feeds = eval("(" + feeds.firstChild.nodeValue + ")"); + + last_feeds = feeds; + + $('feeds-content').innerHTML = ""; + + for (var i = 0; i < feeds.length; i++) { + add_feed_entry(feeds[i]); + } + } + + } catch (e) { + exception_error("parse_feeds", e); + } +} + +function parse_headlines(transport, replace) { + try { + var headlines = transport.responseXML.getElementsByTagName('headlines')[0]; + + if (headlines) { + headlines = eval("(" + headlines.firstChild.nodeValue + ")"); + + if (replace) $('headlines-content').innerHTML = ''; + + var pr = $('MORE-PROMPT'); + + if (pr) pr.parentNode.removeChild(pr); + + for (var i = 0; i < headlines.length; i++) { + + if (!$('A-' + headlines[i].id)) { + add_headline_entry(headlines[i], + find_feed(last_feeds, headlines[i].feed_id)); + } + } + + if (pr) { + $('headlines-content').appendChild(pr); + } else { + $('headlines-content').innerHTML += "
  • " + + "
  • "; + } + + new Effect.Appear('headlines-content'); + } + + } catch (e) { + exception_error("parse_headlines", e); + } +} + +/*function digest_update(transport, feed_id, offset) { try { var feeds = transport.responseXML.getElementsByTagName('feeds')[0]; var headlines = transport.responseXML.getElementsByTagName('headlines')[0]; @@ -267,11 +331,9 @@ function digest_update(transport, feed_id) { if (headlines) { headlines = eval("(" + headlines.firstChild.nodeValue + ")"); - if (_active_feed_id != feed_id) + if (_active_feed_id != feed_id || !offset) $('headlines-content').innerHTML = ""; - //Element.hide('headlines-content'); - var pr = $('MORE-PROMPT'); if (pr) { @@ -283,7 +345,8 @@ function digest_update(transport, feed_id) { var elem = $('A-' + headlines[i].id); if (elem && Element.visible(elem)) { - + if (!headlines[i].unread) + remove_headline_entry(headlines[i].id); } else { add_headline_entry(headlines[i], find_feed(feeds, headlines[i].feed_id)); @@ -295,22 +358,30 @@ function digest_update(transport, feed_id) { __("More articles...") + "
    "; new Effect.Appear('headlines-content'); + } + if (feed_id != undefined) { + _active_feed_id = feed_id; } + if (offset != undefined) _active_feed_offset = offset; + + mark_selected_feed(_active_feed_id); + } catch (e) { exception_error("digest_update", e); } - } +} */ -function digest_init() { +function init() { try { new Ajax.Request("backend.php", { parameters: "backend.php?op=rpc&subop=digest-init", onComplete: function(transport) { - digest_update(transport, -4); + parse_feeds(transport); window.setTimeout('viewfeed(-4)', 100); + _update_timeout = window.setTimeout('update()', 5*1000); } }); } catch (e) { @@ -363,9 +434,6 @@ function toggleMark(mark_img, id) { if (!mark_img) return; - var vfeedu = $("FEEDU--1"); - var crow = $("RROW-" + id); - if (mark_img.src.match("mark_unset")) { mark_img.src = mark_img.src.replace("mark_unset", "mark_set"); mark_img.alt = __("Unstar article"); diff --git a/digest.php b/digest.php index 7b1bfd23d..467f6c286 100644 --- a/digest.php +++ b/digest.php @@ -45,7 +45,7 @@ diff --git a/functions.php b/functions.php index 735fd2c73..e53995335 100644 --- a/functions.php +++ b/functions.php @@ -6782,7 +6782,6 @@ "title" => $line["title"], "link" => $line["link"], "feed_id" => $line["feed_id"], - "has_icon" => feed_has_icon($line["feed_id"]) ); if ($show_excerpt) { -- cgit v1.2.3-54-g00ecf From 4311cc7e177a4c066d87f39d8b654420617172c1 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sun, 12 Sep 2010 12:16:50 +0400 Subject: digest: show number of unread articles in the title --- digest.js | 17 +++++++++++++++++ digest.php | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) (limited to 'digest.php') diff --git a/digest.js b/digest.js index a3cbb4879..777473c61 100644 --- a/digest.js +++ b/digest.js @@ -346,6 +346,10 @@ function parse_feeds(transport) { return 0; }); + var all_articles = find_feed(feeds, -4); + + update_title(all_articles.unread); + last_feeds = feeds; redraw_feedlist(feeds); @@ -602,3 +606,16 @@ function feed_mo(elem) { exception_error("feed_mo", e); } } + +function update_title(unread) { + try { + document.title = "Tiny Tiny RSS"; + + if (unread > 0) + document.title += " (" + unread + ")"; + + } catch (e) { + exception_error("update_title", e); + } +} + diff --git a/digest.php b/digest.php index 467f6c286..c217d2abf 100644 --- a/digest.php +++ b/digest.php @@ -24,7 +24,7 @@ - Tiny Tiny Digest + Tiny Tiny RSS -- cgit v1.2.3-54-g00ecf From 78ac6caf001402142951ec90e8d0a1dac02e433b Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sun, 12 Sep 2010 14:37:47 +0400 Subject: digest: support tags --- digest.css | 30 +++++++++++++++++++++++++++--- digest.js | 31 +++++++++++++++++++++++++++---- digest.php | 12 ++++++++++-- functions.php | 1 + modules/backend-rpc.php | 5 +++-- 5 files changed, 68 insertions(+), 11 deletions(-) (limited to 'digest.php') diff --git a/digest.css b/digest.css index f7ddff689..cfee28bcf 100644 --- a/digest.css +++ b/digest.css @@ -18,6 +18,10 @@ a:hover { color : gray; } +#header a:hover, #footer a:hover { + color : #0069D8; +} + #header { font-weight : bold; font-size : 14px; @@ -159,6 +163,18 @@ a:hover { max-width : 65%; } +#headlines h1 a { + color : #684C99; +} + +#headlines h1 a:hover { + color : gray; +} + +#headlines h1 #headlines-title { + color : gray; +} + #headlines ul#headlines-content div.digest-check { float : right; } @@ -214,15 +230,23 @@ a:hover { } #headlines ul#headlines-content div.info { - margin-top : 2px; font-size : 11px; } #headlines ul#headlines-content div.info a { color : gray; - font-weight : bold; } -#headlines ul#headlines-content div.info a:hover { +#headlines ul#headlines-content span.tags { + font-size : 11px; + margin-bottom : 2px; +} + +#headlines ul#headlines-content span.tags a { + color : #684C99; +} + +#headlines ul#headlines-content div.info a:hover, +#headlines ul#headlines-content span.tags a:hover { color : #659a4c; } diff --git a/digest.js b/digest.js index 82abe6676..51c824ee4 100644 --- a/digest.js +++ b/digest.js @@ -186,8 +186,10 @@ function viewfeed(feed_id, offset) { offset = _active_feed_offset + offset; } - var query = "backend.php?op=rpc&subop=digest-update&feed_id=" + feed_id + - "&offset=" + offset; + var query = "backend.php?op=rpc&subop=digest-update&feed_id=" + + param_escape(feed_id) + "&offset=" + offset; + + console.log(query); new Ajax.Request("backend.php", { parameters: query, @@ -293,6 +295,22 @@ function add_headline_entry(article, feed) { var mark_part = ""; var publ_part = ""; + var tags_part = ""; + + if (article.tags.length > 0) { + + tags_part = " " + __("in") + " "; + + for (var i = 0; i < Math.min(5, article.tags.length); i++) { + tags_part += "" + + article.tags[i] + ", "; + } + + tags_part = tags_part.replace(/, $/, ""); + tags_part = "" + tags_part + ""; + } + if (article.marked) mark_part = ""; else @@ -320,7 +338,7 @@ function add_headline_entry(article, feed) { "" + "
    " + - feed.title + " " + " @ " + + feed.title + " " + tags_part + " @ " + new Date(article.updated * 1000) + "
    " + "
    "; @@ -410,10 +428,15 @@ function parse_headlines(transport, replace) { if (!transport.responseXML) return; var headlines = transport.responseXML.getElementsByTagName('headlines')[0]; + var headlines_title = transport.responseXML.getElementsByTagName('headlines-title')[0]; - if (headlines) { + if (headlines && headlines_title) { headlines = eval("(" + headlines.firstChild.nodeValue + ")"); + var title = headlines_title.firstChild.nodeValue; + + $("headlines-title").innerHTML = title; + if (replace) $('headlines-content').innerHTML = ''; var pr = $('H-MORE-PROMPT'); diff --git a/digest.php b/digest.php index c217d2abf..2b7f91807 100644 --- a/digest.php +++ b/digest.php @@ -91,7 +91,8 @@
    -

    +

    : +

    @@ -107,6 +108,13 @@ v © 2005– - Andrew Dolgov + Andrew Dolgov + +
    + + + + + diff --git a/functions.php b/functions.php index 2174460b4..232ee7c1f 100644 --- a/functions.php +++ b/functions.php @@ -6783,6 +6783,7 @@ "title" => $line["title"], "link" => $line["link"], "feed_id" => $line["feed_id"], + "tags" => get_article_tags($link, $line["id"]), ); if ($show_excerpt) { diff --git a/modules/backend-rpc.php b/modules/backend-rpc.php index 976fac15c..a0e4e77df 100644 --- a/modules/backend-rpc.php +++ b/modules/backend-rpc.php @@ -984,8 +984,6 @@ if (!$feed_id) $feed_id = -4; if (!$offset) $offset = 0; - - print ""; $headlines = api_get_headlines($link, $feed_id, 10, $offset, @@ -994,6 +992,9 @@ //function api_get_headlines($link, $feed_id, $limit, $offset, // $filter, $is_cat, $show_excerpt, $show_content, $view_mode) { + print ""; + print ""; print ""; -- cgit v1.2.3-54-g00ecf From c7a5c8a5a2703f78bf36dc3f2c5cc2f8fc8ec713 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Mon, 13 Sep 2010 14:39:16 +0400 Subject: add loading overlay --- digest.css | 19 +++++++++++++++++++ digest.js | 2 ++ digest.php | 14 ++++++++++++++ 3 files changed, 35 insertions(+) (limited to 'digest.php') diff --git a/digest.css b/digest.css index 45d502e3b..d96cc4968 100644 --- a/digest.css +++ b/digest.css @@ -269,3 +269,22 @@ a:hover { #headlines ul#headlines-content span.tags a:hover { color : #659a4c; } + +#overlay { + background : white; + left : 0; + top : 0; + height : 100%; + width : 100%; + z-index : 100; + position : absolute; + text-align : center; +} + +#overlay_inner { + margin : 1em; +} + +#overlay img { + vertical-align : middle; +} diff --git a/digest.js b/digest.js index ae7e870a2..b788535fc 100644 --- a/digest.js +++ b/digest.js @@ -259,6 +259,8 @@ function viewfeed(feed_id, offset, replace, no_effects, no_indicator, callback) new Ajax.Request("backend.php", { parameters: query, onComplete: function(transport) { + Element.hide("overlay"); + fatal_error_check(transport); parse_headlines(transport, replace, no_effects); set_selected_feed(feed_id); diff --git a/digest.php b/digest.php index 2b7f91807..43eb04121 100644 --- a/digest.php +++ b/digest.php @@ -50,6 +50,20 @@ +
    +
    + + + + +
    +
    + + + + +