[livejournal] r19312: LJSUP-9091: Sort by poster in friends pa...
Committer: amyshkin
LJSUP-9091: Sort by poster in friends pageU trunk/bin/upgrading/s2layers/core1.s2 U trunk/cgi-bin/LJ/S2.pm U trunk/cgi-bin/LJ/User.pm
Modified: trunk/bin/upgrading/s2layers/core1.s2
===================================================================
--- trunk/bin/upgrading/s2layers/core1.s2 2011-06-17 02:49:42 UTC (rev 19311)
+++ trunk/bin/upgrading/s2layers/core1.s2 2011-06-17 03:47:38 UTC (rev 19312)
@@ -276,6 +276,7 @@
function builtin equals(UserLite u) : bool "Returns true if the two user objects refer to the same user. Use this rather than comparing usernames, since usernames aren't globally unique.";
function builtin ljuser() : string "Returns an LJ user tag for the user.";
+ function builtin ljuser(string{} opts) : string "Returns an LJ user tag with journal attribute for the user.";
function builtin ljuser(Color link_color) : string "Returns an LJ user tag for the user. The color of the link will be link_color.";
function builtin get_link(string key) : Link "Returns a link based on the given key, or null if the link is unavailable";
function base_url () : string "Returns URL of user's journal.";
Modified: trunk/cgi-bin/LJ/S2.pm
===================================================================
--- trunk/cgi-bin/LJ/S2.pm 2011-06-17 02:49:42 UTC (rev 19311)
+++ trunk/cgi-bin/LJ/S2.pm 2011-06-17 03:47:38 UTC (rev 19312)
@@ -3656,8 +3656,17 @@
sub UserLite__ljuser
{
my ($ctx, $UserLite, $link_color) = @_;
- my $link_color_string = $link_color ? $link_color->{as_string} : "";
- return LJ::ljuser($UserLite->{_u}, {link_color => $link_color_string, side_alias => $UserLite->{_opt_side_alias} });
+
+ my $params = { side_alias => $UserLite->{_opt_side_alias} };
+
+ if ( $link_color && exists $link_color->{in_journal} ) {
+ $params->{in_journal} = $link_color->{in_journal};
+ }
+ else {
+ $params->{link_color} = $link_color->{as_string};
+ }
+
+ return LJ::ljuser($UserLite->{_u}, $params );
}
sub UserLite__get_link
@@ -4167,7 +4176,7 @@
$S2::pout->($ad_html) if $ad_html;
}
-my %approved_widget_classes = map { $_ => $_ } qw (TopEntries TopUsers FaceBookILike PublicStats OnLivejournal);
+my %approved_widget_classes = map { $_ => $_ } qw (TopEntries TopUsers FaceBookILike PublicStats OnLivejournal MySuperWidget);
sub Page__widget
{
Modified: trunk/cgi-bin/LJ/User.pm
===================================================================
--- trunk/cgi-bin/LJ/User.pm 2011-06-17 02:49:42 UTC (rev 19311)
+++ trunk/cgi-bin/LJ/User.pm 2011-06-17 03:47:38 UTC (rev 19312)
@@ -7339,7 +7339,9 @@
@link_tag_extra,
$journal_name,
@link_extra,
- @extra );
+ @extra,
+ $journal,
+ );
$profile_url = $opts->{'profile_url'};
@@ -7446,8 +7448,10 @@
}
my $extra = join('', @extra);
+ $journal = $opts->{in_journal} ? " lj:journal='" . LJ::ehtml($opts->{in_journal}) . "'" : '';
+
return
- "<span class='$span_classes' lj:user='$username' style='$span_styles'>" .
+ "<span class='$span_classes' lj:user='$username'$journal style='$span_styles'>" .
"<a href='$profile_url'$profile_link_tag_extra>" .
"<img src='$userhead' alt='[info]' " .
"width='$userhead_w' height='$userhead_h' " .
