Changeset 1644732
- Timestamp:
- 04/25/2017 09:54:16 AM (9 years ago)
- Location:
- wp-bookwidgets/trunk
- Files:
-
- 1 added
- 2 edited
-
readme.txt (modified) (3 diffs)
-
wp-bookwidgets.css (added)
-
wp-bookwidgets.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wp-bookwidgets/trunk/readme.txt
r1549404 r1644732 3 3 Tags: bookwidgets, widgets, education 4 4 Requires at least: 4.0 5 Tested up to: 4.7 5 Tested up to: 4.7.4 6 6 Stable tag: trunk 7 7 License: MIT … … 37 37 - `width`: Width of the widget frame 38 38 - `height`: Height of the widget frame 39 - `allowfullscreen`: set this to '1' to add a fullscreen button in the bottom right corner 39 40 40 41 … … 47 48 == Changelog == 48 49 50 ### 0.3 51 52 - Added a allowfullscreen option to bw_embed 53 49 54 ### 0.2 50 55 -
wp-bookwidgets/trunk/wp-bookwidgets.php
r1529397 r1644732 5 5 * Plugin URI: https://github.com/remko/wp-bookwidgets 6 6 * Description: Integrate BookWidgets widgets in your WordPress site 7 * Version: 0. 17 * Version: 0.3 8 8 * Author: Remko Tronçon 9 9 * Author URI: https://el-tramo.be … … 128 128 } 129 129 130 function 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 130 134 add_shortcode('bw_link', function($atts, $content = null) { 131 135 $a = shortcode_atts([ … … 153 157 'code' => '', 154 158 'width' => null, 155 'height' => null 159 'height' => null, 160 'allowfullscreen' => null 156 161 ], $atts); 157 $result = " ";162 $result = "<div class=\"bw-widget-wrapper\">"; 158 163 if (use_lti()) { 159 164 global $bwNextEmbedID; … … 177 182 } 178 183 $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>"; 179 188 180 189 return $result; … … 185 194 global $baseURI; 186 195 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 188 200 189 201
Note: See TracChangeset
for help on using the changeset viewer.