[dw-free] Comment parameter to journal entry views
[commit: http://hg.dwscoalition.org/dw-free/rev/41caad637f26]
http://bugs.dwscoalition.org/show_bug.cgi?id=1571
Whitespace cleanup.
Patch by
kareila.
Files modified:
http://bugs.dwscoalition.org/show_bug.cgi?id=1571
Whitespace cleanup.
Patch by
![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
Files modified:
- cgi-bin/LJ/Comment.pm
- cgi-bin/LJ/S2/EntryPage.pm
- cgi-bin/LJ/Talk.pm
-------------------------------------------------------------------------------- diff -r 1cf34cfa802a -r 41caad637f26 cgi-bin/LJ/Comment.pm --- a/cgi-bin/LJ/Comment.pm Sat Aug 13 18:40:02 2011 +0800 +++ b/cgi-bin/LJ/Comment.pm Mon Aug 15 15:04:46 2011 +0800 @@ -149,7 +149,7 @@ sub create { my ( $class, %opts ) = @_; - + my $need_captcha = delete($opts{ need_captcha }) || 0; # %talk_opts emulates parameters received from web form. @@ -181,8 +181,8 @@ # Because LJ::Talk::Post::init needs this. foreach my $key ( keys %{ $talk_opts{props} } ){ my $talk_key = "prop_$key"; - - $talk_opts{$talk_key} = delete $talk_opts{props}->{$key} + + $talk_opts{$talk_key} = delete $talk_opts{props}->{$key} if not exists $talk_opts{$talk_key}; } @@ -197,7 +197,7 @@ ## init. this handles all the error-checking, as well. my @errors = (); - my $init = LJ::Talk::Post::init(\%talk_opts, $posteru, \$need_captcha, \@errors); + my $init = LJ::Talk::Post::init(\%talk_opts, $posteru, \$need_captcha, \@errors); croak( join "\n" => @errors ) unless defined $init; @@ -214,11 +214,11 @@ my $err; croak ($err) unless LJ::Talk::Post::post_comment($init->{entryu}, $init->{journalu}, - $init->{comment}, $init->{parent}, + $init->{comment}, $init->{parent}, $init->{item}, \$err, ); - - return + + return LJ::Comment->new($init->{journalu}, jtalkid => $init->{comment}->{talkid}); } @@ -246,8 +246,8 @@ *thread_url = \&url; =head2 C<< $self->threadroot_url >> -URL to the thread root. It would be unnecessarily expensive to look up the thread -root, since it is only rarely needed. So we set up a redirect then look up the +URL to the thread root. It would be unnecessarily expensive to look up the thread +root, since it is only rarely needed. So we set up a redirect then look up the thread root only if the user clicks the link. =cut sub threadroot_url { @@ -1450,7 +1450,7 @@ $body .= "<br />" . LJ::Lang::get_text( $lang, "esn.journal_new_comment.edit_reason", undef, { reason => LJ::ehtml( $reason ) } ) . "<br />" if $reason; } else { - $body .= "\n\n" . LJ::Lang::get_text( $lang, "esn.journal_new_comment.edit_reason", undef, { reason => $reason } ) + $body .= "\n\n" . LJ::Lang::get_text( $lang, "esn.journal_new_comment.edit_reason", undef, { reason => $reason } ) if $reason; } } @@ -1556,7 +1556,7 @@ return LJ::Talk::delete_comment ( $self->journal, $self->nodeid, # jitemid - $self->jtalkid, + $self->jtalkid, $self->state ); } @@ -1580,7 +1580,7 @@ # REF on text $ref = \$ref unless ref ($ref) eq 'SCALAR'; - + my $plain = $$ref; # otherwise we modify the source text $plain = LJ::CleanHTML::clean_comment(\$plain); @@ -1588,7 +1588,7 @@ return 1 # spam if $re and ($plain =~ /$re/ or $$ref =~ /$re/); } - + return 0; # normal text } diff -r 1cf34cfa802a -r 41caad637f26 cgi-bin/LJ/S2/EntryPage.pm --- a/cgi-bin/LJ/S2/EntryPage.pm Sat Aug 13 18:40:02 2011 +0800 +++ b/cgi-bin/LJ/S2/EntryPage.pm Mon Aug 15 15:04:46 2011 +0800 @@ -65,10 +65,10 @@ if ($LJ::UNICODE) { $p->{'head_content'} .= '<meta http-equiv="Content-Type" content="text/html; charset='.$opts->{'saycharset'}."\" />\n"; } - + my $prev_url = S2::Builtin::LJ::Entry__get_link( $opts->{ctx}, $s2entry, "nav_prev" )->{url}; $p->{head_content} .= qq{<link rel="prev" href="$prev_url" />\n} if $prev_url; - + my $next_url = S2::Builtin::LJ::Entry__get_link( $opts->{ctx}, $s2entry, "nav_next" )->{url}; $p->{head_content} .= qq{<link rel="next" href="$next_url" />\n} if $next_url; @@ -182,7 +182,7 @@ if ( defined $com->{picid} && ( my $pic = $userpic{$com->{picid}} ) ) { my $width = $pic->{width}; my $height = $pic->{height}; - + if ( $comment_userpic_style eq 'small' ) { $width = $width * 3 / 4; $height = $height * 3 / 4; @@ -507,7 +507,7 @@ my $style_args = LJ::viewing_style_args( %$get ); my $userpic_position = S2::get_property_value( $opts->{ctx}, 'userpics_position' ); - + # load the userpic; include the keyword selected by the user # as a backup for the alttext my $userpic; diff -r 1cf34cfa802a -r 41caad637f26 cgi-bin/LJ/Talk.pm --- a/cgi-bin/LJ/Talk.pm Sat Aug 13 18:40:02 2011 +0800 +++ b/cgi-bin/LJ/Talk.pm Mon Aug 15 15:04:46 2011 +0800 @@ -727,14 +727,14 @@ # used later in this request anyway) and let it know that its comments are already loaded my $set_entry_cache = sub { return 1 unless $nodetype eq 'L'; - + my $entry = LJ::Entry->new($u, jitemid => $nodeid); # find all singletons that LJ::Comment knows about, then grep for the ones we've set in # this get_talk_data call (ones for this userid / nodeid) - my @comments_for_entry = + my @comments_for_entry = grep { $_->journalid == $u->userid && $_->nodeid == $nodeid } LJ::Comment->all_singletons; - + $entry->set_comment_list(@comments_for_entry); }; --------------------------------------------------------------------------------