From acfedd7b7e02875fdc6a85fdcb080771da24961d Mon Sep 17 00:00:00 2001 From: Chip Black Date: Thu, 13 Jan 2011 04:11:03 -0800 Subject: [PATCH] Quick and dirty hack to add new users and tags --- www/index.html | 9 +++++++++ www/js/blerg.js | 29 ++++++++++++++++++++++++++++- 2 files changed, 37 insertions(+), 1 deletion(-) diff --git a/www/index.html b/www/index.html index cd0bfc3..20dc6e0 100644 --- a/www/index.html +++ b/www/index.html @@ -52,6 +52,15 @@
+ +
+

Quick and dirty hack to show recent tags

+
+ +

And here are some users with recent activity

+
+
+

I am 12 and what is this

Blërg is a microblogging platform. Or maybe a miniblogging diff --git a/www/js/blerg.js b/www/js/blerg.js index 4d56790..205c5a9 100644 --- a/www/js/blerg.js +++ b/www/js/blerg.js @@ -79,6 +79,7 @@ LoginStatus.prototype.update = function() { if (this.loggedIn) { $('userlink').href = '/#' + this.username; $('userlink').update('@' + this.username); + $('reflink').href = '/#ref/' + this.username; $('login').hide(); $('logout').show(); } else { @@ -202,7 +203,6 @@ User.prototype.show = function() { $$('[name=section]').each(function(v) { v.update(' @' + this.username) }.bind(this)); $('welcome').hide(); items.show(); - $('reflink').href = '/#ref/' + this.username; $('rss').show(); $('rsslink').href = '/rss/' + this.username; } @@ -402,6 +402,32 @@ function resizePostContent() { }, 150); } +function loadNewThings() { + new Ajax.Request(baseURL + '/newtags.json', { + onSuccess: function(r) { + $('newtags').update(); + r.responseText.evalJSON().each(function(v) { + var a = new Element('a', {href: '/#tag/' + v}); + a.insert('#' + v); + $('newtags').insert(a); + $('newtags').insert(new Element('br')); + }); + } + }); + + new Ajax.Request(baseURL + '/newusers.json', { + onSuccess: function(r) { + $('newusers').update(); + r.responseText.evalJSON().each(function(v) { + var a = new Element('a', {href: '/#' + v}); + a.insert('@' + v); + $('newusers').insert(a); + $('newusers').insert(new Element('br')); + }); + } + }); +} + function hashSwitch() { var m; if (m = location.search.match(/^\?post\/([^/]+)\/(.+)/)) { @@ -437,6 +463,7 @@ function hashSwitch() { $('older_link').hide(); $('welcome').show(); $('rss').hide(); + loadNewThings(); } } -- 2.25.1