PageSourceSearch

https://w-lax.com/js/common.js?v=7

js w-lax.com collected 2026-10-04 19:37:15 UTC 7,087 bytes, 264 lines download raw bytes

1/**
2 * デバッグ用
3 *
4 **/
5if (!('console' in window)) {
6
7	window.console = {};
8	window.console.log = function(str) {
9		alert(str);
10	};
11}
12$(function() {
13
14	$('.twitter-timeline').attr('data-height', 500);
15
16    $("#contents img").not(".scale").not(".captcha").not(".player-lg").each(function() {
17		if($(this).attr('src').match(/closebtn/)){
18			return true;
19		}
20        var width = $(this).width();
21        var height = $(this).height();
22        $(this).css("max-width", "500px");
23        //$(this).css("min-width", "100px");
24        //$(this).css("min-height", "100px");
25        //$(this).css("height", "100px");
26        $(this).removeAttr('height');
27        $(this).removeAttr('width');
28        $(this).css("height", "auto");
29    });
30
31	var colorbox_params = {
32		reposition: true,
33		scalePhotos: true,
34		scrolling: false,
35		previous: '<i class="icon-arrow-left"></i>',
36		next: '<i class="icon-arrow-right"></i>',
37		close: '&times;',
38		current: '{current} of {total}',
39		maxWidth: '100%',
40		maxHeight: '100%',
41		onOpen: function() {
42			document.body.style.overflow = 'hidden';
43		},
44		onClosed: function() {
45			document.body.style.overflow = 'auto';
46		},
47		onComplete: function() {
48			$.colorbox.resize();
49		}
50	};
51
52	$("a[rel^='prettyPhoto']").colorbox(colorbox_params);
53	$("a[rel^='youtube']").colorbox({
54		iframe:true,
55		maxWidth: '100%',
56		maxHeight: '100%',
57		innerWidth:425,
58		innerHeight:344
59	});
60//
61	$("#category").css("height", $("#category").height() - 20 + "px");
62
63	//ページ内スクロール
64	$(".btn_scroll").click(function() {
65		var i = $(".btn_scroll").index(this)
66		var p = $(".content_scroll").eq(i).offset().top;
67		var a = $(".content_scroll").eq(i).attr("id");
68		$('html,body').animate({
69			scrollTop: p
70		}, 'slow', null, function() {
71			location.href = "#" + a;
72		});
73		return false;
74	});
75	/*$(".menucol").each(function(i, val) {
76	 $(this).click(function() {
77	 location.href = $(".menucol2 a").eq(i).attr("href");
78	 });
79	 });*/
80	jQuery.postJSON = function(url, postdata, callback) {
81		var func = function(data) {
82			callback(data);
83		}
84		jQuery.post(url, postdata, func, "json");
85	};
86
87	$(".overphoto img").mouseenter(function() {
88		$container = $(this).parent('.overphoto');
89		if ($container.attr('data-caption') == "")
90			return;
91		$container.css('position', 'relative');
92		$(".mask").remove();
93		$mask = $("<div></div>").css({'text-align': 'center', 'padding-top': '40%', 'font-size': '14px'}).css('color', 'white').css("background", 'black').css('opacity', 0).css('position', 'absolute').addClass('mask');
94		$mask.text($container.attr('data-caption'));
95		$mask.width($container.width());
96		$mask.height($container.height());
97
98		$container.append($mask);
99		$mask.mouseleave(function() {
100			$mask.animate({"opacity": 0}, 100, null, function() {
101				$(this).remove();
102			});
103		});
104		$mask.animate({"opacity": 0.7}, 100);
105	});
106
107	setImageScale();
108	setContentScale();
109
110});
111
112$(document).ready(function() {
113	$('#simple-menu').sidr();
114});
115var resizetimer = false;
116$(window).resize(function() {
117	if (resizetimer !== false) {
118		clearTimeout(resizetimer);
119	}
120	resizetimer = setTimeout(function() {
121		//console.log('resized');
122		setImageScale();
123		setSocialSize();
124		setContentScale();
125	}, 200);
126});
127var sizeFixedCounter = 0;//3回チェックする。
128function setSocialSize() {
129	return;
130	//console.log('set social');
131	if ($("#fb-wrapper").size()>0) {
132
133		var width = $("#fb-wrapper").width();
134        width = Math.max(340,width);
135        if (++sizeFixedCounter == 3)
136            return;
137		sizeFixedCounter = 0;
138		$(".fb-like-box").css('width', width + "px");
139		if ($(".fb_iframe_widget span").size() == 0) {
140
141			$(this).delay(1000).queue(setSocialSize);
142			return;
143		}
144		$(document).find(".fb_iframe_widget iframe").css('width', width + "px");
145		$(".fb_iframe_widget iframe").width(width);
146		$(document).find(".fb_iframe_widget  span").css('width', width + "px");
147
148		$(document).find(".fb_iframe_widget  span").width(width);
149
150		$(document).find(".fb_iframe_widget iframe").css('height', $("#fb-wrapper").height());
151		$(this).delay(1000).queue(setSocialSize);
152
153	}
154	/*
155	if ($("#twitter-wrapper").size()) {
156		var width = $("#twitter-wrapper").width();
157        width = Math.min(520,width);
158        if (++sizeFixedCounter == 3)
159            return;
160		$(document).find("#twitter-wrapper iframe").css('width', width + "px");
161		$("#twitter-wrapper iframe").width(width);
162		$(document).find("#twitter-wrapper iframe").css('height', $("#twitter-wrapper").height());
163		$(this).delay(1000).queue(setSocialSize);
164		//console.log('test');
165	}
166
167*/
168
169}
170function setContentScale() {
171	if ($(".introduce").size() > 0) {
172		var width = $("#contents").width();
173		$(".introduce").children().each(function() {
174			if ($(this).width() > width) {
175				$(this).attr('width', '');
176				$(this).css('width', width + "px");
177			}
178		});
179	}
180
181}
182function setImageScale() {
183	$("img.scale").each(function() {
184		$(this).css({"position": "absolute",
185			"left": 0,
186			"top": 0,
187			"max-width": ""});
188		if ($(this).parent().css("position") != "absolute") {
189			$(this).parent().css({position: "relative"});
190		}
191		$(this).parent().css({
192			overflow: "hidden"
193
194		});
195		var width = $(this).parent().width();
196		var height = $(this).parent().height();
197		var widthWide = true;
198		if (width / height > $(this).width() / $(this).height()) {
199			widthWide = false;
200		}
201		if ($(this).attr("data-fit") == "contain") {
202			widthWide = !widthWide;
203		}
204		if (!widthWide) {
205			height = $(this).height() * width / $(this).width();
206		} else {
207			width = $(this).width() * height / $(this).height();
208		}
209		if (true || $(this).attr("data-fit") != "contain") {
210			$(this).css({
211				top: -((height - $(this).parent().height()) / 2) + "px",
212				left: -((width - $(this).parent().width()) / 2) + "px",
213			});
214		}
215		var border_width = parseFloat($(this).css("border-width").replace("px", ""));
216		if (isNaN(border_width)) {
217			border_width = 0;
218		}
219		$(this).css('width', Math.ceil(width - border_width) + 'px');
220		$(this).height('height', Math.ceil(height - border_width) + 'px');
221		$(this).fadeIn();
222		$(this).addClass('scale_visible');
223	});
224
225	//logo調整
226	//$("#logo").width($("#logo img").width());
227}
228$(document).load(function(){
229
230	window.instgrm.Embeds.process();
231});
232window.addEventListener("load", function() {
233	setImageScale();
234
235	setTimeout(function() {
236		scrollBy(0, 1);
237
238		//スライドショー
239		var $setElm = $('#top_images'),
240				fadeSpeed = 1500,
241				switchDelay = 5000;
242
243		$setElm.each(function() {
244			var targetObj = $(this);
245			var findLi = targetObj.find('img');
246			var findLiFirst = targetObj.find('img:first');
247
248			findLi.css({display: 'block', opacity: '1', zIndex: '99'});
249			findLiFirst.css({zIndex: '100'}).stop().animate({opacity: '1'}, fadeSpeed);
250
251			setInterval(function() {
252				targetObj.find('img').each(function(i) {
253					$(this).css('zIndex', 100 - i).css('opacity', 1);
254				})
255				targetObj.find('img:first-child')
256						.animate({opacity: '0'}, fadeSpeed, null, function() {
257							$(this).css('zIndex', 1).detach().appendTo(targetObj);
258
259						});
260			}, switchDelay);
261		});
262	}, 100);
263	setSocialSize();
264}, false);

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.