Skip to:
Content

BuddyPress.org

Ticket #6772: 6772.09c.two-col.patch

File 6772.09c.two-col.patch, 3.1 KB (added by r-a-y, 8 years ago)
  • src/bp-activity/bp-activity-embeds.php

     
    268268<svg id="Layer_1" style="enable-background:new 0 0 512 512;" version="1.1" viewBox="0 0 512 512" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M405.2,232.9L126.8,67.2c-3.4-2-6.9-3.2-10.9-3.2c-10.9,0-19.8,9-19.8,20H96v344h0.1c0,11,8.9,20,19.8,20  c4.1,0,7.5-1.4,11.2-3.4l278.1-165.5c6.6-5.5,10.8-13.8,10.8-23.1C416,246.7,411.8,238.5,405.2,232.9z"/></svg>
    269269EOD;
    270270
    271                                 $play_icon = sprintf( '<a rel="nofollow" class="play-btn" href="%1$s">%2$s</a>', esc_url( $url ), $play_icon );
     271                                $play_icon = sprintf( '<a rel="nofollow" class="play-btn" href="%1$s" onclick="top.location.href=\'%1$s\'">%2$s</a>', esc_url( $url ), $play_icon );
    272272                        }
    273273
    274274                        // Thumb width
    275                         $width = isset( $oembed->thumbnail_width ) && 'photo' !== $oembed->type && (int) $oembed->thumbnail_width < 550 ? (int) $oembed->thumbnail_width : $width;
     275                        $thumb_width = isset( $oembed->thumbnail_width ) && 'photo' !== $oembed->type && (int) $oembed->thumbnail_width < 550 ? (int) $oembed->thumbnail_width : $width;
     276
     277                        $float_width = 350;
    276278
    277279                        // Set up thumb.
    278                         $content = sprintf( '<div class="thumb" style="max-width:%1$spx">%2$s<a href="%3$s" rel="nofollow" onclick="top.location.href=\'%3$s\'"><img src="%4$s" /></a></div>', $width, $play_icon, esc_url( $url ), esc_url( $thumbnail ) );
     280                        $content = sprintf( '<div class="thumb" style="max-width:%1$spx">%2$s<a href="%3$s" rel="nofollow" onclick="top.location.href=\'%3$s\'"><img src="%4$s" /></a></div>', $thumb_width, $play_icon, esc_url( $url ), esc_url( $thumbnail ) );
    279281
    280282                        // Show title.
    281283                        if ( isset( $oembed->title ) ) {
     
    311313
    312314                // Print rich content.
    313315                if ( '' !== $content ) {
    314                         printf( '<div class="bp-activity-embed-display-media" style="max-width:%spx">%s</div>', $width, $content );
     316                        printf( '<div class="bp-activity-embed-display-media%s" style="max-width:%spx">%s</div>',
     317                                $thumb_width < $float_width ? ' two-col' : ' one-col',
     318                                $thumb_width < $float_width ? $width : $thumb_width,
     319                                $content
     320                        );
    315321                }
    316322
    317323        // Video / audio.
  • src/bp-templates/bp-legacy/buddypress/assets/embeds/css-activity.php

     
    6565        border-radius: 6px;
    6666}
    6767
    68 .bp-activity-embed-display-media,
    69 .bp-activity-embed-display-media .thumb,
    70 .bp-activity-embed-display-media .thumb img {
     68.bp-activity-embed-display-media.one-col,
     69.bp-activity-embed-display-media.one-col .thumb,
     70.bp-activity-embed-display-media.one-col .thumb img {
     71        width: 100%;
     72}
     73
     74.bp-activity-embed-display-media.two-col .thumb,
     75.bp-activity-embed-display-media.two-col .caption {
     76        display: table-cell;
     77        vertical-align: top;
     78}
     79
     80.bp-activity-embed-display-media.two-col .thumb img {
     81        border-right: 1px solid #ccc;
     82        display: block;
    7183        width: 100%;
    7284}
    7385