//filter clk evt function reference_filterClk(){ $(document).on("click","#referencelistForm [name=second_class],#referencelistForm [name=second_category],#referencelistForm [name=first_agency]",function(){ //first chk if( $(this).parents('.depth-2').find('input:checkbox[name="' + event.target.name + '"]:checked').length >= 1){ $(this).parents('.depth-2').siblings('.depth-1').find('input').prop("checked", true); }else{ $(this).parents('.depth-2').siblings('.depth-1').find('input').prop("checked", false); } //filter_mylist clk array var filter_mylist = ""; var filter_mylist_clk = ""; var filter_agency = ""; var filter_agency_clk = ""; filter_agency = $('#filter_agency').val(); filter_mylist = $('#filter_mylist').val(); if($(this).attr('name') == 'second_class'){ filter_mylist_clk = 'class_'+$(this).val() +','; }else if($(this).attr('name') == 'second_category'){ filter_mylist_clk = 'category_'+$(this).val() +','; }else if($(this).attr('name') == 'first_agency'){ filter_mylist_clk = 'agency_'+$(this).val() +','; //생산기관은 1depth 이므로 별도처리 filter_agency_clk = $(this).val() +","; } //생산기관은 1depth 이므로 별도처리 if($(this).is(":checked")){ filter_mylist += filter_mylist_clk; filter_agency += filter_agency_clk; }else{ filter_mylist = filter_mylist.replace(filter_mylist_clk,''); filter_agency = filter_agency.replace(filter_agency,''); } $('#filter_mylist').val(filter_mylist); $('#filter_agency').val(filter_agency); //depth-1 var on_classArr = document.querySelectorAll("div.depth-1.on"); var filter_class = "" ; var filter_category = "" ; for(var i=0; i= 0 ){ filter_mylist_clk = 'class_'+ s_cate_id +','; }else if($(this).attr('id').indexOf('j_cate_theme')>= 0 ){ filter_mylist_clk = 'category_'+ s_cate_id +','; }else if($(this).attr('name').indexOf('first_agency_del')>= 0 ){ filter_mylist_clk = 'agency_'+ s_cate_id +','; filter_agency_clk = s_cate_id +','; } filter_agency = filter_agency.replace(filter_agency_clk,''); filter_mylist = filter_mylist.replace(filter_mylist_clk,''); $('#filter_agency').val(filter_agency); $('#filter_mylist').val(filter_mylist); //depth-1 var on_classArr = document.querySelectorAll("div.depth-1.on"); var filter_class = "" ; var filter_category = "" ; for(var i=0; i= 0){ var checked = document.querySelectorAll("#referencelistForm [name='second_class']:checked"); for(var i=0; i= 0 ){ var second_cate_id = "c_cate_"+ $(checked[i]).attr('id') +"_id_" +checkVal ; var first_cate_nm =$(checked[i]).parents('.depth-2').siblings('.depth-1').find('label').text(); var second_cate_nm = $(checked[i]).next().text(); first_cate_nm = first_cate_nm.substring(0,first_cate_nm.indexOf("(",-1)); second_cate_nm = second_cate_nm.substring(0,second_cate_nm.lastIndexOf("(")); if(comparisonData != second_cate_id){ first_cate_nm = util.xssCheck(first_cate_nm); second_cate_nm = util.xssCheck(second_cate_nm); second_cate_id = util.xssCheck(second_cate_id); $("#reference_fillter_append").append("
  • "+ first_cate_nm + " > "+ second_cate_nm + "
  • ").text(); comparisonData = second_cate_id; } } } } else if(mylist_arr[j].indexOf("category") >= 0){ var checked = document.querySelectorAll("#referencelistForm [name='second_category']:checked"); var comparisonData; //필터라벨 for(var i=0; i= 0 ){ var second_cate_id = "j_cate_"+ $(checked[i]).attr('id') +"_id_" +checkVal ; var first_cate_nm =$(checked[i]).parents('.depth-2').siblings('.depth-1').find('input').next().text(); var second_cate_nm = $(checked[i]).next().text(); first_cate_nm = first_cate_nm.substring(0,first_cate_nm.indexOf("(",-1)); second_cate_nm = second_cate_nm.substring(0,second_cate_nm.indexOf("(",-1)); if(comparisonData != second_cate_id){ first_cate_nm = util.xssCheck(first_cate_nm); second_cate_nm = util.xssCheck(second_cate_nm); second_cate_id = util.xssCheck(second_cate_id); $("#reference_fillter_append").append("
  • "+ first_cate_nm + " > "+ second_cate_nm + "
  • ").text(); comparisonData = second_cate_id; } } } } else if(mylist_arr[j].indexOf("creat_all") >= 0){ $("#reference_fillter_append").append("
  • 생산년도 > 전체
  • ").text(); } else if(mylist_arr[j].indexOf("creat_date") >= 0){ $("#reference_fillter_append").append("
  • 생산년도 > " + $("#creatYyyyStart").val() + "~" + $("#creatYyyyEnd").val() +"
  • ").text(); }else if(mylist_arr[j].indexOf("agency") >= 0){ var second_cate_nm = mylist_arr[j].substring(mylist_arr[j].indexOf("_")+1); $("#reference_fillter_append").append("
  • 생산기관 > "+ second_cate_nm + "
  • ").text(); }else if(mylist_arr[j].indexOf("search_query") >= 0){ $("#reference_fillter_append").append("
  • 검색어 > "+ $("#realQuery").val() + "
  • ").text(); }else if(mylist_arr[j].indexOf("search_bookIndex") >= 0){ $("#reference_fillter_append").append("
  • 목차 > "+ $("#bookIndex").val() + "
  • ").text(); }else if(mylist_arr[j].indexOf("search_mngtNo") >= 0){ $("#reference_fillter_append").append("
  • 관리번호 > "+ $("#mngtNo").val() + "
  • ").text(); }else if(mylist_arr[j].indexOf("search_era") >= 0){ $("#reference_fillter_append").append("
  • 연대 > "+ $("#createStartDate").val() + "~" + $("#createEndDate").val() + "
  • ").text(); }else if(mylist_arr[j].indexOf("search_ageCode") >= 0){ var ageCode_arr = $("#referencelistForm [name=ageCode]").val().split(","); for(var i=0; i < ageCode_arr.length ; i++) { $("#reference_fillter_append").append("
  • 시대 > "+ ageCodeNm(ageCode_arr[i]) + "
  • ").text(); } }else if(mylist_arr[j].indexOf("search_collectionList") >= 0){ var collectionList_arr = $("#referencelistForm [name=collectionList]").val().split(","); for(var i=0; i < collectionList_arr.length ; i++) { $("#reference_fillter_append").append("
  • 이용구분 > "+ collectionNm(collectionList_arr[i]) + "
  • ").text(); } } } //for end } function ageCodeNm(ageCode){ if(ageCode == null) { return ageCode; } if(ageCode == "03") return "선사"; if(ageCode == "04|05|06") return "고대"; if(ageCode == "07") return "고려"; if(ageCode == "08") return "조선"; if(ageCode == "11|12") return "근대"; if(ageCode == "13|14") return "현대"; if(ageCode == "02") return "시대미상"; return ageCode; } function collectionNm(collection){ if(collection == null) { return collection; } if(collection == "lib_online") return "온라인열람"; if(collection == "lib_loan") return "대출"; if(collection == "lib_offline") return "열람"; if(collection == "lib_etc") return "기타"; return collection; } function fnLabel_reference_detail(){ $('#referencelistForm input[name=sojang_council]').prop("checked",false); $('#referencelistForm input[name=sido_name]').prop("checked",false); $("#referencelistForm .cmm-list-chk").each(function (index, item) { $(this).prop("checked",true); }); $("#reference_council_append").empty(); var mylist_arr = $("#referencelistForm [name=filter_mylist]").val().split(","); for(var j=0; j < mylist_arr.length ; j++){ if(mylist_arr[j].indexOf("council") >= 0){ var checked = document.querySelectorAll("#referencelistForm [name='sojang_council']:checked"); for(var i=0; i= 0 ){ var second_cate_id = $(checked[i]).attr('id')+"_id"; var second_cate_id_del = $(checked[i]).attr('id')+"_id_del"; var first_cate_nm =$(checked[i]).parents('.depth-2').siblings('.depth-1').find('input').next().text(); var second_cate_nm = $(checked[i]).next().text(); first_cate_nm = first_cate_nm.substring(0,first_cate_nm.indexOf("(",-1)); second_cate_nm = second_cate_nm.substring(0,second_cate_nm.indexOf("(",-1)); second_cate_id = util.xssCheck(second_cate_id); second_cate_id_del = util.xssCheck(second_cate_id_del); first_cate_nm = util.xssCheck(first_cate_nm); second_cate_nm = util.xssCheck(second_cate_nm); $("#reference_council_append").append("
  • "); } } }//if end }//for end var checked2 = document.querySelectorAll("#referencelistForm [name='sido_name']:checked"); for(var i=0; i