//== Class definition var SweetAlert2Demo = function() { //== Demos var initDemos = function() { //== Sweetalert Demo 1 $('#m_sweetalert_demo_1').click(function(e) { swal('Good job!'); }); //== Sweetalert Demo 2 $('#m_sweetalert_demo_2').click(function(e) { swal("Here's the title!", "...and here's the text!"); }); //== Sweetalert Demo 3 $('#m_sweetalert_demo_3_1').click(function(e) { swal("Good job!", "You clicked the button!", "warning"); }); $('#m_sweetalert_demo_3_2').click(function(e) { swal("Good job!", "You clicked the button!", "error"); }); $('#m_sweetalert_demo_3_3').click(function(e) { swal("Good job!", "You clicked the button!", "success"); }); $('#m_sweetalert_demo_3_4').click(function(e) { swal("Good job!", "You clicked the button!", "info"); }); $('#m_sweetalert_demo_3_5').click(function(e) { swal("Good job!", "You clicked the button!", "question"); }); //== Sweetalert Demo 4 $('#m_sweetalert_demo_4').click(function(e) { swal({ title: "Good job!", text: "You clicked the button!", icon: "success", confirmButtonText: "Confirm me!", confirmButtonClass: "btn btn-focus m-btn m-btn--pill m-btn--air" }); }); //== Sweetalert Demo 5 $('#m_sweetalert_demo_5').click(function(e) { swal({ title: "Good job!", text: "You clicked the button!", icon: "success", confirmButtonText: "I am game!", confirmButtonClass: "btn btn-danger m-btn m-btn--pill m-btn--air m-btn--icon", showCancelButton: true, cancelButtonText: "No, thanks", cancelButtonClass: "btn btn-secondary m-btn m-btn--pill m-btn--icon" }); }); $('#m_sweetalert_demo_6').click(function(e) { swal({ position: 'top-right', type: 'success', title: 'Your work has been saved', showConfirmButton: false, timer: 1500 }); }); $('#m_sweetalert_demo_7').click(function(e) { swal({ title: 'jQuery HTML example', html: $('