PageSourceSearch

http://ehbook.co.kr/home/wp-content/themes/bcp/library/js/commtplus.js?ver=3.9.40

js ehbook.co.kr collected 2026-09-25 00:31:43 UTC 4,734 bytes, 157 lines download raw bytes

1jQuery(function($){
2	
3	var respond = $('#respond');
4	var form = $('#commentform');
5	
6	// 유효성 체크
7	form.bcp().validate_form();
8	form.submit(function(){
9		if( this.form_valid ){
10			bcp.loading_overlay();
11		}
12	});
13	
14	// 퍼마링크 하이라이트
15	if( comment_id = location.hash.replace(/#comment-(\d+)/, '$1') ){
16		$('#comment-'+comment_id).addClass('current-comment');
17		$('#li-comment-'+comment_id).addClass('current-comment-parent');
18	}
19	
20	// 비공개 항목 옆에 disabled 항목 추가.
21	$('.bcp_commtplus_private', form).append('<label class="disabled"><input type="checkbox" disabled="disabled" />' + $('.bcp_commtplus_private label', form).text() + '</label>');
22	
23	// '답글'버튼 클릭시 대상 댓글이 비로그인 댓글인 경우 disabled 항목으로 스위치
24	$('.comment-reply-link').click(function(){
25		$('.bcp_commtplus_private', form).filter(function(){
26			$('input', this).removeAttr('checked');
27			$(this).removeClass('disabled');
28			if( $(this).parents('li.comment:eq(0)').hasClass('guest') )
29				$(this).addClass('disabled');
30		});
31	});
32	
33	// 답글 '취소' 버튼 클릭시 비공개 항목 초기화
34	$('#cancel-comment-reply-link').click(function(){
35		$('.bcp_commtplus_private', form).removeClass('disabled');
36	});
37	
38	// 스마일 아이콘 클릭시 textarea에 삽입
39	$('.bcp_commtplus_smiles a').click(function(e){
40		e.preventDefault();
41		var smile = $(this).data('smile')+' ';
42		var textarea_id = $(this).parents('form.bcp_commtplus-form').length ? 'bcp_commtplus_comment' : 'comment';
43		bcp.insert_to_textarea(smile, textarea_id);
44	});
45	
46	// sns ----------------------------------------------------------------------
47	var sns_setup = function(){
48		
49		var loginby_input =  $('input[name=sns_loginby]');
50		
51		var sns_buttons = $('.bcp_commtplus_loginby').removeClass('hidden').bcp().button_group();
52		
53		var select_service = function(service){
54			$('a', sns_buttons).removeClass('selected');
55			$('a.'+service, sns_buttons).addClass('selected');
56			
57			bcp.loading_overlay();
58			
59			var data = {
60				action: 'commtplus_sns',
61				action_scope: 'set_loginby',
62				service: service
63			}
64			$.post(bcp_vars.ajaxurl, data, function(rs){
65				bcp_commtplus_sns_login_success(service);
66			});
67		}
68		
69		window.bcp_commtplus_sns_login_success = function(service){
70			if( $('#comment').val() )
71				bcp.set_cookie('comment-content-autosave', $('#comment').val());
72			
73			bcp.loading_overlay();
74			location.reload();
75		}
76		
77		$('#loginform').live('login-success', function(){
78			bcp_commtplus_sns_login_success('wp');
79		});
80			
81		$('.wp', sns_buttons).click(function(e){
82			e.preventDefault();
83			if( !$(this).hasClass('selected') && $(this).data('accessable')==0 ){
84				bcp.login_popup();
85			}
86		});
87		
88		$('.fb', sns_buttons).click(function(e){
89			e.preventDefault();
90			if( !$(this).hasClass('selected') && $(this).data('accessable')==0 ){
91				bcp.open_window($(this).data('auth_redirect'), {winnm:'페이스북 로그인', width:600, height:400});
92			}
93		});
94		
95		$('.twitter', sns_buttons).click(function(e){
96			e.preventDefault();
97			if( !$(this).hasClass('selected') && $(this).data('accessable')==0 ){
98				bcp.open_window($(this).data('auth_redirect'), {winnm:'트위터 로그인', width:800, height:680});
99			}
100		});
101		
102		$('a', sns_buttons).click(function(e){
103			e.preventDefault();
104			var t = $(this);
105			if( !$(this).hasClass('selected') && t.data('accessable')==1 ){
106				select_service( t.data('service') );
107			}
108		});
109		
110		$('a.bcp_commtplus-sns-deletet-link').click(function(e){
111			e.preventDefault();
112			if( confirm('정말로 댓글을 삭제하시겠습니까?') ){
113				bcp.loading_overlay();
114				var row = $(this).parents('li.comment:eq(0)');
115				var data = {
116					action: 'commtplus_sns',
117					action_scope: 'sns_delete_post',
118					comment_id: $(this).data('comment_id')
119				}
120				$.post(bcp_vars.ajaxurl, data, function(rs){
121					location.reload();
122				});
123			}
124		});
125		
126		var autosaved_comment = bcp.get_cookie('comment-content-autosave');
127		if( autosaved_comment ){
128			$('#comment').val(autosaved_comment).focus();
129			bcp.set_cookie('comment-content-autosave', null);
130		}
131		
132		var setting_box = $('.bcp_commtplus_setting-box');
133		
134		$('.disconnect', setting_box).click(function(e){
135			e.preventDefault();
136			if( $(this).hasClass('loading') )
137				return;
138			$(this).addClass('loading');
139			var data = {
140				action: 'commtplus_sns',
141				action_scope: 'disconnect',
142				service: $(this).data('service')
143			}
144			$.post(bcp_vars.ajaxurl, data, function(rs){
145				location.reload();
146			});
147		});
148		
149		$('a.bcp_commtplus_setting').click(function(e){
150			e.preventDefault();
151			setting_box.toggleClass('hidden');
152		});
153	}
154	
155	if( $('.bcp_commtplus_loginby').length )
156		sns_setup();
157});

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.