PageSourceSearch

https://customjapan.jp/jl/js/handy.js

js customjapan.jp collected 2026-10-04 15:28:06 UTC 1,262 bytes, 61 lines download raw bytes

1(function($){
2
3
4/*---------------------------------------------
5	Check Handy
6  ---------------------------------------------*/
7
8/* ハンドヘルド端末(スマホやタブレット)の場合は、htmlタグに「handy」というclassを付ける */
9var nut = navigator.userAgent.toLowerCase();
10if(handy()) $("html").addClass("handy");
11
12//クエリー指定でhandy化
13var queries = window.location.search.split('?')[1];
14var query = [];
15if(queries){
16	query[0] = queries.slice(0);
17	if(queries.indexOf('&')!= -1){
18		query = queries.split('&');
19	}
20	for(var i=0;i< query.length;i++){
21		var key = query[i].split('=')[0];
22		var value = query[i].split('=')[1];
23		query[key] = value;
24	}
25	if(query){
26		if(query['test']=='handy'){
27			$("html").addClass("handy");
28		}
29	}
30}
31
32//テスト用
33//$("html").addClass("handy");
34
35})(jQuery);
36
37
38
39//ハンドヘルド端末判定
40function handy()
41{
42	var flg=0;
43	var UA = navigator.userAgent;
44	if
45	(
46		(UA.indexOf('iPhone') !== -1)
47		|| ((UA.indexOf('Android') !== -1) && (UA.indexOf('Mobile') !== -1))
48		|| (UA.indexOf('Windows Phone') !== -1)
49		|| (UA.indexOf('Windows CE') !== -1)
50		|| (UA.indexOf('BlackBerry') !== -1)
51		|| (UA.indexOf('Mobile') !== -1)
52		|| (UA.indexOf('Tablet') !== -1)
53	)
54	{
55		flg=1;
56	}
57
58	return flg;
59}
60
61

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.