PageSourceSearch

https://danpotbang.com/assets/common/js/init.js?v=4

js danpotbang.com collected 2026-10-02 01:29:06 UTC 10,976 bytes, 358 lines download raw bytes

1// If JavaScript is enabled remove 'no-js' class and give 'js' class
2jQuery('html').removeClass('no-js').addClass('js');
3
4// When DOM is fully loaded
5jQuery(document).ready(function($) {
6
7	if($('.help').length > 0){
8		/* 줄바꿈 기능을 사용하기 위해 */
9		$('.help').tooltip({
10			  content: function (callback) {
11			     return $( this ).prop( 'title' ).replace( '|', '<br />' );
12			  }
13			}
14		);
15	}
16
17	//북마크버튼
18	$('.bookmarkMeLink').click(function() {
19			if (window.sidebar && window.sidebar.addPanel) { 
20				// Mozilla Firefox Bookmark
21				window.sidebar.addPanel(document.title,window.location.href,'');
22			}
23			else if(window.sidebar && jQuery.browser.mozilla){
24				//for other version of FF add rel="sidebar" to link like this:
25				//<a id="bookmarkme" href="#" rel="sidebar" title="bookmark this page">Bookmark This Page</a>
26				jQuery(this).attr('rel', 'sidebar');
27			}
28			else if(window.external && ('AddFavorite' in window.external)) { 
29				// IE Favorite
30				window.external.AddFavorite(location.href,document.title); 
31			} else if(window.opera && window.print) { 
32				// Opera Hotlist
33				this.title=document.title;
34				return true;
35			} else { 
36				// webkit - safari/chrome
37				alert('Press ' + (navigator.userAgent.toLowerCase().indexOf('mac') != - 1 ? 'Command/Cmd' : 'CTRL') + ' + D to bookmark this page.');
38
39			}
40	});
41});
42
43/**
44 * 알림창
45 */
46function msg(type,msg){
47
48	if(type=="success"){
49		$.dreamAlert({
50			'type'      :   'success',
51			'message'   :   msg + "<div style='clear:both;'></div>"
52	    });
53	} else {
54        $.dreamAlert({
55            'type'      :   'error',
56            'message'   :   msg + "<div style='clear:both;'></div>"
57        });
58	}
59}
60
61function number_format(x) {
62    return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
63}
64
65function loading_delay(display){
66	if(display){
67		//$(".loading_content" ).parent().css("overflow-y", "hidden");
68		$(".loading_content" ).show();
69	}
70	else{
71		$(".loading_content" ).hide("fast", function(){
72			//$(".loading_content" ).parent().css("overflow-y", "auto");			
73		});
74
75	}
76}
77
78function loading(display){
79	if(display){
80		$(".loading_content" ).parent().css("overflow-y", "hidden");
81		$(".loading_content" ).show();
82	}
83	else{
84		$(".loading_content" ).hide();
85		$(".loading_content" ).parent().css("overflow-y", "auto");
86	}
87}
88
89/**
90 * 프린트 기능(프론트)
91 *
92 */
93function print(){
94	var printWindow = window.open('', '', 'height=400,width=800,scrollbars=yes');
95	printWindow.document.write('<html><head><title></title>');
96	printWindow.document.write('<link href="/assets/common/css/print.css" rel="stylesheet">');
97	printWindow.document.write('<link href="/assets/plugin/bootstrap/css/bootstrap.min.css" rel="stylesheet">');
98	printWindow.document.write('</head><body>');
99	$(".not_print").hide();
100	$(".is_print").show();
101	printWindow.document.write($("#print_area").html());
102	$(".not_print").show();
103	$(".is_print").hide();
104	printWindow.document.write('</body></html>');
105	printWindow.document.close();
106	setTimeout(function() {
107      printWindow.print();
108	}, 1000);
109}
110
111function print_photo(id,photo){
112	if(photo=="sell" || photo=="full_rent" || photo=="monthly_rent"){
113		var printWindow = window.open('/product/view_structure_print/'+id+'/'+photo, 'print', 'height=860,width=1186,scrollbars=yes');
114	}
115	else if(photo==2){
116		var printWindow = window.open('/product/view_print/'+id+'/'+photo, 'print', 'height=860,width=1186,scrollbars=yes');
117	}
118	else if(photo==3){ //지도만
119		var printWindow = window.open('/product/view_print/'+id+'/'+photo, 'print', 'height=800,width=820,scrollbars=yes');
120	}
121	else if(photo=='list'){ //목록만
122		var check_product = new Array();
123		$("input[name='check_product[]']:checked").each(function() {
124			check_product.push($(this).val());
125		});
126		if(check_product.length>0){
127			var printWindow = window.open('/product/view_print/'+0+'/'+photo+'?check_product='+check_product, 'print', 'height=800,width=1186,scrollbars=yes');
128		} else {
129			msg('error','매물을 선택해 주세요');
130		}
131		
132	}
133	else{
134		var printWindow = window.open('/product/view_print/'+id+'/'+photo, 'print', 'height=800,width=820,scrollbars=yes');
135	}
136}
137
138function print_table(){
139	$(".print_checkbox").fadeIn();
140	var check_product = new Array();
141	$("input[name='check_product[]']:checked").each(function() {
142		check_product.push($(this).val());
143	});
144	if(check_product.length>0){
145		var printWindow = window.open('/product/view_print/0/list?front=1&check_product='+check_product, 'print', 'height=800,width=1186,scrollbars=yes');
146	} else {
147		msg('error','매물을 선택해 주세요');
148	}
149}
150
151
152campaign_id='';
153$(document).ready(function(){
154	$('#campaign_select').on('change',function(){
155		campaign_id=$(this).val();
156		if(campaign_id){
157			$('#campaign_input_zone').hide();
158		} else {
159			$('#campaign_input_zone').show();
160		}
161	})	
162})
163
164function mail_campaign_add(){
165	var check_product = new Array();
166	$("input[name='check_product[]']:checked").each(function() {
167		check_product.push($(this).val());
168	});
169	if(check_product.length>0){
170		$("#mail_product").modal("show");
171		// $('#campaign_name').val('');
172		// $("#campaign_add").modal();
173		// $('#campaign_name').focus();
174	} else {
175		alert('매물을 선택해 주세요');
176	}
177}
178
179
180function mail_campaign_save(){
181	var check_product = new Array();
182	$("input[name='check_product[]']:checked").each(function() {
183		check_product.push($(this).val());
184	});
185	if($('#campaign_name').val() || campaign_id){
186		$.post('/adminmail/campaign_add_action',{product_ids:check_product,campaign_name:$('#campaign_name').val(),campaign_id:campaign_id},function(){
187			alert('저장되었습니다.');
188			$('#campaign_add').modal('hide');
189			location.href='/adminmail/campaign';
190		})
191	} else {
192		alert('제목을 입력해 주세요');
193		$('#campaign_name').focus();
194	}
195}
196
197function print_qrcode(id){
198	var printWindow = window.open('/product/view_qrcode/'+id, 'print', 'height=800,width=820,scrollbars=yes');
199}
200
201/**
202 * 면적 대비 가격 표시하기 위한 함수
203 */
204function cal_unit_price(){
205
206	/** 토지 면적대비가격 **/
207
208	var sell_price 			= isNaN(parseInt($("#sell_price").val())) ? 0 : parseInt($("#sell_price").val());
209	var full_rent_price 	= isNaN(parseInt($("#full_rent_price").val())) ? 0 : parseInt($("#full_rent_price").val());
210	var monthly_rent_price 	= isNaN(parseInt($("#monthly_rent_price").val())) ? 0 : parseInt($("#monthly_rent_price").val());
211	var land_area			= isNaN(parseInt($("#land_area").val())) ? 0 : parseInt($("#land_area").val());
212	var road_area			= isNaN(parseInt($("#road_area").val())) ? 0 : parseInt($("#road_area").val());
213	var law_area			= isNaN(parseInt($("#law_area").val())) ? 0 : parseInt($("#law_area").val());
214
215
216	if( land_area != 0 )
217	{
218
219		if( sell_price != 0 ){
220
221			var up_land_m = ( sell_price / ( land_area + road_area ) ).toFixed(0);
222			var up_land_p = ( up_land_m*3.305785 ).toFixed(0);
223
224			$("#land_info").html("<i class=\"fa fa-krw\"></i> 면적대비가격:가격/총면적(대지+도로) => <b>"+number_format(up_land_m)+"</b>만원/㎡, <b>" + number_format(up_land_p) + "</b>만원/평");	
225		}
226
227		if( road_area != 0 ){
228			var road_rate = ( parseInt($("#road_area").val()) / (parseInt($("#land_area").val())+ parseInt($("#road_area").val()) )).toFixed(2) * 100;
229			$("#road_rate").html( "도로지분율:" + road_rate +"%" );
230		}
231
232	}
233
234	/** 매물 면적 대비 가격 : 계약면적 또는 연면적 기준으로 가격을 산정 **/
235	var product_price = 0;
236	
237	if( law_area != 0 ){
238		if( $("#type").val() == "sell" || $("#type").val() == "installation" ){
239
240			product_price = ( sell_price / law_area ).toFixed(0);
241
242		} else if( $("#type").val() == "full_rent" ){
243
244			product_price = ( full_rent_price / law_area ).toFixed(0);
245
246		} else if( $("#type").val() == "monthly_rent" ){
247
248			product_price = ( monthly_rent_price / law_area ).toFixed(0);
249
250		}
251	}
252
253	if(product_price!=0){
254
255		$("#product_info").html("<i class=\"fa fa-krw\"></i> 면적대비가격:가격/면적(계약 또는 연면적) => <b>"+number_format(product_price)+"</b>만원/㎡, <b>" + number_format((product_price*3.305785).toFixed(0)) + "</b>만원/평");
256
257	}
258
259}
260
261function closeWin(param){
262	pop_setcookie("pop"+param,"done",1);
263	$("#notice_"+param).modal('hide');
264	$("#notice_"+param).hide();
265}
266
267function pop_setcookie(name,value,expire){
268	var todayDate = new Date();
269	todayDate.setDate(todayDate.getDate() + expire);
270	document.cookie = name + "=" + escape(value) + "; path=/; expires=" + todayDate.toGMTString() + ";"
271}
272
273function getCookieVal(offset) {
274	var endstr = document.cookie.indexOf(";", offset);
275	if (endstr == -1) endstr = document.cookie.length;
276	return unescape(document.cookie.substring(offset, endstr));
277}
278
279function GetCookie(name) {
280    var arg = name + "=";
281    var alen = arg.length;
282    var clen = document.cookie.length;
283    var i = 0;
284    while (i < clen) {
285        var j = i + alen;
286        if (document.cookie.substring(i, j) == arg) return getCookieVal(j);
287		i = document.cookie.indexOf(" ", i) + 1;
288			if (i == 0) break;
289    }
290	return null;
291}
292
293function notice_show(id,form){
294	$("#"+form).find("#profile_msg").html('');
295	$.getJSON("/notice/get_json/"+id+"/"+Math.round(new Date().getTime()),function(data){
296		$.each(data, function(key, val) {
297			if(key=="title") $("#notice_modal_title").html(val);
298			if(key=="content") $("#notice_modal_content").html(val);
299			$('#notice_modal').modal('show');
300		});
301	});
302}
303
304/**
305 * 금액 만원 단위 한글로 변환
306 */
307function setWon(pWon) {
308	if(!pWon) return 0;
309
310	var won  = (pWon+"").replace(/,/g, "");
311	var arrWon  = ["원", "만", "억 ", "조 ", "경 ", "해 "];
312	var changeWon = "";
313	var pattern = /(-?[0-9]+)([0-9]{4})/;
314
315	while(pattern.test(won)) {                   
316		won = won.replace(pattern,"$1,$2");
317	}
318
319	var arrCnt = won.split(",").length-1;
320
321	for(var ii=0; ii<won.split(",").length; ii++) {
322		changeWon += won.split(",")[ii]+arrWon[arrCnt];
323		arrCnt--;
324	}
325
326	if(won.length > 4){
327		var split_won = changeWon.split("만");
328		return split_won[0]+"만원";	 
329	}
330	else{
331		return changeWon;
332	}
333}
334
335/**
336 * 매물종류를 상단메뉴로 사용할시 사용하는 함수
337 */
338function set_category(obj,segment,id){
339	if(segment=="map"){
340		$('#search').val('');
341		$("#category-navigation").find("a").css("cursor", "wait");
342		$(obj).parent().find("li").removeClass("active");
343		$(obj).addClass("active");
344		$("#category").val(id);
345		$("#search_form").trigger("submit");	
346	}
347	else{
348		location.href="/search/set_category/"+id;
349	}
350}
351
352function set_category_grid(obj,id){
353	location.href="/search/set_category_grid/"+id;
354}
355
356function set_category_table(obj,id){
357	location.href="/search/set_category_table/"+id;
358}

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.