Skip Menu |

This queue is for tickets about the HTML-TagCloud CPAN distribution.

Report information
The Basics
Id: 39269
Status: open
Worked: 15 min
Priority: 0/
Queue: HTML-TagCloud

People
Owner: Nobody in particular
Requestors: belg4mit [...] MIT.EDU
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



CC:
Subject: HTML::TagCloud
Date: Sun, 14 Sep 2008 15:02 -0400
To: bug-HTML-TagCloud [...] rt.cpan.org
From: belg4mit [...] MIT.EDU
In the html method, why add the extra span element? Why not simply apply the class to the div, or anchor? -- Free map of local environmental resources: http://CambridgeMA.GreenMap.org -- MOTD on Boomtime, the 38th of Bureaucracy, in the YOLD 3174: In the Begining the Universe was created, This has made alot of people very angry, and been widly regarded as a bad move. --DNA
Subject: CSS/HTML simplification 1.0->1.1 OR .34->.4
diff -ru HTML-TagCloud-1.00/blib/lib/HTML/TagCloud.pm HTML-TagCloud-1.10/blib/lib/HTML/TagCloud.pm --- HTML-TagCloud-1.00/blib/lib/HTML/TagCloud.pm 2008-11-27 13:52:45.000000000 -0500 +++ HTML-TagCloud-1.10/blib/lib/HTML/TagCloud.pm 2008-11-28 19:16:18.000000000 -0500 @@ -32,11 +32,14 @@ text-align: center; line-height: 1; } +#htmltagcloud a { + text-decoration: none; +} + ); foreach my $level (0 .. $self->{levels}) { my $font = 12 + $level; - $css .= "span.tagcloud$level { font-size: ${font}px;}\n"; - $css .= "span.tagcloud$level a {text-decoration: none;}\n"; + $css .= ".tagcloud$level { font-size: ${font}px;}\n"; } return $css; } @@ -90,7 +93,7 @@ my $html = ''; foreach my $tag (@tags) { - $html .= sprintf qq(<span class="tagcloud%i"><a href="%s"%s>%s</a></span>\n), + $html .= sprintf qq(<a class="tagcloud%i" href="%s"%s>%s</a>\n), $tag->{level}, $tag->{url}, (defined($tag->{title}) ? qq( title="$tag->{title}") : ''), $tag->{name}; diff -ru HTML-TagCloud-1.00/CHANGES HTML-TagCloud-1.10/CHANGES --- HTML-TagCloud-1.00/CHANGES 2006-11-07 16:05:17.000000000 -0500 +++ HTML-TagCloud-1.10/CHANGES 2008-11-28 19:17:03.000000000 -0500 @@ -1,5 +1,12 @@ CHANGES file for HTML::TagCloud: +1.10 Fri Nov 28 19:12:07 EST 2008 + - Remove spans from output, and simplify CSS + +1.00 Thu Nov 27 13:59:10 2008 + - Switch calling style to named parameters + - Add support for anchor titles, and common anchor base + 0.34 Tue Nov 7 21:00:33 GMT 2006 - Internet Explorer fix, which addresses issues with Japanese text (thanks to Tatsuhiko Miyagawa) @@ -26,4 +33,4 @@ marcus) 0.29 Tue Jun 28 22:35:38 BST 2005 - - first release (prompted by Jesse Vincent) \ No newline at end of file + - first release (prompted by Jesse Vincent) diff -ru HTML-TagCloud-1.00/lib/HTML/TagCloud.pm HTML-TagCloud-1.10/lib/HTML/TagCloud.pm --- HTML-TagCloud-1.00/lib/HTML/TagCloud.pm 2008-11-27 13:52:45.000000000 -0500 +++ HTML-TagCloud-1.10/lib/HTML/TagCloud.pm 2008-11-28 19:16:18.000000000 -0500 @@ -32,11 +32,14 @@ text-align: center; line-height: 1; } +#htmltagcloud a { + text-decoration: none; +} + ); foreach my $level (0 .. $self->{levels}) { my $font = 12 + $level; - $css .= "span.tagcloud$level { font-size: ${font}px;}\n"; - $css .= "span.tagcloud$level a {text-decoration: none;}\n"; + $css .= ".tagcloud$level { font-size: ${font}px;}\n"; } return $css; } @@ -90,7 +93,7 @@ my $html = ''; foreach my $tag (@tags) { - $html .= sprintf qq(<span class="tagcloud%i"><a href="%s"%s>%s</a></span>\n), + $html .= sprintf qq(<a class="tagcloud%i" href="%s"%s>%s</a>\n), $tag->{level}, $tag->{url}, (defined($tag->{title}) ? qq( title="$tag->{title}") : ''), $tag->{name}; diff -ru HTML-TagCloud-1.00/t/extend.t HTML-TagCloud-1.10/t/extend.t --- HTML-TagCloud-1.00/t/extend.t 2008-11-27 13:46:18.000000000 -0500 +++ HTML-TagCloud-1.10/t/extend.t 2008-11-28 19:11:44.000000000 -0500 @@ -13,11 +13,11 @@ my $html = $cloud->html(5); is($html, q{<div id="htmltagcloud"> -<span class="tagcloud5"><a href="http://localhost/show/florida" title="282">florida</a></span> -<span class="tagcloud0"><a href="http://localhost/show/fort" title="165">fort</a></span> -<span class="tagcloud1"><a href="http://localhost/show/london" title="197">london</a></span> -<span class="tagcloud2"><a href="http://localhost/show/madagascar" title="224">madagascar</a></span> -<span class="tagcloud3"><a href="http://localhost/show/tanja" title="248">tanja</a></span> +<a class="tagcloud5" href="http://localhost/show/florida" title="282">florida</a> +<a class="tagcloud0" href="http://localhost/show/fort" title="165">fort</a> +<a class="tagcloud1" href="http://localhost/show/london" title="197">london</a> +<a class="tagcloud2" href="http://localhost/show/madagascar" title="224">madagascar</a> +<a class="tagcloud3" href="http://localhost/show/tanja" title="248">tanja</a> </div>}); sub tags { diff -ru HTML-TagCloud-1.00/t/simple.t HTML-TagCloud-1.10/t/simple.t --- HTML-TagCloud-1.00/t/simple.t 2008-11-27 13:29:08.000000000 -0500 +++ HTML-TagCloud-1.10/t/simple.t 2008-11-28 19:20:41.000000000 -0500 @@ -14,34 +14,34 @@ } my $css = $cloud->css; -is(lines($css), 55); +is(lines($css), 34); my $html = $cloud->html(0); is($html, ""); $html = $cloud->html(1); is($html, q{<div id="htmltagcloud"> -<span class="tagcloud1"><a href="/show/florida">florida</a></span> +<a class="tagcloud1" href="/show/florida">florida</a> </div>}); $html = $cloud->html(2); is($html, q{<div id="htmltagcloud"> -<span class="tagcloud2"><a href="/show/florida">florida</a></span> -<span class="tagcloud0"><a href="/show/tanja">tanja</a></span> +<a class="tagcloud2" href="/show/florida">florida</a> +<a class="tagcloud0" href="/show/tanja">tanja</a> </div>}); $html = $cloud->html(5); is(lines($html), 7); is($html, q{<div id="htmltagcloud"> -<span class="tagcloud5"><a href="/show/florida">florida</a></span> -<span class="tagcloud0"><a href="/show/fort">fort</a></span> -<span class="tagcloud1"><a href="/show/london">london</a></span> -<span class="tagcloud2"><a href="/show/madagascar">madagascar</a></span> -<span class="tagcloud3"><a href="/show/tanja">tanja</a></span> +<a class="tagcloud5" href="/show/florida">florida</a> +<a class="tagcloud0" href="/show/fort">fort</a> +<a class="tagcloud1" href="/show/london">london</a> +<a class="tagcloud2" href="/show/madagascar">madagascar</a> +<a class="tagcloud3" href="/show/tanja">tanja</a> </div>}); $html = $cloud->html_and_css(5); -is(lines($html), 63); +is(lines($html), 42); $html = $cloud->html(20); is(lines($html), 22); @@ -56,9 +56,9 @@ $html = $cloud->html(); is($html, q{<div id="htmltagcloud"> -<span class="tagcloud3"><a href="a.html">a</a></span> -<span class="tagcloud3"><a href="b.html">b</a></span> -<span class="tagcloud3"><a href="c.html">c</a></span> +<a class="tagcloud3" href="a.html">a</a> +<a class="tagcloud3" href="b.html">b</a> +<a class="tagcloud3" href="c.html">c</a> </div>}); sub tags {