Plugin Directory

Changeset 2125080


Ignore:
Timestamp:
07/18/2019 08:15:39 AM (7 years ago)
Author:
bazoio
Message:
  • Fix load shortcode data.
Location:
bazo
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • bazo/branches/readme.txt

    r2115213 r2125080  
    66Tested up to: 5.2
    77Requires PHP: 5.6
    8 Stable tag: 1.2
    9 Version: 1.2
     8Stable tag: 1.2.1
     9Version: 1.2.1
    1010Contributors: Bazo
    1111
     
    3535
    3636== Changelog ==
     37
     38= 1.2.1=
     39* Fix load shortcode data.
    3740
    3841= 1.2=
  • bazo/branches/wp-bazo.php

    r2115213 r2125080  
    22    /*
    33      Plugin Name: Bazo
    4       Version: 1.2
     4      Version: 1.2.1
    55      Description: Automatically adds Bazo.io tracker to site
    66      Author: Bazo
     
    164164                    })(document, 'script', '//c.bazo.io/t.min.js');
    165165                </script>
    166                 <!-- END Bazo Tracker v.1.2 -->
     166                <!-- END Bazo Tracker v.1.2.1 -->
    167167            <?php }
    168168        }
     
    179179
    180180
    181     function company_shortcode($atts) {
     181    function company_shortcode( $atts ) {
    182182        $altName = shortcode_atts( array(
    183183            'name' => ''
    184184        ), $atts );
    185         return '<span class="bazo-company">' .$altName['name']. '</span>';
     185
     186        return '<span class="bazo-company">' . $altName['name'] . '</span>';
    186187    }
    187188
     
    191192    function bazo_footer_script() { ?>
    192193        <script>
    193             window.addEventListener('load', function() {
    194                 var getBody = document.getElementsByTagName("body")[0];
    195                 var company = getBody.getAttribute("bazo-company");
    196                 if (!!company) {
    197                     var elems = document.getElementsByClassName('bazo-company');
    198                     for (let i = 0; i < elems.length; ++i) {
    199                         elems[i].innerHTML = company;
     194            window.addEventListener('load', function () {
     195                var bazoInterval = setInterval(bazoReplacer, 1000);
     196
     197                function stopTimer() {
     198                    window.clearInterval(bazoInterval);
     199                }
     200
     201                setTimeout(stopTimer, 10000);
     202
     203                function bazoReplacer() {
     204                    var getBody = document.getElementsByTagName("body")[0];
     205                    var company = getBody.getAttribute("bazo-company");
     206                    if (!!company) {
     207                        stopTimer();
     208                        var elems = document.getElementsByClassName('bazo-company');
     209                        for (let i = 0; i < elems.length; ++i) {
     210                            elems[i].innerHTML = company;
     211                        }
    200212                    }
    201213                }
    202214            });
     215
    203216        </script>
    204217    <?php }
  • bazo/trunk/readme.txt

    r2115213 r2125080  
    66Tested up to: 5.2
    77Requires PHP: 5.6
    8 Stable tag: 1.2
    9 Version: 1.2
     8Stable tag: 1.2.1
     9Version: 1.2.1
    1010Contributors: Bazo
    1111
     
    3535
    3636== Changelog ==
     37
     38= 1.2.1=
     39* Fix load shortcode data.
    3740
    3841= 1.2=
  • bazo/trunk/wp-bazo.php

    r2115213 r2125080  
    22    /*
    33      Plugin Name: Bazo
    4       Version: 1.2
     4      Version: 1.2.1
    55      Description: Automatically adds Bazo.io tracker to site
    66      Author: Bazo
     
    164164                    })(document, 'script', '//c.bazo.io/t.min.js');
    165165                </script>
    166                 <!-- END Bazo Tracker v.1.2 -->
     166                <!-- END Bazo Tracker v.1.2.1 -->
    167167            <?php }
    168168        }
     
    179179
    180180
    181     function company_shortcode($atts) {
     181    function company_shortcode( $atts ) {
    182182        $altName = shortcode_atts( array(
    183183            'name' => ''
    184184        ), $atts );
    185         return '<span class="bazo-company">' .$altName['name']. '</span>';
     185
     186        return '<span class="bazo-company">' . $altName['name'] . '</span>';
    186187    }
    187188
     
    191192    function bazo_footer_script() { ?>
    192193        <script>
    193             window.addEventListener('load', function() {
    194                 var getBody = document.getElementsByTagName("body")[0];
    195                 var company = getBody.getAttribute("bazo-company");
    196                 if (!!company) {
    197                     var elems = document.getElementsByClassName('bazo-company');
    198                     for (let i = 0; i < elems.length; ++i) {
    199                         elems[i].innerHTML = company;
     194            window.addEventListener('load', function () {
     195                var bazoInterval = setInterval(bazoReplacer, 1000);
     196
     197                function stopTimer() {
     198                    window.clearInterval(bazoInterval);
     199                }
     200
     201                setTimeout(stopTimer, 10000);
     202
     203                function bazoReplacer() {
     204                    var getBody = document.getElementsByTagName("body")[0];
     205                    var company = getBody.getAttribute("bazo-company");
     206                    if (!!company) {
     207                        stopTimer();
     208                        var elems = document.getElementsByClassName('bazo-company');
     209                        for (let i = 0; i < elems.length; ++i) {
     210                            elems[i].innerHTML = company;
     211                        }
    200212                    }
    201213                }
    202214            });
     215
    203216        </script>
    204217    <?php }
Note: See TracChangeset for help on using the changeset viewer.