1var SYRUS_CHAT_FIRST_TIME_OPENED = false; 2 3jQuery(document).ready(() => { 4 5 if(jQuery('#syrus-chat-container').length > 0) 6 initSyrusChatContainer(); 7 8}); 9 10function initSyrusChatContainer() { 11 12 jQuery('#syrus-chat-container .chat-toggle, #syrus-chat-container .close-button').on('click', () => { 13 jQuery('#syrus-chat-container .chat-container').toggle(); 14 15 if(!SYRUS_CHAT_FIRST_TIME_OPENED) { 16 setTimeout(() => { 17 jQuery('#syrus-chat-container .message-container.loading-container').remove(); 18 jQuery('#syrus-chat-container .message-container').show(); 19 }, WA_SETTINGS.message_delay ? WA_SETTINGS.message_delay : 1000); 20 } 21 22 SYRUS_CHAT_FIRST_TIME_OPENED = true; 23 }); 24 25 if(isMobileDevice() && WA_SETTINGS.popup_delay_mobile) { 26 setTimeout(() => { 27 if(!isWhatsappAlreadyClosed()) { 28 let d = new Date(); 29 d.setTime(d.getTime() + (2 * 60 * 60 * 1000)); 30 let expires = "expires=" + d.toUTCString(); 31 document.cookie = "whatsapp_closed=1;" + expires + ";path=/"; 32 jQuery('#syrus-chat-container .chat-toggle').click(); 33 } 34 }, WA_SETTINGS.popup_delay_mobile); 35 } 36 37} 38 39function isMobileDevice() { 40 const userAgent = navigator.userAgent.toLowerCase(); 41 const isMobileUserAgent = /android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/.test(userAgent); 42 const screenWidth = window.innerWidth; 43 const screenHeight = window.innerHeight; 44 const isPortraitScreen = screenWidth < screenHeight; 45 46 return isMobileUserAgent || isPortraitScreen; 47} 48 49function isWhatsappAlreadyClosed() { 50 let name = "whatsapp_closed="; 51 let decodedCookie = decodeURIComponent(document.cookie); 52 let ca = decodedCookie.split(';'); 53 54 for (let i = 0; i < ca.length; i++) { 55 let c = ca[i].trim(); 56 57 if (c.indexOf(name) === 0) 58 return c.substring(name.length, c.length) === "1"; 59 } 60 61 return false; 62}
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.