[dw-nonfree] Standardize height + width attributes for user icon display
[commit: http://hg.dwscoalition.org/dw-nonfree/rev/7aa8a0df3b34]
http://bugs.dwscoalition.org/show_bug.cgi?id=926
Properly specify both width and height attributes for scaled userpics.
Patch by
draigwen.
Files modified:
http://bugs.dwscoalition.org/show_bug.cgi?id=926
Properly specify both width and height attributes for scaled userpics.
Patch by
Files modified:
- cgi-bin/bml/scheme/tropo-purple.look
- cgi-bin/bml/scheme/tropo-red.look
--------------------------------------------------------------------------------
diff -r b6821c013ce5 -r 7aa8a0df3b34 cgi-bin/bml/scheme/tropo-purple.look
--- a/cgi-bin/bml/scheme/tropo-purple.look Tue Aug 11 06:11:09 2009 +0000
+++ b/cgi-bin/bml/scheme/tropo-purple.look Wed Aug 12 01:30:56 2009 -0500
@@ -75,20 +75,13 @@ accountlinks<=
my $inbox = $remote->notification_inbox;
my $unread = $inbox->unread_count;
my $identity = $remote->is_identity;
- my $wh = "";
- if ( $userpic ) {
- if ( $userpic->width > $userpic->height ) {
- $wh = 'width="' . ( $userpic->width > 80 ? 80 : $userpic->width ) . '"';
- } else {
- $wh = 'height="' . ( $userpic->height > 80 ? 80 : $userpic->height ) . '"';
- }
- }
- $ret .= "<div id='account-links-userpic'><a href='$LJ::SITEROOT/editpics.bml'>";
+ $ret .= "<div id='account-links-userpic'><a href='$LJ::SITEROOT/editpics'>";
if ( $userpic && !$LJ::IS_SSL ) {
+ my $wh = $userpic->img_fixedsize( width => 80, height => 80 );
$ret .= "<img src='" . $userpic->url . "' $wh alt=\"$ML{'tropo.accountlinks.userpic.alt'}\" />";
} else {
- $ret .= "<img src='$imgprefix/nouserpic.png' width='80' alt=\"$ML{'tropo.accountlinks.userpic.alt'}\" />";
+ $ret .= "<img src='$imgprefix/nouserpic.png' width='80' height='80' alt=\"$ML{'tropo.accountlinks.userpic.alt'}\" />";
}
$ret .= "</a></div>";
$ret .= "<div id='account-links-text'>";
diff -r b6821c013ce5 -r 7aa8a0df3b34 cgi-bin/bml/scheme/tropo-red.look
--- a/cgi-bin/bml/scheme/tropo-red.look Tue Aug 11 06:11:09 2009 +0000
+++ b/cgi-bin/bml/scheme/tropo-red.look Wed Aug 12 01:30:56 2009 -0500
@@ -75,20 +75,13 @@ accountlinks<=
my $inbox = $remote->notification_inbox;
my $unread = $inbox->unread_count;
my $identity = $remote->is_identity;
- my $wh = "";
- if ( $userpic ) {
- if ( $userpic->width > $userpic->height ) {
- $wh = 'width="' . ( $userpic->width > 80 ? 80 : $userpic->width ) . '"';
- } else {
- $wh = 'height="' . ( $userpic->height > 80 ? 80 : $userpic->height ) . '"';
- }
- }
- $ret .= "<div id='account-links-userpic'><a href='$LJ::SITEROOT/editpics.bml'>";
+ $ret .= "<div id='account-links-userpic'><a href='$LJ::SITEROOT/editpics'>";
if ( $userpic && !$LJ::IS_SSL ) {
+ my $wh = $userpic->img_fixedsize( width => 80, height => 80 );
$ret .= "<img src='" . $userpic->url . "' $wh alt=\"$ML{'tropo.accountlinks.userpic.alt'}\" />";
} else {
- $ret .= "<img src='$imgprefix/nouserpic.png' width='80' alt=\"$ML{'tropo.accountlinks.userpic.alt'}\" />";
+ $ret .= "<img src='$imgprefix/nouserpic.png' width='80' height='80' alt=\"$ML{'tropo.accountlinks.userpic.alt'}\" />";
}
$ret .= "</a></div>";
$ret .= "<div id='account-links-text'>";
--------------------------------------------------------------------------------
