FeedMonkey HTML5 RSS Feed Reader

Check-in [ba0047792a]
Login

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

Overview
Comment:Have next/prev honor grouped display of articles under feeds.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | origin/clean | trunk | master
Files: files | file ages | folders
SHA3-256:ba0047792a1adda96e77195d3f18699725f2793beb8ce53f44a3b8c83da711dd
User & Date: ajv-899-334-8894@vsta.org 2017-02-10 19:34:14
Context
2019-03-01
14:22
Remove deprecated mozApps reference check-in: 110d493ffb user: vandys tags: origin/clean, trunk, master
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
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to js/App.js.

125
126
127
128
129
130
131

132
133
134
135
136
137
138
...
164
165
166
167
168
169
170

171
172
173
174
175
176
177
...
258
259
260
261
262
263
264

265
266
267
268
269
270
271
272
273
274

275
276
277
278
279
280
281
...
414
415
416
417
418
419
420
421
422

423



424






425
426
427
428
429
430
431
432
433

434


435
436


437
438
439
440
441
442
443
444
445
446

	this.reload();
};

App.prototype.logout = function() {
	this.backend.logOut();
	this.unread_articles = [];

	this.populateList();
	this.login.log_out();
};

App.prototype.changeToPage = function(page) {

	// FIXME
................................................................................
	document.body.className = "";
	document.body.addClass(color);
	this.updatePieChart();
};

App.prototype.reload = function() {
	this.unread_articles = [];

	$("#all-read").addClass('inactive');
	var number=parseInt(localStorage.numArticles);
	this.backend.reload(this.gotUnreadFeeds.bind(this),number);
};

App.prototype.gotUnreadFeeds = function(new_articles) {

................................................................................
		feeds.push( {"fid": fid, "name": article.feed_title} );
	    }
	}

	// Now build the article list; it's a <ul> of feeds,
	//  then sub-<ul> of articles in that feed
	let html_str = "";

	for (let x = 0; x < feeds.length; ++x) {
	    const xs = x.toString();
	    const f = feeds[x];
	    const feed = byfeed[f.fid];
	    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>";
................................................................................
	} else {
		$("#setpublished").removeClass('inactive');
	}

};

App.prototype.showNext = function() {
	this.setCurrentRead();


	if(this.currentIndex >= this.unread_articles.length - 1) {



		this.goToList();






	} else {
		this.currentIndex++;
		this.showFull(this.unread_articles[this.currentIndex], false);
	}
};

App.prototype.showPrevious = function() {
	this.setCurrentRead();


	if(this.currentIndex <= 0) {


		this.goToList();
	} else {


		this.currentIndex--;
		this.showFull(this.unread_articles[this.currentIndex], true);
	}
};

App.prototype.setCurrentRead = function() {
	var article = this.unread_articles[this.currentIndex];
	if(!article) return; // happens if we're not on a full article site
	if(!article.set_unread) {
		article.unread = false;







>







 







>







 







>










>







 







|

>
|
>
>
>
|
>
>
>
>
>
>
|
|
|
|



|

>
|
>
>
|
<
>
>
|
|
<







125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
...
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
...
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
...
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452

453
454
455
456

457
458
459
460
461
462
463

	this.reload();
};

App.prototype.logout = function() {
	this.backend.logOut();
	this.unread_articles = [];
	this.next_articles = [];
	this.populateList();
	this.login.log_out();
};

App.prototype.changeToPage = function(page) {

	// FIXME
................................................................................
	document.body.className = "";
	document.body.addClass(color);
	this.updatePieChart();
};

App.prototype.reload = function() {
	this.unread_articles = [];
	this.next_articles = [];
	$("#all-read").addClass('inactive');
	var number=parseInt(localStorage.numArticles);
	this.backend.reload(this.gotUnreadFeeds.bind(this),number);
};

App.prototype.gotUnreadFeeds = function(new_articles) {

................................................................................
		feeds.push( {"fid": fid, "name": article.feed_title} );
	    }
	}

	// Now build the article list; it's a <ul> of feeds,
	//  then sub-<ul> of articles in that feed
	let html_str = "";
	this.next_articles = [];
	for (let x = 0; x < feeds.length; ++x) {
	    const xs = x.toString();
	    const f = feeds[x];
	    const feed = byfeed[f.fid];
	    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]) {
		this.next_articles.push(artidx);
		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>";
................................................................................
	} else {
		$("#setpublished").removeClass('inactive');
	}

};

App.prototype.showNext = function() {
    this.setCurrentRead();

    const na = this.next_articles;
    let curidx = na.indexOf(this.currentIndex);

    // Huh, not listed?
    if (curidx < 0) {
	this.goToList();
	return;
    }

    curidx += 1;
    if (curidx >= na.length) {
	this.goToList();
    } else {
	this.currentIndex = na[curidx];
	this.showFull(this.unread_articles[this.currentIndex], false);
    }
};

App.prototype.showPrevious = function() {
    this.setCurrentRead();

    const na = this.next_articles;
    const curidx = na.indexOf(this.currentIndex)-1;
    if (curidx < 0) {
	// This handles not found, and also no previous article
	this.goToList();

	return;
    }
    this.currentIndex = na[curidx];
    this.showFull(this.unread_articles[this.currentIndex], true);

};

App.prototype.setCurrentRead = function() {
	var article = this.unread_articles[this.currentIndex];
	if(!article) return; // happens if we're not on a full article site
	if(!article.set_unread) {
		article.unread = false;