1(function( $ ) { 2 'use strict'; 3 var Alert = undefined; 4 5 (function(Alert) { 6 var alert, error, trash, info, success, warning, _container; 7 info = function(message, title, options) { 8 return alert("info", message, title, "fas fa-info-circle", options); 9 }; 10 warning = function(message, title, options) { 11 return alert("warning", message, title, "fas fa-exclamation-triangle", options); 12 }; 13 error = function(message, title, options) { 14 return alert("error", message, title, "fas fa-exclamation-circle", options); 15 }; 16 17 trash = function(message, title, options) { 18 return alert("trash", message, title, "fas fa-trash-alt", options); 19 }; 20 21 success = function(message, title, options) { 22 return alert("success", message, title, "fas fa-check-circle", options); 23 }; 24 alert = function(type, message, title, icon, options) { 25 var alertElem, messageElem, titleElem, iconElem, innerElem, _container; 26 if (typeof options === "undefined") { 27 options = {}; 28 } 29 options = $.extend({}, Alert.defaults, options); 30 if (!_container) { 31 _container = $("#sf-alerts"); 32 if (_container.length === 0) { 33 _container = $("<ul>").attr("id", "sf-alerts").appendTo($("body")); 34 } 35 } 36 if (options.width) { 37 _container.css({ 38 width: options.width 39 }); 40 } 41 alertElem = $("<li>").addClass("sf-alert").addClass("sf-alert-" + type); 42 setTimeout(function() { 43 alertElem.addClass('sf-open'); 44 }, 1); 45 if (icon) { 46 iconElem = $("<i>").addClass(icon); 47 alertElem.append(iconElem); 48 } 49 innerElem = $("<div>").addClass("sf-alert-block"); 50 alertElem.append(innerElem); 51 if (title) { 52 titleElem = $("<div>").addClass("sf-alert-title").append(title); 53 innerElem.append(titleElem); 54 55 } 56 if (message) { 57 messageElem = $("<div>").addClass("sf-alert-message").append(message); 58 innerElem.append(messageElem); 59 60 } 61 if (options.displayDuration > 0) { 62 setTimeout((function() { 63 leave(); 64 }), options.displayDuration); 65 } else { 66 innerElem.append("<em>Click to Dismiss</em>"); 67 } 68 alertElem.on("click", function() { 69 leave(); 70 }); 71 72 function leave() { 73 alertElem.removeClass('sf-open'); 74 alertElem.one('webkitTransitionEnd otransitionend oTransitionEnd msTransitionEnd transitionend', function() { 75 return alertElem.remove(); 76 }); 77 } 78 return _container.prepend(alertElem); 79 }; 80 Alert.defaults = { 81 width: "", 82 icon: "", 83 displayDuration: 3000, 84 pos: "" 85 }; 86 Alert.info = info; 87 Alert.warning = warning; 88 Alert.error = error; 89 Alert.trash = trash; 90 Alert.success = success; 91 window.Alert = Alert; 92 93 })(Alert || (Alert = {})); 94 95})( 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.