0% found this document useful (0 votes)
81 views8 pages

5

The document contains configuration settings for logging and monitoring. It defines variables for initializing messaging between windows and registering event listeners. It also includes code for loading external scripts and rendering content in a dialog.

Uploaded by

numericsodas0r
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
81 views8 pages

5

The document contains configuration settings for logging and monitoring. It defines variables for initializing messaging between windows and registering event listeners. It also includes code for loading external scripts and rendering content in a dialog.

Uploaded by

numericsodas0r
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 8

"Enable":3,

"MTInterval":4,
"MaxFocusLog":6,
"MaxKSLog":14,
"MaxMTLog":300,
"MaxNGPLog":200,
"MinMTDwnLog":30,
"NGPInterval":4,
"location":"cn",
"timeout":2000,
"_umopt_npfp":1,
var baxiaXhrHandler = function() {
"use strict";
var e = function(t, n) {
return (e = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(e, t) {
e.__proto__ = t
} || function(e, t) {
for (var n in t)
t.hasOwnProperty(n) && (e[n] = t[n])
})(t, n)
};
var t = function() {
return (t = Object.assign || function(e) {
for (var t, n = arguments, i = 1, o = arguments.length; o > i; i++)
for (var r in t = n[i])
Object.prototype.hasOwnProperty.call(t, r) && (e[r] =
t[r]);
return e
}).apply(this, arguments)
},
n = window,
i = function(e, t) {
var i = n.__baxia__ || {};
return e ? i[e] || t : i
},
o = function(e, t) {
n.__baxia__ = n.__baxia__ || {},
n.__baxia__[e] = t
},
r = location,
a = document,
s = function(e, t, n) {
(void 0 === t && (t = 1), void 0 === n && (n = .1), 0 >= n ||
Math.random() < n) && function(e, t) {
var n = [];
for (var i in e)
n.push(i + "=" + encodeURIComponent(e[i]));
(new Image).src = t + n.join("&")
}({
code: t,
msg: (e + "").substr(0, 1e3) + ";v:" + c,
pid: "baxia",
page: r.href.split(/[#?]/)[0],
query: r.search.substr(1),
hash: r.hash,
referrer: a.referrer,
title: a.title,
ua: navigator.userAgent
}, "//gm.mmstat.com/fsp.1.1?")
};
function d(e) {
s(e, 16, 1)
}
var l = function() {
return navigator.userAgent.match(/.*(iPhone|iPad|Android|ios|SymbianOS|
Windows Phone).*/i)
};
var c = "2.5.11",
u = {},
p = i("events", {}),
h = {
on: function(e, t) {
return (p[e] || (p[e] = [])).push(t), o("events", p), u
},
once: function(e, t) {
var n = this,
i = function() {
t.apply(n, function(e) {
for (var t = Array(e.length), n = 0; t.length > n; ++n)
t[n] = e[n];
return t
}(arguments)),
n.off(e, i)
};
return this.on(e, i), u
},
off: function(e, t) {
if (!e && !t)
return p = {}, u;
var n = p[e];
if (n)
if (t)
for (var i = n.length - 1; i >= 0; i--)
n[i] === t && n.splice(i, 1);
else
delete p[e];
return u
},
fire: function(e, t) {
var n = (p = i("events", {}))[e];
if (n)
for (var o = 0, r = (n = n.slice()).length; r > o; o++)
n[o](t);
return u
}
},
f = "@=_=@",
g = null,
m = null,
y = null,
v = [],
x = {
uid: 0,
hid: -1,
q: [],
tm: 0,
postMessage: function(e, t) {
var n = ++x.uid,
i = x.q,
o = {
name: +new Date + "" + n + "^" + document.domain + "&" + t,
uid: n,
target: e
};
i.push(o),
x.tm || (x.tm = setInterval(function() {
var e = x.q;
if (0 !== e.length && e[0].uid > x.hid) {
var t = e[0];
x.hid = t.uid,
t.target.name = t.name
}
}, 10))
},
ListenerMessage: function(e, t) {
var n = "",
i = /^(\d+?)\^(.+?)&(.*?)$/;
setInterval(function() {
if (!e)
return !1;
var o = e.name;
if (o !== n) {
x.q.shift(),
n = o;
var r = i.exec(o);
if (!r)
return;
t && t({
origin: r[2],
data: r[3]
})
}
}, 10)
}
};
function b(e) {
try {
var t = e.data.split(f),
n = void 0,
i = void 0;
t.length > 1 ? (n = t[0], i = t[1]) : (n = (t = JSON.parse(t[0])).type,
i = t.content);
for (var o = 0, r = v.length; r > o; o++)
v[o].event === n && v[o].callback(i)
} catch (a) {}
}
var w = {
initListener: function(e) {
m = e.originWin,
y = e.msgTransfer,
(g = e.currentWin) && m && y && (g.postMessage ? g.addEventListener ?
g.addEventListener("message", b, !1) : g.attachEvent && g.attachEvent("onmessage",
b) : x.ListenerMessage("fromFrame" == y ? m : g, b))
},
register: function(e, t) {
v.push({
event: e,
callback: t
})
},
send: function(e) {
var t = e.type + f + e.content;
g && m && y && (m.postMessage ? m.postMessage(t, "*") :
x.postMessage("fromFrame" == y ? m : g, t))
}
};
o("Messenger", w);
var _ = function(e, t, n, i) {
if (void 0 === i && (i = !1), t.addEventListener)
t.addEventListener(e, n, i);
else if (t.attachEvent)
return t.attachEvent("on" + e, n), !1
};
function M(e, t) {
return e + (e.indexOf("?") > -1 ? "&" : "?") + t
}
!function(e, t) {
void 0 === t && (t = {});
var n = t.insertAt;
if (e && "undefined" != typeof document) {
var i = document.head || document.getElementsByTagName("head")[0],
o = document.createElement("style");
o.type = "text/css",
"top" === n && i.firstChild ? i.insertBefore(o, i.firstChild) :
i.appendChild(o),
o.styleSheet ? o.styleSheet.cssText = e :
o.appendChild(document.createTextNode(e))
}
}(".baxia-dialog {\n position: fixed;\n top: 0;\n right: 0;\n bottom: 0;\n
left: 0;\n z-index: 2147483647;\n}\n\n.baxia-dialog-mask {\n position: absolute;\
n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background: #000;\n
opacity: .5;\n filter:alpha(opacity=50);\n}\n\n.sufei-dialog {\n opacity: 0;\n}\
n\n.baxia-dialog-close {\n position: absolute;\n top: 20px;\n right: 24px;\n
cursor: pointer;\n transform: scaleY(0.8);\n -ms-transform: scaleY(0.8);\n /* IE
9 */\n -moz-transform: scaleY(0.8);\n /* Firefox */\n -webkit-transform:
scaleY(0.8);\n /* Safari 和 Chrome */\n -o-transform: scaleY(0.8);\n font-size:
16px;\n /* padding:10px; */\n width: 10px;\n height: 10px;\n}\n\n.baxia-dialog-
content {\n position: absolute;\n margin: auto;\n left: 0;\n right: 0;\n top:
0;\n bottom: 0;\n width: 420px;\n /* min-width: 420px; */\n height: 320px;\n}\
n\n.baxia-mobile .baxia-dialog-content {\n position: absolute;\n width: 100%;\n
height: 100%;\n margin: 0;\n min-width: auto;\n top: 0;\n left: 0;\n}\n\
n.baxia-mobile .baxia-dialog-content iframe {\n border-radius: 0;\n}\n\n.baxia-
dialog.map .baxia-dialog-content {\n height: 100%;\n width: 100%;\n position:
static;\n margin: 0;\n /* height: 700px;\n min-width: 800px;\n left: 50%;\n
top: 50%;\n margin: -350px 0 0 -400px; */\n}\n.baxia-dialog.map .baxia-dialog-
mask{\n display: none;\n}\n\n.baxia-dialog-content iframe {\n width: 100%;\n
height: 100%;\n border: 0;\n background: #fff;\n border-radius: 18px;\n}\n\
n.baxia-ios-fix-fixed .baxia-dialog {\n position: absolute;\n}\n@media screen and
(max-height:720px) {\n .baxia-dialog-content.map {\n top: 50%;\n left: 50%;\
n min-width: 520px;\n height: 520px;\n margin: -260px 0 0 -260px;\n }\n}\
n\n.custom-dialog-wrapper .nc-container .nc_scale span{\n height: auto;\n}");
var T = document,
S = function(e, t, n, i) {
if (!e)
return t();
var o = T.getElementsByTagName("script")[0],
r = T.createElement("script");
if (r.async = !0, r.src = e, i && (r.bxOriginUrl = i),
e.indexOf("alicdn") > -1 && (r.crossOrigin = !0), r.onerror = function(t) {
s("function:loadJS. msg:" + e + "load error。props:" +
JSON.stringify(n)),
r.onerror = null
}, t) {
var a = !1;
r.onload = r.onreadystatechange = function() {
a || r.readyState && !/loaded|complete/.test(r.readyState) ||
(r.onload = r.onreadystatechange = null, a = !0, t())
}
}
o.parentNode.insertBefore(r, o)
},
O = null,
C = l(),
k = function(e) {
if (e.renderNC = e.renderNC || location.search.indexOf("renderNC") > -
1, e.renderNC)
if (function(e) {
if (e && !document.getElementById(e.id))
return !1;
var t = e && e.querySelector(".nc_wrapper"),
n = e && e.querySelector("._nc");
return !!t || !!n
}(e.renderTo))
console.log("已经渲染或者 DOM 元素不存在");
else {
var t,
n,
i,
r = "";
e.cssLink && (t = e.cssLink, n =
document.getElementsByTagName("head")[0], (i = document.createElement("link")).type
= "text/css", i.rel = "stylesheet", i.href = t, n.appendChild(i)),
C ? (r = "register_h5", S("//g.alicdn.com/sd/nch5/index.js",
function() {
O = window.NoCaptcha,
c.bannerHidden = !1,
O.init(c),
O.setEnabled(!0)
})) : (r = "register", S("//g.alicdn.com/sd/ncpc/nc.js",
function() {
O = new window.noCaptcha(c)
}));
var a = e.verifiedCallback,
s = e.showCallback,
d = e.ncAppkey,
l = e.ncToken,
c = {
renderTo: "#" + e.renderTo.id,
appkey: void 0 === d ? "NCAPPKEY" : d,
token: void 0 === l ? "NCTOKENSTR" : l,
bannerHidden: !1,
scene: r,
replaceCallback: function(e, t, n) {
var i,
r = [];
C ? i = n.bind(this, "ok") : (i = e.success, t =
e.data),
r.push({
key: "bx-nc-ua",
value: t.n
}),
o("ncData", r),
o("ncSlideData", t),
i({
success: !0,
result: {
code: 0
}
}),
a && a()
},
language: e.ncLanguage
};
s && s()
}
},
N = function(e) {
return void 0 === e && (e = {}), "https://" + e.HOST + e.PATH
};
function E(e, t, n) {
var i = function(e, t) {
return {
data: {
slidedata: JSON.stringify(t.data),
x5secdata: e.SECDATA
},
url: N(e) + "/_____tmd_____/slide"
}
}(e, t);
R({
url: i.url,
type: "GET",
dataType: "json",
data: i.data,
success: function(e, t) {
n(!0)
},
error: function(e) {
n(!1)
}
})
}
var R = function(e) {
e = e || {};
var t = [];
for (var n in e.data)
t.push(encodeURIComponent(n) + "=" +
encodeURIComponent(e.data[n]));
t.push(("v=" + Math.random()).replace(".", ""));
var i = t.join("&"),
o = new XMLHttpRequest;
o.onreadystatechange = function() {
if (4 === o.readyState) {
var t = o.status;
t >= 200 && 300 > t ? e.success && e.success(o.responseText,
o.responseXML) : e.error && e.error(t)
}
},
"GET" === e.type ? (o.open("GET", e.url + "?" + i, !0), o.send(null)) :
"POST" === e.type && (o.open("POST", e.url, !0), o.setRequestHeader("Content-Type",
"application/x-www-form-urlencoded"), o.send(i))
},
L = document,
H = window,
I = l(),
P = "false",
q = ["captchacapslidev2", "captchascene", "captchacappuzzle",
"captcharecaptcha"];
function D(e) {
return L.querySelector(e)
}
function W(e) {
return JSON.parse(e)
}
return function(t) {
function n(e) {
return void 0 === e && (e = {}), t.call(this, e) || this
}
return function(t, n) {
function i() {
this.constructor = t
}
e(t, n),
t.prototype = null === n ? Object.create(n) : (i.prototype =
n.prototype, new i)
}(n, t), n.prototype.fail = function() {
this.forEachQueue(function(e) {
e && e.fail()
})
}, n.prototype.resend = function() {
this.forEachQueue(function(e) {
if (e.xhr) {
var t = e.xhr;
try {
t.open.apply(t, t.bxOriginXhr ? t.bxOriginXhr.openParams :
t.openParams);
var n = t._header_;
for (var i in n)
t.setRequestHeader(i, n[i]);
t.send.apply(t, t.bxOriginXhr ? t.bxOriginXhr.sendParams :
t.sendParams),
t._processing = !1
} catch (o) {
throw t.openParams && d("【Resend Step】Xhr resend error,
message: " + o.message + ", openParams: " + JSON.stringify(t && t.openParams) + ",
sendParams: " + JSON.stringify(t && t.sendParams) + ", url: " + t.responseURL + ",
stack: " + o.stack), Error(o)
}
}
})
}, n
}(function() {
function e(e) {
this.queue = [];
this.dialog = null,
this.reset(),
this.on = h.on
}
return e.prototype.handler = function(e) {
this.props = this.formatProps(e),
this.options = i("options") || {},
this.run(e)
}, e.prototype.formatProps = function(e) {
var t,
n = e && e.result;
if ("string" == typeof n && n)
try {
n = JSON.parse(n)
} catch (i) {
try {
void 0 === (t = n) && (t = ""),
n = t.substring(t.indexOf("{"), t.lastIndexOf("}") + 1),
n = JSON.parse(n + "")
} catch (i) {
throw "baxia.js data error"
}
}
return n.url = n.url || n.data && n.data.url || "", e.result = n, e
}, e.prototype.showDialog = function(e) {
var t = e.url,
n = e.h5url;
if (I && n && (t = n, e.url = n), t) {
if (this.options && (this.options.language && (t = M(t, "language="
+ this.options.language)), this.options.ncLanguage && (t = M(t, "ncLanguage=" +
this.options.ncLanguage))), t && -1 === t.indexOf("http"))
t = this.getDomain(this.currentRequest.url) + t;
var i = t.match(/action=([^&]+)/);
i && (this.props.result.action = i[1]);
var o = t.match(/pureCaptcha=([^&]+)/);
o && (this.props.result.pureCaptcha = o[1]);
var r = t.match(/pureDenyWait=([^&]+)/);
r && (this.props.result.pureDenyWait = r[1]),
this.dialog || D("#baxia-dialog-content") ? e.dialogHide ||
this.show(t) : (this.render(e), e.dialogHide || this.show(t))
}
}, e.prototype.hide = function(e) {
void 0 === e && (e = !1),
e ? this.resend() : this.fail();
try {
if (this.dialog) {
if ("none" === this.dialog.style.display)
return;
this.dialog.style.display = "none"
}
h.fire("event:dialogHide@baxia", {
validateSuccess: e
}),

You might also like