PageSourceSearch

https://www.yomiuri.co.jp/yomidr/wp-content/themes/yomidr/resources/js/script.js

js yomiuri.co.jp collected 2026-09-24 07:59:52 UTC 4,191 bytes, 128 lines download raw bytes

1jQuery(document).ready(function($) {
2
3	// 画像保護対策
4	$("img").bind('cut copy paste contextmenu selectstart mousedown', function(){
5		return false;
6	});
7	$(window).keydown(function(event) {
8		var code = (event.keyCode ? event.keyCode : event.which);
9		if ( ( code == 83 ) && ( event.ctrlKey ) ) {
10			event.preventDefault();
11			return false;
12		} else {
13			return true;
14		}
15	});
16	// add image zoom
17	var attachmentLink = $( '.edit-area a[href*="?attachment_id"], .edit-area a[rel*="attachment"]' );
18	attachmentLink.each( function() {
19		var attachmentImg = $( this ).find( 'img' );
20		var imageClass = attachmentImg.attr( 'class' );
21		attachmentImg.attr( 'class', '' );
22		$( this ).append( '<span class="image-zoom">画像の拡大</span>' ).wrap( '<div class="attachment-image ' + imageClass + '"></div>' );
23	} );
24
25	// secondary ranking tab
26	$(".ranking-nav li").click(function() {
27		var num = $(".ranking-nav li").index(this);
28		$(".articles-list-ranking").removeClass('active');
29		$(".articles-list-ranking").eq(num).addClass('active');
30		$(".ranking-nav li").removeClass('active');
31		$(this).addClass('active');
32	});
33
34	// counseling search tab
35	if ( $( '.counseling-nav' ).length ) {
36		var url   = location.href;
37		params    = url.split("?");
38		if( url.indexOf('&') != -1 ) {
39		paramms   = params[1].split("&");
40		} else {
41		paramms   = params;
42		}
43		// パラメータ用の配列を用意
44		var paramArray = [];
45		// 配列にパラメータを格納
46		for ( i = 0; i < paramms.length; i++ ) {
47		    neet = paramms[i].split("=");
48			paramArray.push(neet[0]);
49			paramArray[neet[0]] = neet[1];
50		}
51		// パラメータによって処理を分岐
52		if ( paramArray["consultab"] == "consul") {
53			$("#counseling-search .counseling-read").removeClass('active');
54			$("#counseling-search .counseling-counseling").addClass( 'active' );
55			var target_offset = $(".counseling-counseling").offset();
56			var target_top = target_offset.top - 40;
57			$('html, body').animate({scrollTop:target_top}, 600);
58		} else {
59		}
60	}
61	$("#counseling-search .counseling-nav li").click(function() {
62		var num = $("#counseling-search .counseling-nav li").index(this);
63		$("#counseling-search .radius-square").removeClass('active');
64		$("#counseling-search .radius-square").eq(num).addClass('active');
65		$("#counseling-search .counseling-nav li").removeClass('active');
66		$(this).addClass('active');
67	});
68
69	// toggle-thumbList
70	var hide_num = 2;
71	var text_hide = "すべて表示";
72	var text_show = "隠す";
73	var toggle_thumbList = $(".toggle-thumbList");
74	var button_toggle_thumbList = toggle_thumbList.children(".button-toggle-thumbList");
75
76	var hide_num = hide_num - 1;
77	toggle_thumbList.each(function(){
78		$(this).children("article:gt(" + hide_num + ")").each(function(){
79			$(this).hide();
80		});
81	});
82	button_toggle_thumbList.click(function(){
83		if ( $(this).hasClass("open") ) {
84			$(this).parent().children("article:gt(" + hide_num + ")").each(function(){
85				$(this).hide(300);
86			});
87			$(this).children("a").html(text_hide);
88		} else {
89			$(this).parent().children("article").show(300);
90			$(this).children("a").html(text_show);
91		}
92		$(this).toggleClass("open");
93		return false;
94	});
95
96// 用途不明のためコメントアウト 2016-10-29
97//	$("#global-nav ul ul").each(function(){
98//		var li_length = 0;
99//		$(this).children("li").each(function(){
100//			if ( $(this).text().length > li_length ) {
101//				li_length = $(this).text().length;
102//			}
103//		});
104//		$(this).children("li").css( "width", li_length + "rem" );
105//	});
106
107	// remove empty td
108	$( ".edit-area td" ).each( function() {
109	    if( $( this ).html().trim().length === 0 || $( this ).html() == '&nbsp;' ) {
110			$( this ).remove();
111		}
112	} );
113
114	// ad-in-post floating
115	$( '.ad-in-post + p' ).prev().css( { 'float' : 'left', 'margin-right' : 20 + 'px', 'clear' : 'both' } );
116
117	$("#register-login .button-login a, .recommend-register-area .button-register a, .recommend-register-area .button-login a").click(function() {
118		$.cookie( "login_redirect", document.URL, { path:'/', secure: true } );
119	});
120
121	//病院の実力の開閉
122	$(function(){
123		$(".disease-header").on("click", function() {
124			$(this).next().slideToggle();
125		});
126	});
127
128});

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.