PageSourceSearch

https://kadenkaitori.tokyo/home/default/static/js/common.js

js kadenkaitori.tokyo collected 2026-10-05 03:39:30 UTC 8,009 bytes, 257 lines download raw bytes

1$(function(){
2
3	var clearTime = null;
4
5	get_cart_num();
6
7	setSnsShare(location.href,$("meta[name='description']").attr("content"));
8
9	isTagToggle();
10	$(".hotword li a").each(function(){
11		$(this).click(function(){
12			var words = $(this).text();
13			$("input[name='q']").val(words);
14			$("form[id='fullsearch']").submit();
15		});
16	});
17	$(".quick_side").each(function(){
18		$(this).find("li").slice(10).hide();
19	});
20	$(".btn-more").click(function(){
21		$(this).siblings(".quick_side").find("li").slice(10).toggle();
22		var labtext = $(this).find("img").attr("alt");
23		if(labtext=='開く')
24		{
25		    $(this).find("img").attr('alt','閉じる');
26                    $(this).find("img").attr('src','/home/default/static/images/navigation/more_close.jpg');
27		}
28		else
29		{
30		    $(this).find("img").attr('alt','開く');
31                    $(this).find("img").attr('src','/home/default/static/images/navigation/more_open.jpg');
32		}
33	});
34
35
36	var categoryItemNum = $(".sub-category ul").find("li").length;
37	if(categoryItemNum>24){
38		$(".sub-category ul").find("li").slice(24).hide();
39		$(".sub-category .btn-fl-more").html("more").attr("onclick","categoryToggle(true)");
40	}else{
41		$(".sub-category .btn-fl-more").css("display","none");
42	}
43
44
45    $(".sub-box").on("click",".collect",function(){
46        var that= $(this);
47        var gid=that.data("value");
48        $.ajax({
49            type: "post",
50            url: "/home/Goods/collect_goods",
51            data: {
52                gid: gid,
53            },
54            success: function (resp) {
55                if (resp.status == 1) {
56                    layer.msg(resp.msg, {time:1000,icon: 1,shade:0,area : '250px'});
57                    that.data("isok") ? that.data("isok", false).removeClass("active") : that.data("isok", true).addClass("active");
58                }
59                else if(resp.status ==2)
60                {
61                    layer.msg('「会員専用機能」ログイン後ご利用いただけます', {icon: 0,shade:0,area : '390px'});
62                }
63            }
64        });
65    });
66
67
68
69});
70
71function categoryToggle(flag){
72	$(".sub-category ul").find("li").slice(24).toggle();
73	flag?$(".sub-category .btn-fl-more").html("less").attr("onclick","categoryToggle(false)"):$(".sub-category .btn-fl-more").html("more").attr("onclick","categoryToggle(true)");
74}
75
76function get_cart_num()
77{
78	$.ajax({
79		type: "GET",
80		url: "/home/api/header_cart_sum",
81		success: function (data) {
82			$('#cart_quantity,#mobile_cart_quantity').html(data);
83		}
84	});
85}
86
87function user_login_or_no()
88{
89	var uname = getCookie('uname');
90	if (uname == '') {
91		$('.islogin').remove();
92		$('.nologin').show();
93	} else {
94		$('.nologin').remove();
95		$('.islogin').show();
96	}
97}
98
99function nofind(imgObject)
100{
101    imgObject.src = "/upload/goods/nophoto.png";
102    imgObject.onerror=null;
103}
104
105function TagToggle(){
106
107	var sub_category_xs_ul = $(".sub-category-xs ul");
108
109	if(sub_category_xs_ul.hasClass("controls_hide")){
110		sub_category_xs_ul.removeClass("controls_hide").nextAll("button.btn").html("閉じる");
111	}else{
112		sub_category_xs_ul.addClass("controls_hide").nextAll("button.btn").html("開く");
113	}
114}
115
116function isTagToggle(){
117	var sub_category_xs_ul = $(".sub-category-xs ul");
118	if(sub_category_xs_ul.height()>150){
119		console.log(sub_category_xs_ul.height());
120		sub_category_xs_ul.addClass('controls_hide').nextAll("button.btn").html("開く");
121
122	}else{
123		sub_category_xs_ul.nextAll("button.btn").removeClass('visible-xs').css("display","none");
124	}
125}
126
127
128function shareToggle(){
129	var shareBox = $(".share-box");
130
131	if(shareBox.hasClass("controls-show")){
132		shareBox.removeClass("controls-show");
133		$(".page-share").css("backgroundColor","#F08500");
134	}else{
135		shareBox.addClass("controls-show");
136		$(".page-share").css("backgroundColor","#CF1C18");
137	}
138
139}
140
141
142function setSnsShare(shareUrl, title) {
143    setTwitterLink(".twitter_share a", shareUrl,title);
144    setFacebookLink(".facebook_share a", shareUrl, title);
145    setGooglePlusLink(".google_share a", shareUrl, title);
146    setHatebuLink(".hatena_share a", shareUrl, title);
147    setQQLink(".QQ_share a", shareUrl, title);
148    setLineLink(".LINE_share a", shareUrl, title);
149    setPocketLink(".pocket_share a", shareUrl);
150}
151
152function setTwitterLink(shareSelector, shareUrl, title) {
153    $(shareSelector).attr("href", "https://twitter.com/share?shareUrl=" + shareUrl + "&text=" + encodeURIComponent(title));
154    setShareEvent(shareSelector, 'Twitter', shareUrl);
155}
156
157function setFacebookLink(shareSelector, shareUrl, title) {
158    $(shareSelector).attr("href", "https://www.facebook.com/sharer/sharer.php?u=" + shareUrl + "&t=" + encodeURIComponent(title));    
159    setShareEvent(shareSelector, 'Facebook', shareUrl);
160}
161
162
163function setHatebuLink(shareSelector, shareUrl, title) {
164	$(shareSelector).attr("href", "https://b.hatena.ne.jp/append?"+ shareUrl);
165    setShareEvent(shareSelector, 'Hatena Bookmark', shareUrl);
166}
167
168function setGooglePlusLink(shareSelector, shareUrl, title) {
169    $(shareSelector).attr("href", "https://plus.google.com/share?url=" + shareUrl);
170    setShareEvent(shareSelector, 'Google+', shareUrl);
171}
172
173function setQQLink(shareSelector, shareUrl, title) {
174
175    $(shareSelector).attr("href", "http://connect.qq.com/widget/shareqq/index.html?url=" + shareUrl + "&showcount=0&desc=&summary="+encodeURIComponent($("meta[name='description']").attr("content").slice(0,20))+"...&title="+encodeURIComponent(title)+"&site=iphonekaitori&pics=");
176    setShareEvent(shareSelector, 'QQ', shareUrl);
177}
178
179function setLineLink(shareSelector, shareUrl, title) {
180	$(shareSelector).attr("href", "https://lineit.line.me/share/ui?url=" + shareUrl+"&text=" + encodeURIComponent(title) + " " + shareUrl);
181   // $(shareSelector).attr("href", "http://line.me/R/msg/text/?" + encodeURIComponent(description + " " + shareUrl));
182    setShareEvent(shareSelector, 'LINE', shareUrl);
183}
184function setPocketLink(shareSelector, shareUrl, title){
185	$(shareSelector).attr("href","https://getpocket.com/edit?url=" + shareUrl+"&title=" + encodeURIComponent(title));
186	setShareEvent(shareSelector, 'Pocket', shareUrl);
187}
188
189function setShareEvent(selector, snsName, shareUrl) {
190    $(selector).on('click', function(e){
191
192        var current = this;
193
194		ga('send', 'social', snsName, 'share', shareUrl, {
195			'nonInteraction': 1
196		});
197
198        window.open(current.href, '_blank', 'width=740, height=600, menubar=no, toolbar=no, scrollbars=yes');
199        e.preventDefault();
200    }); 
201}
202
203
204
205function copy(){
206	var copyText=$(".copy_text");
207	copyText.html($("title").html()+" 链接地址:"+location.href);
208	copyText.select(); // 选择对象
209	document.execCommand("Copy"); // 执行浏览器复制命令
210
211
212	if($(".share-info").hasClass("controls-show")){
213
214	}else{
215		$(".share-info").addClass("controls-show");
216		var clearTime = setTimeout(function(){
217			$(".share-info").removeClass("controls-show");
218		},3000);
219	}
220	
221}
222
223
224function FontSize(that, num){
225	$(that).addClass("active").siblings().removeClass("active");
226	var article = document.getElementById("article");
227	switch(num){
228		case -1: 
229			article.className="wz-article font-xs";
230			break;
231		case 0: 
232			article.className="wz-article";
233			break;
234		case 1: 
235			article.className="wz-article font-lg";	
236			break;
237	}
238}
239
240function toHalfWidth(elm) {
241	return elm.value.replace(/[A-Za-z0-9!-~]/g, function(s){
242		return String.fromCharCode(s.charCodeAt(0)-0xFEE0);
243	});
244}
245
246function katakana(elm) {
247	return elm.value.replace(/[0-9]/g, function (s) {
248			return String.fromCharCode(s.charCodeAt(0) - 65248);
249		})
250		.replace(/゙/g, '゛')
251		.replace(/゚/g, '゜')
252		.replace(/ /g, ' ')
253		.replace(/[‐-―]/g, '-')
254		.replace(/(/g, '(')
255		.replace(/)/g, ')');
256		//.replace(/[^ァ-ヴーヽヾヵヶヷヸヹヺ゛゜ \d\-]/g, '');
257}

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.