1//######################################################################### 2// 3// THEME-HEAD.JS 4// 5//######################################################################### 6 7//============================================================ 8// Change class no-js to js 9//============================================================ 10 11(function() { 12 var html = document.getElementsByTagName("html")[0]; 13 html.classList.add("js"); 14 html.classList.add("site-loading"); 15 html.classList.remove("no-js"); 16})(); 17 18 19// return cookie with name, if no cookie return undefined 20function getCookie(name) { 21 var matches = document.cookie.match(new RegExp( 22 "(?:^|; )" + name.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g, '\\$1') + "=([^;]*)" 23 )); 24 return matches ? decodeURIComponent(matches[1]) : undefined; 25} 26 27// set cookie with name and value 28// options - object with cookie params (expires, path, domain, secure) 29function setCookie(name, value, options) { 30 options = options || {}; 31 32 var expires = options.expires; 33 34 if (typeof expires == "number" && expires) { 35 var d = new Date(); 36 d.setTime(d.getTime() + expires * 1000); 37 expires = options.expires = d; 38 } 39 if (expires && expires.toUTCString) { 40 options.expires = expires.toUTCString(); 41 } 42 43 value = encodeURIComponent(value); 44 45 var updatedCookie = name + "=" + value; 46 47 for (var propName in options) { 48 updatedCookie += "; " + propName; 49 var propValue = options[propName]; 50 if (propValue !== true) { 51 updatedCookie += "=" + propValue; 52 } 53 } 54 55 document.cookie = updatedCookie; 56} 57 58// delete cookie with name 59function deleteCookie(name) { 60 setCookie(name, "", { 61 expires: -1 62 }) 63}
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.