FeedMonkey HTML5 RSS Feed Reader

Check-in [270e670bdb]
Login

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

Overview
Comment:Start streamlining id refs
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | origin/clean | trunk | master
Files: files | file ages | folders
SHA3-256:270e670bdbf8a48a2db63628e1ae84612dddf13d7be86c3cd82c9feaa83a543b
User & Date: vandys 2019-03-01 14:36:37
Context
2019-03-02
14:52
Streamline the login var references check-in: 0b9f3fb4e1 user: vandys tags: origin/clean, trunk, master
2019-03-01
14:36
Start streamlining id refs check-in: 270e670bdb user: vandys tags: origin/clean, trunk, master
14:22
Remove deprecated mozApps reference check-in: 110d493ffb user: vandys tags: origin/clean, trunk, master
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to css/screen.css.

116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
.bar {
	margin: 0;
	padding: 10px;
	display: block;
	overflow: auto;
}

.reload, .all-read, #setstarred, #setunread, #setpublished {
	float: right;
	margin-left: 10px;
}

.inactive { opacity: 0.4; }

.settings, .list {







|







116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
.bar {
	margin: 0;
	padding: 10px;
	display: block;
	overflow: auto;
}

.reload, .allRead, #setstarred, #setunread, #setpublished {
	float: right;
	margin-left: 10px;
}

.inactive { opacity: 0.4; }

.settings, .list {

Changes to index.html.

19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
</head>
<body>

<section id="list" class="active">
  <header class="bar">
    <a class="button icon settings" href="#settings">&#9881;</a>
    <a class="button icon reload" href="#reload">&#128260;</a>
    <a class="button icon all-read inactive" href="#all-read" id="all-read">✓</a>
    <canvas width="40" height="40"></canvas>
  </header>
  <article>
    <ul></ul>
  </article>
</section>








|







19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
</head>
<body>

<section id="list" class="active">
  <header class="bar">
    <a class="button icon settings" href="#settings">&#9881;</a>
    <a class="button icon reload" href="#reload">&#128260;</a>
    <a class="button icon allRead inactive" href="#allRead" id="allRead">✓</a>
    <canvas width="40" height="40"></canvas>
  </header>
  <article>
    <ul></ul>
  </article>
</section>

Changes to js/App.js.

62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
...
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
...
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
...
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
...
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
...
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
...
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
			_this.showNext();
		} else if(url == "#previous") {
			_this.showPrevious();
		} else if(url == "#font-smaller") {
			_this.fontChange("smaller");
		} else if(url == "#font-bigger") {
			_this.fontChange("bigger");
		} else if(url == "#all-read") {
			_this.toggleAllRead();
		}

		// this is here so you can tap on a button more then once
		// and it will still call onhashchange
		window.location.hash = "#";
	}
................................................................................

	if(backend == "OwnCloud") {
		this.backend = new OwnCloud(this, localStorage.server_url, localStorage.session_id);
	} else if (backend == "Pond") {
		this.backend = new Pond(this, localStorage.server_url, localStorage.session_id)
	} else {
		this.backend = new TinyTinyRSS(this, localStorage.server_url, localStorage.session_id);
		$("#setpublished").removeClass("hidden");
	}

	var numArticles = localStorage.numArticles;
	if(!numArticles) numArticles = 50;
	this.numArticles(numArticles);
	var maxDownload = localStorage.maxDownload;
	if(!maxDownload) maxDownload = 500000;
................................................................................
	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) {

	if(new_articles == null || !this.validate(new_articles)) {
................................................................................
		unread++;
	    } else {
		e.removeClass("unread");
	    }
	}

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

	this.updatePieChart();
};

App.prototype.updatePieChart = function() {

................................................................................

	// Open all links in browser
	$$(page_id + " .article a").forEach(function(o, i) {
		o.target = "_blank";
	});

	if(article.unread) {
		$("#setunread").addClass('inactive');
	} else {
		$("#setunread").removeClass('inactive');
	}

	if(!article.marked) {
		$("#setstarred").addClass('inactive');
	} else {
		$("#setstarred").removeClass('inactive');
	}

	if(!article.published) {
		$("#setpublished").addClass('inactive');
	} else {
		$("#setpublished").removeClass('inactive');
	}

};

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

................................................................................
		article.unread = false;
		this.updateList();
		this.backend.setArticleRead(article);
	}

	article.set_unread = false;

	$("#setunread").removeClass('inactive');

	this.updatePieChart();
};

App.prototype.toggleCurrentUnread = function() {
	var article = this.unread_articles[this.currentIndex];
	if(article.unread) {
		article.unread = false;
		article.set_unread = false;
		$("#setunread").removeClass('inactive');
	} else {
		article.unread = true;
		article.set_unread = true;
		$("#setunread").addClass('inactive');
	}

	this.updateList();
	this.backend.setArticleUnread(article);
};

App.prototype.toggleAllRead = function() {

	if($("#all-read").hasClass('inactive')) { // set all read

		var articles = [];
		for (var i = 0; i < this.unread_articles.length; i++) {
			var article = this.unread_articles[i];
			article.unread = false;
			article.set_unread = false;
			articles.push(article);
		}
		$("#all-read").removeClass('inactive');

		this.updateList();
		this.backend.setArticlesRead(articles);

	} else {

		var articles = [];
		for (var i = 0; i < this.unread_articles.length; i++) {
			var article = this.unread_articles[i];
			article.unread = true;
			article.set_unread = false;
			articles.push(article);
		}
		$("#all-read").addClass('inactive');
		this.updateList();

		this.backend.setArticlesUnread(articles);
	}
};

App.prototype.toggleStarred = function() {
................................................................................
	var article = this.unread_articles[this.currentIndex];
	if(!article) return; // happens if we're not on a full article site
	
	if(!article.marked) {
		article.marked = true;
		this.updateList();
		this.backend.setArticleStarred(article);
		$("#setstarred").removeClass('inactive');
	} else {
		article.marked = false;
		this.updateList();
		this.backend.setArticleUnstarred(article);
		$("#setstarred").addClass('inactive');
	}

};

App.prototype.togglePublished = function() {
	var article = this.unread_articles[this.currentIndex];
	if(!article) return; // happens if we're not on a full article site
	
	if(!article.published) {
		article.published = true;
		this.backend.setArticlePublished(article);
		$("#setpublished").removeClass('inactive');
	} else {
		article.published = false;
		this.backend.setArticleUnpublished(article);
		$("#setpublished").addClass('inactive');
	}

};

App.prototype.goToList = function() {
	this.changeToPage("#list");
};







|







 







|







 







|







 







|

|







 







|

|



|

|



|

|







 







|









|



|








|








|













|







 







|




|











|



|







62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
...
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
...
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
...
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
...
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
...
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
...
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
			_this.showNext();
		} else if(url == "#previous") {
			_this.showPrevious();
		} else if(url == "#font-smaller") {
			_this.fontChange("smaller");
		} else if(url == "#font-bigger") {
			_this.fontChange("bigger");
		} else if(url == "#allRead") {
			_this.toggleAllRead();
		}

		// this is here so you can tap on a button more then once
		// and it will still call onhashchange
		window.location.hash = "#";
	}
................................................................................

	if(backend == "OwnCloud") {
		this.backend = new OwnCloud(this, localStorage.server_url, localStorage.session_id);
	} else if (backend == "Pond") {
		this.backend = new Pond(this, localStorage.server_url, localStorage.session_id)
	} else {
		this.backend = new TinyTinyRSS(this, localStorage.server_url, localStorage.session_id);
		setpublished.removeClass("hidden");
	}

	var numArticles = localStorage.numArticles;
	if(!numArticles) numArticles = 50;
	this.numArticles(numArticles);
	var maxDownload = localStorage.maxDownload;
	if(!maxDownload) maxDownload = 500000;
................................................................................
	document.body.addClass(color);
	this.updatePieChart();
};

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

App.prototype.gotUnreadFeeds = function(new_articles) {

	if(new_articles == null || !this.validate(new_articles)) {
................................................................................
		unread++;
	    } else {
		e.removeClass("unread");
	    }
	}

	if (unread > 0) {
	    allRead.addClass('inactive');
	} else {
	    allRead.removeClass('inactive');
	}

	this.updatePieChart();
};

App.prototype.updatePieChart = function() {

................................................................................

	// Open all links in browser
	$$(page_id + " .article a").forEach(function(o, i) {
		o.target = "_blank";
	});

	if(article.unread) {
		setunread.addClass('inactive');
	} else {
		setunread.removeClass('inactive');
	}

	if(!article.marked) {
		setstarred.addClass('inactive');
	} else {
		setstarred.removeClass('inactive');
	}

	if(!article.published) {
		setpublished.addClass('inactive');
	} else {
		setpublished.removeClass('inactive');
	}

};

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

................................................................................
		article.unread = false;
		this.updateList();
		this.backend.setArticleRead(article);
	}

	article.set_unread = false;

	setunread.removeClass('inactive');

	this.updatePieChart();
};

App.prototype.toggleCurrentUnread = function() {
	var article = this.unread_articles[this.currentIndex];
	if(article.unread) {
		article.unread = false;
		article.set_unread = false;
		setunread.removeClass('inactive');
	} else {
		article.unread = true;
		article.set_unread = true;
		setunread.addClass('inactive');
	}

	this.updateList();
	this.backend.setArticleUnread(article);
};

App.prototype.toggleAllRead = function() {

	if(allRead.hasClass('inactive')) { // set all read

		var articles = [];
		for (var i = 0; i < this.unread_articles.length; i++) {
			var article = this.unread_articles[i];
			article.unread = false;
			article.set_unread = false;
			articles.push(article);
		}
		allRead.removeClass('inactive');

		this.updateList();
		this.backend.setArticlesRead(articles);

	} else {

		var articles = [];
		for (var i = 0; i < this.unread_articles.length; i++) {
			var article = this.unread_articles[i];
			article.unread = true;
			article.set_unread = false;
			articles.push(article);
		}
		allRead.addClass('inactive');
		this.updateList();

		this.backend.setArticlesUnread(articles);
	}
};

App.prototype.toggleStarred = function() {
................................................................................
	var article = this.unread_articles[this.currentIndex];
	if(!article) return; // happens if we're not on a full article site
	
	if(!article.marked) {
		article.marked = true;
		this.updateList();
		this.backend.setArticleStarred(article);
		setstarred.removeClass('inactive');
	} else {
		article.marked = false;
		this.updateList();
		this.backend.setArticleUnstarred(article);
		setstarred.addClass('inactive');
	}

};

App.prototype.togglePublished = function() {
	var article = this.unread_articles[this.currentIndex];
	if(!article) return; // happens if we're not on a full article site
	
	if(!article.published) {
		article.published = true;
		this.backend.setArticlePublished(article);
		setpublished.removeClass('inactive');
	} else {
		article.published = false;
		this.backend.setArticleUnpublished(article);
		setpublished.addClass('inactive');
	}

};

App.prototype.goToList = function() {
	this.changeToPage("#list");
};