PageSourceSearch

https://printrider.jp/wp-content/plugins/insatu-shop/js/in2cart_util.js?ver=3.5-bp20260323

js printrider.jp collected 2026-10-07 23:02:36 UTC 8,527 bytes, 333 lines download raw bytes

1//-----------------------------------------
2//表示・非表示の切り換え
3//-----------------------------------------
4function in2cart_toggle(id, page_id) {
5	var flag = "";
6	if(document.getElementById(id)) {
7		if(jQuery('#' + id).is(':hidden')) {
8			jQuery('#' + id).show();
9			flag = "show";
10		} else {
11			jQuery('#' + id).hide();
12			flag = "hide";
13		}
14		if(id == "searchBox") {
15			jQuery.cookie(id + "_" + page_id, flag, { expires: 7 });
16		}
17	}
18}
19
20//------------------------------------------------
21//サブミット
22//------------------------------------------------
23function in2jump(url, formID, mode) {
24	if(formID == undefined) formID = 0;
25	if(mode != undefined) {
26		document.forms[formID].mode.value = mode;
27	}
28	if(url != undefined && url != "") {
29		document.forms[formID].action = url;
30	}
31	document.forms[formID].submit();
32}
33
34//------------------------------------------------
35//アラートダイアログ
36//------------------------------------------------
37function in2Dialog(msg) {
38	alert(msg);
39}
40
41//------------------------------------------------
42//確認ダイアログ
43//------------------------------------------------
44function in2ConfirmDialog(msg) {
45	if(window.confirm(msg)) {
46		return true;
47	} else {
48		return false;
49	}
50}
51
52//------------------------------------------------
53//URLのクエリ取得
54//------------------------------------------------
55function in2ReadParse() {
56	var vars = [], hash;
57	var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
58	for(var i = 0; i < hashes.length; i++) {
59		hash = hashes[i].split('=');
60		vars.push(hash[0]);
61		vars[hash[0]] = hash[1];
62	}
63	return vars;
64}
65
66//------------------------------------------------
67//URLへクエリ文字列作成
68//------------------------------------------------
69function in2UrlQuery(query) {
70	var arrData = new Array();
71	for(var key in query) {
72		arrData.push(key + "=" + encodeURI(query[key]));
73	}
74
75	return arrData.join("&");
76}
77
78//------------------------------------------------
79//Window open
80//------------------------------------------------
81function wopen(URL, Winname, Wwidth, Wheight){
82	var WIN;
83	WIN = window.open(URL,Winname,"width="+Wwidth+",height="+Wheight+",scrollbars=yes,resizable=yes,toolbar=no,location=no,directories=no,status=no");
84	WIN.focus();
85}
86
87//------------------------------------------------
88//htmlエスケープ
89//------------------------------------------------
90function escapeHtml(str) {
91  return str.replace(/&/g, '&amp;')
92            .replace(/</g, '&lt;')
93            .replace(/>/g, '&gt;')
94            .replace(/"/g, '&quot;')
95            .replace(/'/g, '&#039;');
96}
97
98//------------------------------------------------
99//htmlアンエスケープ
100//------------------------------------------------
101function unescapeHtml(str) {
102	if(str == undefined || str == "") return "";
103
104  str = str.replace(/&amp;/g, '&')
105            .replace(/&lt;/g, '<')
106            .replace(/&gt;/g, '>')
107            .replace(/&quot;/g, '"')
108            .replace(/&#039;/g, "'")
109            .replace(/&times;/g, "×");
110
111	return str;
112//	return jQuery('<div>').html(str).text();
113
114}
115
116/*
117var escapeHtml = (function (String) {
118  var escapeMap = {
119    '&': '&amp;',
120    "'": '&#x27;',
121    '`': '&#x60;',
122    '"': '&quot;',
123    '<': '&lt;',
124    '>': '&gt;'
125  };
126  var escapeReg = '[';
127  var reg;
128  for (var p in escapeMap) {
129    if (escapeMap.hasOwnProperty(p)) {
130      escapeReg += p;
131    }
132  }
133  escapeReg += ']';
134  reg = new RegExp(escapeReg, 'g');
135  return function escapeHtml (str) {
136    str = (str === null || str === undefined) ? '' : '' + str;
137    return str.replace(reg, function (match) {
138      return escapeMap[match];
139    });
140  };
141}(String));
142*/
143
144//------------------------------------------------
145//通貨のカンマ区切り
146//------------------------------------------------
147function number_format(val){
148	return val.replace( /(\d)(?=(\d\d\d)+(?!\d))/g, '$1,' );
149}
150
151//------------------------------------------------
152//整数か判定
153//------------------------------------------------
154function wd_is_number(val){
155	// チェック条件パターン
156//	var pattern = /^[-]?([1-9]\d*|0)(\.\d+)?$/;
157	var pattern = /^([1-9]\d*|0)$/;
158	// 数値チェック
159	return pattern.test(val);
160}
161
162//------------------------------------------------
163//0埋め
164//------------------------------------------------
165function wd_zero_padding(val, num) {
166
167	var arrZero = new Array();
168	for(var i = 0; i < num; i++) {
169		arrZero.push("0");
170	}
171
172	return (arrZero.join("") + val).slice(num * -1)
173}
174
175//-----------------------------------------
176//各種ajax処理
177//-----------------------------------------
178function wd_common_ajax(self, action, option) {
179
180	//ajax
181	var hshData = {};
182	hshData["action"] = action;
183	hshData["option"] = option
184	hshData["token"] = WD.js_token;
185
186	//オーバーレイ作成
187	if("overlay" in option) {
188		if(option["overlay"] == "in2cart") {
189			in2cart_create_overlay("open");
190		} else if(option["overlay"] == "pdf_queue") {
191			jQuery(".message_history").html("<img id='loading' src='images/loading.gif'>");
192		}
193	} else {
194		jQuery(self).after("<img id='loading' src='images/loading.gif'>");
195	}
196
197	jQuery.ajax({
198		url: WD.endpoint,
199		type: "POST",
200		cache: false,
201		async: true, 
202		data: hshData, 
203		success: function(data) {
204			var json = jQuery.parseJSON(data);
205			if(json.result == 0) {
206				if("no_alert" in option) {
207
208				} else {
209					wdDialog(json.msg);
210				}
211
212				//エラー表示
213				if("error" in json) {
214					in2FormError(json.error, true);
215				}
216
217				return false;
218			}
219
220			if(option.callback) {
221				option.callback(json);
222			}
223		}, 
224		error: function() {
225		}, 
226		complete: function() {
227			if("overlay" in option) {
228				if(option["overlay"] == "in2cart") {
229					in2cart_create_overlay("close");
230				}
231			} else {
232				jQuery("#loading").remove();
233			}
234
235//			wdgp_create_overlay("close");
236//			jQuery("#loading").remove();
237		}
238	});
239}
240
241/**
242 * 共通ファイルアップロードajax処理
243 *
244 * @param element self
245 * @param string option
246 */
247function wd_common_upload_ajax(self, option) {
248	in2FormError({}, false);
249	jQuery(self).after("<img id='loading' src='images/loading.gif'>");
250
251	jQuery.ajax({
252		url: WD.endpoint,
253		type: "POST",
254		cache: false,
255		async: true, 
256		data: option["formData"], 
257        contentType: false,
258        processData: false, 
259		success: function(data) {
260			var json = jQuery.parseJSON(data);
261			if(json.result == 0) {
262                if(json.msg != "") {
263    				wdDialog(json.msg);
264                }
265				in2FormError(json.error, true);
266				return false;
267			}
268
269			if(option.callback) {
270				option.callback(json);
271			}
272
273            // エラーのリセット
274            // wd_form_error({});
275		}, 
276		error: function() {
277			wdDialog("アップロードに失敗しました");
278		}, 
279		complete: function() {
280			jQuery("#loading").remove();
281		}
282	});
283}
284
285function wdDialog(msg) {
286	alert(msg);
287}
288
289//------------------------------------------------
290//チェックボックスのチェックにより背景色を変える
291//------------------------------------------------
292function wd_change_tr_color(self) {
293	var check = jQuery(self).prop("checked");
294	if(check) {
295		jQuery(self).closest("tr").find("td").css("background-color", "#fffbde");
296	} else {
297		jQuery(self).closest("tr").find("td").css("background-color", "");
298	}
299
300    // 全てのチェックの確認
301    var is_all_check = true;
302    jQuery(self).closest("table").find(".delete_checks").each(function() {
303        var check = jQuery(this).prop("checked");
304        if(!check) {
305            is_all_check = false;
306            return false;
307        }
308    });
309    if(is_all_check) {
310        jQuery(self).closest("table").find(".all_delete_check").prop("checked", true);
311    } else {
312        jQuery(self).closest("table").find(".all_delete_check").prop("checked", false);
313    }
314}
315
316/**
317 * 空 or undefined か判定
318 *
319 * @param {string} val
320 * @returns
321 */
322function wd_empty(val) {
323    if(val == "" || val === undefined) {
324        return true;
325    } else {
326        return false;
327    }
328}
329
330//------------------------------------------------
331//コンソールログ
332//------------------------------------------------
333function clog(v) { if(!document.all) console.log(v); }

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.