1(function() { 2 var $; 3 4 $ = jQuery; 5 6 $.bootstrapGrowl = function(message, options) { 7 var $alert, css, offsetAmount; 8 9 options = $.extend({}, $.bootstrapGrowl.default_options, options); 10 $alert = $("<div>"); 11 $alert.attr("class", "bootstrap-growl alert"); 12 if (options.type) { 13 $alert.addClass("alert-" + options.type); 14 } 15 if (options.allow_dismiss) { 16 $alert.append("<span class=\"close\" data-dismiss=\"alert\">×</span>"); 17 } 18 $alert.append(message); 19 if (options.top_offset) { 20 options.offset = { 21 from: "top", 22 amount: options.top_offset 23 }; 24 } 25 offsetAmount = options.offset.amount; 26 $(".bootstrap-growl").each(function() { 27 return offsetAmount = Math.max(offsetAmount, parseInt($(this).css(options.offset.from)) + $(this).outerHeight() + options.stackup_spacing); 28 }); 29 css = { 30 "position": (options.ele === "body" ? "fixed" : "absolute"), 31 "margin": 0, 32 "z-index": "9999", 33 "display": "none" 34 }; 35 css[options.offset.from] = offsetAmount + "px"; 36 $alert.css(css); 37 if (options.width !== "auto") { 38 $alert.css("width", options.width + "px"); 39 } 40 $(options.ele).append($alert); 41 switch (options.align) { 42 case "right": 43 $alert.css("right", "20px"); 44 break; 45 case "left": 46 $alert.css("left", "20px"); 47 break; 48 default: 49 $alert.css({ 50 "left": "50%", 51 "margin-left": "-" + ($alert.outerWidth() / 2) + "px" 52 }); 53 54 } 55 $alert.fadeIn(); 56 if (options.delay > 0) { 57 $alert.delay(options.delay).fadeOut(function() { 58 return $(this).alert("close"); 59 }); 60 } 61 return $alert; 62 }; 63 64 $.bootstrapGrowl.default_options = { 65 ele: "body", 66 type: "success", 67 offset: { 68 from: "top", 69 amount: 160 70 }, 71 align: "center", 72 width: 'atuo', 73 delay: 4000, 74 allow_dismiss: true, 75 stackup_spacing: 10 76 }; 77 78}).call(this);
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.