HEX
Server: Apache
System: Linux 162-240-236-42.bluehost.com 3.10.0-1160.114.2.el7.x86_64 #1 SMP Wed Mar 20 15:54:52 UTC 2024 x86_64
User: bt667 (1004)
PHP: 8.2.29
Disabled: NONE
Upload Files
File: /home/bt667/www/wp-content/plugins/accelerated-mobile-pages/includes/disqus.html
<div id="disqus_thread"></div>
<style type="text/css">
    .i-amphtml-layout-size-defined .i-amphtml-fill-content{
        position: relative!important;
    }
</style>
<script>



    var QueryString = function () {

        var query_string = {};

        var query = window.location.search.substring(1);

        var vars = query.split("&");

        for (var i=0;i<vars.length;i++) {

            var pair = vars[i].split("=");

            if (typeof query_string[pair[0]] === "undefined") {

                query_string[pair[0]] = decodeURIComponent(pair[1]);

            } else if (typeof query_string[pair[0]] === "string") {

                var arr = [ query_string[pair[0]],decodeURIComponent(pair[1]) ];

                query_string[pair[0]] = arr;

            } else {

                query_string[pair[0]].push(decodeURIComponent(pair[1]));

            }

        }

        return query_string;

    }();



    var url = QueryString.url;

    var identifier = QueryString.identifier;

    var disqus_name = QueryString.disqus_name;

    var disqus_title = QueryString.disqus_title;



    var disqus_config = function () {

        this.page.url = url;

        this.page.title = disqus_title;

        this.page.identifier = identifier || url;

    };



    (function () {

        const pattern = /https:\/\/[a-zA-Z]+.disqus.com/;

        const matches = disqus_name.match(pattern);

        if (matches && matches[0].match(pattern)) {

            var d = document, s = d.createElement('script');

            s.src = matches[0];

            s.setAttribute('data-timestamp', +new Date());

            (d.head || d.body).appendChild(s);

        }

    })();



    (function () {

        function checkSizeChange() {

            var viewportHeight = window.innerHeight;

            var contentHeight = document.getElementById('disqus_thread').clientHeight;
            if (viewportHeight !== contentHeight && contentHeight > 100) {

                window.parent.postMessage({

                    sentinel: 'amp',

                    type: 'embed-size',

                    height: contentHeight

                }, '*')

            }

        }



        var mutationObserverAvailable = typeof window.MutationObserver === 'function';



        function bindObserver() {

            var foundframe = false,

                frame, framename,

                frames = document.getElementsByTagName('iframe');



            for (var i=0; i < frames.length; ++i) {

                frame = frames[i];

                framename = frame.getAttribute("name");

                src = frame.getAttribute("src");

                if ( framename && /dsq/.test(framename) && src && src != null) {

                    frame_id = frame.getAttribute("id");

                    // check the size now since the frame is now available

                    checkSizeChange();

                    if (!ampforwp_is_mobile_device()) {

                        var resizeObserver = new MutationObserver(checkSizeChange);

                        resizeObserver.observe(frame, {

                            attributes: true,

                            attributeFilter: ['style']

                        });

                    }

                    foundframe = true;

                    break;

                }

            }



            



            // if the frame is not available yet try again later

            if (foundframe === false) {

                setTimeout(bindObserver, 200);

                return;

            }

        }



        // use mutation observers to quickly change the size of the iframe

        if (mutationObserverAvailable) {

            bindObserver();

        }



        function ampforwp_is_mobile_device() {

            if (navigator.userAgent.match(/Android/i)

            || navigator.userAgent.match(/webOS/i)

            || navigator.userAgent.match(/iPhone/i)

            || navigator.userAgent.match(/iPad/i)

            || navigator.userAgent.match(/iPod/i)

            || navigator.userAgent.match(/BlackBerry/i)

            || navigator.userAgent.match(/Windows Phone/i)) {

            return true;

            }

            return false;

        }




        // also check periodically for the size of the frame

        setInterval(checkSizeChange, mutationObserverAvailable ? 5000 : 500);

    })();

</script>