1window.base_href = window.base_href || document.location.origin; // fix add base_href if dont exist 2var oldSidebarScrollY = 0; 3 4function getCookies(allCookie) { 5 var conver = {}; 6 allCookie = allCookie.split("; "); 7 allCookie.map(function (el) { 8 el = el.split("="); 9 conver[el[0]] = el[1]; 10 }); 11 return conver; 12} 13 14function createRequest() { 15 var req = false; 16 if (window.XMLHttpRequest) { 17 try { 18 req = new XMLHttpRequest(); 19 } catch (e) { 20 req = false; 21 } 22 } else if (window.ActiveXObject) { 23 try { 24 req = new ActiveXObject("Microsoft.XMLHTTP"); 25 } catch (e) { 26 req = false; 27 } 28 } 29 30 return req; 31} 32 33function setCookie(cookieName, cookieValue, nDays) { 34 var today = new Date(), 35 expire = new Date(); 36 if (nDays == null || nDays == 0) { 37 nDays = 1; 38 } 39 expire.setTime(today.getTime() + 3600000 * 24 * nDays); 40 document.cookie = cookieName + "=" + cookieValue + ";expires=" + expire.toGMTString() + ";path=/"; 41} 42 43var sidebarMenu = function () { 44 var sidebarButton = document.getElementById('sidebar-button'), 45 bodyElement = document.body, 46 closeSidebar = document.querySelector('.close-sidebar'), 47 mainContent = document.querySelector('.main-content'), 48 sidebarBookBtn = document.querySelector('#sidebar-phone [data-book-btn="true"]'), 49 sidebarChatBtn = document.querySelector('#sidebar-phone .chatOpenButton '); 50 51 if (sidebarButton) { 52 sidebarButton.addEventListener('click', function () { 53 toggleSidebar(bodyElement); 54 }); 55 56 mainContent.addEventListener('click', function (event) { 57 if (bodyElement.classList.contains('sidebar-opened') 58 && !event.target.classList.contains('icon-bar') 59 && !event.target.classList.contains('sidebar-button')) { 60 toggleSidebar(bodyElement); 61 } 62 }); 63 } 64 65 if (sidebarBookBtn) { 66 sidebarBookBtn.addEventListener('click', function () { 67 if (bodyElement.classList.contains('sidebar-opened')) { 68 if (window.innerWidth > 767) { 69 bodyElement.style.width = 'auto'; 70 } 71 bodyElement.classList.remove('sidebar-opened'); 72 window.scrollTo(0, oldSidebarScrollY); 73 } 74 }); 75 } 76 77 if (sidebarChatBtn) { 78 sidebarChatBtn.addEventListener('click', function () { 79 toggleSidebar(bodyElement); 80 }); 81 } 82} 83 84function toggleSidebar(bodyElement) { 85 86 if (bodyElement.classList.contains('sidebar-opened')) { 87 if (window.innerWidth > 767) { 88 bodyElement.style.width = 'auto'; 89 } 90 bodyElement.classList.remove('sidebar-opened'); 91 window.scrollTo(0, oldSidebarScrollY); 92 93 } else { 94 if (window.innerWidth > 767) { 95 bodyElement.style.width = bodyElement.offsetWidth + 'px'; 96 } 97 oldSidebarScrollY = window.scrollY || window.pageYOffset; 98 bodyElement.classList.add('sidebar-opened'); 99 } 100} 101 102 103document.addEventListener('DOMContentLoaded', function (e) { 104 sidebarMenu(); 105});
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.