Skip to content

Instantly share code, notes, and snippets.

@smith
Created August 29, 2011 01:54
Show Gist options
  • Save smith/1177585 to your computer and use it in GitHub Desktop.
Save smith/1177585 to your computer and use it in GitHub Desktop.
CloudFlare Apps JS
var _gaq = _gaq || [], vglnk = vglnk || {}, clicky_site_id = 0;
(window.__CF || window).addSequenceHandler = function() {
var a = {}, b = "", c;
window.document.onkeydown = function(d) {
c && clearTimeout(c), b += d ? d.keyCode : event.keyCode;
if (a[b])
for (var e = 0; e < a[b].length; e++)
a[b][e]();
c = setTimeout(function() {
b = ""
}, 3e3)
};
return function(b, c) {
a[b] = a[b] || [], a[b].push(c)
}
}(), function(a, b) {
var c = function(a, c) {
vglnk = {api_url: "//api.viglink.com/api",key: "9b4efad421c8b103b2c94b796db973b0",sub_id: a.sid}, a.vig_uk && (vglnk = {api_url: "//api.viglink.com/api",key: a.vig_uk}), function(a, c) {
var d = a.createElement(c);
d.type = "text/javascript", d.async = !0, d.src = ("https:" == b.location.protocol ? vglnk.api_url : "//cdn.viglink.com/api") + "/vglnk.js";
var e = a.getElementsByTagName(c)[0];
e.parentNode.insertBefore(d, e)
}(b, "script"), c && console.debug(a.sid)
}, d = function(a, c) {
(function() {
var c = b.createElement("script");
c.defer = "true", c.src = "http://www.apture.com/js/apture.js?siteToken=" + a.stk, b.getElementsByTagName("head")[0].appendChild(c)
})(), c && console.debug(a.stk)
}, e = function(a, c) {
var d = /https/.test(location.protocol) ? "https://snapabug.appspot.com/snapabug.js" : "http://www.snapengage.com/snapabug.js";
b.write("<script type='text/javascript' src='" + d + "'></script>"), b.write("<script type='text/javascript'>SnapABug.addButton(\"" + a.wid + '","' + a.posit + '","' + a.pcnt + '");</script>'), c && (console.debug(a.wid), console.debug(a.posit), console.debug(a.pcnt))
}, f = function(a, b) {
b && console.debug(a.ua)
}, g = function(a, c) {
(typeof UserVoice == "undefined" || typeof UserVoice.showTab == "undefined") && (function() {
var c = b.createElement("script");
c.type = "text/javascript", c.async = !0, c.src = ("https:" == b.location.protocol ? "https://" : "http://") + "widget.uservoice.com/" + a.key + ".js";
var d = b.getElementsByTagName("script")[0];
d.parentNode.insertBefore(c, d)
}(), c && console.debug(a.key))
}, h = function(a, c) {
clicky_site_id = a.sid, function() {
var a = b.createElement("script");
a.type = "text/javascript", a.async = !0, a.src = "//static.getclicky.com/js", (b.getElementsByTagName("head")[0] || b.getElementsByTagName("body")[0]).appendChild(a)
}(), c && console.debug(a.sid)
}, i = function(a, c) {
var d = function() {
(function() {
var a = b.createElement("script");
a.type = "text/javascript", a.async = !0, a.src = ("https:" == b.location.protocol ? "https://" : "http://") + "cdnjs.cloudflare.com/ajax/libs/chrome-frame/1.0.2/CFInstall.min.js";
var c = b.getElementsByTagName("script")[0];
c.parentNode.insertBefore(a, c)
})()
}, e = function() {
(function() {
var a = b.createElement("script");
a.type = "text/javascript", a.async = !0, a.src = ("https:" == b.location.protocol ? "https://" : "http://") + "cdnjs.cloudflare.com/ajax/libs/flexie/1.0.0/flexie.min.js";
var c = b.getElementsByTagName("script")[0];
c.parentNode.insertBefore(a, c)
})()
}, f = {GF: d,FX: e}, g = a.cdnjs.split(",");
for (key in g)
f[g[key]] && f[g[key]]()
}, j = function(c, d) {
var e = function() {
(function() {
var a = b.createElement("script");
a.type = "text/javascript", a.async = !0, a.src = ("https:" == b.location.protocol ? "https://" : "http://") + "ajax.cloudflare.com/cdn-cgi/nexp/browserblaster.min.js";
var c = b.getElementsByTagName("script")[0];
c.parentNode.insertBefore(a, c)
})()
};
if (c.a == "1")
e();
else {
var f = c.brwbl.split(",");
a.__CF.addSequenceHandler(f.join(""), e)
}
}, k = function(a, c) {
if (a.pkr) {
var d = b.createElement("div");
d.id = "smt-lang-selector", b.getElementsByTagName("body")[0].appendChild(d)
}
}, l = function(a, c) {
vizilinksProperty = {channel: a.cnl,startMinimized: a.sm ? "true" : "false"};
var d = b.createElement("script");
d.type = "text/javascript", d.async = !0, d.src = "http://cdn.haileo.com/js/cloudflare/haileoads.js";
var e = b.getElementsByTagName("script")[0];
e.parentNode.insertBefore(d, e)
}, m = function(c, d) {
var e = ("https:" == b.location.protocol ? "https://" : "http://") + "ajax.cloudflare.com/cdn-cgi/nexp/pronounce.min.js";
b.write('<script src="' + e + '" type="text/javascript"></script>'), a.PRONOUNCE_APP_TOKEN = c.dalytkn
}, n = {ga_key: f,vig_key: c,apt_key: d,snap_key: e,usrvc: g,clky: h,cdnjs: i,brwbl: j,smrtln: k,hleo: l,prnc: m}, o = a.__CF || {}, p = o.AJS || {};
for (key in p)
n[key] && n[key](p[key], !1)
}(window, document)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment