diff --git a/css/screen.css b/css/screen.css index 15170fc..b635a28 100644 --- a/css/screen.css +++ b/css/screen.css @@ -204,11 +204,11 @@ canvas { .blue #list li { border-bottom: 1px solid #2980b9; } .yellow #list li { border-bottom: 1px solid #f39c12; } -#list li:after { +#list li li:after { content: ""; position: absolute; right: 7px; - top: 0.1em; + top: -0.2em; font-weight: 100; font-size: 3em; font-family: "Entypo"; diff --git a/js/App.js b/js/App.js index cfac263..3a13209 100644 --- a/js/App.js +++ b/js/App.js @@ -22,9 +22,11 @@ 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; + if (window.navigator.mozApps) { + var request = window.navigator.mozApps.getSelf(); + request.onsuccess = function() { + $("#version").innerHTML = request.result.manifest.version; + } } var _this = this; @@ -227,15 +229,53 @@ App.prototype.validate = function(articles) { 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