Skip to content

Commit

Permalink
Add support for badge builder teaser
Browse files Browse the repository at this point in the history
  • Loading branch information
brichards committed Oct 18, 2013
1 parent f204405 commit d139f83
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
Binary file added images/badge-builder-teaser.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 3 additions & 2 deletions includes/class.Credly_Badge_Builder.php
Expand Up @@ -121,8 +121,9 @@ public function render_link( $args = array() ) {
$embed_url = $this->generate_link( $args );
$output = '<a href="' . esc_url( $embed_url ) . '" class="thickbox badge-builder-link" data-width="' . $args['width'] . '" data-height="' . $args['height'] . '">' . $args['link_text'] . '</a>';
} else {
$output = '<a href="#teaser" class="thickbox badge-builder-link" data-width="' . $args['width'] . '" data-height="' . $args['height'] . '">' . $args['link_text'] . '</a>';
$output .= '<div id="teaser"></div>';
$embed_url = '#TB_inline?width=' . $args['width'] . '&height=' . $args['width'] . '&inlineId=teaser';
$output = '<a href="' . $embed_url . '" class="thickbox badge-builder-link" data-width="' . $args['width'] . '" data-height="' . $args['height'] . '">' . $args['link_text'] . '</a>';
$output .= '<div id="teaser" style="display:none;"><a href="' . admin_url( 'admin.php?page=badgeos_sub_credly_integration' ) . '"><img src="' . $GLOBALS['badgeos']->directory_url . 'images/badge-builder-teaser.png" alt="Enable Credly Integration to use the Badge Builder"></a></div>';
}

add_thickbox();
Expand Down
1 change: 1 addition & 0 deletions js/credly-badge-builder.js
Expand Up @@ -60,6 +60,7 @@ jQuery(document).ready(function($) {

$('.badge-builder-thickbox').css({ 'marginLeft': -(width / 2) });
$('.badge-builder-thickbox, .badge-builder-thickbox #TB_iframeContent').width(width).height(height);
$('.badge-builder-thickbox, .badge-builder-thickbox #TB_ajaxContent').width(width).height(height).css({'padding':'0px'});

}, 0 );
}
Expand Down

0 comments on commit d139f83

Please sign in to comment.