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 var buttonHTML = ''; 11 $.each(params.buttons,function(name,obj){ 12 13 // Generating the markup for the buttons: 14 15 buttonHTML += '<a href="#" class="button '+obj['class']+'">'+name+'<span></span></a>'; 16 17 if(!obj.action){ 18 obj.action = function(){}; 19 } 20 }); 21 22 var markup = [ 23 '<div id="confirmOverlay">', 24 '<div id="confirmBox">', 25 '<h1>',params.title,'</h1>', 26 '<p>',params.message,'</p>', 27 '<div id="confirmButtons">', 28 buttonHTML, 29 '</div></div></div>' 30 ].join(''); 31 32 $(markup).hide().appendTo('body').fadeIn(); 33 34 var buttons = $('#confirmBox .button'), 35 i = 0; 36 37 $.each(params.buttons,function(name,obj){ 38 buttons.eq(i++).click(function(){ 39 40 // Calling the action attribute when a 41 // click occurs, and hiding the confirm. 42 43 obj.action(); 44 $.confirm.hide(); 45 return false; 46 }); 47 }); 48 } 49 50 $.confirm.hide = function(){ 51 $('#confirmOverlay').fadeOut(function(){ 52 $(this).remove(); 53 }); 54 } 55 56})(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.