You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
261 lines
8.8 KiB
261 lines
8.8 KiB
3 years ago
|
!(function (e, t) {
|
||
|
if ("object" == typeof exports && "object" == typeof module)
|
||
|
module.exports = t();
|
||
|
else if ("function" == typeof define && define.amd) define([], t);
|
||
|
else {
|
||
|
var n = t();
|
||
|
for (var r in n) ("object" == typeof exports ? exports : e)[r] = n[r];
|
||
|
}
|
||
|
})(window, function () {
|
||
|
return (
|
||
|
(n = {}),
|
||
|
(e.m = t =
|
||
|
[
|
||
|
function (e, t, n) {
|
||
|
"use strict";
|
||
|
function r(e, t) {
|
||
|
for (var n = 0; n < t.length; n++) {
|
||
|
var r = t[n];
|
||
|
(r.enumerable = r.enumerable || !1),
|
||
|
(r.configurable = !0),
|
||
|
"value" in r && (r.writable = !0),
|
||
|
Object.defineProperty(e, r.key, r);
|
||
|
}
|
||
|
}
|
||
|
n.r(t);
|
||
|
var o = (function () {
|
||
|
function e() {
|
||
|
!(function (e, t) {
|
||
|
if (!(e instanceof t))
|
||
|
throw new TypeError("Cannot call a class as a function");
|
||
|
})(this, e);
|
||
|
}
|
||
|
return (
|
||
|
(function (e, t, n) {
|
||
|
n && r(e, n);
|
||
|
})(e, 0, [
|
||
|
{
|
||
|
key: "strOrEl2El",
|
||
|
value: function (t) {
|
||
|
if (t)
|
||
|
return t.nodeType && 1 === t.nodeType
|
||
|
? t
|
||
|
: "String" === e.getType(t)
|
||
|
? document.querySelector(t)
|
||
|
: void 0;
|
||
|
},
|
||
|
},
|
||
|
{
|
||
|
key: "getType",
|
||
|
value: function (e) {
|
||
|
return Object.prototype.toString
|
||
|
.call(e)
|
||
|
.replace(/(\[object )|(\])/g, "");
|
||
|
},
|
||
|
},
|
||
|
{
|
||
|
key: "warningLog",
|
||
|
value: function (t) {
|
||
|
e.logWarning && console.warn(" warning " + t);
|
||
|
},
|
||
|
},
|
||
|
]),
|
||
|
e
|
||
|
);
|
||
|
})();
|
||
|
function i(e, t) {
|
||
|
for (var n = 0; n < t.length; n++) {
|
||
|
var r = t[n];
|
||
|
(r.enumerable = r.enumerable || !1),
|
||
|
(r.configurable = !0),
|
||
|
"value" in r && (r.writable = !0),
|
||
|
Object.defineProperty(e, r.key, r);
|
||
|
}
|
||
|
}
|
||
|
var a = {
|
||
|
w: "900px",
|
||
|
h: "600px",
|
||
|
totolLimit: "all",
|
||
|
size: 10,
|
||
|
rate: "CNY",
|
||
|
showRank: (o.logWarning = !0),
|
||
|
showVolume: !0,
|
||
|
showCirculationRate: !0,
|
||
|
show24HTrend: !0,
|
||
|
showGlobalPrice: !1,
|
||
|
showActualMoneyIn: !1,
|
||
|
showMarketCap: !1,
|
||
|
showChangePercent: !1,
|
||
|
showHandRate: !0,
|
||
|
showCirculatingSupply: !0,
|
||
|
click: !1,
|
||
|
},
|
||
|
c = (function () {
|
||
|
function e() {
|
||
|
var t =
|
||
|
0 < arguments.length && void 0 !== arguments[0]
|
||
|
? arguments[0]
|
||
|
: "#sosobMarket",
|
||
|
n =
|
||
|
1 < arguments.length && void 0 !== arguments[1]
|
||
|
? arguments[1]
|
||
|
: {},
|
||
|
r =
|
||
|
2 < arguments.length && void 0 !== arguments[2]
|
||
|
? arguments[2]
|
||
|
: {};
|
||
|
!(function (e, t) {
|
||
|
if (!(e instanceof t))
|
||
|
throw new TypeError("Cannot call a class as a function");
|
||
|
})(this, e),
|
||
|
(this._el = o.strOrEl2El(t)),
|
||
|
(this._config = Object.assign(
|
||
|
JSON.parse(JSON.stringify(a)),
|
||
|
n
|
||
|
)),
|
||
|
(this._callbacks = r),
|
||
|
this.init();
|
||
|
}
|
||
|
return (
|
||
|
(function (e, t, n) {
|
||
|
t && i(e.prototype, t), n && i(e, n);
|
||
|
})(
|
||
|
e,
|
||
|
[
|
||
|
{
|
||
|
key: "getEl",
|
||
|
value: function () {
|
||
|
return this._el;
|
||
|
},
|
||
|
},
|
||
|
{
|
||
|
key: "getConfig",
|
||
|
value: function () {
|
||
|
return this._config;
|
||
|
},
|
||
|
},
|
||
|
{
|
||
|
key: "init",
|
||
|
value: function () {
|
||
|
var e = this._el,
|
||
|
t = this._config,
|
||
|
n = t.w,
|
||
|
r = t.h,
|
||
|
o = this.initIframe(),
|
||
|
i = this.configToUrl();
|
||
|
(e.style.width = n),
|
||
|
(e.style.height = r),
|
||
|
(o.src = i),
|
||
|
(e.innerHTML = ""),
|
||
|
e.appendChild(o);
|
||
|
},
|
||
|
},
|
||
|
{
|
||
|
key: "initIframe",
|
||
|
value: function () {
|
||
|
var e = this,
|
||
|
t = document.createElement("iframe");
|
||
|
return (
|
||
|
(t.style.cssText =
|
||
|
"width: 100%; height: 100%;border: none;margin: 0;padding: 0;"),
|
||
|
t.setAttribute("frameborder", "0"),
|
||
|
t.setAttribute("allowtransparency", "true"),
|
||
|
t.setAttribute("scrolling", "no"),
|
||
|
t.setAttribute("allowfullscreen", ""),
|
||
|
t.addEventListener("load", function () {
|
||
|
e._callbacks.load && e._callbacks.load();
|
||
|
}),
|
||
|
t
|
||
|
);
|
||
|
},
|
||
|
},
|
||
|
{
|
||
|
key: "configToUrl",
|
||
|
value: function () {
|
||
|
var t = JSON.stringify(this._config),
|
||
|
n = encodeURIComponent(t);
|
||
|
return ""
|
||
|
.concat(e.baseUrl, "?isIframe=true&config=")
|
||
|
.concat(n);
|
||
|
},
|
||
|
},
|
||
|
],
|
||
|
[
|
||
|
{
|
||
|
key: "generateHtmlCode",
|
||
|
value: function (t) {
|
||
|
return '\n\x3c!-- sosobMarket BEGIN --\x3e \n<div>\n <div id="sosobMarket"></div>\n <script type="text/javascript" src="'
|
||
|
.concat(
|
||
|
e.jsUrl,
|
||
|
'"></script>\n <script type="text/javascript">\n new sosobMarket(\n \'#sosobMarket\',\n '
|
||
|
)
|
||
|
.concat(
|
||
|
JSON.stringify(t),
|
||
|
"\n );\n </script>\n</div>\n\x3c!-- sosobMarket END --\x3e\n"
|
||
|
);
|
||
|
},
|
||
|
},
|
||
|
]
|
||
|
),
|
||
|
e
|
||
|
);
|
||
|
})();
|
||
|
(c.baseUrl = "https://www.sosob.io/market"),
|
||
|
(c.jsUrl = "https://www.sosob.io/static/js/sosobMarket.min.js"),
|
||
|
(window.sosobMarket = c);
|
||
|
},
|
||
|
]),
|
||
|
(e.c = n),
|
||
|
(e.d = function (t, n, r) {
|
||
|
e.o(t, n) || Object.defineProperty(t, n, { enumerable: !0, get: r });
|
||
|
}),
|
||
|
(e.r = function (e) {
|
||
|
"undefined" != typeof Symbol &&
|
||
|
Symbol.toStringTag &&
|
||
|
Object.defineProperty(e, Symbol.toStringTag, { value: "Module" }),
|
||
|
Object.defineProperty(e, "__esModule", { value: !0 });
|
||
|
}),
|
||
|
(e.t = function (t, n) {
|
||
|
if ((1 & n && (t = e(t)), 8 & n)) return t;
|
||
|
if (4 & n && "object" == typeof t && t && t.__esModule) return t;
|
||
|
var r = Object.create(null);
|
||
|
if (
|
||
|
(e.r(r),
|
||
|
Object.defineProperty(r, "default", { enumerable: !0, value: t }),
|
||
|
2 & n && "string" != typeof t)
|
||
|
)
|
||
|
for (var o in t)
|
||
|
e.d(
|
||
|
r,
|
||
|
o,
|
||
|
function (e) {
|
||
|
return t[e];
|
||
|
}.bind(null, o)
|
||
|
);
|
||
|
return r;
|
||
|
}),
|
||
|
(e.n = function (t) {
|
||
|
var n =
|
||
|
t && t.__esModule
|
||
|
? function () {
|
||
|
return t.default;
|
||
|
}
|
||
|
: function () {
|
||
|
return t;
|
||
|
};
|
||
|
return e.d(n, "a", n), n;
|
||
|
}),
|
||
|
(e.o = function (e, t) {
|
||
|
return Object.prototype.hasOwnProperty.call(e, t);
|
||
|
}),
|
||
|
(e.p = ""),
|
||
|
e((e.s = 0))
|
||
|
);
|
||
|
function e(r) {
|
||
|
if (n[r]) return n[r].exports;
|
||
|
var o = (n[r] = { i: r, l: !1, exports: {} });
|
||
|
return t[r].call(o.exports, o, o.exports, e), (o.l = !0), o.exports;
|
||
|
}
|
||
|
var t, n;
|
||
|
});
|