PageSourceSearch

https://www.sanai-net.com/assets/js/cash.js

js sanai-net.com collected 2026-10-06 08:15:13 UTC 6,651 bytes, 216 lines download raw bytes

1// JavaScript Document
2
3$(function () {
4
5// 対象URL:http://gray-code.com/js_sample/url3.html?username=teest&mode=data1&mode=data2
6
7// URLを取得
8var url = new URL(window.location.href);
9
10// URLSearchParamsオブジェクトを取得
11var params = url.searchParams;
12
13//params.delete('pnumber');
14
15
16// アドレスバーのURLからGETパラメータを削除
17//history.replaceState('', '', url.pathname);
18	
19	
20
21    //Pagenation作成
22    //setPagenation(5);
23	
24});
25//*************************************************************************************
26//  名  称  : cookie登録削除処理
27//  概  要  :
28//*************************************************************************************
29/* cookie登録削除処理 */
30$(document).on('click', '.chk', function(){
31    if ($(this).prop('checked')) {
32        $.cookie($(this).val(), "true");
33        var cl = $.cookie("clear");
34        if (cl) {
35            cl = cl + ",";
36        } else {
37            cl = "";
38        }
39        $.cookie("clear", cl + $(this).val());
40    } else {
41        $.removeCookie($(this).val());
42    }
43});
44 
45/* 遷移時チェック */
46$(document).ready(function(){
47    $(".chk").each(function(){
48        id = $(this).val();
49        if ($.cookie(id)) {
50            $(this).prop("checked", true);
51        }
52    });
53	
54});
55 
56 
57/* 選択クリア */
58$(document).on('click', "#cookie_clear", function(){
59    var cl = $.cookie("clear");
60    var arr = cl.split(',');
61    arr.forEach(function(value) {
62        $.removeCookie(value);
63    });
64    $.removeCookie("clear");
65    window.location.href = "/?m=list"; /* リストページの先頭に遷移 */
66});
67
68
69
70
71
72
73    
74function setPagenation(arg_Page) {
75  var ulMain = window.document.getElementById("ulPagenation")
76  var liPage;
77  var pLink;
78  var newTextNode; //内部テキスト
79  //置き換えるpタグ
80  var pLinkPointFront = document.createElement("p");
81  pLinkPointFront.setAttribute("id", "liPageFront");
82  pLinkPointFront.style.position = 'relative';
83  pLinkPointFront.style.display = 'none';
84  pLinkPointFront.style.padding = '0.5rem 0.75rem';
85  pLinkPointFront.style.marginLeft = '-1px';
86  pLinkPointFront.style.lineHeight = '1.25';
87  pLinkPointFront.style.color = '#2B4162';
88  pLinkPointFront.style.backgroundColor = '#fff';
89  pLinkPointFront.style.border = '1px solid #d8e2ef';
90  newTextNode = document.createTextNode('...');
91  pLinkPointFront.appendChild(newTextNode);
92  var pLinkPointRear = document.createElement("p");
93  pLinkPointRear.setAttribute("id", "liPageRear");
94  pLinkPointRear.style.position = 'relative';
95  pLinkPointRear.style.display = 'none';
96  pLinkPointRear.style.padding = '0.5rem 0.75rem';
97  pLinkPointRear.style.marginLeft = '-1px';
98  pLinkPointRear.style.lineHeight = '1.25';
99  pLinkPointRear.style.color = '#2B4162';
100  pLinkPointRear.style.backgroundColor = '#fff';
101  pLinkPointRear.style.border = '1px solid #d8e2ef';
102  newTextNode = document.createTextNode('...');
103  pLinkPointRear.appendChild(newTextNode);
104
105  //画面初期化
106  $("#ulPagenation").empty();
107
108  //Prev作成
109  var liPrev = document.createElement("li");
110  liPrev.setAttribute("class", "page-item");
111  pLink = document.createElement("p");
112  pLink.setAttribute("class", "page-link");
113  pLink.addEventListener("click", onClick_liPrev, false);
114  newTextNode = document.createTextNode("<");
115  pLink.appendChild(newTextNode);
116  liPrev.appendChild(pLink);
117  ulMain.appendChild(liPrev);
118
119  //各ページリンク作成
120  maxPage = $('#ulPagenation').attr('data-maxpage') - 0;
121  for (var i = 1; i <= maxPage; i++) {
122    var liPage = document.createElement("li");
123    liPage.setAttribute("class", "page-item");
124    liPage.setAttribute("id", "liPage" + i);
125    pLink = document.createElement("p");
126    pLink.setAttribute("class", "page-link");
127    pLink.addEventListener("click", onClick_liPage, false);
128    pLink.eventParam = i;
129    newTextNode = document.createTextNode(i);
130    pLink.appendChild(newTextNode);
131    liPage.appendChild(pLink);
132    //2ページ目 or ラストの場合
133    if (i == 2) {
134      ulMain.appendChild(pLinkPointFront);
135    }
136    if (i == maxPage) {
137      ulMain.appendChild(pLinkPointRear);
138    }
139    ulMain.appendChild(liPage);
140    //指定ページをアクティブ
141    if (i == arg_Page) {
142      liPage.classList.add("active");
143    }
144  }
145
146  //Pagenation調整
147  setPagenationNum(arg_Page);
148
149  //Next作成
150  var liNext = document.createElement("li");
151  liNext.setAttribute("class", "page-item");
152  pLink = document.createElement("p");
153  pLink.setAttribute("class", "page-link");
154  pLink.addEventListener("click", onClick_liNext, false);
155  newTextNode = document.createTextNode(">");
156  pLink.appendChild(newTextNode);
157  liNext.appendChild(pLink);
158  ulMain.appendChild(liNext);
159}
160
161
162
163//*************************************************************************************
164//  名  称  :  Pagenation調整
165//  概  要  :
166//*************************************************************************************
167function setPagenationNum(arg_Page) {
168  //ページ数取得
169  maxPage = $('#ulPagenation').attr('data-maxpage') - 0;
170
171  //前部の設定
172  for (var i = 1; i <= maxPage; i++) {
173    //4ページ目の場合、前部の「...」を表示
174    if (i == 4) {
175      $('#liPageFront').css('display', 'block');
176      $('#liPage' + (i - 2)).css('display', 'none');
177    }
178
179    //4ページ目以降の場合、-1ページ目を非表示
180    if (i >= 4) {
181      $('#liPage' + (i - 1)).css('display', 'none');
182    }
183
184    //選択ページに到達したら脱出
185    if (i == arg_Page) {
186      $('#liPage' + (i - 1)).css('display', 'block');
187      if (arg_Page < 4) {
188        $('#liPageFront').css('display', 'none');
189      }
190      break;
191    }
192  }
193
194  //後部の設定
195  for (var i = maxPage; 1 <= i; i--) {
196    //4ページ目の場合、前部の「...」を表示
197    if (i == maxPage - 3) {
198      $('#liPageRear').css('display', 'block');
199      $('#liPage' + (i + 2)).css('display', 'none');
200    }
201
202    //-4ページ目以降の場合、-2ページ目を非表示
203    if (maxPage - 3 >= i) {
204      $('#liPage' + (i + 1)).css('display', 'none');
205    }
206
207    //選択ページに到達したら脱出
208    if (i == arg_Page) {
209      $('#liPage' + (i + 1)).css('display', 'block');
210      if (arg_Page > maxPage - 3) {
211        $('#liPageRear').css('display', 'none');
212      }
213      break;
214    }
215  }
216}

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.