PageSourceSearch

https://www.city.togane.chiba.jp/js/toolbox.js?20221226

js city.togane.chiba.jp collected 2026-10-02 08:36:55 UTC 7,170 bytes, 196 lines download raw bytes

1/* フォントサイズ */
2function setCookie(s) {
3    cName = "fontsize_font=";
4    exp = new Date();
5    exp.setTime(exp.getTime() + 31536000000);
6    document.cookie = cName + s + "; path=/" + "; expires=" + exp.toGMTString();
7}
8
9function getCookie() {
10    zoom = "";
11    cName = "fontsize_font=";
12    tmpCookie = document.cookie + ";";
13
14    start = tmpCookie.indexOf(cName);
15    if (start != -1) {
16        end = tmpCookie.indexOf(";", start);
17        zoom = tmpCookie.substring(start + cName.length, end);
18        document.getElementById("body").style.fontSize = zoom;
19    } else {
20        document.getElementById("body").style.fontSize = "100%";
21    }
22}
23
24function textSizeUp() {
25    currentSize = document.getElementById("body").style.fontSize;
26    selectSize = "";
27    if (currentSize == "100%") {
28        selectSize = "110%";
29    } else if (currentSize == "110%") {
30        selectSize = "120%";
31    } else if (currentSize == "120%") {
32        selectSize = "150%";
33    } else if (currentSize == "150%") {
34        selectSize = "200%";
35    } else if (currentSize == "200%") {
36        m = escape("これ以上文字のサイズを大きくできません。");
37        alert(unescape(m));
38        selectSize = "200%";
39    } else {
40        selectSize = "110%";
41    }
42    document.getElementById("body").style.fontSize = selectSize;
43    setCookie(selectSize);
44}
45
46function textSizeReset() {
47    currentSize = document.getElementById("body").style.fontSize;
48    m = escape("ただいまの文字サイズは" + currentSize + "(標準:100%)です。元に戻しますか?");
49    r = confirm(unescape(m));
50    if (r) {
51        currentSize = "100%";
52        document.getElementById("body").style.fontSize = currentSize;
53    }
54    setCookie(currentSize);
55}
56
57function pagePrint() {
58    m = escape("このページを印刷(A4縦用紙)します。よろしいですか?");
59    r = confirm(unescape(m));
60    if (r) self.print();
61}
62
63function dispFootPrintList() {
64    storage = sessionStorage;
65    var panList = null;
66    var panUrlList = null;
67    var panHtml = "";
68    var panArr = [];
69    var panUrlArr = [];
70    var title = "";
71    var url = "";
72    panList = storage.getItem('panList');
73    panUrlList = storage.getItem('panUrlList');
74
75    title = $("title").text().split(" | ")[0]; // タイトル名取得
76    url = location.href; // URL取得
77
78    if (panList != null && panUrlList != null) {
79        panArr = panList.split('\n');
80        panUrlArr = panUrlList.split('>');
81        if (panUrlArr[panUrlArr.length - 1] != url) { // 違うページを表示した場合
82            panList = panList + '\n' + title;
83            panUrlList = panUrlList + '>' + url;
84            panArr.push(title);
85            panUrlArr.push(url);
86        }
87        if (panArr.length > 5) { // 5件まで表示
88            start = panList.indexOf('\n');
89            end = panList.length;
90            panList = panList.substring(start + 1, end);
91            panArr.shift();
92        }
93        storage.setItem('panList', panList);
94        if (panUrlArr.length > 5) { // 5件まで表示
95            start = panUrlList.indexOf('>');
96            end = panUrlList.length;
97            panUrlList = panUrlList.substring(start + 1, end);
98            panUrlArr.shift();
99        }
100        storage.setItem('panUrlList', panUrlList);
101        for (var index in panUrlArr) {
102            if (index == (panUrlArr.length - 1)) {
103                panHtml = panHtml + '<li>' + panArr[index] + '</li>';
104            } else {
105                panHtml = panHtml + '<li><a href="' + panUrlArr[index] + '">' + panArr[index] + '</a></li>';
106            }
107        }
108        if (panHtml != null && document.getElementById('pankuzu2') != null) { // あしあとリスト表示
109            document.getElementById('pankuzu2').innerHTML = panHtml;
110        }
111    } else {
112        if (panList == null) {
113            storage.setItem('panList', title);
114        }
115        if (panUrlList == null) {
116            storage.setItem('panUrlList', url);
117        }
118    }
119}
120
121// 足あと・色の反転
122$(function () {
123    dispFootPrintList();
124    getCookie();
125    getColorCookie();
126});
127
128//ID検索
129function bindIdSearch(wrapper_id, main_url_path) {
130    if ($('#' + wrapper_id).length) {
131        var wrapper = $('#' + wrapper_id);
132        var searchButton = wrapper.find('button[type="submit"]');
133        var searchBox = wrapper.find('input[name="q"]');
134        var result = $('<div>');
135        wrapper.append(result);
136        var result_css = {
137            "font-size": "80%",
138            "border-top": "1px solid #ccc",
139            "padding": "8px"
140        };
141        searchButton.on('click', function () {
142
143            var sno = searchBox.val();
144            var filePath = '';
145
146            if (sno.match(/^([1-9]\d*|0)$/) == null) { // 半角数字以外の文字および未入力の場合
147                result.css(result_css);
148                result.html("<p>半角数字10桁以内で入力してください。</p>");
149                return false;
150            }
151            if (sno.length > 10) { // 10桁を超える番号が入力された場合
152                result.css(result_css);
153                result.html("<p>半角数字10桁以内で入力してください。</p>");
154                return false;
155            } else {
156                var page = parseInt(sno / 1000);
157                var filePath = main_url_path + 'cmsfiles/contents/' + ('0000000' + page).slice(-7) + '.dat';
158
159                $.ajax({
160                    url: filePath,
161                    method: 'POST',
162                    dataType: "text",
163                    success: function (data) {
164                        var contentsList = [];
165                        var lines = data.split(String.fromCharCode(10)); // 改行ごとに区切る
166                        for (var i = 0; i < lines.length; ++i) {
167                            var cells = lines[i].split(","); // カンマごとに区切る
168                            contentsList[cells[0]] = cells[1];
169                        }
170                        if (contentsList[sno] != null) {
171
172                            window.open(main_url_path + contentsList[sno], '_self');
173                        } else {
174                            result.css(result_css);
175                            result.html("<p>入力された番号のコンテンツが見つかりませんでした。</p>");
176                        }
177                        return false;
178                    },
179                    error: function () {
180                        result.css(result_css);
181                        result.html("<p>入力された番号のコンテンツが見つかりませんでした。</p>");
182                        return false;
183                    }
184                })
185                return false;
186            }
187        })
188    }
189}
190
191$(function () {
192    var main_url_path = '/';
193    bindIdSearch("cse-search-box2", main_url_path);
194    bindIdSearch("cse-search-box-sp2", main_url_path);
195
196});

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.