Sha256: 206eb31be92dfae8f3cc97c8ae6235dde8fbaa61236e997d157ff696feaa43c6

Contents?: true

Size: 1.39 KB

Versions: 37

Compression:

Stored size: 1.39 KB

Contents

---
---
var disqus_shortname = '{{site.disqus_shortname}}';

if (typeof ds_loaded == "undefined") {
    var ds_loaded = false; //To track loading only once on a page.
}

function loadDisqus() {
    var disqus_div = document.getElementById("disqus_thread"); //The ID of the Disqus DIV tag
    var top = disqus_div.offsetTop;
    var disqus_data = disqus_div.dataset;
    if (!ds_loaded && (window.scrollY || window.pageYOffset) + window.innerHeight > top) {
        ds_loaded = true;
        for (var key in disqus_data) {
            if (key.substr(0, 6) == "disqus") {
                window["disqus_" + key.replace("disqus", "").toLowerCase()] = disqus_data[key];
            }
        }
        var dsq = document.createElement("script");
        dsq.type = "text/javascript";
        dsq.async = true;
        dsq.src = "https://" + window.disqus_shortname + ".disqus.com/embed.js";
        if (document.getElementById("dcl-hidden-div")) {
            document.getElementById("dcl-hidden-div").innerHTML = "Loading...";
        }
        (document.getElementsByTagName("head")[0] || document.getElementsByTagName("body")[0]).appendChild(dsq);
    }
}

var disqus_div_new = document.getElementById("disqus_thread");
var divExists = disqus_div_new != null;

if (document.body.scrollHeight < window.innerHeight) {
    loadDisqus();
} else if (divExists) {
    window.onscroll = function() {
        loadDisqus();
    }
}

Version data entries

37 entries across 37 versions & 1 rubygems

Version Path
jekyll-theme-mehdix-rtl-3.2.0 assets/js/disqus.js
jekyll-theme-mehdix-rtl-3.1.2 assets/js/disqus.js
jekyll-theme-mehdix-rtl-3.1.1 assets/js/disqus.js
jekyll-theme-mehdix-rtl-3.1.0 assets/js/disqus.js
jekyll-theme-mehdix-rtl-3.0.1 assets/js/disqus.js
jekyll-theme-mehdix-rtl-3.0.0 assets/js/disqus.js
jekyll-theme-mehdix-rtl-2.5.1 assets/js/disqus.js
jekyll-theme-mehdix-rtl-2.5.0 assets/js/disqus.js
jekyll-theme-mehdix-rtl-2.4.1 assets/js/disqus.js
jekyll-theme-mehdix-rtl-2.4.0 assets/js/disqus.js
jekyll-theme-mehdix-rtl-2.3.0 assets/js/disqus.js
jekyll-theme-mehdix-rtl-2.2.1 assets/js/disqus.js
jekyll-theme-mehdix-rtl-2.2.0 assets/js/disqus.js
jekyll-theme-mehdix-rtl-2.1.0 assets/js/disqus.js
jekyll-theme-mehdix-rtl-2.0.1 assets/js/disqus.js
jekyll-theme-mehdix-rtl-2.0.0 assets/js/disqus.js
jekyll-theme-mehdix-rtl-1.2.1 assets/js/disqus.js
jekyll-theme-mehdix-rtl-1.2.0 assets/js/disqus.js
jekyll-theme-mehdix-rtl-1.1.1 assets/js/disqus.js
jekyll-theme-mehdix-rtl-1.1.0 assets/js/disqus.js