PageSourceSearch

https://ngame11.com/resources/default/js/new_jackpotjs.js

js ngame11.com collected 2026-10-08 08:11:35 UTC 12,963 bytes, 150 lines download raw bytes

1! function() {
2    "use strict";
3    var i = [],
4        a = null,
5        e = "Intl" in window && "NumberFormat" in Intl;
6    var n = (t.prototype.sendRealRequest = function(t) {
7        var i;
8        if (null == this.frame && (this.frame = document.createElement("iframe"), this.frame.style.height = "0px", this.frame.style.width = "0px", this.frame.style.border = "0px", this.frame.style.visibility = "hidden", this.frame.style.position = "absolute", document.body.appendChild(this.frame)), null != this.frame.contentDocument ? i = this.frame.contentDocument : null != this.frame.contentWindow && (i = this.frame.contentWindow.document), null == i) return null == this.binding && (this.binding = this.sendRealRequest.bind(this, t)), void setTimeout(this.binding, 100);
9        this.tickerIndex = t, i.open(), i.write('<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/><script type="text/javascript" >var xmlstring = {};<\/script><script type="text/javascript" src="' + this.url + '"><\/script></head><body></body></html>'), i.close(), this.interval = window.setInterval(this.checkDataAvailability.bind(this), 250)
10    }, t.prototype.checkDataAvailability = function() {
11        var t = null;
12        null != this.frame.contentWindow ? "jpxml" in this.frame.contentWindow.xmlstring && (t = this.frame.contentWindow.xmlstring) : null != this.frame.contentDocument && "jpxml" in this.frame.xmlstring && (t = this.frame.xmlstring), null != t && (clearInterval(this.interval), this.interval = -1, i[this.tickerIndex].handleResponse(t))
13    }, t.prototype.isDownloading = function() {
14        return -1 != this.interval
15    }, t);
16
17    function t(t) {
18        this.url = t, this.errormsg = null, this.binding = null, this.interval = -1
19    }
20    var s = (p.prototype.attachToTextBox = function(t) {
21        // this.textbox = document.getElementById(t)
22        this.textbox = document.querySelectorAll(t)
23    }, p.prototype.debugTextBox = function(t) {
24        this.debug = document.getElementById(t)
25    }, p.prototype.SetCurrencySign = function(t) {
26        "count" != this.type && (this.sign = t)
27    }, p.prototype.SetCurrencyPos = function(t) {
28        "count" != this.type && (this.signpos = t)
29    }, p.prototype.countdown = function() {
30        10 == this.countDownTick && (this.countDownTick = 0), this.countDownTick++, 5 < this.countDownTick && (this.countDownValue = this.parseCountdown()), this.showJackpot(), setTimeout(this.countdownbinding, 1e3)
31    }, p.prototype.tick = function() {
32        0 != this.setup && null != this.textbox && (0 == this.tickerStartTime || 0 != this.ticking ? (-1 == this.countDownTick && 0 != this.countDownTarget && (this.countDownTick = 0, this.countdown()), this.maybeUpdateData(), this.showJackpot(), setTimeout(this.binding, this.updateInterval)) : this.showJackpot())
33    }, p.prototype.handleResponse = function(t) {
34        var i, e, n = this.tickerEndSum,
35            s = 0,
36            r = 0,
37            o = 0,
38            a = t.endTime - t.startTime + 60 * t.execInterval + 180;
39        if (this.downloadInterval = 1e3 * a, this.tickingPeriod = this.downloadInterval + 6e4, null != (i = p.parseFromString(t.jpxml)))
40            if (4 == this.info && 2 == this.local) {
41                var h = this.findTargetNodes(i);
42                if (h && 0 < h.length) {
43                    for (var c = n = 0; c < h.length; c++) {
44                        var u = h[c],
45                            l = 0;
46                        "sum" == this.type ? l = parseFloat(u.getAttribute("wins")) : "count" == this.type ? l = parseFloat(u.getAttribute("winc")) : u.firstChild && u.firstChild.nodeValue && (l = parseFloat(u.firstChild.nodeValue)), isNaN(l) || (n += l), s += isNaN(parseFloat(u.getAttribute("seed"))) ? 0 : parseFloat(u.getAttribute("seed")), r += isNaN(parseFloat(u.getAttribute("step"))) ? 0 : parseFloat(u.getAttribute("step"))
47                    }
48                    0 == n && (n = this.tickerEndSum), null == this.sign && (this.sign = h[0].getAttribute("sign"), 3 == this.sign.length && (this.sign = " " + this.currency.toUpperCase(), this.signpos = 1)), -1 == this.signpos && (this.signpos = parseInt(h[0].getAttribute("pos")))
49                }
50            } else null != (e = this.findTargetNode(i)) && ("sum" == this.type ? n = parseFloat(e.getAttribute("wins")) : "count" == this.type ? n = parseFloat(e.getAttribute("winc")) : e.firstChild && e.firstChild.nodeValue && (n = parseFloat(e.firstChild.nodeValue)), 1 == isNaN(n) && (n = this.tickerEndSum), null == this.sign && (this.sign = e.getAttribute("sign"), 3 == this.sign.length && (this.sign = " " + this.currency.toUpperCase(), this.signpos = 1)), -1 == this.signpos && (this.signpos = parseInt(e.getAttribute("pos"))), s = parseFloat(e.getAttribute("seed")), r = parseFloat(e.getAttribute("step")), o = p.parseFromUnixString(e.getAttribute("guaranteedHitTime")), 1 == isNaN(s) && (s = 0), 1 == isNaN(r) && (r = 0), 1 == isNaN(o) && (o = 0));
51        this.setJackpot(n, s, r, o)
52    }, p.prototype.parseCountdown = function() {
53        var t = (new Date).getTime(),
54            i = this.countDownTarget - t;
55        i < 0 && (i = 0);
56        var e = 24 * Math.floor(i / 864e5) + Math.floor(i % 864e5 / 36e5),
57            n = Math.floor(i % 36e5 / 6e4),
58            s = Math.floor(i % 6e4 / 1e3);
59        return this.prettyTime(e) + ":" + this.prettyTime(n) + ":" + this.prettyTime(s)
60    }, p.prototype.prettyTime = function(t) {
61        return t < 10 ? "0" + t.toString() : t.toString()
62    }, p.parseFromUnixString = function(t) {
63        var i = NaN;
64        return null != t && 0 != t.length && (i = 1e3 * parseInt(t)), i
65    }, p.parseFromString = function(t) {
66        if ("" == t) return null;
67        if ("DOMParser" in window) return (new DOMParser).parseFromString(t, "text/xml");
68        try {
69            var i = new ActiveXObject("Microsoft.XMLDOM");
70            return i.async = !1, i.loadXML(t), i
71        } catch (t) {
72            return a = t.toString(), null
73        }
74    }, p.prototype.findTargetNodes = function(t) {
75        if ("count" == this.type) return t.getElementsByTagName("total");
76        for (var i = [], e = t.getElementsByTagName("amount"), n = 0; n < e.length; n++) e[n].getAttribute("currency").toLowerCase() == this.currency && i.push(e[n]);
77        return i
78    }, p.prototype.findTargetNode = function(t) {
79        var i, e = t;
80        if (4 == this.info) {
81            for (var n = !1, s = t.getElementsByTagName("total"), r = 0; r < s.length; r++) s[r].getAttribute("local") == this.local.toString() && (e = s[r], n = !0);
82            if (0 == n) return null;
83            if ("count" == this.type) return e
84        }
85        if ("count" == this.type) i = e.getElementsByTagName(this.countElement)[0];
86        else if (5 == this.info)
87            for (var o = e.getElementsByTagName("amount"), a = 0; a < o.length; a++) o[a].getAttribute("currency").toLowerCase() == this.currency && (i = o[a]);
88        else
89            for (o = e.getElementsByTagName("amount"), a = 0; a < o.length; a++)
90                if (o[a].getAttribute("currency").toLowerCase() == this.currency) {
91                    i = o[a];
92                    break
93                } return i
94    }, p.prototype.setJackpot = function(t, i, e, n) {
95        this.tickerEndSum = t;
96        var s = this.getJackpot(),
97            r = Math.round(this.tickingPeriod / this.updateInterval * 1e11) / 1e11;
98        if (0 < e ? (this.tickerStartSum = Math.max(this.tickerEndSum - e * this.tickingPeriod / 1e3, this.tickerEndSum * this.startPercent / 100, i), this.tickerStartSum = Math.max(this.tickerStartSum, s), this.tickStep = Math.min(e, (this.tickerEndSum - this.tickerStartSum) / r)) : (this.tickerStartSum = this.tickerEndSum * this.startPercent / 100, this.tickerStartSum = Math.max(this.tickerStartSum, s), this.tickStep = (this.tickerEndSum - this.tickerStartSum) / r), this.tickerStartTime = (new Date).getTime(), this.countDownTarget = n, null != this.debug) {
99            var o = "";
100            1 == this.info && (o += "GameTicker: " + this.game + "/" + (this.casino ? this.casino : "global") + "/" + this.currency), 2 == this.info && (o += "CasinoTicker: " + this.casino + "/" + this.currency), 4 == this.info && (o += "TotalTicker: " + (2 == this.local ? "(local+global) " : 1 == this.local ? "(local) " : "global ") + this.currency), 5 == this.info && (o += "GroupTicker: " + this.group + "/" + this.currency), this.type && (o += " - " + this.type), this.debug.innerHTML = null == a ? o + "<br>StartSum: " + this.tickerStartSum + "<br>EndSum: " + this.tickerEndSum + "<br>TickingPeriod: " + this.tickingPeriod + "<br>TickingStep: " + this.tickStep + "<br>" + this.url : o + "<br>" + a
101        }
102    }, p.prototype.getJackpot = function() {
103        var t = (new Date).getTime();
104        if (0 == this.tickerStartTime) return 0;
105        if (0 == this.ticking) return this.tickerEndSum;
106        var i = (t - this.tickerStartTime) / this.updateInterval;
107        return this.tickerStartSum + i * this.tickStep
108    }, p.prototype.maybeUpdateData = function() {
109        if (null == this.xhr || 1 != this.xhr.isDownloading()) {
110            var t = (new Date).getTime();
111            return t > this.downloadTime + this.downloadInterval ? (this.downloadTime = t, null == this.xhr && (this.xhr = new n(this.url)), void this.xhr.sendRealRequest(this.index)) : void 0
112        }
113    }, p.prototype.showJackpot = function() {
114        var t, i = this.getJackpot();
115        0 != i ? (t = "count" == this.type ? i.toString() : 5 < this.countDownTick && "" != this.countDownValue ? this.countDownValue : (t = 1 == e ? i.toLocaleString(void 0, {
116            minimumFractionDigits: 2,
117            maximumFractionDigits: 2
118        }) : (Math.round(100 * i) / 100).toFixed(2), 0 != this.signpos ? t + this.sign : this.sign + t), this.textbox.forEach(tb => {tb.innerHTML = t})) : this.textbox.forEach(tb => {tb.innerHTML = "UPDATING"})
119    }, p);
120
121    function p(t) {
122        if ("info" in t != 0) {
123            switch (this.tickingPeriod = 12e4, this.downloadInterval = 119e3, this.updateInterval = 59, this.startPercent = 99, this.countDownTarget = 0, this.countDownValue = "", this.countDownTick = -1, this.tickStep = 0, this.tickerStartSum = 0, this.tickerEndSum = 0, this.tickerStartTime = 0, this.ticking = !0, this.url = "", this.downloadTime = 0, this.type = "", this.setup = !1, this.currency = null, this.casino = null, this.countElement = null, this.currency = null != t.currency ? t.currency.toLowerCase() : "usd", this.info = t.info, this.signpos = -1, this.binding = this.tick.bind(this), this.countdownbinding = this.countdown.bind(this), t.root_url ? this.url = t.root_url : this.url = function() {
124                    for (var t = document.getElementsByTagName("script"), i = 0; i < t.length; i++)
125                        if (t[i].src.indexOf("new_jackpotjs.js") == t[i].src.length - 16) return t[i].src.replace(/jackpots\/new_jackpotjs.js.*/, "");
126                    throw new Error("could not determine data endpoint")
127                }(), t.info) {
128                case 1:
129                    if (null == t.game || 1 == t.local && null == t.casino) return;
130                    this.countElement = "game", null != t.casino && (this.casino = t.casino.toLowerCase()), this.game = t.game.toLowerCase(), this.setup = !0;
131                    break;
132                case 2:
133                    if (null == t.casino) return;
134                    this.countElement = "casinodata", this.casino = t.casino.toLowerCase(), this.setup = !0;
135                    break;
136                case 4:
137                    this.local = 1 == t.local || 0 == t.local ? t.local : 2, this.setup = !0;
138                    break;
139                case 5:
140                    if (null == t.group) return;
141                    this.countElement = "game", this.group = t.group.toLowerCase(), this.setup = !0;
142                    break;
143                default:
144                    return
145            }
146            1 == t.info ? this.url += "js?info=" + t.info + "&casino=" + t.casino + "&game=" + t.game : 2 == t.info ? this.url += "js?info=" + t.info + "&casino=" + t.casino : 4 == t.info ? (this.url += "js?info=" + t.info, null != t.casino && (this.url += "&casino=" + t.casino)) : 5 == t.info && (this.url += "js?info=" + t.info + "&group=" + t.group + "&casino=" + t.casino), null != t.currency && (this.url += "&currency=" + t.currency), null != t.type && (this.url += "&type=" + t.type), "local" in t && (this.url += "&local=" + t.local, this.local = 1 == t.local || 0 == t.local ? t.local : 2, this.setup = !0), "pos" in t && (this.url += "&pos=" + t.pos.toString()), null != t.sign && (this.url += "&sign=" + t.sign), this.setup = !0, "count" != t.type && "sum" != t.type || (this.ticking = !1, this.type = t.type, "count" == this.type && (this.sign = "")), this.index = i.length, i.push(this)
147        }
148    }
149    window.Ticker = s
150}();

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.