PageSourceSearch

https://pr.conects.com/js/course/online.js

js conects.com collected 2026-10-03 22:25:13 UTC 10,236 bytes, 282 lines download raw bytes

1$(document).ready(function () {
2	$(document).off("click", ".btn-popup-textbook");
3	$(document).on("click", ".btn-popup-textbook", function () {
4		// var saleinfo_id = $(this).data("saleinfo_id");
5		// $.ajax({
6		// 	url : "//" + getSiteInv() + "pr.conects.com/api/sales/book",
7		// 	type : "post",
8		// 	dataType: "json",
9		// 	data : { saleinfo_id : saleinfo_id },
10		// 	success : function(r){
11		// 		if(r.status != "200"){
12		// 			alert(r.userMessage);
13		// 		}else{
14		// 			$("#class-layerpop-textbook").html(r.result.html);
15		// 			dimShow("#class-layerpop-textbook");
16		// 		}
17		// 	}
18		// });
19
20		window.open('//' + getSiteInv() +'pr.conects.com/course/detail/files/' + $(this).data("saleinfo_id"));
21	});
22
23	$(document).off("click", ".summary-button-list .ot_play, .summary-button-list .prev_play");
24	$(document).on("click", ".summary-button-list .ot_play, .summary-button-list .prev_play", function(){
25	        var url = $(this).data("movie-url");
26                var class_name = $(this).attr("class");
27                /*
28		if (url.indexOf(".mp4") != -1) {
29			url = "//" + getSiteInv() + "myclass.dangi.co.kr/player/free/common/product?full_movie_url="+ url;
30                }
31                */
32		//_open_win_scroll(url, class_name, 1000, 700);
33		// v1
34		_open_win_preview_video(url, class_name, 1000, 700);
35	});
36
37	$(document).off("click", ".books-more");
38	$(document).on("click", ".books-more", function () {
39		let cartLayer = $(".class-combine_layerpop-cart");
40		$(this).toggleClass('active');
41		$(this).closest('.lecture-division').find('.book-list').toggleClass('active');
42		cartLayer.hide();
43	});
44
45	$(document).off("click", ".summary-order input[type='checkbox']");
46	$(document).on("click", ".summary-order input[type='checkbox']", function () {
47		let cartLayer = $(this).closest(".class-combine_lecture-main").find(".class-combine_layerpop-cart");
48		var saleinfo_id = $(this).val();
49		let layerTop = parseInt($(this).offset().top - $(this).closest(".class-combine_lecture-main").offset().top + 20);
50		switch ($(this).siblings("label").find("strong").text()) {
51			case "교재":
52				if ($(this).prop("checked")) {
53					$(this).closest(".summary-order").siblings(".summary-button").find(
54						".books-more").addClass('active');
55					$(this).closest('.lecture-division').find('.book-list').addClass(
56						'active');
57					$(this).closest('.lecture-division').find(
58						'.book-list input[type="checkbox"]').prop("checked", true);
59					$(".class-combine_layerpop-cart").hide();
60					cartLayer.css("top", layerTop);
61					cartLayer.show();
62				} else {
63					$(this).closest(".summary-order").siblings(".summary-button").find(
64						".books-more").removeClass('active');
65					$(this).closest('.lecture-division').find('.book-list').removeClass(
66						'active');
67					$(this).closest('.lecture-division').find(
68						'.book-list input[type="checkbox"]').prop("checked", false)
69					cartLayer.hide();
70				}
71				break;
72			case "첨삭":
73				if ($(this).prop("checked")) {
74						$(this).closest('.lecture-division').find('.edit-list').addClass(
75								'active');
76						$(this).closest('.lecture-division').find(
77								'.edit-list input[type="checkbox"]').prop("checked", true);
78						$(".class-combine_layerpop-cart").hide();
79						cartLayer.css("top", layerTop);
80						cartLayer.show();
81				} else {
82						$(this).closest('.lecture-division').find('.edit-list').removeClass(
83								'active');
84						$(this).closest('.lecture-division').find(
85								'.edit-list input[type="checkbox"]').prop("checked", false)
86						cartLayer.hide();
87				}
88				break;
89
90			default:
91				if ($(this).prop("checked")) {
92					$(".class-combine_layerpop-cart").hide();
93					cartLayer.css("top", layerTop);
94					cartLayer.show();
95				} else {
96					cartLayer.hide();
97				}
98				break;
99		}
100	});
101
102	$(document).off("click", ".class-combine_popup-dim, .btn-popup-close");
103	$(document).on("click", ".class-combine_popup-dim, .btn-popup-close", function () {
104		dimHide("#class-layerpop-textbook");
105		dimHide(".class-combine_layerpop-list"); //강좌리스트 레이어 팝업 숨김처리
106		$(".class-combine_layerpop-cart").hide(); //장바구니 레이어 팝업 숨김처리
107	});
108
109	$(document).on("click", ".book_cart_proc", function(){
110
111		var saleinfo_id = $(this).data("saleinfo_id");
112
113		$.ajax({
114			url : "//" + getSiteInv() + "pr.conects.com/api/sales/check_login",
115			type : "post",
116			dataType: "json",
117			async: false,
118			xhrFields: {
119				withCredentials: true
120			},
121			success : function(r){
122				if(r.status != "200"){
123					alert(r.userMessage);
124					location.href =  "https://" + getSiteInv() + "member.conects.com/member/login?redirect_url=" + encodeURIComponent(document.URL);
125				}else{
126					$("iframe[name='book_cart_iframe']").remove();
127					var i = $('<iframe name="book_cart_iframe" style="display:none;"></iframe>');
128					i.appendTo("body");
129
130					$("#book_cart_form").remove();
131					var f = $('<form id="book_cart_form"></form>');
132					f.attr("action", "//" + getSiteInv() + "my.conects.com/payment/cart/add_multiple");
133					f.attr("method", "post");
134					f.attr("target", "book_cart_iframe");
135					f.appendTo("body");
136					f.append($('<input type="hidden" value="' + saleinfo_id + '" name="saleinfo_id[]">'));
137					f.submit();
138
139					if (confirm('선택하신 상품이 장바구니에 담겼습니다.\n장바구니로 이동하시겠습니까?')) {
140						location.href = "//" + getSiteInv() + "my.conects.com/payment/cart";
141					}
142				}
143			}
144		});
145	});
146
147	$(document).on("click", ".book_payment_proc", function(){
148		var saleinfo_id = $(this).data("saleinfo_id");
149		$.ajax({
150			url : "//" + getSiteInv() + "pr.conects.com/api/sales/check_login",
151			type : "post",
152			dataType: "json",
153			xhrFields: {
154				withCredentials: true
155			},
156			success : function(r){
157				if(r.status != "200"){
158					alert(r.userMessage);
159					location.href =  "https://" + getSiteInv() + "member.conects.com/member/login?redirect_url=" + encodeURIComponent(document.URL);
160				}else{
161					$("#book_payment_form").remove();
162					var f = $('<form id="book_payment_form"></form>');
163					f.attr("action", "//" + getSiteInv() + "my.conects.com/payment/order/add_multiple");
164					f.attr("method", "post");
165					f.appendTo("body");
166					f.append($('<input type="hidden" value="' + saleinfo_id + '" name="saleinfo_id[]">'));
167					f.submit();
168				}
169			}
170		});
171	});
172
173	$(document).on("click", function (event) {
174		if (event.target.className == "class-combine_lecture-main" || event.target.className == "clearfix content-box") {
175			$(".class-combine_layerpop-cart").hide();
176		}
177	});
178
179	if (typeof _CONECTS_COMMON_PLAYER_ == "undefined") {
180		var e = document.createElement('script'); e.type ='text/javascript'; e.async = true;
181
182		var inv = getSiteInv();
183		inv = (inv.indexOf('qa-') != -1) ? 'qa-' : inv;
184		console.log('inv', inv);
185		//e.src = ('//' + getSiteInv() +  'pr.conects.com/js/course/common_player.js');
186		e.src = ('//' + inv +  'pr.conects.com/js/course/common_player.js');
187
188		var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(e, s);
189	}
190});
191
192function getSiteInv() {
193	var prefix = "";
194	var is_dev = location.href.toLowerCase().indexOf('//dev');
195	var is_qa = location.href.toLowerCase().indexOf('//qa');
196	var is_stage = location.href.toLowerCase().indexOf('//sg');
197	if (is_dev !=-1) {
198		prefix = 'dev-';
199	}else if(is_qa !=-1){
200		prefix = 'qa-p7-';
201	}else if(is_stage !=-1){
202		prefix = 'sg-';
203	}
204	return prefix;
205}
206
207function _open_win_scroll(url, name, width, height, xpos, ypos){
208	popupWins = new Array();
209	name =  name || '_blank';
210	xpos = xpos || (screen.availWidth-width)/2;
211	ypos = ypos || (screen.availHeight-height)/2;
212
213	if ( typeof( popupWins[name] ) != "object" ){
214		popupWins[name] = window.open(url, name, 'width='+width+', height='+height+', left='+xpos+', top='+ypos+', menubar=no, status=no, toolbar=no, scrollbars=yes, resizable=yes');
215	 } else {
216		 if (!popupWins[name].closed){
217			popupWins[name].location.href = url;
218		 } else {
219			popupWins[name] = window.open(url, name, 'width='+width+', height='+height+', left='+xpos+', top='+ypos+', menubar=no, status=no, toolbar=no, scrollbars=yes, resizable=yes');
220		 }
221	 }
222
223	 popupWins[name].focus();
224}
225
226// dim처리
227function dimShow(popupName) {
228	let popup = $(popupName);
229	let scTop = $(window).scrollTop();
230	if ($(".class-combine_popup-dim").length < 1) {
231		$("#container").append(
232			"<div class='class-combine_popup-dim' style='display:none;background:rgba(0,0,0,0.7);position:fixed;top:0;left:0;width:100%;height:100%;z-index:110;' onclick='_CONECTS_COMMON_PLAYER_.dim_hide();'></div>"
233		)
234	}
235	$(".class-combine_popup-dim").show();
236	// 강좌 리스트 팝업일 경우 scroll 위치에 따른 위치 고정값을 넣지 않음
237	switch (popupName) { //교재 팝업과 같이 고유 위치값을 갖지 않고 센터에 노출되는 경우 case문에 넣기
238		case ".class-combine_layerpop-list":
239		case ".class-combine_layerpop-classlist":
240		case "#select_saleinfo_player":
241			popup.show();
242			break;
243
244		case "#class-layerpop-textbook":
245			$(".class-combine_layerpop-textbook").remove();
246			$("#container").append(popup);
247
248		default:
249			popup.css("top", scTop + 50).show();
250			break;
251	}
252}
253
254function dimHide(popupName) {
255	//console.log('popupName', popupName);
256	let popup = $(popupName);
257	popup.hide();
258	$(".class-combine_popup-dim").hide();
259}
260
261// 맛보기 강좌 플레이어
262function _open_win_preview_video(url, name, width, height, xpos, ypos){
263	popupWins = new Array();
264	name =  name || '_blank';
265	xpos = xpos || (screen.availWidth-width)/2;
266	ypos = ypos || (screen.availHeight-height)/2;
267
268	// TODO:: QA 구분
269	var video_url = 'https://pr.conects.com/course/detail/preview_video?preview_video_url=' + encodeURIComponent(url);
270
271	if ( typeof( popupWins[name] ) != "object" ){
272		popupWins[name] = window.open(video_url, name, 'width='+width+', height='+height+', left='+xpos+', top='+ypos+', menubar=no, status=no, toolbar=no, scrollbars=yes, resizable=yes');
273	} else {
274		if (!popupWins[name].closed){
275			popupWins[name].location.href = url;
276		} else {
277			popupWins[name] = window.open(video_url, name, 'width='+width+', height='+height+', left='+xpos+', top='+ypos+', menubar=no, status=no, toolbar=no, scrollbars=yes, resizable=yes');
278		}
279	}
280
281	popupWins[name].focus();
282}

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.