mark: A photo of Mark kneeling on top of the Taal Volcano in the Philippines. It was a long hike. (Default)
Mark Smith ([staff profile] mark) wrote in [site community profile] changelog2009-06-12 09:04 pm

[dw-free] Double check the icon sizes for the user interaction links

[commit: http://hg.dwscoalition.org/dw-free/rev/f3b13011c03c]

http://bugs.dwscoalition.org/show_bug.cgi?id=1050

Fix icon sizes for user link bar.

Patch by [personal profile] afuna.

Files modified:
  • cgi-bin/DW/Logic/UserLinkBar.pm
  • cgi-bin/LJ/S2.pm
  • htdocs/userinfo.bml
--------------------------------------------------------------------------------
diff -r 57a34c54466c -r f3b13011c03c cgi-bin/DW/Logic/UserLinkBar.pm
--- a/cgi-bin/DW/Logic/UserLinkBar.pm	Fri Jun 12 21:01:09 2009 +0000
+++ b/cgi-bin/DW/Logic/UserLinkBar.pm	Fri Jun 12 21:04:00 2009 +0000
@@ -115,6 +115,9 @@ sub fix_link {
     
     $link->{class} = $self->{class_prefix} . "_" . $link->{class} 
         if $self->{class_prefix} && $link->{class};
+
+    $link->{width} ||= 20;
+    $link->{height} ||= 18;
 
     return $link;
 }
@@ -398,6 +401,8 @@ sub tellafriend {
         my $link = {
             url => "tools/tellafriend.bml?user=$user",
             image => "$LJ::IMGPREFIX/silk/profile/tellafriend.png",
+            width => 16,
+            height => 16,
             text_ml => 'userlinkbar.tellafriend',
             class => 'tellafriend',
         };
diff -r 57a34c54466c -r f3b13011c03c cgi-bin/LJ/S2.pm
--- a/cgi-bin/LJ/S2.pm	Fri Jun 12 21:01:09 2009 +0000
+++ b/cgi-bin/LJ/S2.pm	Fri Jun 12 21:04:00 2009 +0000
@@ -3370,7 +3370,7 @@ sub UserLite__get_link
         my $link = $_[0];
         return undef unless $link;
 
-        return LJ::S2::Link($link->{url}, $link->{title}, LJ::S2::Image($link->{image}, 20, 18));
+        return LJ::S2::Link( $link->{url}, $link->{title}, LJ::S2::Image( $link->{image}, $link->{width} || 20, $link->{height} || 18 ) );
     };
 
     return $button->( $linkbar->manage_membership ) if $key eq 'manage_membership';
diff -r 57a34c54466c -r f3b13011c03c htdocs/userinfo.bml
--- a/htdocs/userinfo.bml	Fri Jun 12 21:01:09 2009 +0000
+++ b/htdocs/userinfo.bml	Fri Jun 12 21:04:00 2009 +0000
@@ -297,18 +297,21 @@ body<=
     $ret .= q{ <div class='actions'><ul> };
 
     foreach my $link ( $profile->action_links ) {
+        my $width = $link->{width} ? "width=\"$link->{width}\"" : "";
+        my $height = $link->{height} ? "height=\"$link->{height}\"" : "";
+
         if ( $link->{url} ) {
             $ret .= qq(
                 <li class="$link->{class}" title="$link->{title}">
                     <a href="$link->{url}">
-                        <img src="$link->{image}" alt="" />$link->{text}
+                        <img src="$link->{image}" $width $height alt="" />$link->{text}
                     </a>
                 </li>
             );
         } else {
             $ret .= qq(
                 <li class="$link->{class}" title="$link->{title}">
-                    <img src="$link->{image}" alt="" />$link->{text}
+                    <img src="$link->{image}" $width $height alt="" />$link->{text}
                 </li>
             );
         }
--------------------------------------------------------------------------------

Post a comment in response:

This account has disabled anonymous posting.
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting

If you are unable to use this captcha for any reason, please contact us by email at support@dreamwidth.org