1(function() { 2 var toastrJsUrl = '/admin/js/na-popups.js'; 3 var toastrCssUrl = '/admin/css/na-popup-style.css'; 4 5 $.loadJs = function (url, callback) { 6 $.ajax({ 7 url: url, 8 dataType: 'script', 9 success: callback, 10 async: true 11 }); 12 }; 13 14 $.loadCss = function (url) { 15 $('<link/>', { 16 rel: 'stylesheet', 17 type: 'text/css', 18 href: url 19 }).appendTo('head'); 20 }; 21 22 $.getPopUpMessages = function () { 23 var data; 24 $.ajax({ 25 url: "/pop_up_messages/getAllPopUpMessagesById", 26 type: "GET", 27 async: false, 28 enctype: 'multipart/form-data', 29 success: function(response) 30 { 31 data = $.parseJSON(response); 32 }, 33 error: function() 34 { 35 console.log('error'); 36 } 37 }); 38 return data; 39 }; 40 41 $.loadMsgs = function (msgs) { 42 if (typeof msgs !== "undefined") { 43 $('<div/>', {class: 'popup__holder'}).appendTo('body'); 44 $.each( msgs, function( key, val ) { 45 var settings = JSON.parse(val.settings); 46 var colors = JSON.parse(val.colors); 47 if(val.message !== null && val.message !== '') { 48 var text_color = val.colors !== null && val.colors !== '' ? colors.text_color : '#FFF'; 49 var background_color = val.colors !== null && val.colors !== '' ? colors.background_color : '#333'; 50 51 $("<div class='popup__item' style=' color:#" + text_color + ";background:#" + background_color + ";'><span class='popup__icon " + settings.icon + " '></span><p>" + val.message + "</p><span class='popup__close'></span></div>").appendTo('.popup__holder'); 52 if (!settings.icon) { 53 $('.popup__icon').remove(); 54 } 55 } 56 }); 57 } 58 }; 59 60 61 if (typeof window.toastr == "undefined") { 62 var popUpMessages = $.getPopUpMessages(); 63 $.loadCss(toastrCssUrl); 64 $.loadMsgs(popUpMessages); 65 setTimeout(function(){ 66 $.loadJs(toastrJsUrl); 67 },1000); 68 } 69 70 71 72})();
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.