PageSourceSearch

https://showabiken.co.jp/js/public/analysis.js?1738215636

js showabiken.co.jp collected 2026-10-05 09:36:06 UTC 13,344 bytes, 424 lines download raw bytes

1$(document).ready(function() {
2	var $window      = $(window),
3		width        = $window.width(),
4		height       = $window.height(),
5		$centerArea  = $('#middle-area > div.center-area');
6
7	var $params      = $('#params');
8	var siteType     = ($params.data('device') == 'smart')? 'SP' : 'PC';
9	var $sectionType = $('section.section .block-area');
10
11	var $bg          = $('#bg');
12	var $section     = $bg.find('section.section');
13
14	// ページID
15	var pageID = $params.data('page-id');
16	if(!$params.length){
17		pageID = $bg.data('page-id');
18	}
19	// ギャラリーページのpage_idが取れていないため調整
20	if($("#GlForm").length){
21		pageID   = $("body").data('page-id');
22		siteType = ($("body").data('device') == 'smart')? 'SP' : 'PC';
23	}
24
25	//#4766 window 識別
26	if (!window.name) {
27		var rum      = Math.ceil(Math.random() * 100);
28		var now      = Date.now() / 1000;
29		var win_name = Math.ceil(now * rum);
30		window.name  = win_name;
31	}
32
33	//#2297 シングルページ 対応
34	if ($sectionType.length) {
35		$params  = $bg;
36		siteType = ($params.data('device') == 'smart')? 'SP' : 'PC';
37	}
38/*******************************************************************/
39	$.cookie.json = true;
40	var scrollParam = $.cookie('scroll');
41	if (scrollParam == null) {
42		scrollParam = [];
43	}
44	var clickParam = $.cookie('click');
45	if (clickParam == null) {
46		clickParam = [];
47	}
48//console.log("read");
49//console.log("scrollParam");
50//console.log(scrollParam);
51//console.log("clickParam");
52//console.log(clickParam);
53/*******************************************************************/
54	//for click
55	var cl_data     = {};
56	var mouse_moves = [];
57	$('#bg').on('mousemove', function(e) {
58		if (siteType != "PC") {
59			return false;
60		}
61
62		// クリック位置の座標(コンテンツ領域のみで算出)
63		x = e.clientX;
64		y = e.clientY + $window.scrollTop();
65
66		mouse_moves.push({
67			'x': x,
68			'y': y
69		});
70	}).on('click tap', function(e) {
71		var offset = 0, x, y, data;
72
73		//#2297 シングルページ 対応
74		var sp_flg      = false;
75		var sp_full_flg = false;
76		var scroll      = 0;
77
78		if ($sectionType.length) {
79			var centerW  = $sectionType.eq(0).width();
80			var sectionh = $section.eq(0).height();
81			var centerh  = $sectionType.eq(0).height();
82			scroll       = $window.scrollTop();
83			width        = $bg.width();
84			sp_flg       = true;
85			pos2_header  = 0;
86			pos2_footer  = 0;
87			pos2_other   = 0;
88			page_bottom  = 0;
89
90			if ($bg.data('sp-type') == 1 && siteType == 'PC') {
91				//フッター、固定バナー、固定メニューの場合は高さ微調整(固定のときキャプチャー位置は下に)
92				var st_index = ($('section.section').filter('.active').length)? $('section.section').index($('section.section').filter('.active')) : 0;
93
94				scroll = sectionh * st_index;
95
96				//フッター、固定バナー、固定メニュー対応用
97				page_bottom = sectionh * parseInt($('section.section').length);
98				if ($('#bg').find('#header').length && !$('#bg').find('#header.pos2').length) {
99					page_bottom += parseInt($('#bg').find('#header').height());
100				}
101			} else {
102				//パララックス以外は、最後のセクションの位置から計算
103				var lt_index    = $('section.section').length - 1;
104				var $_lt_sction = $('section.section').eq(lt_index);
105
106				page_bottom = parseInt($_lt_sction.position().top) + parseInt($_lt_sction.height());
107
108				if ($('#bg').find('#header').length && !$('#bg').find('#header.pos2').length) {
109					page_bottom += parseInt($('#bg').find('#header').height());
110				}
111			}
112
113			//matu ヘッダー固定時対応
114			if ($(e.target).closest('#header').length && !($('#bg').find('#header.pos2').length && !$('#bg').find('#header').hasClass('normal-header'))) {
115				//pos2_header = $('#bg').find('#header.pos2').height();
116			}
117
118			pageID = $bg.data('page-id');
119		} else {
120			var centerW = $centerArea.width();
121		}
122
123		//111.5
124		if (siteType == 'PC') {
125			offset = (width - centerW) / 2;
126		}
127
128		// クリック位置の座標(コンテンツ領域のみで算出)
129		if (sp_flg) {
130			if (siteType == 'PC') {
131				offset = (width >= centerW && !($(e.target).closest('#header').length || $(e.target).closest('#footer').length || $(e.target).closest('#fixedbanner').length))? (width - centerW) / 2 : 0;
132			}
133			x = e.clientX - offset;
134			y = e.clientY + scroll + pos2_header;
135
136			//#2297 シングルページ 対応
137			if ($bg.data('sp-type') == 1 && siteType == 'PC') {
138				//パララックスタイプ
139				//1020:573.75 = 16:9 (1020はキャプチャサイズ)
140				y = (y - (((sectionh - centerh) / 2) * st_index)) + pos2_header;
141				if ($(e.target).closest('#header').length || $(e.target).closest('#footer').length || $(e.target).closest('#fixedbanner').length) {
142					x = Math.round(x * (1020 / width));
143				} else {
144					x = Math.round(x * (1020 / centerW));
145				}
146				y = Math.round(y * (573.75 / sectionh));
147			} else if (!$bg.data('sp-type') && siteType == 'PC') {
148				//シングルページ
149				//ヘッダー、フッター、固定バナーは可変でうごくので調整
150				if (($(e.target).closest('#header').length && !$(e.target).closest('#header').hasClass('normal-header')) || $(e.target).closest('#footer').length || $(e.target).closest('#fixedbanner').length) {
151					//現在ヒートマップキャプチャーの1100なので
152					//x = Math.round(x * (1100 / centerW));
153					x = Math.round(x * (1100 / width));
154				}
155			}
156
157			if ($(e.target).closest('#header').length && (($('#bg').find('#header.pos2').length && !$('#bg').find('#header').hasClass('normal-header')) || $('#bg').find('#header.a-logo-fixed').length && siteType != 'PC')) {
158				//y = e.clientY - parseInt($(e.target).closest('#header.pos2').position().top);
159				y = e.clientY;
160			}
161
162			//フッター、固定バナー、固定メニューの場合は高さ微調整(固定のときキャプチャー位置は下に)
163			if ($(e.target).closest('#footer.pos2').length) {
164			// || $(e.target).closest('#fixedbanner.pos2').length) {
165				pos2_footer = $(e.target).closest('#footer.pos2').height();
166				y           = page_bottom - pos2_footer + (e.clientY - parseInt($(e.target).closest('#footer.pos2').position().top));
167			}
168
169			if ($(e.target).closest('#fixedbanner.pos2').length) {
170				//フッターの下にくるので
171				if ($('#bg').find('#footer').length && !$('#bg').find('#footer').hasClass('pos2')) {
172					page_bottom += $('#bg').find('#footer').height();
173				}
174				y = page_bottom + (e.clientY - parseInt($(e.target).closest('#fixedbanner.pos2').position().top));
175			}
176		} else {
177			x = e.clientX - offset;
178			y = e.clientY + $window.scrollTop();
179		}
180
181//		if ((x > 0 && x < centerW) || ($bg.data('sp-type') == 1 && siteType == 'PC')) {
182			// 送信データ
183			cl_data = {
184				x			: x,
185				y			: y,
186				page_id		: pageID,
187				site_type	: siteType,
188				url			: location.href,
189				'window'	: width + ',' + height
190			};
191
192			clickParam = [];
193			clickParam.push(cl_data);
194			$.cookie('click', clickParam, { path: "/" });
195//console.log("click");
196//console.log(clickParam);
197//console.log($.cookie('click'));
198
199//			var click_count_url = analysisUrl + '/click_tracking/';
200//			$.ajax({
201//				type	: "POST",
202//				cache	: false,
203//				data	: data,
204//				async	: true,
205//				url		: click_count_url
206//			});
207//		}
208	});
209	/*******************************************************************/
210
211	/*******************************************************************/
212	if (SHFlg > 0) { // スクロールヒートフラグを追加。
213		//for scroll
214		var scrolltimer      = false;
215		var visittimer       = false;
216		var scPageID         = $params.data('page-id');
217		var sc_data          = {};
218		var scroll_y         = $window.scrollTop();
219		var scroll_x         = $window.scrollLeft();
220		var scroll_count_url = analysisUrl + '/scroll_tracking/';
221
222		// 
223		visittimer = setInterval(function() {
224			// 送信データ
225			sc_data = {
226				x			: scroll_x,
227				y			: scroll_y,
228				page_id		: scPageID,
229				site_type	: siteType,
230				url			: location.href,
231				'window'	: width + ',' + height,
232				'height'	: height,
233				'width'		: width,
234				'page_size'	: $('#bg').width() + ',' + $('#bg').height(),
235			};
236			// 今のも追加
237			scrollParam.push(sc_data);
238			// $.cookie('scroll', scrollParam, { path: "/" });
239			// cookie secure属性 設定
240			if ($("#cookie_secure_samesite_flg").val() == "1") {
241				$.cookie('scroll', scrollParam, { path: "/", secure: true, sameSite: "lax" });
242			}else{
243				$.cookie('scroll', scrollParam, { path: "/" });
244			}
245
246//			$.ajax({
247//				type	: "POST",
248//				cache	: false,
249//				data	: sc_data,
250//				async	: true,
251//				url		: scroll_count_url,
252//				success	: function() {
253//
254//				}
255//			});
256
257			// 終了時にタイマーを切る
258			clearTimeout(visittimer);
259		}, 2);
260
261		// スクロール
262		$(window).scroll(function() {
263			if (visittimer !== false) {
264				//console.log('visittimer false');
265				//console.log(sc_data);
266				clearTimeout(visittimer);
267			}
268			if (scrolltimer !== false) {
269				//console.log('scrolltimer false');
270				//console.log(sc_data)
271				clearTimeout(scrolltimer);
272			}
273
274			scrolltimer = setTimeout(function() {
275				scroll_y = $window.scrollTop();
276				scroll_x = $window.scrollLeft();
277
278				// 送信データ
279				sc_data = {
280					x			: scroll_x,
281					y			: scroll_y,
282					page_id		: scPageID,
283					site_type	: siteType,
284					url			: location.href,
285					'window'	: width + ',' + height,
286					'height'	: height,
287					'width'		: width,
288					'page_size'	: $('#bg').width() + ',' + $('#bg').height(),
289				};
290//console.log(scrollParam.length);
291				if (scrollParam.length <= 5) {
292					if (scrollParam.length == 5) {
293						var new_scrollParam = [];
294						for (let key in scrollParam) {
295							if (key == 0) continue;
296							new_scrollParam.push(scrollParam[key]);
297						}
298						scrollParam = new_scrollParam;
299//console.log(scrollParam);
300					}
301					scrollParam.push(sc_data);
302//console.log(scrollParam.length);
303//console.log(scrollParam);
304					// $.cookie('scroll', scrollParam, { path: "/" });
305					// cookie secure属性 設定
306					if ($("#cookie_secure_samesite_flg").val() == "1") {
307						$.cookie('scroll', scrollParam, { path: "/", secure: true, sameSite: "lax" });
308					}else{
309						$.cookie('scroll', scrollParam, { path: "/" });
310					}
311				}
312//				$.ajax({
313//					type	: "POST",
314//					cache	: false,
315//					data	: sc_data,
316//					async	: true,
317//					url		: scroll_count_url,
318//					success	: function() {
319//						//console.log(sc_data);
320//					}
321//				});
322			}, 1000);
323		});
324	}
325/*******************************************************************/
326
327/*******************************************************************/
328	//for access
329	var access_count_url = analysisUrl + '/access_count';
330	var paerntUrl        = "";
331	// #2828
332	if (window.parent && (window.parent !== window) && (document.location.search.indexOf('sp_preview_flg=1') == -1)) {
333		paerntUrl = parent.location.href;
334	}
335
336	//個別ブロックカウント対応(商品紹介など)
337	var block_id  = 0;
338	var record_id = 0;
339	if ($('#one-detail').length) {
340		block_id  = $('#one-detail').data('block-id');
341		record_id = $('#one-detail').data('record-id');
342	}
343
344	var data = {
345		url			: location.href,
346		page_id		: pageID,
347		page_device	: $params.data('device'),
348		referer		: document.referrer,
349		parent_url	: paerntUrl,
350		block_id	: block_id,
351		record_id	: record_id,
352		win_name	: window.name,	//#4766
353	};
354
355	$.ajax({
356		type	: "POST",
357		cache	: false,
358		data	: data,
359		async	: true,
360		url		: access_count_url
361	});
362	/*******************************************************************/
363/*
364	// ページ移動前に送信する
365//	scrollParam = $.cookie('scroll');
366//	clickParam  = $.cookie('click');
367	$(window).on('beforeunload', function(event) {
368console.log("send");
369console.log("scrollParam");
370console.log(scrollParam);
371console.log("clickParam");
372console.log(clickParam);
373		// 一括送信
374		var tracking_url = analysisUrl + '/tracking/';
375		$.ajax({
376			type	: "POST",
377			cache	: false,
378			data	: {
379				'sc_data'	: scrollParam,
380				'cl_data'	: clickParam,
381			},
382			async	: false,
383			url		: tracking_url,
384			success	: function() {
385				// クリアし
386//				$.removeCookie('scroll');
387//				scrollParam = [];
388//				$.removeCookie('scroll2');
389//				clickParam = [];
390//				$.cookie('scroll', scrollParam);
391//				$.cookie('scroll2', clickParam);
392			}
393		});
394	});
395
396*/
397	if (clickParam != [] || scrollParam != []) {
398//console.log("send");
399//console.log("scrollParam");
400//console.log(scrollParam);
401//console.log("clickParam");
402//console.log(clickParam);
403		// 一括送信
404		var tracking_url = analysisUrl + '/tracking/';
405		$.ajax({
406			type	: "POST",
407//			cache	: false,
408			data	: {
409				'sc_data'	: scrollParam,
410				'cl_data'	: clickParam,
411			},
412			async	: false,
413			url		: tracking_url,
414			success	: function() {
415				// クリアし
416				$.removeCookie('scroll', { path: "/" });
417				scrollParam = [];
418				$.removeCookie('click', { path: "/" });
419				clickParam = [];
420			}
421		});
422	}
423
424});

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.