lavkach3

Форк
0
503 строки · 13.6 Кб
1
!(function (a) {
2
  a(["jquery"], function (a) {
3
    return (function () {
4
      function h(a, b, c) {
5
        return u({
6
          type: e.error,
7
          iconClass: v().iconClasses.error,
8
          message: a,
9
          optionsOverride: c,
10
          title: b,
11
        });
12
      }
13
      function i(c, d) {
14
        return (
15
          c || (c = v()),
16
          (b = a("#" + c.containerId)),
17
          b.length ? b : (d && (b = r(c)), b)
18
        );
19
      }
20
      function j(a, b, c) {
21
        return u({
22
          type: e.info,
23
          iconClass: v().iconClasses.info,
24
          message: a,
25
          optionsOverride: c,
26
          title: b,
27
        });
28
      }
29
      function k(a) {
30
        c = a;
31
      }
32
      function l(a, b, c) {
33
        return u({
34
          type: e.success,
35
          iconClass: v().iconClasses.success,
36
          message: a,
37
          optionsOverride: c,
38
          title: b,
39
        });
40
      }
41
      function m(a, b, c) {
42
        return u({
43
          type: e.warning,
44
          iconClass: v().iconClasses.warning,
45
          message: a,
46
          optionsOverride: c,
47
          title: b,
48
        });
49
      }
50
      function n(a, c) {
51
        var d = v();
52
        b || i(d), q(a, d, c) || p(d);
53
      }
54
      function o(c) {
55
        var d = v();
56
        return (
57
          b || i(d),
58
          c && 0 === a(":focus", c).length
59
            ? void w(c)
60
            : void (b.children().length && b.remove())
61
        );
62
      }
63
      function p(c) {
64
        for (var d = b.children(), e = d.length - 1; e >= 0; e--) q(a(d[e]), c);
65
      }
66
      function q(b, c, d) {
67
        var e = !(!d || !d.force) && d.force;
68
        return (
69
          !(!b || (!e && 0 !== a(":focus", b).length)) &&
70
          (b[c.hideMethod]({
71
            duration: c.hideDuration,
72
            easing: c.hideEasing,
73
            complete: function () {
74
              w(b);
75
            },
76
          }),
77
          !0)
78
        );
79
      }
80
      function r(c) {
81
        return (
82
          (b = a("<div/>")
83
            .attr("id", c.containerId)
84
            .addClass("toast-container")
85
            .addClass(c.positionClass)),
86
          b.appendTo(a(c.target)),
87
          b
88
        );
89
      }
90
      function s() {
91
        return {
92
          tapToDismiss: !0,
93
          toastClass: "toast",
94
          containerId: "toast-container",
95
          debug: !1,
96
          showMethod: "fadeIn",
97
          showDuration: 300,
98
          showEasing: "swing",
99
          onShown: void 0,
100
          hideMethod: "fadeOut",
101
          hideDuration: 1e3,
102
          hideEasing: "swing",
103
          onHidden: void 0,
104
          closeMethod: !1,
105
          closeDuration: !1,
106
          closeEasing: !1,
107
          closeOnHover: !0,
108
          extendedTimeOut: 1e3,
109
          iconClasses: {
110
            error: "toast-error",
111
            info: "toast-info",
112
            success: "toast-success",
113
            warning: "toast-warning",
114
          },
115
          iconClass: "toast-info",
116
          positionClass: "toast-top-right",
117
          timeOut: 5e3,
118
          titleClass: "toast-title",
119
          messageClass: "toast-message",
120
          escapeHtml: !1,
121
          target: "body",
122
          closeHtml: '<button type="button">&times;</button>',
123
          closeClass: "toast-close-button",
124
          newestOnTop: !0,
125
          preventDuplicates: !1,
126
          progressBar: !1,
127
          progressClass: "toast-progress",
128
          rtl: !1,
129
        };
130
      }
131
      function t(a) {
132
        c && c(a);
133
      }
134
      function u(c) {
135
        function q(a) {
136
          return (
137
            null == a && (a = ""),
138
            a
139
              .replace(/&/g, "&amp;")
140
              .replace(/"/g, "&quot;")
141
              .replace(/'/g, "&#39;")
142
              .replace(/</g, "&lt;")
143
              .replace(/>/g, "&gt;")
144
          );
145
        }
146
        function r() {
147
          y(), A(), B(), C(), D(), E(), z(), s();
148
        }
149
        function s() {
150
          var a = "";
151
          switch (c.iconClass) {
152
            case "toast-success":
153
            case "toast-info":
154
              a = "polite";
155
              break;
156
            default:
157
              a = "assertive";
158
          }
159
          j.attr("aria-live", a);
160
        }
161
        function u() {
162
          e.closeOnHover && j.hover(I, H),
163
            !e.onclick && e.tapToDismiss && j.click(G),
164
            e.closeButton &&
165
              n &&
166
              n.click(function (a) {
167
                a.stopPropagation
168
                  ? a.stopPropagation()
169
                  : void 0 !== a.cancelBubble &&
170
                    a.cancelBubble !== !0 &&
171
                    (a.cancelBubble = !0),
172
                  e.onCloseClick && e.onCloseClick(a),
173
                  G(!0);
174
              }),
175
            e.onclick &&
176
              j.click(function (a) {
177
                e.onclick(a), G();
178
              });
179
        }
180
        function x() {
181
          j.hide(),
182
            j[e.showMethod]({
183
              duration: e.showDuration,
184
              easing: e.showEasing,
185
              complete: e.onShown,
186
            }),
187
            e.timeOut > 0 &&
188
              ((h = setTimeout(G, e.timeOut)),
189
              (o.maxHideTime = parseFloat(e.timeOut)),
190
              (o.hideEta = new Date().getTime() + o.maxHideTime),
191
              e.progressBar && (o.intervalId = setInterval(J, 10)));
192
        }
193
        function y() {
194
          c.iconClass && j.addClass(e.toastClass).addClass(f);
195
        }
196
        function z() {
197
          e.newestOnTop ? b.prepend(j) : b.append(j);
198
        }
199
        function A() {
200
          if (c.title) {
201
            var a = c.title;
202
            e.escapeHtml && (a = q(c.title)),
203
              k.append(a).addClass(e.titleClass),
204
              j.append(k);
205
          }
206
        }
207
        function B() {
208
          if (c.message) {
209
            var a = c.message;
210
            e.escapeHtml && (a = q(c.message)),
211
              l.append(a).addClass(e.messageClass),
212
              j.append(l);
213
          }
214
        }
215
        function C() {
216
          e.closeButton &&
217
            (n.addClass(e.closeClass).attr("role", "button"), j.prepend(n));
218
        }
219
        function D() {
220
          e.progressBar && (m.addClass(e.progressClass), j.prepend(m));
221
        }
222
        function E() {
223
          e.rtl && j.addClass("rtl");
224
        }
225
        function F(a, b) {
226
          if (a.preventDuplicates) {
227
            if (b.message === g) return !0;
228
            g = b.message;
229
          }
230
          return !1;
231
        }
232
        function G(b) {
233
          var c = b && e.closeMethod !== !1 ? e.closeMethod : e.hideMethod,
234
            d = b && e.closeDuration !== !1 ? e.closeDuration : e.hideDuration,
235
            f = b && e.closeEasing !== !1 ? e.closeEasing : e.hideEasing;
236
          if (!a(":focus", j).length || b)
237
            return (
238
              clearTimeout(o.intervalId),
239
              j[c]({
240
                duration: d,
241
                easing: f,
242
                complete: function () {
243
                  w(j),
244
                    clearTimeout(h),
245
                    e.onHidden && "hidden" !== p.state && e.onHidden(),
246
                    (p.state = "hidden"),
247
                    (p.endTime = new Date()),
248
                    t(p);
249
                },
250
              })
251
            );
252
        }
253
        function H() {
254
          (e.timeOut > 0 || e.extendedTimeOut > 0) &&
255
            ((h = setTimeout(G, e.extendedTimeOut)),
256
            (o.maxHideTime = parseFloat(e.extendedTimeOut)),
257
            (o.hideEta = new Date().getTime() + o.maxHideTime));
258
        }
259
        function I() {
260
          clearTimeout(h),
261
            (o.hideEta = 0),
262
            j.stop(!0, !0)[e.showMethod]({
263
              duration: e.showDuration,
264
              easing: e.showEasing,
265
            });
266
        }
267
        function J() {
268
          var a = ((o.hideEta - new Date().getTime()) / o.maxHideTime) * 100;
269
          m.width(a + "%");
270
        }
271
        var e = v(),
272
          f = c.iconClass || e.iconClass;
273
        if (
274
          ("undefined" != typeof c.optionsOverride &&
275
            ((e = a.extend(e, c.optionsOverride)),
276
            (f = c.optionsOverride.iconClass || f)),
277
          !F(e, c))
278
        ) {
279
          d++, (b = i(e, !0));
280
          var h = null,
281
            j = a("<div/>"),
282
            k = a("<div/>"),
283
            l = a("<div/>"),
284
            m = a("<div/>"),
285
            n = a(e.closeHtml),
286
            o = { intervalId: null, hideEta: null, maxHideTime: null },
287
            p = {
288
              toastId: d,
289
              state: "visible",
290
              startTime: new Date(),
291
              options: e,
292
              map: c,
293
            };
294
          return r(), x(), u(), t(p), e.debug && console && console.log(p), j;
295
        }
296
      }
297
      function v() {
298
        return a.extend({}, s(), f.options);
299
      }
300
      function w(a) {
301
        b || (b = i()),
302
          a.is(":visible") ||
303
            (a.remove(),
304
            (a = null),
305
            0 === b.children().length && (b.remove(), (g = void 0)));
306
      }
307
      var b,
308
        c,
309
        g,
310
        d = 0,
311
        e = {
312
          error: "error",
313
          info: "info",
314
          success: "success",
315
          warning: "warning",
316
        },
317
        f = {
318
          clear: n,
319
          remove: o,
320
          error: h,
321
          getContainer: i,
322
          info: j,
323
          options: {},
324
          subscribe: k,
325
          success: l,
326
          version: "2.1.3",
327
          warning: m,
328
        };
329
      return f;
330
    })();
331
  });
332

333
  // Success Type
334
  $("#ts-success").on("click", function () {
335
    toastr.success("Have fun storming the castle!", "Miracle Max Says");
336
  });
337

338
  // Success Type
339
  $("#ts-info").on("click", function () {
340
    toastr.info("We do have the Kapua suite available.", "Turtle Bay Resort");
341
  });
342

343
  // Success Type
344
  $("#ts-warning").on("click", function () {
345
    toastr.warning(
346
      "My name is Inigo Montoya. You killed my father, prepare to die!"
347
    );
348
  });
349

350
  // Success Type
351
  $("#ts-error").on("click", function () {
352
    toastr.error(
353
      "I do not think that word means what you think it means.",
354
      "Inconceivable!"
355
    );
356
  });
357

358
  // Position Top Left
359
  $("#pos-top-left").on("click", function () {
360
    toastr.info(
361
      "I do not think that word means what you think it means.",
362
      "Top Left!",
363
      { positionClass: "toastr toast-top-left", containerId: "toast-top-left" }
364
    );
365
  });
366

367
  // Position Top Center
368
  $("#pos-top-center").on("click", function () {
369
    toastr.info(
370
      "I do not think that word means what you think it means.",
371
      "Top Center!",
372
      {
373
        positionClass: "toastr toast-top-center",
374
        containerId: "toast-top-center",
375
      }
376
    );
377
  });
378

379
  // Position Top Right
380
  $("#pos-top-right").on("click", function () {
381
    toastr.info(
382
      "I do not think that word means what you think it means.",
383
      "Top Right!",
384
      {
385
        positionClass: "toastr toast-top-right",
386
        containerId: "toast-top-right",
387
      }
388
    );
389
  });
390

391
  // Position Top Full Width
392
  $("#pos-top-full").on("click", function () {
393
    toastr.info(
394
      "I do not think that word means what you think it means.",
395
      "Top Full Width!",
396
      {
397
        positionClass: "toastr toast-top-full-width",
398
        containerId: "toast-top-full-width",
399
      }
400
    );
401
  });
402

403
  // Position Bottom Left
404
  $("#pos-bottom-left").on("click", function () {
405
    toastr.info(
406
      "I do not think that word means what you think it means.",
407
      "Bottom Left!",
408
      {
409
        positionClass: "toastr toast-bottom-left",
410
        containerId: "toast-bottom-left",
411
      }
412
    );
413
  });
414

415
  // Position Bottom Center
416
  $("#pos-bottom-center").on("click", function () {
417
    toastr.info(
418
      "I do not think that word means what you think it means.",
419
      "Bottom Center!",
420
      {
421
        positionClass: "toastr toast-bottom-center",
422
        containerId: "toast-bottom-center",
423
      }
424
    );
425
  });
426

427
  // Position Bottom Right
428
  $("#pos-bottom-right").on("click", function () {
429
    toastr.info(
430
      "I do not think that word means what you think it means.",
431
      "Bottom Right!",
432
      {
433
        positionClass: "toastr toast-bottom-right",
434
        containerId: "toast-bottom-right",
435
      }
436
    );
437
  });
438

439
  // Position Bottom Full Width
440
  $("#pos-bottom-full").on("click", function () {
441
    toastr.info(
442
      "I do not think that word means what you think it means.",
443
      "Bottom Full Width!",
444
      {
445
        positionClass: "toastr toast-bottom-full-width",
446
        containerId: "toast-bottom-full-width",
447
      }
448
    );
449
  });
450

451
  // Text Notification
452
  $("#text-notification").on("click", function () {
453
    toastr.info("Have fun storming the castle!", "Miracle Max Says");
454
  });
455

456
  // Close Button
457
  $("#close-button").on("click", function () {
458
    toastr.success("Have fun storming the castle!", "With Close Button", {
459
      closeButton: true,
460
    });
461
  });
462

463
  // Progress Bar
464
  $("#progress-bar").on("click", function () {
465
    toastr.warning("Have fun storming the castle!", "Progress Bar", {
466
      progressBar: true,
467
    });
468
  });
469

470
  // Clear Toast Button
471
  $("#clear-toast-btn").on("click", function () {
472
    toastr.error(
473
      'Clear itself?<br /><br /><button type="button" class="btn btn-secondary clear">Yes</button>',
474
      "Clear Toast Button"
475
    );
476
  });
477

478
  // Slide Down / Slide Up
479
  $("#slide-toast").on("click", function () {
480
    toastr.success(
481
      "I do not think that word means what you think it means.",
482
      "Slide Down / Slide Up!",
483
      { showMethod: "slideDown", hideMethod: "slideUp", timeOut: 2000 }
484
    );
485
  });
486

487
  // Fade In / Fade Out
488
  $("#fade-toast").on("click", function () {
489
    toastr.success(
490
      "I do not think that word means what you think it means.",
491
      "Slide Down / Slide Up!",
492
      { showMethod: "fadeIn", hideMethod: "fadeOut", timeOut: 2000 }
493
    );
494
  });
495
})(
496
  "function" == typeof define && define.amd
497
    ? define
498
    : function (a, b) {
499
        "undefined" != typeof module && module.exports
500
          ? (module.exports = b(require("jquery")))
501
          : (window.toastr = b(window.jQuery));
502
      }
503
);
504

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.