PageSourceSearch

https://www.r-y-o.com/shared/js/sp_botan.js

js r-y-o.com collected 2026-10-08 01:51:42 UTC 3,128 bytes, 44 lines download raw bytes

1// JavaScript Document
2
3/* --------------------------------------------------------------------------------------
4  スマホの振り分け用ボタン
5--------------------------------------------------------------------------------------- */
6
7$(function (){
8	var sortSelect       = 1, //選択振り分けは「0」を。自動振り分けは「1」を入力
9		fontColor        = '#fff', //文字色
10		borderColor      = '#180f0a', //ボーダーの色
11		Gradation_top    = '#180f0a', //グラデーション上部の色
12		Gradation_bottom = '#180f0a', //グラデーション下部の色
13		font             = '"游明朝体", "Yu Mincho", YuMincho,"ヒラギノ明朝 Pro W3","Hiragino Mincho Pro","HGS明朝E","MS P明朝",serif',
14		//font             = '"Yu Gothic", YuGothic,"ヒラギノ角ゴ Pro W3","Hiragino Kaku Gothic Pro","メイリオ",Meiryo,"Osaka","MS Pゴシック","MS PGothic",sans-serif',
15		current_URL      = location.href, //現在のURL取得
16		sp_URL = current_URL.substr(0, current_URL.lastIndexOf("/")) + "/sp" + current_URL.substring(current_URL.lastIndexOf("/")); //スマホのURLに変換
17	
18	// iPhoneまたは、Androidの場合は振り分けを判断
19	if (document.referrer.indexOf('契約ドメイン') == -1 && ((navigator.userAgent.indexOf('iPhone') > 0 && 
20	navigator.userAgent.indexOf('iPad') == -1) || navigator.userAgent.indexOf('iPod') > 0 || navigator.userAgent.indexOf('Android') > 
21	0)) {
22		
23		if (sortSelect === 0) {
24			sp_alert();
25			sp_Btn();
26		} else if(sortSelect === 1) {
27			sp_Btn();
28		} 
29	}
30	
31	
32	function sp_alert() {
33		if(confirm('スマートフォン用のサイト表示しますか?\n(キャンセルの場合はPCサイトを表示します。)')) { location.href = sp_URL; }
34	}
35	
36	function sp_Btn() {
37		//スマホ閲覧時スマホサイト誘導ボタンのCSS
38		$("body").before('<style type="text/css">#sp_botan a{position:relative;top:0;left:0;width:100%;z-index: 100000000000;border:1px ' + borderColor + ' solid;padding:25px 0;text-align:center;font-size:32px;color:' + fontColor + ';display:block;text-decoration:none;font-family:' + font + ';, serif;background: #4a4759;background: -moz-linear-gradient(top,  ' + Gradation_top + ' 1%, ' + Gradation_bottom + ' 100%);background: -webkit-gradient(linear, left top, left bottom, color-stop(1%,' + Gradation_top +'), color-stop(100%,' + Gradation_bottom + '));background: -webkit-linear-gradient(top,  ' + Gradation_top + ' 1%,' + Gradation_top + ' 100%);background: -o-linear-gradient(top,  ' + Gradation_top +' 1%,' + Gradation_bottom + ' 100%);background: -ms-linear-gradient(top,  ' + Gradation_top + ' 1%,' + Gradation_bottom +' 100%);background: linear-gradient(to bottom,  ' + Gradation_top + ' 1%,' + Gradation_bottom + ' 100%);filter: progid:DXImageTransform.Microsoft.gradient( startColorstr="' + Gradation_top +'", endColorstr="' + Gradation_bottom + '",GradientType=0 );}</style>');
39		
40		//スマホ閲覧時スマホサイト誘導ボタンの出力
41		$("body").prepend('<p id="sp_botan"><a href="' + sp_URL +'">スマートフォンサイトはこちら</a></p>');
42	}
43});
44

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.