PageSourceSearch

https://www.town.uchiko.ehime.jp/ssi/js/footstep.js

js town.uchiko.ehime.jp collected 2026-10-02 14:40:04 UTC 5,553 bytes, 138 lines download raw bytes

1jQuery(document).ready(function($){
2	if(('sessionStorage' in window) && (window.sessionStorage !== null)) {
3
4		var pageTitle = $('h1').text(); // ページタイトル
5		if($('.top_index')[0]){
6			pageTitle = 'トップページ'; // トップページの場合
7		}
8		else if($('.front_index')[0]){
9			pageTitle = 'フロントページ'; // フロントページの場合
10		}
11		else if($('h1 img')[0]){
12			pageTitle = $('h1 img').attr('alt');
13		}
14
15		var pageUrl = htmlspecialchars_URL(location.href);
16
17		// あしあとリスト
18		function  footstepList() {
19			var footstep_rireki_buf = ''; // 履歴一覧用
20
21			footstep_rireki_buf = JSON.parse(sessionStorage.getItem('footstep_rireki'));
22			if(footstep_rireki_buf === null){
23				footstep_rireki_buf = '';
24			}
25
26			// あしあとの親要素設置
27			if($('#pankuzu_wrap')[0]){
28				$('#pankuzu_wrap').append($('<div id="footstep_wrap" />'));
29			}else{
30				$('#mymainback').prepend($('<div id="footstep_wrap" />'));
31			}
32			$('#footstep_wrap').append('<div id="footstep"><div id="footstep_ttl">足あと</div><div id="footstep_detail"></div></div>');
33			// 今までのあしあとの展開
34			$('#footstep_detail').append(footstep_rireki_buf);
35			if($('#footstep_detail span:last-child a').attr('href') != pageUrl){
36				$('#footstep_detail').append('<span class="fs_rireki"><a href="' + pageUrl + '">' + pageTitle + '</a></span>');
37			}
38
39			// 末尾(現在のページ)はリンクさせない
40			$('#footstep_detail span:last-child a').on('click keypress',function(){
41				return false;
42			});
43			// あしあとクリア
44			$('#footstep').append('<button type="button" value="削除" id="clear_footstep">削除</button>');
45			$('#clear_footstep').on('click',function(){
46				$('#footstep_detail').html('');
47				footstep_rireki_buf = $('#footstep_detail').html();
48				sessionStorage.setItem('footstep_rireki',JSON.stringify(footstep_rireki_buf));
49				$(this).hide();
50				$('#footstep_ttl').hide();
51			});
52
53			// 最大10件の履歴を保持
54			if($('#footstep_detail > span').length > 10){
55				$('#footstep_detail > span:first-child').remove();
56			}
57
58			footstep_rireki_buf = $('#footstep_detail').html();
59			if(footstep_rireki_buf === undefined){footstep_rireki_buf = ''}
60			sessionStorage.setItem('footstep_rireki',JSON.stringify(footstep_rireki_buf));
61		}
62
63
64		// 最後に見たページを表示
65		function lastViewPage(){
66			var fs_lastItemHtml = $('#footstep span:last-child').html();
67			var fs_lastItemLS = JSON.parse(localStorage.getItem('footstep_lasturi'));
68			if(fs_lastItemLS === null){
69				fs_lastItemLS = '';
70			}
71
72			$('#header_nav2').prepend('<div id="link_lastviewpage" />');
73			$('#link_lastviewpage').prepend(fs_lastItemLS);
74
75			localStorage.setItem('footstep_lasturi',JSON.stringify(fs_lastItemHtml));
76		}
77
78
79		// ページ記憶:削除ボタンイベント割当
80		function kTPsetDelButton(ktp_buf){
81				$('#ktp_item_list .ktp_item_del').on('click keypress',function(){
82					$(this).closest('.ktp_item').remove();
83					ktp_buf = $('#ktp_item_list').html();
84					localStorage.setItem('keep_page_uri',JSON.stringify(ktp_buf));
85				});
86				return ktp_buf;
87		}
88		// ページ記憶
89		function keepThisPage() {
90			$('#container').after('<div id="keep_page"><div id="ktp_list_wrap"><div id="ktp_list_wrap2"><button type="button" id="ktp_save" class="btn_func"><span>このページを一時保存する</span></button><button type="button" id="ktp_del_all" class="btn_func"><span>保存したページをすべて削除する</span></button><ul id="ktp_item_list"></ul></div></div></div>');
91			$('#ktp_list_wrap').hide();
92			var ktp_buf = JSON.parse(localStorage.getItem('keep_page_uri'));
93			if(ktp_buf === null || ktp_buf === undefined){
94				ktp_buf = '';
95			}
96			$('#ktp_item_list').html(ktp_buf);
97			$('#keep_page').prepend('<div id="kpt_viewsw_wrap"><a href="javascript:void(0)" onclick="javascript:return false;" onkeypress="javascript:return false;" id="ktp_viewsw"><span>このページを一時保存する</span></a></div>');
98
99			// var ktp_area_width = $('#keep_page').width();
100			// $('#keep_page').css('right','-'+ktp_area_width+'px');
101
102			ktp_buf = kTPsetDelButton(ktp_buf)
103			$('#ktp_save').on('click keypress',function(){
104				// $('#keep_page').css('right','0px');
105				if($('#ktp_item_list li:first-child a').attr('href') != pageUrl){
106					$('#ktp_item_list').prepend('<li class="ktp_item"><a href="'+pageUrl+'">'+pageTitle+'</a><button type="button" value="削除" class="ktp_item_del">削除</button></li>');
107					ktp_buf = $('#ktp_item_list').html();
108					localStorage.setItem('keep_page_uri',JSON.stringify(ktp_buf));
109					// ktp_area_width = $('#keep_page').width();
110					// $('#keep_page').css('right','-'+ktp_area_width+'px');
111					ktp_buf = kTPsetDelButton(ktp_buf)
112				}
113			});
114			$('#ktp_del_all').on('click keypress',function(){
115				$('#ktp_item_list').empty();
116					ktp_buf = $('#ktp_item_list').html();
117					localStorage.setItem('keep_page_uri',JSON.stringify(ktp_buf));
118			});
119
120			$('#ktp_viewsw,#ktp_list_wrap').on('click keypress',function(event){
121				event.stopPropagation();
122			})
123			$('#ktp_viewsw').on('click keypress',function(){
124				$(this).toggleClass('open');
125				$('#ktp_list_wrap').toggle();
126			});
127			$(document).on('click keypress',function(){
128				$('#ktp_viewsw').removeClass('open');
129				$('#ktp_list_wrap').hide();
130			});
131		}
132
133		// keepThisPage();
134		footstepList();
135		// lastViewPage();
136
137	}
138});

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.