1/*! 2 * jquery.confirm 3 * 4 * @version 2.3.1 5 * 6 * @author My C-Labs 7 * @author Matthieu Napoli <[email protected]> 8 * @author Russel Vela 9 * @author Marcus Schwarz <[email protected]> 10 * 11 * @license MIT 12 * @url https://myclabs.github.io/jquery.confirm/ 13 */ 14(function(a) { 15 a.fn.confirm = function(b) { 16 if (typeof b === "undefined") { 17 b = {} 18 } 19 this.click(function(c) { 20 c.preventDefault(); 21 var d = a.extend({ 22 button: a(this) 23 }, b); 24 a.confirm(d, c) 25 }); 26 return this 27 }; 28 a.confirm = function(k, g) { 29 if (typeof k == "undefined") { 30 console.error("No options given."); 31 return 32 } 33 if (a(".confirmation-modal").length > 0) { 34 return 35 } 36 var j = {}; 37 if (k.button) { 38 var c = { 39 title: "title", 40 text: "text", 41 "confirm-button": "confirmButton", 42 "submit-form": "submitForm", 43 "cancel-button": "cancelButton", 44 "confirm-button-class": "confirmButtonClass", 45 "cancel-button-class": "cancelButtonClass", 46 "dialog-class": "dialogClass", 47 "modal-options-backdrop": "modalOptionsBackdrop", 48 "modal-options-keyboard": "modalOptionsKeyboard" 49 }; 50 a.each(c, function(e, l) { 51 var m = k.button.data(e); 52 if (typeof m != "undefined") { 53 j[l] = m 54 } 55 }) 56 } 57 var d = a.extend({}, a.confirm.options, { 58 confirm: function() { 59 if (j.submitForm || (typeof j.submitForm == "undefined" && k.submitForm) || (typeof j.submitForm == "undefined" && typeof k.submitForm == "undefined" && a.confirm.options.submitForm)) { 60 g.target.closest("form").submit() 61 } else { 62 var e = g && (("string" === typeof g && g) || (g.currentTarget && g.currentTarget.attributes.href.value)); 63 if (e) { 64 if (k.post) { 65 var l = a('<form method="post" class="hide" action="' + e + '"></form>'); 66 a("body").append(l); 67 l.submit() 68 } else { 69 window.location = e 70 } 71 } 72 } 73 }, 74 cancel: function(e) {}, 75 button: null 76 }, k, j); 77 var b = ""; 78 if (d.title !== "") { 79 b = '<div class="modal-header"><button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button><h4 class="modal-title">' + d.title + "</h4></div>" 80 } 81 var h = ""; 82 if (d.cancelButton) { 83 h = '<button class="cancel btn ' + d.cancelButtonClass + '" type="button" data-dismiss="modal">' + d.cancelButton + "</button>" 84 } 85 var f = '<div class="confirmation-modal modal fade" tabindex="-1" role="dialog"><div class="' + d.dialogClass + '"><div class="modal-content">' + b + '<div class="modal-body">' + d.text + '</div><div class="modal-footer"><button class="confirm btn ' + d.confirmButtonClass + '" type="button" data-dismiss="modal">' + d.confirmButton + "</button>" + h + "</div></div></div></div>"; 86 var i = a(f); 87 if (typeof d.modalOptionsBackdrop != "undefined" || typeof d.modalOptionsKeyboard != "undefined") { 88 i.modal({ 89 backdrop: d.modalOptionsBackdrop, 90 keyboard: d.modalOptionsKeyboard 91 }) 92 } 93 i.on("shown.bs.modal", function() { 94 i.find(".btn-primary:first").focus() 95 }); 96 i.on("hidden.bs.modal", function() { 97 i.remove() 98 }); 99 i.find(".confirm").click(function() { 100 d.confirm(d.button) 101 }); 102 i.find(".cancel").click(function() { 103 d.cancel(d.button) 104 }); 105 a("body").append(i); 106 i.modal("show") 107 }; 108 a.confirm.options = { 109 text: "Are you sure?", 110 title: "", 111 confirmButton: "Yes", 112 cancelButton: "Cancel", 113 post: false, 114 submitForm: false, 115 confirmButtonClass: "btn-primary", 116 cancelButtonClass: "btn-default", 117 dialogClass: "modal-dialog", 118 modalOptionsBackdrop: true, 119 modalOptionsKeyboard: true 120 } 121})(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.