PageSourceSearch

https://logiology.com/Assets/vendors/sweetalert2/sweet-alerts.init.js

js logiology.com collected 2026-10-01 23:51:35 UTC 9,598 bytes, 279 lines download raw bytes

1/*
2Template Name: Skote - Responsive Bootstrap 4 Admin Dashboard
3Author: Themesbrand
4Version: 2.0
5Website: https://themesbrand.com/
6Contact: [email protected]
7File: Sweetalert Js File
8*/
9
10!function ($) {
11    "use strict";
12
13    var SweetAlert = function () {
14    };
15
16    //examples
17    SweetAlert.prototype.init = function () {
18
19        //Basic
20        $('#sa-basic').on('click', function () {
21            Swal.fire(
22                {
23                    title: 'Any fool can use a computer',
24                    confirmButtonColor: '#556ee6',
25                }
26            )
27        });
28
29        //A title with a text under
30        $('#sa-title').click(function () {
31            Swal.fire(
32                {
33                    title: "The Internet?",
34                    text: 'That thing is still around?',
35                    icon: 'question',
36                    confirmButtonColor: '#556ee6'
37                }
38            )
39        });
40
41        //Success Message
42        $('#sa-success').click(function () {
43            Swal.fire(
44                {
45                    title: 'Good job!',
46                    text: 'You clicked the button!',
47                    icon: 'success',
48                    showCancelButton: true,
49                    confirmButtonColor: '#556ee6',
50                    cancelButtonColor: "#f46a6a"
51                }
52            )
53        });
54
55        //Warning Message
56        $('#sa-warning').click(function () {
57            Swal.fire({
58                title: "Are you sure?",
59                text: "You won't be able to revert this!",
60                icon: "warning",
61                showCancelButton: true,
62                confirmButtonColor: "#34c38f",
63                cancelButtonColor: "#f46a6a",
64                confirmButtonText: "Yes, delete it!"
65              }).then(function (result) {
66                if (result.value) {
67                  Swal.fire("Deleted!", "Your file has been deleted.", "success");
68                }
69            });
70        });
71
72        //Parameter
73        $('#sa-params').click(function () {
74			Swal.fire({
75                title: 'Are you sure?',
76                text: "You won't be able to revert this!",
77                icon: 'warning',
78                showCancelButton: true,
79                confirmButtonText: 'Yes, delete it!',
80                cancelButtonText: 'No, cancel!',
81                confirmButtonClass: 'btn btn-success mt-2',
82                cancelButtonClass: 'btn btn-danger ml-2 mt-2',
83                buttonsStyling: false
84            }).then(function (result) {
85                if (result.value) {
86                    Swal.fire({
87                      title: 'Deleted!',
88                      text: 'Your file has been deleted.',
89                      icon: 'success'
90                    })
91                  } else if (
92                    // Read more about handling dismissals
93                    result.dismiss === Swal.DismissReason.cancel
94                  ) {
95                    Swal.fire({
96                      title: 'Cancelled',
97                      text: 'Your imaginary file is safe :)',
98                      icon: 'error'
99                    })
100                  }
101            });
102        });
103
104        //Custom Image
105        $('#sa-image').click(function () {
106            Swal.fire({
107                title: 'Sweet!',
108                text: 'Modal with a custom image.',
109                imageUrl: 'assets/images/logo-dark.png',
110                imageHeight: 20,
111                confirmButtonColor: "#556ee6",
112                animation: false
113            })
114        });
115		
116        //Auto Close Timer
117        $('#sa-close').click(function () {
118            var timerInterval;
119            Swal.fire({
120            title: 'Auto close alert!',
121            html: 'I will close in <strong></strong> seconds.',
122            timer: 2000,
123            confirmButtonColor: "#556ee6",
124            onBeforeOpen:function () {
125                Swal.showLoading()
126                timerInterval = setInterval(function() {
127                Swal.getContent().querySelector('strong')
128                    .textContent = Swal.getTimerLeft()
129                }, 100)
130            },
131            onClose: function () {
132                clearInterval(timerInterval)
133            }
134            }).then(function (result) {
135            if (
136                // Read more about handling dismissals
137                result.dismiss === Swal.DismissReason.timer
138            ) {
139                console.log('I was closed by the timer')
140            }
141            })
142        });
143
144
145
146        //custom html alert
147        $('#custom-html-alert').click(function () {
148            Swal.fire({
149                title: '<i>HTML</i> <u>example</u>',
150                icon: 'info',
151                html: 'You can use <b>bold text</b>, ' +
152                '<a href="//Themesbrand.in/">links</a> ' +
153                'and other HTML tags',
154                showCloseButton: true,
155                showCancelButton: true,
156                confirmButtonClass: 'btn btn-success',
157                cancelButtonClass: 'btn btn-danger ml-1',
158                confirmButtonColor: "#47bd9a",
159                cancelButtonColor: "#f46a6a",
160                confirmButtonText: '<i class="fas fa-thumbs-up mr-1"></i> Great!',
161                cancelButtonText: '<i class="fas fa-thumbs-down"></i>'
162            })
163        });
164
165        //position
166        $('#sa-position').click(function () {
167            Swal.fire({
168                position: 'top-end',
169                icon: 'success',
170                title: 'Your work has been saved',
171                showConfirmButton: false,
172                timer: 1500
173            })
174        });
175
176        //Custom width padding
177        $('#custom-padding-width-alert').click(function () {
178            Swal.fire({
179                title: 'Custom width, padding, background.',
180                width: 600,
181                padding: 100,
182                confirmButtonColor: "#556ee6",
183                background: '#fff url(//subtlepatterns2015.subtlepatterns.netdna-cdn.com/patterns/geometry.png)'
184            })
185        });
186
187        //Ajax
188        $('#ajax-alert').click(function () {
189            Swal.fire({
190                title: 'Submit email to run ajax request',
191                input: 'email',
192                showCancelButton: true,
193                confirmButtonText: 'Submit',
194                showLoaderOnConfirm: true,
195                confirmButtonColor: "#556ee6",
196                cancelButtonColor: "#f46a6a",
197                preConfirm: function (email) {
198                    return new Promise(function (resolve, reject) {
199                        setTimeout(function () {
200                            if (email === '[email protected]') {
201                                reject('This email is already taken.')
202                            } else {
203                                resolve()
204                            }
205                        }, 2000)
206                    })
207                },
208                allowOutsideClick: false
209            }).then(function (email) {
210                Swal.fire({
211                    icon: 'success',
212                    title: 'Ajax request finished!',
213                    html: 'Submitted email: ' + email
214                })
215            })
216        });
217
218        //chaining modal alert
219        $('#chaining-alert').click(function () {
220            Swal.mixin({
221                input: 'text',
222                confirmButtonText: 'Next &rarr;',
223                showCancelButton: true,
224                confirmButtonColor: "#556ee6",
225                cancelButtonColor: "#74788d",
226                progressSteps: ['1', '2', '3']
227              }).queue([
228                {
229                  title: 'Question 1',
230                  text: 'Chaining swal2 modals is easy'
231                },
232                'Question 2',
233                'Question 3'
234              ]).then( function (result) {
235                if (result.value) {
236                  Swal.fire({
237                    title: 'All done!',
238                    html:
239                      'Your answers: <pre><code>' +
240                        JSON.stringify(result.value) +
241                      '</code></pre>',
242                    confirmButtonText: 'Lovely!'
243                  })
244                }
245              })
246        });
247
248        //Danger
249        $('#dynamic-alert').click(function () {
250            swal.queue([{
251                title: 'Your public IP',
252                confirmButtonColor: "#556ee6",
253                confirmButtonText: 'Show my public IP',
254                text: 'Your public IP will be received ' +
255                'via AJAX request',
256                showLoaderOnConfirm: true,
257                preConfirm: function () {
258                    return new Promise(function (resolve) {
259                        $.get('https://api.ipify.org?format=json')
260                            .done(function (data) {
261                                swal.insertQueueStep(data.ip)
262                                resolve()
263                            })
264                    })
265                }
266            }]).catch(swal.noop)
267        });
268
269
270    },
271        //init
272        $.SweetAlert = new SweetAlert, $.SweetAlert.Constructor = SweetAlert
273}(window.jQuery),
274
275//initializing
276    function ($) {
277        "use strict";
278        $.SweetAlert.init()
279    }(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.