Типа я (zilogic) wrote in changelog,
Типа я
zilogic
changelog

[livejournal] r21284: LJSUP-10691: Image placeholders in comme...

Committer: amyshkin
LJSUP-10691: Image placeholders in comments
U   trunk/cgi-bin/cleanhtml.pl
U   trunk/cgi-bin/weblib.pl
Modified: trunk/cgi-bin/cleanhtml.pl
===================================================================
--- trunk/cgi-bin/cleanhtml.pl	2012-03-02 10:42:55 UTC (rev 21283)
+++ trunk/cgi-bin/cleanhtml.pl	2012-03-02 12:11:08 UTC (rev 21284)
@@ -1166,7 +1166,7 @@
                     }
 
                     if ($img_bad) {
-                        $newdata .= qq~<a class="b-mediaplaceholder b-mediaplaceholder-photo" data-href="$href_b_link" href="~ .
+                        $newdata .= qq~<a class="b-mediaplaceholder b-mediaplaceholder-photo" ~ . ( $hash->{'width'} && $hash->{'height'} ? qq~style="width:$hash->{'width'}px;height:$hash->{'height'}px;" ~ : '' ) . qq~data-href="$href_b_link" href="~ .
                             LJ::ehtml($hash->{'src'}) . '" onclick="return LiveJournal.placeholderClick(this, \'image\')">' .
                             '<span class="b-mediaplaceholder-inner">' .
                             '<i class="b-mediaplaceholder-pic"></i>' .

Modified: trunk/cgi-bin/weblib.pl
===================================================================
--- trunk/cgi-bin/weblib.pl	2012-03-02 10:42:55 UTC (rev 21283)
+++ trunk/cgi-bin/weblib.pl	2012-03-02 12:11:08 UTC (rev 21284)
@@ -2037,7 +2037,7 @@
     $height -= 2;
 
     return qq {
-            <a class="b-mediaplaceholder b-mediaplaceholder-video" href="$link" onclick="return LiveJournal.placeholderClick(this, '$placeholder_html')">
+            <a class="b-mediaplaceholder b-mediaplaceholder-video" href="$link"} . ( $width && $height ? 'style="width:${width}px;height:${height}px;"' : '' ) . qq{ onclick="return LiveJournal.placeholderClick(this, '$placeholder_html')">
                 <span class="b-mediaplaceholder-inner">
                     <i class="b-mediaplaceholder-pic"></i>
                     <span class="b-mediaplaceholder-label b-mediaplaceholder-view">} . LJ::Lang::ml("mediaplaceholder.viewvideo") . qq{</span>

Tags: amyshkin, livejournal, pl, zilogic
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