third-party.min.js 2.58 KB
!function (t, e, i, o) {
    t.fn.doubleTapToGo = function (o) {
        return "ontouchstart" in e || e.navigator.msPointerEnabled || navigator.userAgent.toLowerCase().match(/windows phone os 7/i) ? (this.each(function () {
            var e = !1;
            t(this).on("click", function (i) {
                var o = t(this);
                o[0] != e[0] && (i.preventDefault(), e = o)
            }), t(i).on("click touchstart MSPointerDown", function (i) {
                for (var o = !0, r = t(i.target).parents(), a = 0; a < r.length; a++)r[a] == e[0] && (o = !1);
                o && (e = !1)
            })
        }), this) : !1
    }
}(jQuery, window, document), function (t) {
    "use strict";
    t.fn.fitVids = function (e) {
        var i = {customSelector: null};
        if (!document.getElementById("fit-vids-style")) {
            var o = document.head || document.getElementsByTagName("head")[0], r = ".fluid-width-video-wrapper{width:100%;position:relative;padding:0;}.fluid-width-video-wrapper iframe,.fluid-width-video-wrapper object,.fluid-width-video-wrapper embed {position:absolute;top:0;left:0;width:100%;height:100%;}", a = document.createElement("div");
            a.innerHTML = '<p>x</p><style id="fit-vids-style">' + r + "</style>", o.appendChild(a.childNodes[1])
        }
        return e && t.extend(i, e), this.each(function () {
            var e = ["iframe[src*='player.vimeo.com']", "iframe[src*='youtube.com']", "iframe[src*='youtube-nocookie.com']", "iframe[src*='kickstarter.com'][src*='video.html']", "object", "embed"];
            i.customSelector && e.push(i.customSelector);
            var o = t(this).find(e.join(","));
            o = o.not("object object"), o.each(function () {
                var e = t(this);
                if (!("embed" === this.tagName.toLowerCase() && e.parent("object").length || e.parent(".fluid-width-video-wrapper").length)) {
                    var i = "object" === this.tagName.toLowerCase() || e.attr("height") && !isNaN(parseInt(e.attr("height"), 10)) ? parseInt(e.attr("height"), 10) : e.height(), o = isNaN(parseInt(e.attr("width"), 10)) ? e.width() : parseInt(e.attr("width"), 10), r = i / o;
                    if (!e.attr("id")) {
                        var a = "fitvid" + Math.floor(999999 * Math.random());
                        e.attr("id", a)
                    }
                    e.wrap('<div class="fluid-width-video-wrapper"></div>').parent(".fluid-width-video-wrapper").css("padding-top", 100 * r + "%"), e.removeAttr("height").removeAttr("width")
                }
            })
        })
    }
}(window.jQuery || window.Zepto);