Permalink
Browse files

First cut at adding tagcloud functionality.

  • Loading branch information...
1 parent a61da19 commit 6b5845100a5b29638b92ae99a61e380d6d927a38 @leenookx committed Sep 15, 2009
@@ -0,0 +1,16 @@
+require 'tagcloud'
+
+class TagcloudController < ApplicationController
+
+ # Create a new tag cloud.
+ # POST /tagcloud/1
+ # POST /tagcloud/1.xml
+ def create
+ end
+
+ # Update an existing tag cloud.
+ # PUT /tagcloud/1
+ # PUT /tagcloud/1.xml
+ def update
+ end
+end
@@ -0,0 +1,2 @@
+module TagcloudHelper
+end
No changes.
@@ -0,0 +1 @@
+This is not really a standalone server...
No changes.
No changes.
@@ -4,6 +4,7 @@
<%= javascript_include_tag 'twitter-utils' %>
<%= javascript_include_tag 'topix-utils' %>
<%= javascript_include_tag 'flickr-utils' %>
+<%= javascript_include_tag 'tagcloud-utils' %>
<%= javascript_include_tag 'prototype' %>
@@ -25,6 +26,7 @@ Event.observe(window, 'load', function() {
</script>
<h1>Current Twitter Trends</h1>
<div id="twittertrends" class="twittertrends"></div>
+<div id="tagcloud" class="tagcloud"></div>
<div id="topix" class="topix"></div>
<div id="flickr" class="flickr"></div>
View
@@ -8,6 +8,7 @@
map.resources :blogs
map.resources :semanticblogs
map.resources :calaisservices
+ map.resources :tagcloud
map.resources :feeds, :has_many => :stories
map.resources :links
@@ -0,0 +1,10 @@
+function addToTagCloud(tag, url, src) {
+ var req = new Ajax.Request("/tagcloud/", {
+ method: 'POST',
+ onFailure: function(request) {
+ alert('AJAX doesnt work.');
+ },
+ parameters: {tag: tag, url: url, src: src}
+ });
+}
+
@@ -34,6 +34,8 @@ function receiveTopixResponse(results) {
tmp += ", ";
}
tmp += categories[j].firstChild.nodeValue;
+
+ addToTagCloud(categories[j].firstChild.nodeValue, "", "topix");
}
tmp += "</p></div>";
@@ -2,4 +2,5 @@ div.story { border: solid blue 1px; background-color: cyan }
div.status { border: solid red 1px; background-color: pink }
div.twittertrends { border: solid green 1px; background-color: #00FF66; width: 30% }
div.flickr { border: solid cyan 1px; background-color: blue; margin-left: 500px; padding-left: 9px }
+div.tagcloud { border: solid cyan 1px; background-color: blue }
@@ -0,0 +1,8 @@
+require 'test_helper'
+
+class TagcloudControllerTest < ActionController::TestCase
+ # Replace this with your real tests.
+ test "the truth" do
+ assert true
+ end
+end
@@ -0,0 +1,4 @@
+require 'test_helper'
+
+class TagcloudHelperTest < ActionView::TestCase
+end

0 comments on commit 6b58451

Please sign in to comment.