You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

61 lines
2.9 KiB

4 years ago
  1. ! function (e) {
  2. "use strict";
  3. var t = function () { };
  4. t.prototype.init = function () {
  5. e("#sa-basic").on("click", function () {
  6. swal("Here's a message!")
  7. }),
  8. e("#sa-title").on("click", function () {
  9. swal("Here's a message!", "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed lorem erat, tincidunt vitae ipsum et, pellentesque maximus enim. Mauris eleifend ex semper, lobortis purus sed, pharetra felis")
  10. }),
  11. e("#sa-success").on("click", function () {
  12. swal("Good job!", "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed lorem erat, tincidunt vitae ipsum et, pellentesque maximus enim. Mauris eleifend ex semper, lobortis purus sed, pharetra felis", "success")
  13. }),
  14. e("#sa-warning").on("click", function () {
  15. swal({
  16. title: "Are you sure?",
  17. text: "You will not be able to recover this imaginary file!",
  18. type: "warning",
  19. showCancelButton: !0,
  20. confirmButtonClass: "btn-warning",
  21. confirmButtonText: "Yes, delete it!",
  22. closeOnConfirm: !1
  23. }, function () {
  24. swal("Deleted!", "Your imaginary file has been deleted.", "success")
  25. })
  26. }),
  27. e("#sa-params").on("click", function () {
  28. swal({
  29. title: "Are you sure?",
  30. text: "You will not be able to recover this imaginary file!",
  31. type: "warning",
  32. showCancelButton: !0,
  33. confirmButtonColor: "#DD6B55",
  34. confirmButtonText: "Yes, delete it!",
  35. cancelButtonText: "No, cancel plx!",
  36. closeOnConfirm: !1,
  37. closeOnCancel: !1
  38. }, function (e) {
  39. e ? swal("Deleted!", "Your imaginary file has been deleted.", "success") : swal("Cancelled", "Your imaginary file is safe :)", "error")
  40. })
  41. }),
  42. e("#sa-image").on("click", function () {
  43. swal({
  44. title: "Sweet!",
  45. text: "Here's a custom image.",
  46. imageUrl: "assets/plugins/bootstrap-sweetalert/thumbs-up.jpg"
  47. })
  48. }),
  49. e("#sa-close").on("click", function () {
  50. swal({
  51. title: "Auto close alert!",
  52. text: "I will close in 2 seconds.",
  53. timer: 2e3,
  54. showConfirmButton: !1
  55. })
  56. })
  57. }, e.SweetAlert = new t, e.SweetAlert.Constructor = t
  58. }(window.jQuery),
  59. function (e) {
  60. "use strict";
  61. e.SweetAlert.init()
  62. }(window.jQuery);