FeedMonkey HTML5 RSS Feed Reader

Check-in [7dde4dacdd]
Login

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

Overview
Comment:Group posts by feed name. Step #1 of getting collapsing feeds so it's easier to swim through larger feeds.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | origin/clean | trunk | master
Files: files | file ages | folders
SHA3-256:7dde4dacddf7355dcf182d0003c73425c7be1247ce931cca9a0b5089e8bddd1f
User & Date: ajv-899-334-8894@vsta.org 2017-01-29 04:27:39
Context
2017-01-29
05:13
Make collapsing feed article lists check-in: d9dcf7e0ea user: ajv-899-334-8894@vsta.org tags: origin/clean, trunk, master
04:27
Group posts by feed name. Step #1 of getting collapsing feeds so it's easier to swim through larger feeds. check-in: 7dde4dacdd user: ajv-899-334-8894@vsta.org tags: origin/clean, trunk, master
2016-02-19
04:58
Use document element (base is deprecated). Use timeout (updating URL hash, among others, resets scroll position). check-in: 2e9c3fd831 user: ajv-899-334-8894@vsta.org tags: origin/clean, trunk, master
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to css/screen.css.

200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
}

.red    #list li { border-bottom: 1px solid #c0392b; }
.white  #list li { border-bottom: 1px solid #bdc3c7; }
.blue   #list li { border-bottom: 1px solid #2980b9; }
.yellow #list li { border-bottom: 1px solid #f39c12; }

#list li:after {
	content: "";
	position: absolute;
	right: 7px;
	top: 0.1em;
	font-weight: 100;
	font-size: 3em;
	font-family: "Entypo";
}

.red    #list li:after { color: #c0392b; }
.white  #list li:after { color: #bdc3c7; }







|



|







200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
}

.red    #list li { border-bottom: 1px solid #c0392b; }
.white  #list li { border-bottom: 1px solid #bdc3c7; }
.blue   #list li { border-bottom: 1px solid #2980b9; }
.yellow #list li { border-bottom: 1px solid #f39c12; }

#list li li:after {
	content: "";
	position: absolute;
	right: 7px;
	top: -0.2em;
	font-weight: 100;
	font-size: 3em;
	font-family: "Entypo";
}

.red    #list li:after { color: #c0392b; }
.white  #list li:after { color: #bdc3c7; }

Changes to js/App.js.

18
19
20
21
22
23
24

25
26
27

28
29
30
31
32
33
34
...
223
224
225
226
227
228
229
230
231





















232











233

234
235
236

237


238



239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269

App.prototype.authenticate = function() {
	
};

App.prototype.after_login = function(backend) {


	var request = window.navigator.mozApps.getSelf();
	request.onsuccess = function() {
		$("#version").innerHTML = request.result.manifest.version;

	}

	var _this = this;

	window.onhashchange = function(e) {

		// do not reload page
................................................................................
	}

	return false;
};

App.prototype.populateList = function() {

	var html_str = "";
	for (var i = 0; i < this.unread_articles.length; i++) {





















		var article = this.unread_articles[i];











		html_str += "<li"+ (article.unread ? " class='unread'" : "") +">";

		html_str += "<a href='#full-"+i+"'>";
		html_str += "<p class='title'>" + article.feed_title + "</p>";
		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;
	$$("#list ul li").forEach(function(o, i) {

		if(!this.unread_articles[i].unread) {
			o.removeClass("unread");
		}
		else {
			unread++;
			o.addClass("unread");
		}
	}, this);

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

	this.updatePieChart();
};

App.prototype.updatePieChart = function() {








>
|
|
|
>







 







|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
>
>
>
>
>
>
>
>
>
>
>
|
>
|
<

>
|
>
>

>
>
>








|
|

|
|
|
|
|
|
|


|
|

|







18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
...
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269

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

App.prototype.authenticate = function() {
	
};

App.prototype.after_login = function(backend) {

	if (window.navigator.mozApps) {
	    var request = window.navigator.mozApps.getSelf();
	    request.onsuccess = function() {
		    $("#version").innerHTML = request.result.manifest.version;
	    }
	}

	var _this = this;

	window.onhashchange = function(e) {

		// do not reload page
................................................................................
	}

	return false;
};

App.prototype.populateList = function() {

	// First pull all articles together from each distinct feed
	var ua = this.unread_articles;
	var newarts = [], byfeed = [];
	while (ua.length > 0) {
	    article = ua[0];

	    // Next feed ID
	    var fid = article.feed_id;
	    // Here's all the articles under that ID
	    var feeds =
		ua.filter( function(a) { return a.feed_id == fid; } );
	    // Keep a list of them so it's easy to tabulate
	    byfeed.push(feeds);

	    // Add them on to the new unread_articles, so they're
	    //  in order.
	    newarts = newarts.concat(feeds);

	    // Trim them off the old, unsorted article list
	    ua = ua.filter( function(a) { return a.feed_id != fid; } );
	}

	// Make the reordered article list the "official" one
	ua = this.unread_articles = newarts;

	// Now build the article list; it's a <ul> of feeds,
	//  then sub-<ul> of articles in that feed
	var html_str = "";
	var artidx = 0;
	for (i = 0; i < byfeed.length; ++i) {
	    var feed = byfeed[i];
	    html_str += "<li>" + feed[0].feed_title;
	    html_str += "<ul>";
	    for (var j = 0; j < feed.length; ++j) {
		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>";
		artidx += 1;
	    }
	    html_str += "</ul></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');
	}

	this.updatePieChart();
};

App.prototype.updatePieChart = function() {