Plugin Directory

Changeset 1644732


Ignore:
Timestamp:
04/25/2017 09:54:16 AM (9 years ago)
Author:
remko
Message:

v0.3

Location:
wp-bookwidgets/trunk
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • wp-bookwidgets/trunk/readme.txt

    r1549404 r1644732  
    33Tags: bookwidgets, widgets, education
    44Requires at least: 4.0
    5 Tested up to: 4.7
     5Tested up to: 4.7.4
    66Stable tag: trunk
    77License: MIT
     
    3737- `width`: Width of the widget frame
    3838- `height`: Height of the widget frame
     39- `allowfullscreen`: set this to '1' to add a fullscreen button in the bottom right corner
    3940
    4041
     
    4748== Changelog ==
    4849
     50### 0.3
     51
     52- Added a allowfullscreen option to bw_embed
     53
    4954### 0.2
    5055
  • wp-bookwidgets/trunk/wp-bookwidgets.php

    r1529397 r1644732  
    55 * Plugin URI: https://github.com/remko/wp-bookwidgets
    66 * Description: Integrate BookWidgets widgets in your WordPress site
    7  * Version: 0.1
     7 * Version: 0.3
    88 * Author: Remko Tronçon
    99 * Author URI: https://el-tramo.be
     
    128128}
    129129
     130function get_new_tab_icon() {
     131  return '<svg class="bw-icon" width="1792" height="1792" viewBox="0 0 1792 1792" xmlns="http://www.w3.org/2000/svg"><path d="M1408 928v320q0 119-84.5 203.5t-203.5 84.5h-832q-119 0-203.5-84.5t-84.5-203.5v-832q0-119 84.5-203.5t203.5-84.5h704q14 0 23 9t9 23v64q0 14-9 23t-23 9h-704q-66 0-113 47t-47 113v832q0 66 47 113t113 47h832q66 0 113-47t47-113v-320q0-14 9-23t23-9h64q14 0 23 9t9 23zm384-864v512q0 26-19 45t-45 19-45-19l-176-176-652 652q-10 10-23 10t-23-10l-114-114q-10-10-10-23t10-23l652-652-176-176q-19-19-19-45t19-45 45-19h512q26 0 45 19t19 45z"/></svg>';
     132}
     133
    130134add_shortcode('bw_link', function($atts, $content = null) {
    131135  $a = shortcode_atts([
     
    153157    'code' => '',
    154158    'width' => null,
    155     'height' => null
     159    'height' => null,
     160    'allowfullscreen' => null
    156161  ], $atts);
    157   $result = "";
     162  $result = "<div class=\"bw-widget-wrapper\">";
    158163  if (use_lti()) {
    159164    global $bwNextEmbedID;
     
    177182  }
    178183  $result .= "></iframe>";
     184  if (($a['allowfullscreen'] == "1") || ($a['allowfullscreen'] == "true")) {
     185    $result .= "<a class=\"bw-widget-new-tab\" href=\"" . esc_attr(get_play_link($a["code"])) . "\" target=\"_blank\">" . get_new_tab_icon() . "</a>";
     186  }
     187  $result .= "</div>";
    179188
    180189  return $result;
     
    185194  global $baseURI;
    186195  wp_enqueue_script("bw_embed_support", "{$baseURI}/js/embed-support.js", false);
    187 });
     196  wp_register_style('wp-bookwidgets', plugins_url('wp-bookwidgets.css', __FILE__) );
     197  wp_enqueue_style('wp-bookwidgets');
     198});
     199
    188200
    189201
Note: See TracChangeset for help on using the changeset viewer.