1const GA_ID = 'UA-29779093-8'; 2const GA_DOMAIN = 'www.kaken.or.jp'; 3 4function setCookie(name, value, days) { 5 var expires = ""; 6 if (days) { 7 var date = new Date(); 8 date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000)); 9 expires = "; expires=" + date.toUTCString(); 10 } 11 document.cookie = name + "=" + (value || "") + expires + "; path=/;domain=" + GA_DOMAIN; 12} 13 14function getCookie(name) { 15 var nameEQ = name + "="; 16 var ca = document.cookie.split(';'); 17 for (var i = 0; i < ca.length; i++) { 18 var c = ca[i]; 19 while (c.charAt(0) == ' ') c = c.substring(1, c.length); 20 if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length); 21 } 22 return null; 23} 24 25function eraseCookie(name) { 26 document.cookie = name + '=; Path=/; Expires=Thu, 01 Jan 1970 00:00:01 GMT;domain=' + GA_DOMAIN; 27} 28 29window.addEventListener('DOMContentLoaded', function () { 30 31 'use strict'; 32 //localStorage ãã ga_cookie_opt_in ã®å¤ãåå¾ 33 const cookieOptin = getCookie('ga_cookie_opt_in'); 34 35 //ga_cookie_opt_in = no ãªã Google Analytics ãç¡å¹ã« 36 if (cookieOptin == 'no') { 37 console.log('ga_cookie_opt_in = no / ga-disable = true'); 38 //Disable Google Analyticsï¼UA-XXXX-Y ã®é¨åã¯æ£ãããã®ã«æ¸ãæãã¦ãã ããï¼ 39 window['ga-disable-${GA_ID}'] = true; 40 41 //ga_cookie_opt_in = yes ãªã Google Analytics ãã©ããã³ã°ã³ã¼ããçºè¡ 42 } else if (cookieOptin == 'yes') { 43 console.log('ga_cookie_opt_in = yes'); 44 //Enable Google Analyticsï¼UA-XXXX-Y ã®é¨åã¯æ£ãããã®ã«æ¸ãæãã¦ãã ããï¼ 45 window['ga-disable-${GA_ID}'] = false; 46 47 //ga_cookie_opt_in ã«å¤ããªãå ´åã¯ä¸æ¦ Google Analytics ãç¡å¹ã«ãã¦éç¥ã表示 48 } else { 49 console.log('ga_cookie_opt_in = null'); 50 //Disable Google Analyticsï¼UA-XXXX-Y ã®é¨åã¯æ£ãããã®ã«æ¸ãæãã¦ãã ããï¼ 51 window['ga-disable-${GA_ID}'] = true; 52 53 // âGoogle Web Fonts ãã Material Icons ãèªã¿è¾¼ã¿ï¼ãã§ã«å¥ã§èªã¿è¾¼ãã§ããå ´åã¯åé¤å¯ï¼â 54 const iconcss = document.createElement('link'); 55 iconcss.href = 'https://fonts.googleapis.com/icon?family=Material+Icons'; 56 iconcss.setAttribute('rel', 'stylesheet'); 57 document.head.appendChild(iconcss); 58 // âGoogle Web Fonts ãã Material Icons ãèªã¿è¾¼ã¿ï¼ãã§ã«å¥ã§èªã¿è¾¼ãã§ããå ´åã¯åé¤å¯ï¼â 59 // éç¥ãã¼ã®ã¹ã¿ã¤ã«ï¼ãã¹ã¯å¿ è¦ã«å¿ãã¦å¤æ´ãã¦ãã ããï¼ 60 const acceptcss = document.createElement('link'); 61 acceptcss.href = '/cms/kaken/css/ga-cookie-opt-in.css'; 62 acceptcss.setAttribute('rel', 'stylesheet'); 63 document.head.appendChild(acceptcss); 64 65 //éç¥ã®è¡¨ç¤ºï¼ããã¹ãã®å 容ããã©ã¤ãã·ã¼ããªã·ã¼ã¸ã®ãªã³ã¯ã¯å¿ è¦ã«å¿ãã¦å¤æ´ãã¦ãã ããï¼ 66 const accept = document.createElement('div'); 67 accept.setAttribute('class', 'module-ga-cookie-accept-bar'); 68 accept.setAttribute('id', 'name-ga-cookie-accept-bar'); 69 accept.innerHTML = '<p><i class="material-icons" aria-hidden="true">warning</i>å½ç¤¾ã®ã¦ã§ããµã¤ãã¯ãã客æ§ã®å©ä¾¿æ§åä¸ãã¦ã§ããµã¤ãã®æ¹åçãç®çã«ãCookieã使ç¨ãã¦ããã¾ãã<br>詳ããã¯<a href="/cookiepolicy">Cookieããªã·ã¼</a>ãã覧ãã ãããCookieã®å©ç¨ã«åæé ããå ´åã¯ããåæããããã¿ã³ãæ¼ãã¦ãã ããã</p><p><button id="name-ga-cookie-accept-btn" class="module-ga-cookie-accept-btn"><i class="material-icons" aria-hidden="true">check</i>åæãã</button> <button id="name-ga-cookie-deny-btn" class="module-ga-cookie-accept-btn module-ga-cookie-deny-btn"><i class="material-icons" aria-hidden="true">close</i>åæããªã</button></p>'; 70 document.body.appendChild(accept); 71 } 72 73 //åãã¿ã³ã®åå¾ 74 const acceptBtn = document.getElementById('name-ga-cookie-accept-btn');
75 const denyBtn = document.getElementById('name-ga-cookie-deny-btn'); 76 const resetBtn = document.getElementById('name-ga-cookie-reset-btn'); 77 78 //ãåæããããã¿ã³ã®ã¯ãªãã¯ã§ãªããã¤ã³ï¼ga_cookie_opt_in = yesï¼ 79 if (acceptBtn) { 80 acceptBtn.onclick = function () { 81 setCookie('ga_cookie_opt_in', 'yes', 3650); 82 document.getElementById('name-ga-cookie-accept-bar').classList.add('state-remove'); 83 //CSS Animation ãå®äºããã¾ã§å¾ æ©ããããã®åæâ¦â¦ 84 window.setTimeout('window.location.reload(false)', 500); 85 }; 86 } 87 88 //ãåæããªãããã¿ã³ã®ã¯ãªãã¯ã§ãªããã¢ã¦ãï¼ga_cookie_opt_in = noï¼ 89 if (denyBtn) { 90 denyBtn.onclick = function () { 91 setCookie('ga_cookie_opt_in', 'no'); 92 document.getElementById('name-ga-cookie-accept-bar').classList.add('state-remove'); 93 window.setTimeout('window.location.reload(false)', 500); 94 }; 95 } 96 97 //ãè¨å®ããªã»ããããã¿ã³ã®ã¯ãªãã¯ã§ ga_cookie_opt_in ã®å¤ãåé¤ 98 if (resetBtn) { 99 resetBtn.onclick = function () { 100 eraseCookie('ga_cookie_opt_in'); 101 location.reload(); 102 }; 103 } 104 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.