PageSourceSearch

https://www.og-cel.jp/common/js/devicemode_pc.js

js og-cel.jp collected 2026-10-02 19:52:07 UTC 1,548 bytes, 78 lines download raw bytes

1function isiPad() {
2	return RegExp("iPad;").test(navigator.userAgent);
3}
4function isWebKit() {
5	return RegExp(" AppleWebKit/").test(navigator.userAgent);
6}
7function isMobile() {
8	return isWebKit() && RegExp(" Mobile").test(navigator.userAgent) && !isiPad() ;
9}
10
11
12var pathArr = location.pathname.split("/"); 
13var param = location.search;
14// URL‚Ì”»•Ê
15if($.inArray('sp', pathArr) == -1) { // PC”Å‚ÌURL‚̂Ƃ«
16	// ƒfƒoƒCƒX‚Ì”»•Ê
17	if(isMobile() == true ) { // ƒXƒ}ƒz‚̂Ƃ«
18
19		// cookie‚ªŽg—p‰Â”\‚©”»•Ê
20		$.cookie(
21			'judgment',
22			'valid',
23			{
24				path:'/',
25				domain:'.osakagas.co.jp'
26			}
27		);
28		if($.cookie('judgment')) { // —˜—p‰Â”\‚̂Ƃ«
29
30			// —˜—p”»•Ê—p‚Ìcookie‚̍폜
31			$.cookie('judgment', null);
32
33			// devicemode‚Ì’l‚Ì”»•Ê
34			if(!$.cookie('devicemode')) { // devicemode‚É’l‚ª“ü‚Á‚ĂȂ¢‚Æ‚«
35
36				//ƒXƒ}ƒz”łւ̑JˆÚ
37				var thisHref = redirectUrl;
38				window.location = thisHref + param;
39
40			} else { // devicemode‚É’l‚ª“ü‚Á‚Ä‚¢‚邯‚«
41
42				// PC”Å‚Ö(ƒy[ƒW‘JˆÚ‚È‚µ)
43
44			}
45
46		// —˜—p•s‰ÂŽž‚̏ˆ—
47		} else {
48
49			// —˜—p”»•Ê—p‚Ìcookie‚̍폜
50			$.cookie('judgment', null);
51
52		}
53
54	} else { // ƒXƒ}ƒzˆÈŠO‚̂Ƃ«
55
56	}
57
58
59	$(function() {
60		// ƒXƒ}ƒz”łւ̗U“±ƒŠƒ“ƒN‚ðƒNƒŠƒbƒN‚µ‚½Žž
61		$('#sp_btn a').live('click', function() {
62			var thisHref = $(this).attr('href');
63			$.cookie(
64				'devicemode',
65				null,
66				{
67					expires:3,
68					path:'/',
69					domain:'.osakagas.co.jp'
70				}
71			);
72
73			window.location = thisHref;
74			return false;
75		});
76	});
77} else { // SP”Å‚ÌURL‚̂Ƃ«
78}

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.