From 249c93a228245c71853542814857ca0045e43052 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Fri, 7 Dec 2018 16:00:11 +0300 Subject: initial for js templates --- js/Headlines.js | 91 +++++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 88 insertions(+), 3 deletions(-) (limited to 'js/Headlines.js') diff --git a/js/Headlines.js b/js/Headlines.js index 2b33ed396..31e72fa3d 100755 --- a/js/Headlines.js +++ b/js/Headlines.js @@ -239,6 +239,86 @@ define(["dojo/_base/declare"], function (declare) { } } }, + renderHeadline: function (headlines, hl) { + let row = null; + + if (App.isCombinedMode()) { + row = `
+
+
+ + star + rss_feed +
+ + + + ${hl.title} + — ${hl.author} + + + + + + ${hl.updated} + +
+ + ${hl.score_icon} + +

Sorry for hijacking this htread, but I have a similar issue.

+

I have a feed category with about 120 unread articles. I toggle headline grouping, but I am not sure if this matters or not.

+

I click on the category on the left pane, and start clicking “ctrl+down” to scroll to read the articles.
+At some point ( I tried to figure it out, but can say exactly after how many articles I read) the page won’t scroll down with “ctrl+down”, so I have to scroll with down key alone.

+

TT-rss says it’s refreshing the content (or something similar), but was it does, is marking as read a bunch of articles, that were supposed to be shown between the last one I actually read, and the first unread it shows, which should not really be the first unread.

+

Last time it happened, I had around 120 unread articles, I could scroll via ctrl+down untill 80 were unread, I scroled manually, and it jumped to 50 unread. The right pane is also refreshed, so I can not scroll up to go through the ones marked as unread.

+

I hope it is somewhat related to this thread, otherwise let me know and I can open a new one.

+

Please let me know if what I wrote is clear.

+

By the way I am running f6e287df110b2046643551aaae70917c61b061c9 on shared hosting, PHP 7 and Mysql.

`; + + + } else { + row = `
+
+ + star + rss_feed +
+ + + ${hl.feed_title} + +
+ ${hl.updated} +
+
+ ${hl.score_pic} + ${hl.feed_icon} +
+
+ `; + } + + const tmp = document.createElement("div"); + tmp.innerHTML = row; + dojo.parser.parse(tmp); + + $("headlines-frame").appendChild(tmp.firstChild); + }, onLoaded: function (transport, offset) { const reply = App.handleRpcJson(transport); @@ -276,7 +356,8 @@ define(["dojo/_base/declare"], function (declare) { $("headlines-frame").addClassName(App.isCombinedMode() ? "cdm" : "normal"); const headlines_count = reply['headlines-info']['count']; - Feeds.infscroll_disabled = parseInt(headlines_count) != 30; + //Feeds.infscroll_disabled = parseInt(headlines_count) != 30; + Feeds.infscroll_disabled = true; // TEMPORARY console.log('received', headlines_count, 'headlines, infscroll disabled=', Feeds.infscroll_disabled); @@ -292,7 +373,11 @@ define(["dojo/_base/declare"], function (declare) { $("headlines-frame").innerHTML = ''; - let tmp = document.createElement("div"); + for (let i = 0; i < reply['headlines']['content'].length; i++) { + this.renderHeadline(reply['headlines'], reply['headlines']['content'][i]); + } + + /* let tmp = document.createElement("div"); tmp.innerHTML = reply['headlines']['content']; dojo.parser.parse(tmp); @@ -304,7 +389,7 @@ define(["dojo/_base/declare"], function (declare) { this.loaded_article_ids.push(row.id); } - } + } */ let hsp = $("headlines-spacer"); -- cgit v1.2.3