{"size": 2674, "ext": "js", "max_stars_repo_path": "js/pjax.js", "max_stars_repo_name": "a01sa01to/KSS-New", "max_stars_repo_stars_event_min_datetime": "2020-03-03T08:16:34.000Z", "max_stars_repo_stars_event_max_datetime": "2020-04-08T15:10:52.000Z", "max_issues_repo_path": "js/pjax.js", "max_issues_repo_name": "a01sa01to/KSS-New", "max_issues_repo_issues_event_min_datetime": "2020-03-16T04:51:42.000Z", "max_issues_repo_issues_event_max_datetime": "2022-01-11T06:01:44.000Z", "max_forks_repo_path": "js/pjax.js", "max_forks_repo_name": "a01sa01to/KSS-New", "max_forks_repo_forks_event_min_datetime": "2020-03-04T01:28:17.000Z", "max_forks_repo_forks_event_max_datetime": "2020-03-04T01:28:17.000Z"}
{"max_stars_count": 3, "max_issues_count": 18, "max_forks_count": 1, "avg_line_length": 29.7111111111, "max_line_length": 112, "alphanum_fraction": 0.609947644}
// window.addEventListener('load',()=>{
	(()=>{
		$('a').click(async function(e){
		e.preventDefault();
		const loadList = ["/monthPlan/", "/blog/"];
		const href = $(this).attr("href");
		console.log(href, loadList.includes(href))
		if(href.startsWith("#")){
			// Slide
		}
		else if(href.startsWith("/") && !loadList.includes(href)){
			await pjax(href);
		}
		else if(loadList.includes(href)){
			location.href = href;
		}
		else{
			open(href);
		}
	})
})();
// });
window.addEventListener('popstate',async ()=>{
	await pjax(undefined,false)
})
const pjax = async (href=location.href, keepHistroy=true)=>{
	$('.displayToggleBtn, .headerContainer, header .topMenu, p.logo > i.fas.fa-angle-down').removeClass("showing");
	$('main').html('<div class="loader">Loading...</div>')
	await $.ajax({url: href, type: "GET"}).done(data=>{
		$(data).each(function(){
			const tagname = this.nodeName.toLowerCase();
			window.document.baseURI = href;
			if(tagname === "script"){
				let isContained = false;
				for (const e of $(document).find("script")) {
					if(e.src === this.src && e.innerHTML === this.innerHTML){
						isContained = true;
					}
				}
				if(href === "/blog/" && this.src.includes(`bundle.js`)){
					fetch('/blog/bundle.js').then(r=>r.text()).then(t=>eval(t));
				}
				else if(!isContained){
					const scr = document.createElement("script");
					scr.src = (this.src)?this.src:"";
					scr.innerHTML = (this.innerHTML)?this.innerHTML:"";
					document.head.appendChild(scr);
				}
			}
			else if(tagname === "style"){
				const pjStyle = document.querySelector('style#pjAppend')
				if(pjStyle) pjStyle.remove();
				const sty = document.createElement("style");
				sty.id = "pjAppend";
				sty.innerHTML = this.innerHTML;
				document.head.appendChild(sty)
			}
			else if(tagname === "link"){
				let isContained = false;
				for (const e of $(document).find("link")) {
					if(e.href === this.href && e.rel === this.rel){
						isContained = true;
					}
				}
				if(!isContained){
					const lin = document.createElement("link");
					lin.href = this.href;
					lin.rel = this.rel;
					document.head.appendChild(lin);
				}
			}
			else if(tagname === "main"){
				$('main').html(this.innerHTML);
			}
			else if(tagname === "title"){
				document.title = `${this.innerHTML} - 茨城県立古河中等教育学校ホームページ New`;
			}
		})
	}).fail(()=>{
		$('main').html('ページを読み込む際にエラーが発生しました。');
	}).always(()=>{
		if(keepHistroy) history.pushState(undefined,0,href);
		window.scrollTo(0,0);
		const load_event = document.createEvent('Event');
		load_event.initEvent('load', false, false);
		window.dispatchEvent(load_event);
	});
	await imgLoad();
	headerMenuUpdate();
}