1/** 2 * Sweet Alert 2 customs 3 */ 4 5// Replace standard warning message by SWAL 6// keep default js alert to use in specific cases 7window.legacyAlert = window.alert; 8 9// icons alert and confirm: "success", "error", "warning", "info", "question". Default: "warning" 10// overwrite default js alert 11window.alert = function(msg, title, icon, params) { 12 var title = (title == null) ? 'New Message' : title; 13 var icon = (icon == null) ? 'warning' : icon; 14 Swal.fire($.extend({ 15 icon, 16 title, 17 text: msg, 18 }, params || {}) 19 ); 20}; 21 22// new js alert 23window.alertHtml = async function(html, title, icon, params) { 24 25 var title = (title == null) ? 'New Message' : title; 26 var icon = (icon == null) ? 'warning' : icon; 27 await Swal.fire($.extend({ 28 icon, 29 title, 30 html, 31 }, params || {}) 32 ); 33}; 34 35 36 37window.swal_req = function(url, urlData, urlType, title, type, params) 38{ 39 var urlType = (urlType == null) ? 'POST' : urlType; 40 41 // Set up and execute ajax with callback 42 43 AjaxSetup(); 44 $.ajax({ 45 type : "POST", 46 cache : false, 47 url : url, 48 data : urlData, 49 dataType : 'html', 50 success: showModal 51 }); 52 53 function showModal(msg) 54 { 55 var settings = {}; 56 if (title != null) settings.title = title; 57 if (type != null) settings.type = type; 58 settings.html = msg; 59 60 Swal.fire( $.extend(settings, params || {}) ); 61 } 62 63 return; 64}
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.