PageSourceSearch

https://abulife.az/assets/tenant/frontend/js/jquery.syotimer.min.js

js abulife.az collected 2026-10-02 01:17:29 UTC 8,153 bytes, 116 lines download raw bytes

1/**
2 * SyoTimer v.2.1.3 | under MIT licence
3 * http://syomochkin.xyz/folio/syotimer/demo.html
4 */
5! function(i, e) { "function" == typeof define && define.amd ? define(["jquery"], i) : "object" == typeof module && module.exports ? module.exports = function(e, t) { return void 0 === t && (t = "undefined" != typeof window ? require("jquery") : require("jquery")(e)), i(t), t } : i(e) }(function(l) {
6    var m = "day",
7        a = "hour",
8        s = "min",
9        r = "sec",
10        n = { d: m, h: a, m: s, s: r },
11        d = { list: [r, s, a, m], next: function(e) { e = this.list.indexOf(e); return e < this.list.length && this.list[e + 1] }, prev: function(e) { e = this.list.indexOf(e); return 0 < e && this.list[e - 1] } },
12        o = { year: 2034, month: 7, day: 31, hour: 0, min: 0, sec: 0, timeZone: "local", ignoreTransferTime: !1, layout: "dhms", periodic: !1, periodInterval: 7, periodUnit: "d", doubleNumbers: !0, effectType: "none", lang: "eng", headTitle: "", footTitle: "", afterDeadline: function(e) { e.bodyBlock.html('<p style="font-size: 1.2em;">The countdown is finished!</p>') } },
13        u = { sec: !1, min: !1, hour: !1, day: !1 },
14        c = {
15            init: function(e) {
16                var t = l.extend({}, o, e || {});
17                t.itemTypes = y.getItemTypesByLayout(t.layout), t._itemsHas = l.extend({}, u);
18                for (var i = 0; i < t.itemTypes.length; i++) t._itemsHas[t.itemTypes[i]] = !0;
19                return this.each(function() { l(this).data("syotimer-options", t), c._render.apply(this, []), c._persecHandler.apply(this, []) })
20            },
21            _render: function() {
22                for (var e = l(this), t = e.data("syotimer-options"), i = y.getTimerItem(), n = l("<div/>", { class: "syotimer__head" }).html(t.headTitle), o = l("<div/>", { class: "syotimer__body" }), r = l("<div/>", { class: "syotimer__footer" }).html(t.footTitle), a = {}, s = 0; s < t.itemTypes.length; s++) {
23                    var d = i.clone();
24                    d.addClass("syotimer-cell_type_" + t.itemTypes[s]), o.append(d), a[t.itemTypes[s]] = d
25                }
26                var u = { headBlock: n, bodyBlock: o, footBlock: r };
27                e.data("syotimer-blocks", u).data("syotimer-items", a).addClass("syotimer").append(n).append(o).append(r)
28            },
29            _persecHandler: function() {
30                var e = l(this),
31                    t = e.data("syotimer-options");
32                l(".syotimer-cell > .syotimer-cell__value", e).css("opacity", 1);
33                var i = new Date,
34                    n = new Date(t.year, t.month - 1, t.day, t.hour, t.min, t.sec),
35                    n = y.getDifferenceWithTimezone(i, n, t),
36                    n = y.getsecsToDeadLine(n, t);
37                0 <= n ? (c._refreshUnitsDom.apply(this, [n]), c._applyEffectSwitch.apply(this, [t.effectType])) : (e = l.extend(e, e.data("syotimer-blocks")), t.afterDeadline(e))
38            },
39            _refreshUnitsDom: function(e) {
40                var t = l(this),
41                    i = t.data("syotimer-options"),
42                    n = t.data("syotimer-items"),
43                    o = i.itemTypes,
44                    r = y.getUnitsToDeadLine(e);
45                i._itemsHas.day || (r.hour += 24 * r.day), i._itemsHas.hour || (r.min += 60 * r.hour), i._itemsHas.min || (r.sec += 60 * r.min);
46                for (var a = 0; a < o.length; a++) {
47                    var s = o[a],
48                        d = r[s],
49                        u = n[s];
50                    u.data("syotimer-unit-value", d), l(".syotimer-cell__value", u).html(y.format2(d, s !== m && i.doubleNumbers)), l(".syotimer-cell__unit", u).html(l.syotimerLang.getNumeral(d, i.lang, s))
51                }
52            },
53            _applyEffectSwitch: function(e, t) {
54                t = t || r;
55                var i, n = this,
56                    o = l(n);
57                "none" === e ? setTimeout(function() { c._persecHandler.apply(n, []) }, 1e3) : "opacity" !== e || (i = o.data("syotimer-items")[t]) && (o = d.next(t), t = i.data("syotimer-unit-value"), l(".
57syotimer-cell__value", i).animate({ opacity: .1 }, 1e3, "linear", function() { c._persecHandler.apply(n, []) }), o && 0 === t && c._applyEffectSwitch.apply(n, [e, o]))
58            }
59        },
60        y = {
61            getTimerItem: function() {
62                var e = l("<div/>", { class: "syotimer-cell__value", text: "0" }),
63                    t = l("<div/>", { class: "syotimer-cell__unit" }),
64                    i = l("<div/>", { class: "syotimer-cell" });
65                return i.append(e).append(t), i
66            },
67            getItemTypesByLayout: function(e) { for (var t = [], i = 0; i < e.length; i++) t.push(n[e[i]]); return t },
68            getsecsToDeadLine: function(e, t) {
69                var i, n, o = e / 1e3,
70                    o = Math.floor(o),
71                    o = t.periodic ? (e = e / (1e3 * (n = y.getPeriodUnit(t.periodUnit))), e = Math.ceil(e), e = Math.abs(e), 0 <= o ? (i = 0 === (i = e % t.periodInterval) ? t.periodInterval : i, --i) : i = t.periodInterval - e % t.periodInterval, 0 == (t = o % n) && o < 0 && i--, Math.abs(i * n + t)) : o;
72                return o
73            },
74            getUnitsToDeadLine: function(e) {
75                var t = m,
76                    i = {};
77                do { var n = y.getPeriodUnit(t) } while (i[t] = Math.floor(e / n), e %= n, t = d.prev(t));
78                return i
79            },
80            getPeriodUnit: function(e) {
81                switch (e) {
82                    case "d":
83                    case m:
84                        return 86400;
85                    case "h":
86                    case a:
87                        return 3600;
88                    case "m":
89                    case s:
90                        return 60;
91                    case "s":
92                    case r:
93                        return 1
94                }
95            },
96            getDifferenceWithTimezone: function(e, t, i) {
97                var n = t.getTime() - e.getTime(),
98                    o = 0,
99                    r = 0;
100                return "local" !== i.timeZone && (o = 1e3 * (parseFloat(i.timeZone) * y.getPeriodUnit(a) - -e.getTimezoneOffset() * y.getPeriodUnit(s))), i.ignoreTransferTime && (r = 1e3 * (-e.getTimezoneOffset() * y.getPeriodUnit(s) - -t.getTimezoneOffset() * y.getPeriodUnit(s))), n - (o + r)
101            },
102            format2: function(e, t) { return t = !1 !== t, e <= 9 && t ? "0" + e : "" + e }
103        },
104        i = {
105            setOption: function(e, t) {
106                var i = l(this),
107                    n = i.data("syotimer-options");
108                n.hasOwnProperty(e) && (n[e] = t, i.data("syotimer-options", n))
109            }
110        };
111    l.fn.syotimer = function(e) {
112        if ("string" == typeof e && "setOption" === e) { var t = Array.prototype.slice.call(arguments, 1); return this.each(function() { i[e].apply(this, t) }) }
113        if (null == e || "object" == typeof e) return c.init.apply(this, [e]);
114        l.error("SyoTimer. Error in call methods: methods is not exist")
115    }, l.syotimerLang = { rus: { sec: ["секунда", "секунды", "секунд"], min: ["минута", "минуты", "минут"], hour: ["час", "часа", "часов"], day: ["день", "дня", "дней"], handler: "rusNumeral" }, eng: { sec: ["sec", "sec"], min: ["min", "min"], hour: ["hour", "hour"], day: ["day", "day"] }, por: { sec: ["segundo", "segundos"], min: ["minuto", "minutos"], hour: ["hora", "horas"], day: ["dia", "dias"] }, spa: { sec: ["segundo", "segundos"], min: ["minuto", "minutos"], hour: ["hora", "horas"], day: ["día", "días"] }, heb: { sec: ["שניה", "שניות"], min: ["דקה", "דקות"], hour: ["שעה", "שעות"], day: ["יום", "ימים"] }, universal: function(e) { return 1 === e ? 0 : 1 }, rusNumeral: function(e) { e = 4 < e % 100 && e % 100 < 20 ? 2 : [2, 0, 1, 1, 1, 2][e % 10 < 5 ? e % 10 : 5]; return e }, getNumeral: function(e, t, i) { e = this[l.syotimerLang[t].handler || "universal"](e); return l.syotimerLang[t][i][e] } }
116}, window.jQuery);

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.