// $(document).ready(function () { // 2021.01.18 - 1ÁÖÀÏ ÈÄ ¾Æ·¡ setcookie_han Á¦°Å( 400 bad request ¿À·ù ¹æÁö À§ÇØ smart °Ë»ö ¸ñ·Ï cookie ÃʱâÈ­ ) Setcookie_Han('search_txt', ''); Setcookie_Han('smt_srch_latlng', ''); // ----------------------- ÅëÇÕ ¸ñ·ÏÀ϶§ ºÐ¾ß¸¦ Ç¥½Ã if ($("#d_srch_frm input[name=search_type]").val() == 'smart' || $("#d_srch_frm input[name=sw_tch]").val() == 'all') Show_Sw_Tch = 1; // ----------------------- ÇÊÅÍÆäÀÌÁöÀÏ °æ¿ì ¸¶Áö¸·¿¡ °Ë»öÇß´ø °Ë»öÁ¶°ÇÀÌ Àû¿ëµÇµµ·Ï ÇÔ if (typeof test_getCookie('prev_srch_opt') !== 'undefined' && ($("#track_frm input[name=pg_nm]").val() == 'rlty_srch' || ($("#detail_srch_frm").length > 0 && $("#track_frm input[name=pg_nm]").val() == 'rlty_list' && $("#track_frm input[name=clr_frm]").val() == '') || $("#track_frm input[name=pg_nm]").val() == 'main_page') ) { //var Srch_Opt_Obj = getQstrObj(test_getCookie('prev_srch_opt')); var Srch_Opt_Obj = $.deparam(test_getCookie('prev_srch_opt')); // ----------------------- ÅëÇÕ°Ë»öÁ¶°Ç ¹öÆ° ÃÖ½ÅÈ­( ºÐ¾ß, ¿ëµµ ) if ($("#track_frm input[name=pg_nm]").val() == 'rlty_srch' && $.inArray($("#track_frm input[name=corp_id]").val(), HQ_CORP_ID_A) > -1 ) trim_opt_btn(Srch_Opt_Obj); // ----------------------- ¼ÒÀçÁö ÄÞº¸¹Ú½ºÀÇ °ªÀ» cookie ¿¡ ÀúÀåµÈ °ªÀ¸·Î ¼³Á¤ÇÔ var js_frm_nm = decodeURI(Cjs_getCookie('cookie_frm_nm')); var js_tk_pid = decodeURI(Cjs_getCookie('cookie_tk_pid')); var js_tk_sub = decodeURI(Cjs_getCookie('cookie_tk_sub')); var js_sw_tch = decodeURI(Cjs_getCookie('cookie_sw_tch')); var js_sido = ''; var js_sgg = ''; var js_umd = ''; if (typeof Srch_Opt_Obj['sido'] !== 'undefined') js_sido = Srch_Opt_Obj['sido']; if (typeof Srch_Opt_Obj['sgg'] !== 'undefined') js_sgg = Srch_Opt_Obj['sgg']; if (typeof Srch_Opt_Obj['umd'] !== 'undefined') js_umd = Srch_Opt_Obj['umd']; //if( String(js_tk_pid) == String($("#"+js_frm_nm+" input[name=tk_pid]").val()) // && String(js_tk_sub) == String($("#"+js_frm_nm+" input[name=tk_sub]").val()) // && String(js_sw_tch) == String($("#"+js_frm_nm+" input[name=sw_tch]").val()) //){ if (js_sido && js_sgg) { $("#detail_srch_frm select[id=sido], #brd_frm select[id=sido]").val(js_sido); ajax_client_main('area_combobox', '', 'all', '', js_sido, js_sgg, js_umd); } else if (js_sido) { $("#detail_srch_frm select[id=sido], #brd_frm select[id=sido]").val(js_sido); ajax_client_main('area_combobox', '', 'sido', 'sgg', js_sido); } } // ----------------------- ¸ñ·ÏÆäÀÌÁöÀÏ °æ¿ì smart °Ë»öÀ϶§ log ÀúÀå if ($("#frm_bg_log input[name=tk_pid]").val() == 'rlty_list' && $("#d_srch_frm input[name=search_type]").val() == 'smart' ) { var ajx_p01_val = $("#track_frm input[name=mem_id]").val() + '!_!' + $("#track_frm input[name=corp_id]").val() + '!_!' + $("#track_frm input[name=t_r]").val(); ajax_client_main('bg_catch_action', 'psd_a_frm', ajx_p01_val, 'smart_srch'); } }); // °°Àº ¸ñÀûÀ¸·Î »ç¿ëµÇ´Â checkbox µé Àüü ¼±ÅÃ/ÇØÁ¦ $(document).on('click', "[btn-tp='grp_chkbox']", function (event) { var trgt_nm = $(this).attr('trgt-nm').replace('[', '\\[').replace(']', '\\]'); if ($(this).attr('act-tp') == 'select') $("input[name=" + trgt_nm + "]").prop('checked', true); else $("input[name=" + trgt_nm + "]").prop('checked', false); }); // Ŭ¸¯½Ã form submit ÇÏ¿© °Ë»ö $(document).on('mouseup', "[btn-tp='chk_n_submit']", function (event) { var obj; var selected_value = $(this).attr('value'); var input_nm = ''; if ($.inArray($(this).attr('target-ct'), kyg_sp_A) > -1) { obj = {}; input_nm = $(this).attr('target-ct'); } else if ($(this).attr('target-ct') == 'rtyct') { obj = $('#detail_srch_frm input[name=rltyct_A\\[\\]]'); input_nm = 'rltyct_A\\[\\]'; } else if ($(this).attr('target-ct') == 'stats') { obj = $('#detail_srch_frm input[name=sale_status_A\\[\\]]'); input_nm = 'sale_status_A\\[\\]'; } else return false; // --- if (typeof obj.length === 'undefined') { $.each(kyg_sp_A, function (idx, val) { $("#detail_srch_frm input[name=" + idx + "]").prop('checked', false); }); } else obj.each(function () { $(this).prop('checked', false); }); // --- $("#detail_srch_frm input[name=" + input_nm + "][value='" + selected_value + "']").prop('checked', true); //console.log($("#detail_srch_frm").serialize()); //return false; // --- $('#detail_srch_frm').submit(); }); // if ($("#bg_log_basic_frm input[name=t_or_r]").val() == 'test') { $(".kyg_box_title, .pre_box_title, .gng_box_title, .bun_box_title, .rp_box_title").on('click, change', function () { // console.log($(this).attr('class')); }); } // »ç¿ëÀÚ ºÐ¾ß º¯°æ À¯¹« flag $("#detail_srch_frm input[type=checkbox]").on('change', function () { if ($("#detail_srch_frm input[name=js_frm_reset]").val() == '1') return false; if ($.inArray($(this).attr('name'), sw_tch_btn_A) > -1) Cjs_setCookie('set_sw_by_user', 1, 1); // »ç¿ëÀÚÀÇ ºÐ¾ß º¯°æ À¯¹« flag }); // ÅëÇÕ°Ë»ö¿¡¼­ ¼±ÅÃµÈ °Ë»öÁ¶°Ç Ç¥½Ã $("#detail_srch_frm").find('select, input').on('change', function () { if ($("#detail_srch_frm input[name=sw_tch_kyg]:checked").length == 1 && $("#detail_srch_frm input[name=sw_tch_pre]:checked").length == 1 && $("#detail_srch_frm input[name=sw_tch_gng]:checked").length == 1 && $("#detail_srch_frm input[name=sw_tch_bun]:checked").length == 1 && $("#detail_srch_frm input[name=sw_tch_rp]:checked").length == 1 ) { every_sw_tch = true; } else { every_sw_tch = false; } // --- if ($.inArray($("#track_frm input[name=corp_id]").val(), HQ_CORP_ID_A) > -1) { PrintSelSrchOpts($(this).attr('name'), $(this).val(), ''); } }); $("#detail_srch_frm").find('label[name=sw_tch_A_btn]').on('click', function () { if (!$($(this).attr('for')).prop('checked')) $(this).removeClass('active'); }) // ¿ëµµ »ó¼¼ ¼±ÅÃ/ÇØÁ¦½Ã class Ãß°¡/Á¦°Å, checkbox check Ãß°¡/Á¦°Å $("#detail_srch_frm input[name=k_rltyct_A\\[\\]], #detail_srch_frm input[name=p_rltyct_A\\[\\]], #detail_srch_frm input[name=g_rltyct_A\\[\\]], #detail_srch_frm input[name=b_rltyct_A\\[\\]], #detail_srch_frm input[name=r_rltyct_A\\[\\]]").on("change", function () { var inp_val = $(this).val(); //console.log(inp_val); if (inp_val == '¾ÆÆÄÆ®' || inp_val == '¿ÀÇǽºÅÚ' || inp_val == 'ºÐ¾ç/ÀÔÁÖ±Ç') TrimRtyBtn(inp_val); else if ($.inArray(inp_val, kyg_sole_rlty_A) > -1 || $.inArray(inp_val, pre_sole_rlty_A) > -1 || $.inArray(inp_val, gng_sole_rlty_A) > -1 || $.inArray(inp_val, bun_sole_rlty_A) > -1 || $.inArray(inp_val, rp_sole_rlty_A) > -1) TrimRtyBtn('´Üµ¶/´Ù°¡±¸'); else if ($.inArray(inp_val, kyg_billa_rlty_A) > -1 || $.inArray(inp_val, pre_billa_rlty_A) > -1 || $.inArray(inp_val, gng_billa_rlty_A) > -1 || $.inArray(inp_val, bun_billa_rlty_A) > -1 || $.inArray(inp_val, rp_billa_rlty_A) > -1) TrimRtyBtn('¿¬¸³/´Ù¼¼´ë'); else if ($.inArray(inp_val, kyg_store_rlty_A) > -1 || $.inArray(inp_val, pre_store_rlty_A) > -1 || $.inArray(inp_val, gng_store_rlty_A) > -1 || $.inArray(inp_val, bun_store_rlty_A) > -1 || $.inArray(inp_val, rp_store_rlty_A) > -1) TrimRtyBtn('»ó°¡'); else if ($.inArray(inp_val, kyg_land_rlty_A) > -1 || $.inArray(inp_val, pre_land_rlty_A) > -1 || $.inArray(inp_val, gng_land_rlty_A) > -1 || $.inArray(inp_val, bun_land_rlty_A) > -1 || $.inArray(inp_val, rp_land_rlty_A) > -1) TrimRtyBtn('ÅäÁö'); }); // ¿ëµµ ´ëºÐ·ù º¯°æ½Ã ¿ëµµ»ó¼¼ view update $("#detail_srch_frm input[name=rltyct_A\\[\\]]").on("change", function () { var inp_val = $(this).val(); var class_act = false; var prop_stat = false; // --- if ($(this).prop('checked') == false) { prop_stat = false; class_act = true; } else { prop_stat = true; class_act = false; } // --- ModDtlRtyct(inp_val, prop_stat, class_act); }); // A00 ¿ëµµ ´ëºÐ·ù combobox º¯°æ½Ã ÇÏÀ§ ¿ëµµ combobox º¯°æ $("select[name=m_usg]").change(function () { if ($(this).data('options') === undefined) { /*Taking an array of all options-2 and kind of embedding it on the select1*/ $(this).data('options', $('select[name=sel_rtyct] option').clone()); } var usg_ct = $(this).val(); var options; if (usg_ct != '') options = $(this).data('options').filter('[usg-ct="' + usg_ct + '"]'); else options = $(this).data('options').not('[usg-ct="' + usg_ct + '"]'); $('select[name=sel_rtyct]').html(options); }); // $(window).on('load', function () { var dtl_srch_qry_str = ''; if ($('#detail_srch_frm').length > 0) dtl_srch_qry_str = $("#detail_srch_frm").find("select, input[type=text], input[type=radio], input[type=checkbox]:checked").serialize(); else if ($('#d_srch_frm').length > 0) { dtl_srch_qry_str = $("#d_srch_frm").serialize(); var missing_params = $('#d_srch_frm input[name=rltyct_A\\[\\]]:checkbox, #d_srch_frm input[name=sale_status_A\\[\\]]:checkbox').map(function () { return { name: this.name, value: this.value }; }); dtl_srch_qry_str += '&' + $.param(missing_params); } var dtl_srch_obj; if (dtl_srch_qry_str != '' && $.inArray($("#track_frm input[name=corp_id]").val(), HQ_CORP_ID_A) > -1) { dtl_srch_obj = QstrToObj(dtl_srch_qry_str); every_sw_tch = false; if ((dtl_srch_obj.sw_tch_kyg > 0 || dtl_srch_obj.sw_tch_kyg == '°æ¸Å') && (dtl_srch_obj.sw_tch_pre > 0 || dtl_srch_obj.sw_tch_pre == '¿¹Á¤') && (dtl_srch_obj.sw_tch_gng > 0 || dtl_srch_obj.sw_tch_gng == '°ø¸Å') && (dtl_srch_obj.sw_tch_bun > 0 || dtl_srch_obj.sw_tch_bun == 'ºÐ¾ç') && (dtl_srch_obj.sw_tch_rp > 0 || dtl_srch_obj.sw_tch_rp == '½Ç°Å·¡°¡') ) { every_sw_tch = true; } // --- $.each(dtl_srch_obj, function (nm, val) { if (nm == 'sw_tch_kyg' && val == 1) val = '°æ¸Å'; else if (nm == 'sw_tch_pre' && val == 1) val = '¿¹Á¤'; else if (nm == 'sw_tch_gng' && val == 1) val = '°ø¸Å'; else if (nm == 'sw_tch_bun' && val == 1) val = 'ºÐ¾ç'; else if (nm == 'sw_tch_rp' && val == 1) val = '½Ç°Å·¡°¡'; // --- //if(nm == 'rltyct_A' && $("#d_srch_frm input[name=tot_sel_rty_cnt]").val() == 0) { } //if( skip_e_sw_tch == true // && ( nm == 'sw_tch_kyg' // || nm == 'sw_tch_pre' // || nm == 'sw_tch_gng' // || nm == 'sw_tch_bun' // || nm == 'sw_tch_rp' ){ } //else if (nm == 'rltyct_A') { } else if (nm == 'sale_status_A' && $("#d_srch_frm input[name=tot_sel_stat_cnt]").val() == 0) { } else if (val != '') { PrintSelSrchOpts(nm, val, 'load'); } }); } // --- ³¯Â¥ input Ŭ¸¯½Ã ´Þ·Â È°¼ºÈ­¿¡´ëÇÑ history Ãß°¡ $('.mdetail_pick_date, .pre_pub_date').click(function () { Do_Pushstate('open_calendar'); }); // --- ´Þ·Â $('.mdetail_pick_date').pignoseCalendar({ lang: 'ko', format: 'YYYY.MM.DD' }); // --- ¿¹Á¤ °ø°íÀÏ $('.pre_pub_date').pignoseCalendar({ lang: 'ko', format: 'YYYY.MM.DD', minDate: $("#period_4_srch_frm input[name=pre_dt_fr]").val(), maxDate: $("#period_4_srch_frm input[name=pre_dt_to]").val() }); // --- ¸Å¹° ÀÔ·Â/¼öÁ¤ ´Þ·Â $('.btn-calendar').click(function () { Do_Pushstate('open_calendar'); }); $('.btn-calendar').pignoseCalendar({ modal: true, // It means modal will be showed when you click the target button. lang: 'ko', select: function (date, context) { $(".btn-calendar span[name=move_in_date_txt]").html(date[0]._i); $(".btn-calendar input[name=move_in_date]").val(date[0]._i); } }); // --- ´Þ·Â °ËÀº»ö ±×¸²ÀÚ¹è°æ Ŭ¸¯½Ã hash Á¦°ÅÀ§ÇØ µÚ·Î°¡±â ó¸® $('.pignose-calendar-wrapper-overlay').click(function () { history.go(-1); }); // --- ÆîÃÄÁø °Ë»öÁ¶°Ç Á¦¸ñÀÇ È­»ìÇ¥ ¹æÇâ Á¶Á¤ ¹× view »óÅ ÀúÀå $(".collapse").on('show.bs.collapse', function () { Cjs_setCookie(this.id, 'true', 100); //$("div[data-target='#" + this.id + "']").children(".grn_arrow").addClass('rotate_n_180'); //$("div[data-target='#" + this.id + "'] > .grn_arrow, div[data-target='#" + this.id + "'] > .grn_arrow_big").addClass('rotate_n_180'); }); $(".collapse").on('hide.bs.collapse', function () { Cjs_setCookie(this.id, '', 100); //$("div[data-target='#" + this.id + "']").children(".grn_arrow").removeClass('rotate_n_180'); $("div[data-target='#" + this.id + "'] > .grn_arrow, div[data-target='#" + this.id + "'] > .grn_arrow_big").removeClass('rotate_n_180'); }); /* ¸ñ·Ï¿¡¼­ µÚ·Î°¡±â½Ã ¼±ÅÃÇß¾ú´ø ¿ëµµ¹öÆ°ÀÌ Ç¥½ÃµÇÁö ¾Ê¾Æ ¾Æ·¡ script ·Î ÇØ´ç¹®Á¦¸¦ °³¼±ÇÔ. bootstrap ÀÇ checkbox ¸¦ ¹öÆ°È­ ÇÑ°ÍÀ» »ç¿ëÁßÀ̸ç, ÀÌ ¹®Á¦´Â bootstrap ÀÇ Æ¯¼ºÀ¸·Î »ý°¢µÊ. */ $("input[name^=rltyct_A], input[name^=sale_status_A], input[name=is_lien], input[name=sr_de_power], input[name=is_outprein], input[name=is_sright], input[name=is_landnreg], input[name=void_value], input[name=is_quota], input[name=is_tomb], input[name=is_landexri], input[name=is_blind], input[name=sr_lease_w_deposit], input[name=is_agrilicence],input[name=sr_lease],input[name=sr_provi_reg],input[name=sr_provi_disp],input[name=usage_tp],input[name=trade_type]").each(function (idx, el) { if ($(this).prop('checked') == true) $(this).parent().addClass("active"); }); }); // ======================================================================== Áöµµ°Ë»ö // ºÐ¾ß ¹öÆ° ¼±Åýà UI º¯°æ ¹× ¹°°Ç °Ë»ö $("#selected_filter .sw_tch_info button").click(function () { //console.log($(this).attr('value')); var btn_v = $(this).val(); if ($(this).hasClass('focus')) $(this).removeClass('focus'); // --- if ($(this).hasClass('active')) { $("#detail_srch_frm input[name=" + btn_v + "]:checkbox").prop('checked', false); $(this).removeClass('active'); } else { $("#detail_srch_frm input[name=" + btn_v + "]:checkbox").prop('checked', true); $(this).addClass('active'); } Cjs_setCookie('prev_srch_opt', $("#detail_srch_frm").serialize(), 0.3); remove_CustomOverlay(); mapSearch(); }); // ½Ã¼³ Á¾·ù ¼±Åà ½Ã ¹°°Ç °Ë»ö $(".filter_ctrl Input[type=checkbox]").change(function () { if ($("#detail_srch_frm input[name=" + $(this).val() + "]").val() == '') $("#detail_srch_frm input[name=" + $(this).val() + "]").val('1'); else $("#detail_srch_frm input[name=" + $(this).val() + "]").val(''); remove_CustomOverlay(); mapSearch(); }); // ¿ëµµ ¹öÆ° ¼±Åýà UI º¯°æ ¹× ¹°°Ç °Ë»ö $("#selected_filter .rltyct_info button").click(function () { var btn_v = $(this).val(); var btn_nm = $(this).attr('name'); // ------------------------------ Áöµµ °Ë»ö UIÀÇ ¿ëµµ ¹öÆ° ¼±Åýà °¢ºÐ¾ßÀÇ ¿ëµµ »ó¼¼ ÃʱâÈ­ $("#detail_srch_frm #kyg_rlty_bx input[type=checkbox]").each(function () { $(this).prop('checked', false); }); $("#detail_srch_frm #pre_rlty_bx input[type=checkbox]").each(function () { $(this).prop('checked', false); }); $("#detail_srch_frm #gng_rlty_bx input[type=checkbox]").each(function () { $(this).prop('checked', false); }); $("#detail_srch_frm #bun_rlty_bx input[type=checkbox]").each(function () { $(this).prop('checked', false); }); $("#detail_srch_frm #rp_rlty_bx input[type=checkbox]").each(function () { $(this).prop('checked', false); }); // ------------------------------ if ($(this).hasClass(btn_nm + '_on')) { $(this).removeClass(btn_nm + '_on'); $("input[name=rltyct_A\\[\\]]:checkbox").each(function () { if ($(this).val() == btn_v) $(this).prop('checked', false); }); } else { $(this).addClass(btn_nm + '_on'); $("input[name=rltyct_A\\[\\]]:checkbox").each(function () { if ($(this).val() == btn_v) $(this).prop('checked', true); }); } Cjs_setCookie('prev_srch_opt', $("#detail_srch_frm").serialize(), 0.3); remove_CustomOverlay(); mapSearch(); }); // ======================================================================== Áöµµ°Ë»ö //