PageSourceSearch

https://www.pref.yamanashi.jp/shared/system/js/path_info/path_info.js

js pref.yamanashi.jp collected 2026-09-24 08:37:27 UTC 1,453 bytes, 56 lines download raw bytes

1(function($){
2
3	/**
4	 * Covert char fullsize to haftsize
5	 * @return Char
6	 */
7	function convertToHalfWidth(fullWidthNum) {
8		return fullWidthNum.replace(/[\uFF10-\uFF19]/g, function(m) {
9			return String.fromCharCode(m.charCodeAt(0) - 0xfee0);
10		});
11	}
12
13	$(function() {
14		$("#id_search_btn").click(function(e) {
15			searchPageId(e);
16		});
17		// エンターキークリック時に検索する
18		$("#id_search_txt").keypress(function(e) {
19			if (e.keyCode == 13) {
20				searchPageId(e);
21			}
22		});
23		
24		function searchPageId(e) {
25			var pageId = convertToHalfWidth($("#id_search_txt").val());
26			if (pageId.length === 0) {
27				alert("ページIDが指定されていません。");
28			} else if (isNaN(pageId)) {
29				alert("ページIDが不正です。");
30			} else {
31				$.ajax({
32					url : '/cgi-bin/search_page/search_page.php',
33					type : "POST",
34					cache : false,
35					async : true,
36					dataType: 'json',
37					data : { page_id : pageId },
38					scriptCharset : 'UTF-8',
39					success : function(ret) {
40						if (ret.result_code == 1) {
41							window.location.href = ret.path;
42						} else {
43							alert("対象のページが見つかりませんでした。");
44						}
45					},
46					error : function(XMLHttpRequest, textStatus, errorThrow) {
47						alert("ページ情報の取得に失敗しました。");
48						return false;
49					}
50				});
51			}
52			e.preventDefault();
53		}
54	});
55
56})(jQuery);

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.