commit:acfedd7b7e02875fdc6a85fdcb080771da24961d
author:Chip Black
committer:Chip Black
date:Thu Jan 13 04:11:03 2011 -0800
parents:b6235374b91ba7acf62c06c72de2f1291f46ac4c
Quick and dirty hack to add new users and tags
diff --git a/www/index.html b/www/index.html
line changes: +9/-0
index cd0bfc3..20dc6e0
--- a/www/index.html
+++ b/www/index.html
@@ -52,6 +52,15 @@
   </div>
 
   <div id="welcome">
+
+  <div style="float: right; width: 25%; margin: 0 0 8pt 8pt">
+  <h2>Quick and dirty hack to show recent tags</h2>
+  <div id="newtags"></div>
+
+  <h2>And here are some users with recent activity</h2>
+  <div id="newusers"></div>
+  </div>
+
   <h2>I am 12 and what is this</h2>
 
   <p>Blërg is a microblogging platform.  Or maybe a miniblogging

diff --git a/www/js/blerg.js b/www/js/blerg.js
line changes: +28/-1
index 4d56790..205c5a9
--- 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();
     }
 }