madeon (madeon) wrote in changelog,
madeon
madeon
changelog

[livejournal] r22105: LJSUP-12384: Add "repost" icon for post ...

Committer: sbelyaev
LJSUP-12384: Add "repost" icon for post title
U   trunk/bin/upgrading/s2layers/core1.s2
U   trunk/cgi-bin/LJ/S2.pm
Modified: trunk/bin/upgrading/s2layers/core1.s2
===================================================================
--- trunk/bin/upgrading/s2layers/core1.s2	2012-05-30 07:20:50 UTC (rev 22104)
+++ trunk/bin/upgrading/s2layers/core1.s2	2012-05-30 08:21:59 UTC (rev 22105)
@@ -343,7 +343,6 @@
     function time_display () : string "Show the time of this post, with most useful information for user, and with tooltip for more.";
     function time_display (string datefmt, string timefmt) : string "time_display, with customized date/time formats.";
     function builtin formatted_subject (string{} opts) : string "formats subject - outputs subject as html-link, gets hash of attributes - class and(or) style ";
-    var readonly string reposted_by "The string about reposter";
 }
 
 class Entry extends EntryLite
@@ -352,9 +351,12 @@
     var readonly string security "The security level of the entry ('private', 'protected'), or blank if public.";
     var readonly bool sticky "Indicates that this entry is sticky";
     var readonly bool delayed "Indicates that this entry is delayed";
+    var readonly bool repost "Indicates that this entry is repost";
+
     var Image security_icon "A little icon which should be displayed somewhere on an entry to represent the security setting";
     var Image sticky_icon "A little icon which should be displyaed somewhere on an entry to represent the sticky setting";
     var Image delayed_icon "A little icon which should be displyaed somewhere on an entry to represent the delayed entry";
+    var Image repost_icon "A little icon which should be displyaed somewhere on an entry to represent the reposted entry";
 
     var Image mood_icon "Mood icon, or null.";
     var CommentInfo comments "Comment information on this entry";
@@ -1906,11 +1908,16 @@
     des = "Alternative text for icons of delayed entries";
     noui = 1;
 }
+property string text_icon_alt_reposted {
+    des = "Alternative text for icons of reposted entries";
+    noui = 1;
+}
 set text_icon_alt_protected = "[protected post]";
 set text_icon_alt_private = "[private post]";
 set text_icon_alt_groups = "[custom friends groups post]";
 set text_icon_alt_sticky = "[sticky post]";
 set text_icon_alt_delayed = "[delayed post]";
+set text_icon_alt_reposted = "[reposted post]";
 
 property string comment_form_text_hint {
     des = "Text hint for comment message";

Modified: trunk/cgi-bin/LJ/S2.pm
===================================================================
--- trunk/cgi-bin/LJ/S2.pm	2012-05-30 07:20:50 UTC (rev 22104)
+++ trunk/cgi-bin/LJ/S2.pm	2012-05-30 08:21:59 UTC (rev 22105)
@@ -1957,11 +1957,6 @@
     $e->{'system_time'} = DateTime_parts($arg->{'system_dateparts'});
     $e->{'depth'} = 0;  # Entries are always depth 0.  Comments are 1+.
 
-    if ($e->{'real_journalid'}) {
-        my $reposter = LJ::want_user($e->{'real_journalid'});
-        $e->{'reposted_by'} = LJ::Lang::ml( 'entry.reference.reposter', { 'reposter' => LJ::ljuser2($reposter) } );
-    }
-
     my $link_keyseq = $e->{'link_keyseq'};
     push @$link_keyseq, 'delete_reference'  if LJ::is_enabled('entry_reference');
     push @$link_keyseq, 'mem_add'           if LJ::is_enabled('memories');
@@ -1971,6 +1966,11 @@
     push @$link_keyseq, 'unwatch_comments'  if LJ::is_enabled('esn');
     push @$link_keyseq, 'flag'              if LJ::is_enabled('content_flag');
 
+    if ($e->{'real_journalid'}) {
+        $e->{'repost'} = 1;
+        $e->{'repost_icon'} = Image_std('reposted-entry');
+    }
+
     # Note: nav_prev and nav_next are not included in the keyseq anticipating
     #      that their placement relative to the others will vary depending on
     #      layout.
@@ -2059,8 +2059,9 @@
         #   layers when they do weird parsing/manipulation of the text member in
         #   untrusted layers.
         $e->{text_must_print_trusted} = 1 if $e->{text} =~ m!<(script|object|applet|embed|iframe)\b!i;
-            
-        if ($entry->is_sticky() || $arg->{'sticky_type'} ) {
+
+        my $show_sticky = ($entry->is_sticky() || $arg->{'sticky_type'}) && !$e->{'repost'};
+        if ($show_sticky) {
            $e->{'sticky'} = 1;
            $e->{'sticky_icon'} = Image_std("sticky-entry");
         }
@@ -2217,6 +2218,7 @@
             'security-groups' => Image("$LJ::IMGPREFIX/icon_groups.gif", 19, 16, $ctx->[S2::PROPS]->{'text_icon_alt_groups'}, 'title' => $ctx->[S2::PROPS]->{'text_icon_alt_groups'}),
             'sticky-entry' => Image("$LJ::IMGPREFIX/icon_sticky.png", 13, 15, $ctx->[S2::PROPS]->{'text_icon_alt_sticky'}, 'title' => $ctx->[S2::PROPS]->{'text_icon_alt_sticky'}),
             'delayed-entry' => Image("$LJ::IMGPREFIX/icon_delayed.png", 13, 15, $ctx->[S2::PROPS]->{'text_icon_alt_delayed'}, 'title' => $ctx->[S2::PROPS]->{'text_icon_alt_delayed'}),
+            'reposted-entry' => Image("$LJ::IMGPREFIX/icon_repost.png", 13, 15, $ctx->[S2::PROPS]->{'text_icon_alt_reposted'}, 'title' => $ctx->[S2::PROPS]->{'text_icon_alt_reposted'}),
         };
     }
     return $LJ::S2::RES_CACHE->{$name};

Tags: livejournal, madeon, pm, s2, sbelyaev
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments