/********************************************************************************************************* ## Web's Republic Board Category to List Script ## * º» ½ºÅ©¸³Æ®ÀÇ ÀúÀÛ±ÇÀº (ÁÖ)À¥½º¸®ÆÛºí¸¯¿¡ ÀÖ½À´Ï´Ù. * º» ½ºÅ©¸³Æ®¸¦ ¹«´ÜÀ¸·Î ÀÌ¿ëÇϰųª º¹Á¦ ¶Ç´Â ¼öÁ¤ »ç¿ë½Ã ÀúÀ۱ǹý¿¡ ÀǰŠó¹ú¹ÞÀ» ¼ö ÀÖ½À´Ï´Ù. * version : 1.0 * date : 2017-02-15 * author : Park Soo Hyun (shpark7502@naver.com) *********************************************************************************************************/ $(function() { var cate_link = [], cate_title = [], currentURL = $(location).attr('pathname'), param = "?&com_board_category_code=", currentParam = "", insertHTML = "", idx = 0; var getUrlParameter = function getUrlParameter(sParam) { var sPageURL = decodeURIComponent(window.location.search.substring(1)), sURLVariables = sPageURL.split('&'), sParameterName, i; for (i = 0; i < sURLVariables.length; i++) { sParameterName = sURLVariables[i].split('='); if (sParameterName[0] === sParam) { return sParameterName[1] === undefined ? true : sParameterName[1]; } } }; if($("select[name='com_board_category_code']").length > 0) { currentParam = getUrlParameter('com_board_category_code'); $("select[name='com_board_category_code'] > option").each(function() { cate_link[idx] = $(this).val(); if($(this).text() == 'Àüü') { cate_title[idx] = 'ALL'; } else { cate_title[idx] = $(this).text(); } idx++; }); insertHTML = '
'; insertHTML += ''; insertHTML += '
'; $("#visual_container .pdT40").before(insertHTML); // $("table.board:first").parent().before(insertHTML); $.each(cate_link, function(m, key) { if(key == currentParam) { var curr_cate = $(".board_tab > ul > li[data-category='" + key + "'] > a > .eng").text(); if(!key) { $("#visual_container h3.title").text('All Products'); $("h1.cate_tit > span").text('All Products'); } else { $("#visual_container h3.title").text(curr_cate); $("h1.cate_tit > span").text(curr_cate); } $(".board_tab > ul > li[data-category='" + key + "'] > a").addClass('selected'); } }); if(!currentParam) { $(".board_tab > ul > li:first > a").addClass('selected'); } } });