Plugin Directory

Changeset 2017101


Ignore:
Timestamp:
01/22/2019 07:12:28 PM (7 years ago)
Author:
tryinteract
Message:

tagging 3.0.6: bug fixes

Location:
interact-quiz-embed
Files:
2 edited
3 copied

Legend:

Unmodified
Added
Removed
  • interact-quiz-embed/tags/3.0.6/interact-quiz-embed.php

    r1975142 r2017101  
    55Description: Use this plugin to embed your Interact quiz into your Wordpress site.
    66Author: The Quiz Collective Inc.
    7 Version: 3.0.5
     7Version: 3.0.6
    88Author URI: https://www.tryinteract.com
    99
     
    6767    shortcode_atts(array('id'=>'', 'type'=>'quiz', 'w'=>'800', 'h'=>'800', 'no_cover'=>'false'), $atts);
    6868
     69    wp_enqueue_script('interact-embed-script');
     70
    6971    if(isset($atts['w'])) { $width = $atts['w']; } else { $width = '800'; }
    7072    if(isset($atts['h'])) { $height = $atts['h']; } else { $height = '800'; }
     
    125127function interact_scripts(){
    126128    global $post;
    127 
    128     // embed script if shortcode exists on page content
    129     if(is_a($post, 'WP_Post') && has_shortcode($post->post_content, 'interact')) {
    130       ?>
    131             <script type="text/javascript">
    132                 (function(d, t){
    133                     var s=d.createElement(t);
    134                     s.src='https://i.tryinteract.com/embed/app.js';
    135                     s.onload=s.onreadystatechange=function(){var rs=this.readyState;if(rs)if(rs!='complete')if(rs!='loaded')return;};
    136                     var scr=d.getElementsByTagName(t)[0],par=scr.parentNode;par.insertBefore(s,scr);
    137                 })(document,'script');
    138             </script>
    139         <?php
    140     }
    141129
    142130    // promotion script
     
    157145
    158146
     147
     148/*
     149*
     150* Register the Script
     151*
     152*/
     153
     154function interact_enqueue_scripts(){
     155    wp_register_script('interact-embed-script', plugins_url('interact-embed.js', __FILE__), null, '1.0', true);
     156}
     157
     158add_action( 'wp_enqueue_scripts', 'interact_enqueue_scripts' ); 
     159
     160
     161
    159162/*
    160163*
  • interact-quiz-embed/tags/3.0.6/readme.txt

    r1975142 r2017101  
    33Tags: interact, quiz, poll, giveaway, embed, shortcode, promotion
    44Requires at least: 3.0.1
    5 Tested up to: 4.9.8
    6 Stable tag: 3.0.5
     5Tested up to: 5.0.3
     6Stable tag: 3.0.6
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    5151== Changelog ==
    5252
     53= 3.0.6 =
     54* Bug fixes.
     55
    5356= 3.0.5 =
    5457* Added shortcode attribute redirect="host" to enable top-level browser redirection outside iframe.
  • interact-quiz-embed/trunk/interact-quiz-embed.php

    r1975142 r2017101  
    55Description: Use this plugin to embed your Interact quiz into your Wordpress site.
    66Author: The Quiz Collective Inc.
    7 Version: 3.0.5
     7Version: 3.0.6
    88Author URI: https://www.tryinteract.com
    99
     
    6767    shortcode_atts(array('id'=>'', 'type'=>'quiz', 'w'=>'800', 'h'=>'800', 'no_cover'=>'false'), $atts);
    6868
     69    wp_enqueue_script('interact-embed-script');
     70
    6971    if(isset($atts['w'])) { $width = $atts['w']; } else { $width = '800'; }
    7072    if(isset($atts['h'])) { $height = $atts['h']; } else { $height = '800'; }
     
    125127function interact_scripts(){
    126128    global $post;
    127 
    128     // embed script if shortcode exists on page content
    129     if(is_a($post, 'WP_Post') && has_shortcode($post->post_content, 'interact')) {
    130       ?>
    131             <script type="text/javascript">
    132                 (function(d, t){
    133                     var s=d.createElement(t);
    134                     s.src='https://i.tryinteract.com/embed/app.js';
    135                     s.onload=s.onreadystatechange=function(){var rs=this.readyState;if(rs)if(rs!='complete')if(rs!='loaded')return;};
    136                     var scr=d.getElementsByTagName(t)[0],par=scr.parentNode;par.insertBefore(s,scr);
    137                 })(document,'script');
    138             </script>
    139         <?php
    140     }
    141129
    142130    // promotion script
     
    157145
    158146
     147
     148/*
     149*
     150* Register the Script
     151*
     152*/
     153
     154function interact_enqueue_scripts(){
     155    wp_register_script('interact-embed-script', plugins_url('interact-embed.js', __FILE__), null, '1.0', true);
     156}
     157
     158add_action( 'wp_enqueue_scripts', 'interact_enqueue_scripts' ); 
     159
     160
     161
    159162/*
    160163*
  • interact-quiz-embed/trunk/readme.txt

    r1975142 r2017101  
    33Tags: interact, quiz, poll, giveaway, embed, shortcode, promotion
    44Requires at least: 3.0.1
    5 Tested up to: 4.9.8
    6 Stable tag: 3.0.5
     5Tested up to: 5.0.3
     6Stable tag: 3.0.6
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    5151== Changelog ==
    5252
     53= 3.0.6 =
     54* Bug fixes.
     55
    5356= 3.0.5 =
    5457* Added shortcode attribute redirect="host" to enable top-level browser redirection outside iframe.
Note: See TracChangeset for help on using the changeset viewer.