// =========================================================== event on document
// ----------------------- »ó´Ü¹Ù ½ºÅ©·Ñ½Ã °¡¸®´Â script
var tt_prevScrollpos = window.pageYOffset;
// ---
if($.inArray($("#track_frm input[name=pg_nm]").val(), sw_tch_d_A) >= 0)
var d_pic_h = ($(".dview_pic").height()) ? Math.round($(".dview_pic").height()) : d_padding_t;
// ---
window.onscroll = function() {
var tt_currentScrollPos = Math.round(window.pageYOffset);
if($.inArray($("#track_frm input[name=pg_nm]").val(), sw_tch_d_A) >= 0)
SortFixedBar('d', tt_currentScrollPos, (d_pic_h-d_padding_t));
else
SortFixedBar('cmn', tt_prevScrollpos, tt_currentScrollPos);
tt_prevScrollpos = tt_currentScrollPos;
}
// =========================================================== event on document
$(document).on("click", "[btn-tp='OpenDview']", function(){
var swth = $(this).attr('sw_tch_han');
var rtyct = $(this).attr('rty_cate');
var cc = $(this).attr('cc');
var sn = $(this).attr('sn');
var rn = $(this).attr('rn');
var sn_1 = $(this).attr('sn_1');
var sn_2 = $(this).attr('sn_2');
var sn_3 = $(this).attr('sn_3');
var sn_4 = $(this).attr('sn_4');
Detail_View(swth, cc, sn, rn, sn_1, sn_2);
});
$(document).on("click", "[ctn-id]", function(){
var ctn_id = $(this).attr('ctn-id');
var ctn_html;
// ---
if($(this).hasClass('w_parent')) // class ¿¡ w_parent °¡ ÀÖ´Ù¸é ÇØ´ç tag µµ html ¿¡ Ãß°¡
{
ctn_html = $("#"+ctn_id).clone();
var new_el_id = ctn_html.prop('id').replace('DF_', ''); // ajax ¿ë id ¸¦ ¼³Á¤ÇÔ
ctn_html.prop('id', new_el_id);
}
else
ctn_html = $("#"+ctn_id).html();
// ---
$("#modal_detail_tt").html(modal_title_A[ctn_id]);
$("#modal_detail_ctn").html(ctn_html);
// ---
if($(this).hasClass('add_more_btn'))
{
if( new_el_id == 'rp_list_tbl'
|| new_el_id == 'news_list'
|| new_el_id == 'molit_pub_list'
|| new_el_id == 'gosi_list'
|| new_el_id == 'panre_list'
|| new_el_id == 'other_rlty'
|| new_el_id == 'expt_list'
){
if(new_el_id == 'rp_list_tbl')
{
more_btn_html = '
';
more_btn_html += '´õº¸±â
';
}
else
{
more_btn_html = '´õº¸±â
';
}
$("#modal_detail_ctn").append(more_btn_html);
}
}
});
// ----------------------- ·Î±×ÀÎÀÌ ÇÊ¿äÇÑ ±â´É»ç¿ë½Ã ·Î±×ÀÎ check
//$(document).on("click", "span[chk-logon-for], button[chk-logon-for]", function(event){
// event.stopPropagation();
// if($(this).attr('chk-logon-for') == 'reg_concern')
// {
// if($(this).attr("concern-fwh") == 'list')
// {
// $("#frm_concern input[name='sw_tch_han']").val($(this).attr("sw_tch_han"));
// $("#frm_concern input[name='Rty_Cate']").val($(this).attr("rty_cate"));
// $("#frm_concern input[name='Cc']").val($(this).attr("cc"));
// $("#frm_concern input[name='Sn']").val($(this).attr("sn"));
// $("#frm_concern input[name='Rn']").val($(this).attr("rn"));
// $("#frm_concern input[name='Sn_1']").val($(this).attr("sn_1"));
// $("#frm_concern input[name='Sn_2']").val($(this).attr("sn_2"));
// $("#frm_concern input[name='Sn_3']").val($(this).attr("sn_3"));
// $("#frm_concern input[name='Sn_4']").val($(this).attr("sn_4"));
// $("#frm_concern input[name='act_tp']").val('set');
// }
// // ---
// if($(this).attr("concern-tp") == 'set') { }
// else
// {
// ajax_client_main('set_concern', 'frm_concern', 'del');
// return false;
// }
// }
// ChkLogOn($(this).attr('chk-logon-for'), $(this).attr('data-toggle'));
//});
//$("span[chk-logon-for='reg_memo'], button[chk-logon-for='reg_memo'], span[chk-logon-for='reg_concern'], button[chk-logon-for='reg_concern'], li[chk-logon-for='reg_predict_amt']").on("click", function(){
$(document).on("click", "span[chk-logon-for='reg_memo'], button[chk-logon-for='reg_memo'], span[chk-logon-for='reg_concern'], button[chk-logon-for='reg_concern'], li[chk-logon-for='reg_predict_amt']", function(){
if($(this).attr('chk-logon-for') == 'reg_concern')
{
if($(this).attr("concern-fwh") == 'list')
{
$("#frm_concern input[name='sw_tch_han']").val($(this).attr("sw_tch_han"));
$("#frm_concern input[name='Rty_Cate']").val($(this).attr("rty_cate"));
$("#frm_concern input[name='Cc']").val($(this).attr("cc"));
$("#frm_concern input[name='Sn']").val($(this).attr("sn"));
$("#frm_concern input[name='Rn']").val($(this).attr("rn"));
$("#frm_concern input[name='Sn_1']").val($(this).attr("sn_1"));
$("#frm_concern input[name='Sn_2']").val($(this).attr("sn_2"));
$("#frm_concern input[name='Sn_3']").val($(this).attr("sn_3"));
$("#frm_concern input[name='Sn_4']").val($(this).attr("sn_4"));
$("#frm_concern input[name='act_tp']").val('set');
}
// ---
if($(this).attr("concern-tp") == 'set') { }
else
{
ajax_client_main('set_concern', 'frm_concern', 'del');
return false;
}
}
ChkLogOn($(this).attr('chk-logon-for'), $(this).attr('data-toggle'));
});
// ----------------------- ±ËÀû ¼öÁý
$(document).on("click", "[u-clk]", function(){
fill_track_frm($(this));
// Ŭ¸¯ÇÑ element ÀÇ parent °¡ ±ËÀû¼öÁý attr À» °¡Áö°í ÀÖÀ»°æ¿ì 2ÁßÀ¸·Î ·Î±×°¡ ±â·ÏµÇÁö ¾Êµµ·ÏÇÔ
if($(this).parent().closest("[u-clk]").get() != '')
return false;
});
// ----------------------- ´õº¸±â(È»ìÇ¥) ½Ç°Å·¡°¡ ¸ñ·Ï ´õº¸±â
$(document).on('click', "[btn-tp='nxt_rp_list']", function(event) {
ajax_progress_indicator('02', 'rp_list_progress');
ajax_client_main('get_rp_list', 'rp_list_frm', '');
});
$(document).on('mouseover', "[el-tp='brd_grp']", function() {
var grp_nm = $(this).attr("name");
$("div[name=" + grp_nm + "]").children().css('background-color', '#ef0000');
});
$(document).on('mouseout', "[el-tp='brd_grp']", function() {
var grp_nm = $(this).attr("name");
$("div[name=" + grp_nm + "]").children().css('background-color', '#bbbbbb');
});
// ----------------------- PC ¼ºê¸Þ´º more
$(document).on('mouseover', "#tpl_tt_2", function() {
if($(this).children().children().css('overflow-y') == 'hidden')
$(this).children().children().css('overflow-y', 'visible');
});
$(document).on('mouseout', "#tpl_tt_2", function() {
if($(this).children().children().css('overflow-y') == 'visible')
$(this).children().children().css('overflow-y', 'hidden');
});
// ----------------------- ´õº¸±â(È»ìÇ¥) ´ÙÀ½ ÆäÀÌÁöÀÇ ¹°°Ç¸ñ·ÏÀ» °¡Á®¿È
$(document).on('click', "[btn-tp='nxt_srch_list']", function() {
var ajx_nm = '';
if( $('#'+$(this).attr('el_nm')).attr('nextpg') == 0 || $('#'+$(this).attr('el_nm')).attr('prcs_step') == 1)
return false;
if( $(this).attr('frm_nm') == 'other_rlty_frm'
|| $(this).attr('frm_nm') == 'sold_rlty_frm'
|| $(this).attr('frm_nm') == 'expt_list_frm'
|| $(this).attr('frm_nm') == 'rlty_by_addr_frm') ajx_nm = 'ied_srch';
else if( $(this).attr('frm_nm') == 'news_frm'
|| $(this).attr('frm_nm') == 'molit_pub_frm'
|| $(this).attr('frm_nm') == 'panre_frm' ) ajx_nm = 'srch_engine';
else if( $(this).attr('frm_nm') == 'gosi_frm' ) ajx_nm = 'get_brd';
else if( $(this).attr('frm_nm') == 'sp_amt_frm'
|| $(this).attr('frm_nm') == 'std_amt_frm' ) ajx_nm = 'get_p_amt';
else
return false;
if(ajx_nm)
ajax_client_main(ajx_nm, $(this).attr('frm_nm'), $(this).attr('el_nm'));
});
// ----------------------- tab ¹öÆ° ¹× °¡¸®±â/ÆîÄ¡±â element ÀÇ id °ªÀÌ ±ÔÄ¢¼º ÀÖÀ» °æ¿ì
$(document).on('click', "[btn-tp='tab_btn']", function() {
el_id = $(this).attr('trgt-id');
el_id_num = $(this).attr('value');
// tab ¹öÆ°ÀÇ È°¼ºÈ Ç¥½Ã class ¸¦ Á¦°Å
$("[btn-tp='tab_btn'][trgt-id='"+el_id+"']").removeClass('active');
// Ŭ¸¯ÇÑ tab ¹öÆ°ÀÇ È°¼ºÈ class Ãß°¡
$("[btn-tp='tab_btn'][trgt-id='"+el_id+"'][value='"+el_id_num+"']").addClass('active');
// °°Àº ±×·ìÀÇ °¡¸®±â/ÆîÄ¡±âÇÒ element ¸¦ ¸ðµÎ °¡¸²
$("[id='"+el_id+"']").css('display','none');
$("[id='"+el_id+"']").addClass('hide');
// ajax ¿É¼ÇÀÌ ÀÖÀ»°æ¿ì
if( typeof $(this).attr('ajx_nm') != 'undefined'
&& $(this).attr('ajx_nm') != ''
&& $("[id='"+el_id+"'][value='"+el_id_num+"']").html() == ''
){
ajax_client_main($(this).attr('ajx_nm'), '', $(this).attr('p01'), $(this).attr('p02'), $(this).attr('p03'), $(this).attr('p04'), $(this).attr('p05'));
}
// Ŭ¸¯ÇÑ ¹öÆ°¿¡ ÇØ´çµÇ´Â element ¸¦ º¸À̵µ·Ï Æîħ
$("[id='"+el_id+"'][value='"+el_id_num+"']").css('display','');
$("[id='"+el_id+"'][value='"+el_id_num+"']").removeClass('hide');
//console.log("[id='"+el_id+"'][value='"+el_id_num+"']");
});
// ----------------------- ´õº¸±â ´ë»ó element ÀÇ display ¸¦ on/off, ÇØ´ç ¹öÆ°ÀÇ È»ìÇ¥ º¯°æ(À§/¾Æ·¡ ¸ð¾ç)
$(document).on('click', "[btn-tp='change_css_display']", function() {
var element_name = $(this).attr('target-el');
var target_cate = $(this).attr('target-ct'); // ´ë»ó element °¡ ´õº¸±â ÀÎÁö on/off ÀÎÁö ±¸ºÐ
var grp_li = $(this).attr('grp-el'); // Ŭ¸¯ÇÑ ´ë»óÀ» Á¦¿ÜÇÑ elements µéÀ» ¸ðµÎ off ÇÔ.
var secondary_btn = $(this).attr('secondary-btn'); // display °¡ º¯ÇÏ´Â div ³»ÀÇ ¹öÆ°À¸·Î È»ìÇ¥¸¦ º¯°æÇÏÁö ¾Ê°í °°Àº target-el ¸¦ °¡Áø ¹öÆ°ÀÇ È»ìÇ¥¸¦ º¯°æÇÔ
// ---
if(typeof grp_li === 'undefined') { }
else Hide_Elements(element_name, grp_li, 0);
// ---
if($(this).children('.grn_arrow, .grn_arrow_big').hasClass('rotate_n_180'))
{
if(secondary_btn)
{
$("div[target-el="+element_name+"][primary-btn='1'], button[target-el="+element_name+"][primary-btn='1']").children('.grn_arrow, .grn_arrow_big').removeClass('rotate_n_180');
}
else
{
$(this).children('.grn_arrow, .grn_arrow_big').removeClass('rotate_n_180');
}
if(element_name)
$("#"+element_name+", div[name="+element_name+"]").addClass('hide');
if(target_cate == 'on_off')
Cjs_setCookie(element_name, '', 100);
}
else
{
if(secondary_btn)
$("div[target-el="+element_name+"][primary-btn='1'], button[target-el="+element_name+"][primary-btn='1']").children('.grn_arrow, .grn_arrow_big').addClass('rotate_n_180');
else
$(this).children('.grn_arrow, .grn_arrow_big').addClass('rotate_n_180');
if(element_name)
$("#"+element_name+", div[name="+element_name+"]").removeClass('hide');
if(target_cate == 'on_off')
Cjs_setCookie(element_name, 1, 100);
}
// ---
});
// ----------------------- Ãßõ/ºñÃßõ ¹öÆ° onclick, mouse out/over
$(document).on('click', "[btn-tp='vote']", function() {
var act_tp = $(this).val();
var brd_id = $(this).attr("brd_id");
var p_odr = $(this).attr("p_ord");
var c_dth = $(this).attr("c_dth");
var c_odr = $(this).attr("c_ord");
var btn_txt_1 = '';
var btn_txt_2 = '';
swal({
title: "",
text: "ÀÌ ±ÛÀÌ ¸¶À½¿¡ µå¼Ì³ª¿ä?",
showCancelButton: true,
confirmButtonColor: '#DD6B55',
confirmButtonText: "ÁÁ¾Æ¿ä",
cancelButtonText: "³ªºü¿ä",
closeOnClickOutside: false,
closeOnConfirm: true,
closeOnCancel: true,
allowOutsideClick: true,
html: true
},
function(isConfirm) {
if(isConfirm == true) ajax_client_main('vote', '', 'up', brd_id, p_odr, c_dth, c_odr);
else if(isConfirm == false) ajax_client_main('vote', '', 'down', brd_id, p_odr, c_dth, c_odr);
});
});
$(document).on('mouseover touchstart', "[btn-tp='vote']", function() {
var act_tp = $(this).val();
var class_nm = 'arrow_' + act_tp + '_active';
$(this).children().addClass(class_nm);
});
$(document).on('mouseout touchend', "[btn-tp='vote']", function() {
var act_tp = $(this).val();
var class_nm = 'arrow_' + act_tp + '_active';
$(this).children().removeClass(class_nm);
});
// =========================================================== event on tag
$("#frm_memo input[name=BRD_TITLE]").on('keydown', function(e) {
if(e.keyCode == 13) {
ajax_client_main('write_memo', 'frm_memo', '');
history.go(-1);
return false;
}
});
// -----------------------
$("#s_srch_frm input[name=search_txt]").on('keyup', function(event) {
var key = event.keyCode || event.charCode;
if( key == 8 || key == 46 )
{
if($(this).val() == '')
fill_word_list();
}
});
// ----------------------- input ÀԷ³»¿ë ±â¾ï
$("#frm_memo #BRD_TITLE").on('focusout', function(e){ Cjs_setCookie('BRD_TITLE', $(this).val(), 100); });
$("#frm_memo #BRD_CONTENT").on('focusout', function(e){ Cjs_setCookie('BRD_CONTENT', $(this).val(), 100); });
// =========================================================== event on window
$(window).on('hashchange', function(e){ });
$(window).on('load', function(){
input_cursor('on');
});
// =========================================================== window onbeforeunload
window.onbeforeunload = function(e) {
$(".pg_prograss_indicator").removeClass('d-none'); // ÆäÀÌÁö ·Îµù½Ã ³ª¿À´Â indicate º¸ÀÌÁö ¾Êµµ·Ï ÇÔ
};
// =========================================================== document ready event
$(document).ready(function(){
$("#s_srch_frm input[name=search_txt]").val('');
// ---
var js_c_frm_nm = decodeURI(Cjs_getCookie('cookie_frm_nm'));
var js_c_tk_pid = decodeURI(Cjs_getCookie('cookie_tk_pid'));
var js_c_tk_sub = decodeURI(Cjs_getCookie('cookie_tk_sub'));
var js_c_sw_tch = decodeURI(Cjs_getCookie('cookie_sw_tch'));
var js_c_sido = decodeURI(Cjs_getCookie('cookie_sido'));
var js_c_sgg = decodeURI(Cjs_getCookie('cookie_sgg'));
var js_c_umd = decodeURI(Cjs_getCookie('cookie_umd'));
//if( String(js_c_tk_pid) == String($("#"+js_c_frm_nm+" input[name=tk_pid]").val())
// && String(js_c_tk_sub) == String($("#"+js_c_frm_nm+" input[name=tk_sub]").val())
//){
// if(js_c_sido && js_c_sgg)
// {
// $("#"+js_c_frm_nm+" select[id=sido]").val(js_c_sido);
// ajax_client_main( 'area_combobox', '', 'all', '', js_c_sido, js_c_sgg, js_c_umd);
// }
// else if(js_c_sido)
// {
// $("#"+js_c_frm_nm+" select[id=sido]").val(js_c_sido);
// ajax_client_main( 'area_combobox', '', 'sido', 'sgg', js_c_sido);
// }
//}
});
// =========================================================== document keyup event
$(document).keyup(function(event) {
// --- ctrl + shft + y = °Ë»ö¹Ù Ä¿¼À̵¿
var cod = altk = ctrk = shft = false;
cod = event.keyCode;
altk = event.altKey;
ctrk = event.ctrlKey;
shfk = event.shiftKey;
if(ctrk && shfk && (cod == 89))
$("#s_srch_frm input[name=search_txt]").focus();
});