[dw-free] remove comments from icon alt/title text
[commit: http://hg.dwscoalition.org/dw-free/rev/2add8a22f90b]
http://bugs.dwscoalition.org/show_bug.cgi?id=4346
Old behavior: show all keywords if we chose the default icon. New behavior:
show "(Default)", instead. Also, remove the comments field from the
title/alt text, and tweak some comments in the code to make them more
accurate.
Patch by
deborah.
Files modified:
http://bugs.dwscoalition.org/show_bug.cgi?id=4346
Old behavior: show all keywords if we chose the default icon. New behavior:
show "(Default)", instead. Also, remove the comments field from the
title/alt text, and tweak some comments in the code to make them more
accurate.
Patch by
Files modified:
- cgi-bin/LJ/Entry.pm
- cgi-bin/LJ/Userpic.pm
--------------------------------------------------------------------------------
diff -r d016e56edd35 -r 2add8a22f90b cgi-bin/LJ/Entry.pm
--- a/cgi-bin/LJ/Entry.pm Tue Mar 20 17:59:48 2012 +0800
+++ b/cgi-bin/LJ/Entry.pm Wed Mar 21 11:23:40 2012 +0800
@@ -889,8 +889,7 @@
Returns the keyword to use for the entry.
-If a keyword is specified, it uses that, otherwise
-it tries the custom mood text, followed by the standard mood.
+If a keyword is specified, it uses that.
=cut
sub userpic_kw {
diff -r d016e56edd35 -r 2add8a22f90b cgi-bin/LJ/Userpic.pm
--- a/cgi-bin/LJ/Userpic.pm Tue Mar 20 17:59:48 2012 +0800
+++ b/cgi-bin/LJ/Userpic.pm Wed Mar 21 11:23:40 2012 +0800
@@ -366,11 +366,9 @@
my ( $self, $kw ) = @_;
# load the alttext.
- # "username: description (keyword), comment"
+ # "username: description (keyword)"
# If any of those are not present leave them (and their
# affiliated punctuation) out.
- # Minimum will be "username: (default system keyword)" if user
- # hasn't set anything manually.
# always include the username
my $u = $self->owner;
@@ -380,16 +378,12 @@
$alt .= " " . $self->description;
}
- # If we don't have the particular keyword, load all of the
- # keywords for this userpic
+ # 1. If there is a keyword associated with the icon, use it.
+ # 2. If it was chosen via the default icon, show "(Default)".
if ($kw) {
$alt .= " (" . $kw . ")";
} else {
- $alt .= " (" . $self->keywords . ")";
- }
-
- if ($self->comment) {
- $alt .= ", " .$self->comment;
+ $alt .= " (Default)";
}
return LJ::ehtml( $alt );
@@ -401,7 +395,7 @@
my ( $self, $kw ) = @_;
# load the titletext.
- # "username: keyword, comment (description)"
+ # "username: keyword (description)"
# If any of those are not present leave them (and their
# affiliated punctuation) out.
@@ -409,16 +403,12 @@
my $u = $self->owner;
my $title = $u->username . ":";
- # If we don't have the particular keyword, load all of the
- # keywords for this userpic
+ # 1. If there is a keyword associated with the icon, use it.
+ # 2. If it was chosen via the default icon, show "(Default)".
if ($kw) {
$title .= " " . $kw;
} else {
- $title .= " " . $self->keywords;
- }
-
- if ($self->comment) {
- $title .= ", " .$self->comment;
+ $title .= " (Default)";
}
if ($self->description) {
--------------------------------------------------------------------------------
