Plugin Directory

Changeset 2261404


Ignore:
Timestamp:
03/15/2020 07:07:46 PM (6 years ago)
Author:
bingewith
Message:

adding logic for when the JS on WP does not load

Location:
bingewith/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • bingewith/trunk/bingewith.php

    r2239459 r2261404  
    3434                }
    3535              }
     36              var BingeIframeRan = true;
    3637              </script>');
    3738
     
    4647      $permalink = get_permalink();
    4748      if (get_post_meta(get_post()->ID, 'bingewith', true) !== "false") {
    48         $msg = "<iframe class='binge-iframe' height='70' width='100%' frameBorder='0' style='margin-top: 10px!important; margin-bottom: 10px!important; opacity: 0;' src='https://bingewith.com/article/::_wp&permalink=$permalink' scrolling='no'></iframe>";
     49        $iframe_id = "binge-iframe-" . get_post()->ID;
     50        $onload_handler = 'if (typeof BingeIframeRan === "undefined") { document.getElementById("' . $iframe_id . '").style.opacity = 1 } ';
     51        $msg = "<iframe id='$iframe_id' class='binge-iframe' height='70' width='100%' frameBorder='0' onload='$onload_handler' style='margin-top: 10px!important; margin-bottom: 10px!important; opacity: 0;' src='https://bingewith.com/article/::_wp&permalink=$permalink' scrolling='no'></iframe>";
    4952                // Preprend our iframe to the post content.
    5053                $content = $msg . $content;
  • bingewith/trunk/readme.txt

    r2239459 r2261404  
    33Tags: audio blogs
    44Requires at least: 4.6
    5 Tested up to: 5.3.2
     5Tested up to: 5.3
    66Requires PHP: 5.2.4
    77Stable tag: 1.4
     
    2828== Changelog ==
    2929
    30 = 1.3 =
    31 * Showing audio player on posts only. Excludes product pages or other post types.
    32 * Reduces size of widget to 70px height taking the full 100% width;
     30= 1.3=
     31Showing audio player on posts only. Excludes product pages or other post types.
     32Reduces size of widget to 70px height taking the full 100% width;
    3333
    3434= 1.1 =
Note: See TracChangeset for help on using the changeset viewer.