PageSourceSearch

https://okane-antena.com/js/_set_vfunc.js?20260925

js okane-antena.com collected 2026-09-25 14:08:16 UTC 11,727 bytes, 634 lines download raw bytes

1
2/*-----------------------------
3sleep
4------------------------------*/
5
6
7function sleep(time, callback){
8	setTimeout(callback, time);
9}
10
11/*-----------------------------
12高さをそろえる
13------------------------------*/
14
15function align_height() {
16	var mainH = $("#main").height();
17	var subH = $("#sub").height();
18	if (mainH>subH) {
19		$("#sub")
20			.height(mainH)
21		;
22	}
23}
24
25
26/*-----------------------------
27tableの背景色
28------------------------------*/
29
30function table_bg() {
31	$("table.feed_list").find("tr.oe")
32		.each(
33			function(i) {
34				var cls = i%2==0 ? 'odd' : 'even';
35				$(this)
36					.removeClass('odd')
37					.removeClass('even')
38					.addClass(cls);
39				;
40			}
41		)
42	;
43}
44
45/*-----------------------------
46balloonエフェクト系
47------------------------------*/
48
49function balloon_set() {
50	$("p.f_title")
51		.each(
52			function() {
53				var except = $(this).find("span").text();
54				$(this).find("a")
55					.attr("title", except)
56					.addClass("balloon")
57				;
58				$(this).find("span")
59					.remove()
60				;
61			}
62		)
63	;
64	$("p.f_title2")
65		.each(
66			function() {
67				var except = $(this).find("span").text();
68				var bname = $(this).find("strong").text();
69				if (bname!=null) {
70					var except = '<strong style="color: #800000; font-weight: bold;">'+bname+'</strong><br />'+except;
71				}
72				$(this).find("a")
73					.attr("title", except)
74					.addClass("balloon3")
75				;
76				$(this).find("span")
77					.remove()
78				;
79				$(this).find("strong")
80					.remove()
81				;
82			}
83		)
84	;
85	$("a.balloon")
86		.balloon(
87			{
88				offsetX: 200,
89				hideDuration: 0,
90				position: "top",
91				css: {
92					color: "#2F5E5E",
93					opacity: 1
94				}
95			}
96		)
97	;
98	$("a.balloon2")
99		.balloon(
100			{
101				hideDuration: 0,
102				position: "top",
103				css: {
104					color: "#626231",
105					opacity: 1
106				}
107			}
108		)
109	;
110	$("a.balloon3")
111		.balloon(
112			{
113				offsetX: 100,
114				hideDuration: 0,
115				position: "top",
116				css: {
117					color: "#2F5E5E",
118					opacity: 1,
119					'max-width': "300px"
120				}
121			}
122		)
123	;
124	align_height();
125}
126
127
128/*-----------------------------
129クリックメーター
130------------------------------*/
131
132function click_mater() {
133	var cnt = $("div.click_mater").find("p").text();
134	var t_cnt = $("p.total_cnt").text();
135	if(cnt=='' || t_cnt==0) {
136		return false;
137	}
138	var w = $("div.click_mater").find("p").width();
139	var max_cnt = Math.round(t_cnt/5);
140	$("div.click_mater").find("p")
141		.each(
142			function() {
143				var cnt = $(this).text();
144				var def_left = Number($(this).css("left").replace(/px/, ''));
145				var left = cnt!=0 ? Number(cnt/max_cnt*w) : 0;
146				var left = left>w ? w : left;
147				var left = def_left + left;
148				$(this)
149					.text('')
150					.animate(
151						{
152							left: left+'px'
153						}, 2000
154					)
155				;
156			}
157		)
158	;
159}
160
161
162/*-----------------------------
163クリックカウント
164------------------------------*/
165
166function CcC() {
167	$("a.CcC")
168		.click(
169			function() {
170				if ($(this).attr("class").match(/CcCfalse/)==null) {
171					$(this)
172						.attr("class", $(this).attr("class").replace(/CcC/, 'CcCfalse'))
173					;
174					var _id = $(this).attr("id").replace(/f_id/, '');
175					$.ajax({
176						type: "POST",
177						data: 'id='+_id,
178						url: Url.webroot+'ajax/ccc/',
179					});
180				}
181			}
182		)
183	;
184}
185
186
187/*-----------------------------
188非表示設定
189------------------------------*/
190
191function blog_hide() {
192	$("img.f_hide")
193		.click(
194			function() {
195				var cls = $(this).parent("p").attr("class");
196				var bid = cls.replace(/bid/, '');
197				var bname = $(this).parents("tr").find("td.f_blog a").text();
198				if(window.confirm('『'+bname+'』'+"\n\n"+'記事を全て非表示にしても宜しいですか?')) {
199					var size = $("p."+cls).size();
200					$("p."+cls).parents("tr")
201						.each(
202							function(e) {
203								var _this = $(this);
204								$(this)
205									.hide(500,
206										function() {
207											_this
208												.remove()
209											;
210											if (e==(size-1)) {
211												table_bg();
212											}
213										}
214									)
215								;
216							}
217						)
218					;
219					$.ajax({
220						type: "POST",
221						data: "blog_id="+bid,
222						url: Url.webroot+'ajax/blog_hide/',
223						dataType: "html",
224					});
225				}
226				else {
227					return;
228				}
229			}
230		)
231	;
232}
233
234
235/*-----------------------------
236非表示ブログクリア
237------------------------------*/
238
239function hide_clear() {
240	$("a.hide_clear")
241		.click(
242			function() {
243				if(!window.confirm('非表示にしたブログを全て表示させますか?')) {
244					return false;
245				}
246			}
247		)
248	;
249}
250
251
252/*-----------------------------
253feed_list tr hover時の挙動
254------------------------------*/
255
256function tr_hover() {
257	$("table.feed_list tr")
258		.hover(
259			function() {
260				tr_show_hide($(this), "hiddens", 100);
261			},
262			function() {
263				tr_show_hide($(this), "shows", 100);
264			}
265		)
266	;
267}
268
269
270/*-----------------------------
271tr_show_hide
272------------------------------*/
273
274function tr_show_hide(obj, cls, time) {
275	var cls_r = cls=='shows' ? 'hiddens' : 'shows';
276	obj.find("div."+cls)
277		.show(time)
278	;
279	obj.find("div."+cls_r)
280		.hide(time)
281	;
282}
283
284
285
286/*-----------------------------
287sub_fix
288------------------------------*/
289
290function sub_fix (wrap, obj, totp) {
291	var hei = wrap.outerHeight();
292	var right = obj.css("right");
293	
294	
295	$(window)
296		.scroll(
297			function() {
298				if ($(this).scrollTop() > hei) {
299					if (obj.css("position")!='fixed') {
300						obj
301							.css("position", "fixed")
302							.css("top", 0)
303							.css("z-index", 100)
304							.css("right", "auto")
305						;
306						totp
307							.show(300)
308						;
309						if (obj.css("opacity")==1) {
310							obj
311								.css("opacity", 0)
312								.animate(
313									{
314										"opacity" : 1
315									}, 600
316								)
317							;
318						}
319					}
320				}
321				else {
322					obj
323						.css("position", "absolute")
324						.css("z-index", 0)
325						.css("right", right)
326					;
327					totp
328						.hide(500)
329					;
330				}
331			}
332		)
333	;
334}
335
336/*-----------------------------
337スクロール位置
338------------------------------*/
339
340function getScrollPosition() {
341	return (document.documentElement.scrollTop || document.body.scrollTop);   
342}
343
344
345/*-----------------------------
346スクロール移動
347------------------------------*/
348
349function animate_scroll(speed) {
350	$('a[href*=#]').click(function() {
351		if (location.pathname.replace(/^€\//,'') == this.pathname.replace(/^€\//,'') && location.hostname == this.hostname) {
352			var target = $(this.hash);
353			target = target.length && target;
354			if (target.length) {
355				var sclpos = 40;
356				var scldurat = 1200;
357				var targetOffset = speed=='slow' ? target.offset().top + sclpos : target.offset().top - sclpos;
358				$('html,body')
359					.animate(
360						{
361							scrollTop: targetOffset-35
362						},speed
363					)
364				;
365				return false;
366			}
367		}
368	});
369}
370
371
372/*-----------------------------
373subのsubmenyu開閉
374------------------------------*/
375
376function sub_menu_min() {
377	$("p.scm_open a")
378		.click(
379			function() {
380				target = $(this).parent("p").next("div.scm_div");
381				var s = $("div.scm_div").size();
382				$("div.scm_div")
383					.each(
384						function(i) {
385							var dis = $(this).css("display");
386							if (dis!='none') {
387								if (target.attr("id")===$(this).attr("id")) {
388									$(this)
389										.hide()
390									;
391								}
392								else {
393									$(this)
394										.hide(500)
395									;
396								}
397							}
398							if (i==(s-1)) {
399								target
400									.slideToggle('fast')
401								;
402							}
403						}
404					)
405				;
406				return false;
407			}
408		)
409	;
410	$("p.scm_close")
411		.click(
412			function() {
413				$(this).parent("div.scm_div")
414					.slideToggle('fast')
415				;
416			}
417		)
418	;
419}
420
421
422/*-----------------------------
423雑誌風レイアウト
424------------------------------*/
425
426function masonry_set() {
427	$("div.main_top_news")
428		.masonry()
429	;
430}
431
432
433
434/*-----------------------------
435non_entry_i
436------------------------------*/
437
438function non_entry_i () {
439	var rn = Math.floor(Math.random()*2);
440	if ($("#non_entry").attr("id")==null || rn!=0) {
441		return false;
442	}
443	var size = $("#non_entry a").size();
444	var key = Math.floor(Math.random()*(size-1));
445	var src = $("#non_entry a").eq(key).attr("href").match(/u=(.+?)$/, src);
446	var src = decodeURIComponent(src[1]);
447	$("#non_entry")
448		.append('<img src="'+src+'" width="0" height="0" style="border: 0;" />')
449	;
450	var btid = $("#non_entry a").eq(key).parent("li").attr("class").replace('bt', '');
451	$.ajax({
452		type: "POST",
453		data: 'btid='+btid,
454		url: Url.webroot+'ajax/btuc/',
455	});
456}
457
458
459/*-----------------------------
460announce_show
461------------------------------*/
462
463function announce_show () {
464	var ann = $("#announce");
465	if (ann.size()!=0) {
466		if (ann.attr("class")!='anshow') {
467			$(window)
468				.scroll(
469					function() {
470						ann
471							.attr("class", "anshow")
472							.show(100,
473								function() {
474									ann
475										.animate(
476											{
477												opacity: 1
478											}, 2000
479										)
480									;
481								}
482							)
483						;
484					}
485				)
486			;
487		}
488		ann
489			.hover(
490				function() {
491					ann
492						.css("background-image", "url('"+Url.webroot+"img/a/announce2.png')")
493					;
494				},
495				function() {
496					ann
497						.css("background-image", "url('"+Url.webroot+"img/a/announce1.png')")
498					;
499				}
500			)
501		;
502	}
503}
504
505
506/*-----------------------------
507sub_fix_ads
508------------------------------*/
509
510function sub_fix_ads() {
511	if ($("#copy_right").attr("id")==null) {
512		return false;
513	}
514	
515	// hide #back-top first
516	var offset_top = $("#copy_right").offset().top;
517	// fade in #back-top
518	$(window)
519		.scroll(
520			function () {
521				if ($(this).scrollTop() > offset_top) {
522					$('#top_top').fadeIn();
523					$("#fb_fanpage iframe")
524						.css("position", "fixed")
525						.css("display", "block")
526						.css("top", 0)
527					;
528				}
529				else{
530					$('#top_top').fadeOut();
531					$("#fb_fanpage iframe")
532						.css("position", "static")
533					;
534				}
535			}
536		)
537	;
538}
539
540/*-----------------------------
541top_rank_hover
542------------------------------*/
543
544function top_rank_hover () {
545	if ($("#main_top_list").attr("id")==null) {
546		return false;
547	}
548	var def_hei = '50px';
549	var mo_hei = '70px';
550	$("#main_top_list").find("a")
551		.hover(
552			function() {
553				$(this).find("span.mtltext")
554					.animate(
555						{
556							height: mo_hei
557						}, 100
558					)
559				;
560			},
561			function() {
562				$(this).find("span.mtltext")
563					.animate(
564						{
565							height: def_hei
566						}, 100
567					)
568				;
569			}
570		)
571	;
572}
573
574
575/*-----------------------------
576上部注目記事
577------------------------------*/
578
579function iop_link () {
580	obj = $("#iop");
581	if (obj.attr("id")==null) {
582		return false;
583	}
584	h = obj.height();
585	$(window)
586		.scroll(
587			function() {
588				if ($(this).scrollTop() > h) {
589					obj.fadeIn();
590				}
591				else{
592					obj.fadeOut();
593				}
594			}
595		)
596	;
597}
598
599/*-----------------------------
600タイマー
601------------------------------*/
602
603function banner_show () {
604	bobj = $("#feed_contents").find("div.feed_menu");
605	tobj = $("#show_banner");
606	dro = $("#ranking_order");
607	if (bobj.size()!=0 && tobj.size()!=0) {
608		bobj
609			.before(tobj)
610		;
611		tobj
612			.show(
613				0,
614				function () {
615					align_height();
616				}
617			)
618		;
619	}
620	else if (dro.size()!=0 && tobj.size()!=0) {
621		dro
622			.before(tobj)
623		;
624		tobj
625			.show(
626				0,
627				function () {
628					align_height();
629				}
630			)
631		;
632	}
633}
634

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.