1 2/***************************** 3Toaster Notification 4******************************/ 5(function($) { 6 7 var notification = new Notif({ 8 topPos: 50, 9 autoClose: false, 10 }); 11 12 13 function Notif(option){ 14 var el = this; 15 el.self = $('.toast-message'); 16 el.close = this.self.find('.close'); 17 el.message = el.self.find('.message'); 18 el.top = option.topPos; 19 el.autoClose = (typeof option.autoClose === "boolean")? option.autoClose: false; 20 21 // Methods 22 el.show = function(){ 23 el.self.css('top', el.top); 24 if(el.autoClose){ 25 setTimeout(function(){ 26 el.hide(); 27 }, el.autoCloseTimeout); 28 } 29 } 30 el.hide = function(){ 31 el.self.css('top','-100%'); 32 setCookie("toast", "closed"); 33 }; 34 35 el.close.on('click', this.hide); 36 } 37 38 function checkCookie() { 39 var user = getCookie("toast"); 40 if (user != "") { 41 } else { 42 notification.show() 43 } 44 } 45 46 function setCookie(cname, cvalue) { 47 var hours = $('#cookie-hours').text(); 48 var d = new Date(); 49 // d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000)); 50 // d.setTime(d.getTime() + (30 * 1000)); 51 d.setTime(d.getTime() + (hours * 60 * 60 * 1000)); 52 var expires = "expires="+d.toUTCString(); 53 document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/"; 54 console.log(hours); 55 } 56 57 function getCookie(cname) { 58 var name = cname + "="; 59 var ca = document.cookie.split(';'); 60 for(var i = 0; i < ca.length; i++) { 61 var c = ca[i]; 62 while (c.charAt(0) == ' ') { 63 c = c.substring(1); 64 } 65 if (c.indexOf(name) == 0) { 66 return c.substring(name.length, c.length); 67 } 68 } 69 return ""; 70 } 71 checkCookie(); 72 73})(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.