1(function($){ 2 3 $.confirm = function(params){ 4 5 if($('#confirmOverlay').length){ 6 // A confirm is already shown on the page: 7 return false; 8 } 9 10 let buttonHTML = ''; 11 $.each(params.buttons,function(name,obj){ 12 var text = obj['text'] !== undefined && obj['text'].length > 0 ? obj['text'] : name; 13 14 // Generating the markup for the buttons: 15 16 buttonHTML += '<a href="#" class="button ' + obj['class']+'">' + text + '<span></span></a>'; 17 18 if(!obj.action){ 19 obj.action = function(){}; 20 } 21 }); 22 23 let checkboxHTML = ''; 24 if (params.checkboxMessage && params.checkboxId) { 25 checkboxHTML += '<div class="custom_checkbox_container"><div class="custom_checkbox">\n' + 26 '\t\t<label class="checkbox_label">\n' + 27 '\t\t\t<input type="checkbox" id="' + params.checkboxId + '">\n' + 28 '\t\t\t<span class="checkbox_custom rectangular"></span>\n' + 29 '\t\t</label>\n' + 30 '\t\t<div class="checkbox_title">' + params.checkboxMessage + '</div>\n' + 31 '\t</div></div>'; 32 } 33 34 var markup = [ 35 '<div id="confirmOverlay">', 36 '<div id="confirmBox">', 37 '<h2>',params.title,'</h2>', 38 '<p>',params.message,'</p>', 39 '<div id="confirmButtons">', 40 buttonHTML, 41 '</div>', 42 checkboxHTML, 43 '</div></div>' 44 ].join(''); 45 46 $(markup).hide().appendTo('body').fadeIn(); 47 48 var buttons = $('#confirmBox .button'), 49 i = 0; 50 51 $.each(params.buttons,function(name,obj){ 52 buttons.eq(i++).click(function(){ 53 54 // Calling the action attribute when a 55 // click occurs, and hiding the confirm. 56 57 if (params.removeImmediately === true) { 58 $.confirm.remove(); 59 obj.action(); 60 } else { 61 obj.action(); 62 $.confirm.hide(); 63 } 64 65 return false; 66 }); 67 }); 68 } 69 70 $.confirm.remove = function(){ 71 $('#confirmOverlay').remove(); 72 } 73 74 $.confirm.hide = function(){ 75 $('#confirmOverlay').fadeOut(function(){ 76 $(this).remove(); 77 }); 78 } 79 80})(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.