PageSourceSearch

http://ehbook.co.kr/home/wp-content/themes/ehbook2014/js/site.js?ver=0108

js ehbook.co.kr collected 2026-09-25 00:31:41 UTC 5,480 bytes, 220 lines download raw bytes

1$.fn.my_mainpage = function(){
2	var mainpage = this;
3	
4	$('#newbooks', mainpage).each(function(){
5		var t = this;
6		var covers = $('.covers', t);
7		var nav = $('<ul class="nav clearfix"/>').appendTo(t);
8		var bg = $('<span id="cover-bg"/>').appendTo('body');
9		var timeout;
10		
11		covers.find('a').each(function(i){
12			$('<li><a href="'+$(this).attr('href')+'"><img src="'+$(this).data('thumbnail')+'"><span class="cover"></span></a></li>')
13			.data('idx', i)
14			.appendTo(nav);
15		});
16		covers.find('li:first-child').addClass('first-child');
17		
18		var change_active = function(idx, back){
19			if( idx != nav.find('.active').data('idx') ){
20				var h = covers.find('li:eq(0)').height();
21				if( h > 100 ){
22					covers.height(h).find('li').css({position: 'absolute', bottom: 0});
23				}
24				covers.find('li').removeClass('active').hide().eq(idx).addClass('active').show();
25				nav.find('li').removeClass('active').eq(idx).addClass('active');
26			}
27		}
28		
29		var show_bg = function(){
30			if( timeout ) clearTimeout(timeout);
31			
32			if( is_IE && browser_version<=7 ) return;
33			bg.stop().css({display:'block'}).animate({opacity:0.6}, 300); 
34			covers.find('.border').hide();
35			covers.addClass('has-bg');
36		}
37		
38		var hide_bg = function(){
39			timeout = setTimeout(function(){ 
40				change_active(0); 
41			}, 2000); 
42			
43			if( is_IE && browser_version<=7 ) return;
44			bg.stop().animate({opacity:0}
44, 300, function(){ 
45				$(this).css({display:'none'}); 
46			}); 
47			covers.find('.border').show();
48			covers.removeClass('has-bg');
49		}
50		
51		covers.hover(
52			function(){ 
53				show_bg(); 
54			},
55			function(){ 
56				hide_bg();
57			}
58		);
59		
60		nav.find('li').hover(
61			function(){
62				change_active( $(this).data('idx') );
63				show_bg();
64			},
65			function(){ 
66				hide_bg(); 
67			}
68		);
69		
70		bg.click(function(){
71			hide_bg();
72		});
73		
74		$('a.more', t).appendTo(nav);
75		
76		covers.find('li:eq(0)').addClass('active');
77		nav.find('li:eq(0)').addClass('active');
78	});
79}
80
81$.fn.my_sitemap = function(){
82	if( ! this.length ) return;
83	
84	var t = this;
85	var dropdown = t.find('a.dropdown');
86	var inner = t.find('.inner');
87	var holder = t.find('.main-inside');
88	var loaded= false;
89	
90	var loadData = function(){
91		if( loaded ) return;
92		loaded = true;
93		
94		var data = {
95			action: 'sitemap'
96		}
97		$.post(bcp_vars.ajaxurl, data, function(html){
98			holder.html(html);
99			inner.slideDown(200);
100			dropdown.removeClass('loading');
101			t.addClass('open');
102		});
103	}
104	
105	dropdown.click(function(e){
106		e.preventDefault();
107		if( t.hasClass('open') ){
108			inner.slideUp(200, function(){
109				t.removeClass('open');
110			});
111		}else{
112			if( loaded ){
113				inner.slideDown(200);
114				t.addClass('open');
115			}else{
116				loadData();
117				dropdown.addClass('loading');
118			}
119		}
120	}).click();
121}
122
123$.fn.my_mobile_gnb_singular_select = function(){
124	var t = this;
125	
126	if( $('body').hasClass('home') ){
127		$('.home', t).addClass('selected');
128	
129	}else if( $('body').hasClass('single-post') || $('body').hasClass('taxonomy-category') || $('body').hasClass('taxonomy-post_tag') ){
130		$('.menu-item.blog', t).addClass('current-menu-item');
131	
132	}else if( $('body').hasClass('single-book') ){
133		$('.menu-item.books', t).addClass('current-menu-item');
134	
135	}else if( $('body').hasClass('single-bookauth') ){
136		$('.menu-item.authors', t).addClass('current-menu-item');
137	
138	}
139	return t;
140}
141
142
143$(function(){
144	
145	if( bcp.is_mobile_mode ){
146	
147		
148		
149	}else{
150		
151		$('#cnb').hover(function(){
152			$(this).addClass('hover');
153		},function(){
154			$(this).removeClass('hover');
155		});
156		// plugin ----------------------------------------------------------------------
157		$('.widget_bcp-sns .service-link').each(function(i){
158			$(this).insertBefore( $(this).prev('.container') );
159		});
160		
161		var sidebar_sns_widget_resize = function(){
162			var t = $('#sidebar');
163			var container = $('.widget_bcp-sns .container', t).hide();
164			var h = $('#content').height() - t.height() - 10;
165			var max_h = $(window).height() - 120;
166			h = Math.max(300, Math.min(max_h, h));
167			container.height(h).show();
168		}
169		$(window).load(sidebar_sns_widget_resize);
170		sidebar_sns_widget_resize();
171		
172		// 사이드바 세로크기 꽉차게
173		$(window).load(function(){
174			if( $('#sidebar').height() < $('#content').height() )
175				$('#sidebar').css('min-height', $('#content').height() );
176		});
177		
178		// blog ----------------------------------------------------------------------
179		$('.loop.full-thumbnail').each(function(i){
180			$('header', this).prependTo( $('.inner', this) );
181		});
182	}
183	
184	// book ----------------------------------------------------------------------
185	$('.book-preview-link').book_preview_link();
186	
187	$('.book-shop-links').book_shop_links();
188	
189	$('.book-toolbar .viewmode a').click(function(e){
190		e.preventDefault();
191		bcp.set_cookie('booklist-viewmode', $(this).data('viewmode'), {path:'/', expires:7});
192		location.reload();
193	});
194	
195	$('.booklist .toolbar select').each(function(i){
196		if( this.selectedIndex > 0 )
197			$(this).addClass('selected');
198	});
199	
200	$('.booklist .list.viewmode-compact').each(function(i){
201		var t = $(this);
202		var col = 5;
203		var row_index = 0;
204		$('.book-embed:nth-child(' + col + 'n)', t).addClass('last-col');
205		$('.book-embed', t).each(function(j){
206			if( j%col==0 ){
207				alt = row_index++%2==0 ? 'alt' : 'even';
208				row = $('<div class="row clearfix"></div>').addClass(alt).appendTo(t);
209			}
210			$(this).appendTo(row);
211		});
212	}); 
213	
214	// 팝업 링크
215	$('.login-popup-link').my_login_popup_link();
216	
217	// 비디오 리사이즈
218	$('.singular #content').fitVids();
219
220});

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.