school-administrarion/assets/scripts/sweetalert.init.min.js

2 lines
2.5 KiB
JavaScript
Executable File

!function(t){"use strict";var e={};t(document).ready(function(){return t("#sal-basic").length&&e.basic(),t("#sal-text").length&&e.text(),t("#sal-success").length&&e.success(),t("#sal-warning").length&&e.warning(),t("#sal-icon").length&&e.icon(),t("#sal-html").length&&e.html(),t("#sal-auto").length&&e.auto(),t("#sal-prompt").length&&e.prompt(),!1}),e={basic:function(){return t("#sal-basic").on("click",function(){return swal({title:"Here's a message!",confirmButtonColor:"#304ffe"}),!1}),!1},text:function(){return t("#sal-text").on("click",function(){return swal({title:"Here's a message!",text:"It's pretty, isn't it?",confirmButtonColor:"#304ffe"}),!1}),!1},success:function(){return t("#sal-success").on("click",function(){return swal({title:"Good job!",text:"You clicked the button!",type:"success",confirmButtonColor:"#304ffe"}),!1}),!1},warning:function(){return t("#sal-warning").on("click",function(){return swal({title:"Are you sure?",text:"You will not be able to recover this imaginary file!",type:"warning",showCancelButton:!0,confirmButtonColor:"#DD6B55",confirmButtonText:"Yes, delete it!",cancelButtonText:"No, cancel plx!",closeOnConfirm:!1,closeOnCancel:!1,confirmButtonColor:"#f60e0e"},function(t){t?swal({title:"Deleted!",text:"Your imaginary file has been deleted.",type:"success",confirmButtonColor:"#304ffe"}):swal({title:"Cancelled",text:"Your imaginary file is safe :)",type:"error",confirmButtonColor:"#f60e0e"})}),!1}),!1},icon:function(){return t("#sal-icon").on("click",function(){return swal({title:"Sweet!",text:"Here's a custom image.",imageUrl:"assets/images/avatar.png",confirmButtonColor:"#304ffe"}),!1}),!1},html:function(){return t("#sal-html").on("click",function(){return swal({title:"HTML <small>Title</small>!",text:'A custom <span style="color:#F8BB86">html<span> message.',html:!0,confirmButtonColor:"#304ffe"}),!1}),!1},auto:function(){return t("#sal-auto").on("click",function(){return swal({title:"Auto close alert!",text:"I will close in 2 seconds.",timer:2e3,showConfirmButton:!1}),!1}),!1},prompt:function(){return t("#sal-prompt").on("click",function(){return swal({title:"An input!",text:"Write something interesting:",type:"input",showCancelButton:!0,closeOnConfirm:!1,animation:"slide-from-top",inputPlaceholder:"Write something",confirmButtonColor:"#304ffe"},function(t){return t===!1?!1:""===t?(swal({title:"You need to write something!",type:"error",confirmButtonColor:"#f60e0e"}),!1):void swal({title:"Nice!",text:"You wrote: "+t,type:"success",confirmButtonColor:"#304ffe"})}),!1}),!1}}}(jQuery);