FeedMonkey HTML5 RSS Feed Reader

Check-in [8687d19ebd]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:With change in article numbering, need way to tie article back to HTML element. Use an ID.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | origin/clean | trunk | master
Files: files | file ages | folders
SHA3-256:8687d19ebdad933c0bbd4455a6b0944e296c524b862bd46be3b09a5345f22d2c
User & Date: ajv-899-334-8894@vsta.org 2017-01-29 19:15:16
Context
2017-02-10
19:34
Have next/prev honor grouped display of articles under feeds. check-in: ba0047792a user: ajv-899-334-8894@vsta.org tags: origin/clean, trunk, master
2017-01-29
19:15
With change in article numbering, need way to tie article back to HTML element. Use an ID. check-in: 8687d19ebd user: ajv-899-334-8894@vsta.org tags: origin/clean, trunk, master
17:03
Allow for successive growing of "unread_articles". Move helper function adjacent to method which uses it. check-in: b91e2dbdd2 user: ajv-899-334-8894@vsta.org tags: origin/clean, trunk, master
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to js/App.js.

269
270
271
272
273
274
275
276
277


278
279
280
281
282
283
284
...
288
289
290
291
292
293
294
295
296
297
298





299
300
301
302

303
304
305

306
307
308
309
310
311
312
	    html_str += '<li><span' +
		' onclick="return(toggleFeed(' + xs + '));"' +
		'>' + f.name + '</span>';
	    const feedid = '"feed' + xs + '"';
	    html_str += '<ul id=' + feedid + ' style="display: none;">'
	    for (let artidx of byfeed[f.fid]) {
		const article = ua[artidx];
		html_str += "<li"+ (article.unread ?
		    " class='unread'" : "") +">";


		html_str += "<a href='#full-" + artidx + "'>";
		html_str += "<h2>" + article.title + "</h2>";
		if (article.excerpt) {
		    html_str += "<p class='excerpt'>" +
			article.excerpt + "</p>";
		}
		html_str += "</a></li>";
................................................................................
	
	$("#list ul").innerHTML = html_str;

	this.updatePieChart();
};

App.prototype.updateList = function() {
	var unread = 0, artnum = 0;
	$$("#list ul ul li").forEach(function(o, i) {

	    if (!this.unread_articles[artnum++].unread) {





		o.removeClass("unread");
	    }
	    else {
		unread++;

		o.addClass("unread");
	    }
	}, this);


	if (unread > 0) {
	    $("#all-read").addClass('inactive');
	} else {
	    $("#all-read").removeClass('inactive');
	}








|
|
>
>







 







|
|

|
>
>
>
>
>
|
<
<

>
|

<
>







269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
...
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306


307
308
309
310

311
312
313
314
315
316
317
318
	    html_str += '<li><span' +
		' onclick="return(toggleFeed(' + xs + '));"' +
		'>' + f.name + '</span>';
	    const feedid = '"feed' + xs + '"';
	    html_str += '<ul id=' + feedid + ' style="display: none;">'
	    for (let artidx of byfeed[f.fid]) {
		const article = ua[artidx];
		html_str += '<li' +
		    ' id="art' + artidx.toString() + '"' +
		    (article.unread ?  ' class="unread"' : '') +
		    '>';
		html_str += "<a href='#full-" + artidx + "'>";
		html_str += "<h2>" + article.title + "</h2>";
		if (article.excerpt) {
		    html_str += "<p class='excerpt'>" +
			article.excerpt + "</p>";
		}
		html_str += "</a></li>";
................................................................................
	
	$("#list ul").innerHTML = html_str;

	this.updatePieChart();
};

App.prototype.updateList = function() {
	var unread = 0;
	const ua = this.unread_articles, ual = ua.length;

	// Walk "unread" articles, keep count of those still
	//  unread and update display.
	for (let i = 0; i < ual; ++i) {
	    const art = ua[i];
	    const e = document.getElementById("art" + i.toString());
	    if (art.unread) {
		e.addClass("unread");


		unread++;
	    } else {
		e.removeClass("unread");
	    }

	}

	if (unread > 0) {
	    $("#all-read").addClass('inactive');
	} else {
	    $("#all-read").removeClass('inactive');
	}