1/****************************************************************** 2* [css class ì¤ëª ] 3* .active : 1ì°¨ë©ë´ ìì(gl-menu-itemê³¼ ê°ì ìì¹) 4* .show : 2ì°¨ë©ë´ ë ¸ì¶(gl-menu-itemê³¼ ê°ì ìì¹) 5* .is-current : í´ë¹íì´ì§ 2ì°¨ë©ë´ ìì((gl-menu-sub-itemê³¼ ê°ì ìì¹)) 6 7* [ì¤í¬ë¦½í¸ ë³ì] 8* DESIGN_INDEX : index íì´ì§ ì¼ ë ë©ë´ 첫ë²ì§¸ë©ë´ ì í ì¬ë¶ (true / false) 9* DESIGN_OVER : hoverì ë©ë´ active ê³ ì (true / false) 10* DESIGN_DIR : 2ì°¨ë©ë´ í¼ì¹¨ íí (horizon / vertical) 11* DESIGN_SIZE : í¬ê¸°ì¤ì (basic / full) 12* DESIGN_HOLD : 2ì°¨ë©ë´ ë ¸ì¶ ê³ ì (true / false) 13* DESIGN_POSI : 2ì°¨ë©ë´ ìì¹ (left / center / right) 14* DESIGN_EFFECT : 2ì°¨ë©ë´ ìëë©ì´ì (true: slide / false: fade) 15* DESIGN_SPEED : 2ì°¨ë©ë´ ìëë©ì´ì ìë(기본: 300) 16******************************************************************/ 17 18$(function() { 19 const USER_HEADER = $(".user-header"); 20 const USER_WIDTH = USER_HEADER.find(".index-width, .mode-inner").outerWidth(); 21 const GLOBAL_NAV = $(".gl-nav"); 22 const GLOBAL_MENU = $(".gl-menu"); 23 const GLOBAL_MENU_ITEM = $(".gl-menu-item"); 24 const GLOBAL_SUBMENU = $(".gl-menu-sub"); 25 const GLOBAL_SUBMENU_ITEM = $(".gl-menu-sub-item"); 26 const GLOBAL_MENU_BTN = $(".gl-menu-btn"); 27 const GLOBAL_MENU_BTN_WIDTH = GLOBAL_MENU_BTN.outerWidth(); 28 29 // section codes for this page 30 const CODE_SECTION = GLOBAL_MENU.data("main-code"); // 1ì°¨ 31 const CODE_SECTION_SUB = GLOBAL_MENU.data("sub-code"); // 2ì°¨
32 // const CODE_SECTION_SRN = GLOBAL_MENU.data("serial-code"); // ì°ì¬ 33 const CODE_SECTION_MULTI = GLOBAL_MENU.data("multi-code"); // ë¤ì¤ì¹ì 34 35 // data attr for design options 36 const DESIGN_INDEX = GLOBAL_MENU.data("menu-index"); 37 const DESIGN_OVER = GLOBAL_MENU.data("menu-over"); 38 const DESIGN_HOLD = GLOBAL_MENU.data("menu-holder"); 39 const DESIGN_DIR = GLOBAL_MENU.data("menu-direction"); 40 const DESIGN_SIZE = GLOBAL_MENU.data("menu-size"); 41 const DESIGN_POSI = GLOBAL_MENU.data("menu-position"); 42 const DESIGN_EFFECT = GLOBAL_MENU.data("menu-effect"); 43 const DESIGN_SPEED = GLOBAL_MENU.data("menu-speed"); 44 45 // ëìì¸ íí 46 if(DESIGN_DIR == "vertical") { 47 GLOBAL_SUBMENU.each(function() { 48 GLOBAL_SUBMENU.addClass("gl-menu-vert"); 49 }); 50 } 51 52 // ì¬ì´ì¦ 53 if(DESIGN_SIZE) { 54 USER_HEADER.addClass(DESIGN_SIZE); 55 } 56 57 // 2ì°¨ë©ë´ ìëë©ì´ì (í¨ê³¼) 58 if(DESIGN_EFFECT) { 59 GLOBAL_MENU.addClass("gl-menu-animate"); 60 } 61 62 // 첫 íì´ì§ ê³ ì ì¼ ê²½ì° 63 function _indexholder(boolean) { 64 if(boolean) { 65 if((CODE_SECTION.indexOf("index") == 1 || CODE_SECTION == "/" || CODE_SECTION == "/news/articleList.html" || CODE_SECTION == "/edit/webPublishing.php") && CODE_SECTION_MULTI == "") { 66 GLOBAL_MENU_ITEM.removeClass("active show").first().attr("aria-current", "page").addClass("active"); 67 68 if(DESIGN_HOLD) { 69 GLOBAL_MENU_ITEM.filter("[aria-current=page]").addClass("show"); 70 } 71 } 72 } 73 } 74 _indexholder(DESIGN_INDEX); 75 76 // 1ì°¨ë©ë´ê° ì íë íì´ì§ì ê°ì ê²½ì° 77 GLOBAL_MENU_ITEM.each(function(i, e){ 78 const _this = $(e); 79 const _datacode = _this.data("menu-code"); 80 const _menuwidth = (USER_WIDTH - GLOBAL_MENU_BTN_WIDTH); 81 const _offsetx = _this.position().left; 82 const _subwidth = _this.find(".gl-menu-sub").outerWidth(); 83 84 // position 85 if(DESIGN_DIR == "horizon") { 86 if(DESIGN_POSI == "center") { 87 const _thissubwidth = (_menuwidth - _offsetx); 88 if(_subwidth > _offsetx || _subwidth > _thissubwidth) { 89 _this.find(".gl-menu-sub") 90 .attr("style", "--nd-menu-sub-offset-x:" + Math.ceil(_offsetx * -1) + "px;") 91 .css({ 92 "max-width": _menuwidth, 93 "transform": "none" 94 }); 95 } 96 } else if(DESIGN_POSI == "right") { 97 if(_subwidth > _offsetx) { 98 _this.find(".gl-menu-sub") 99 .attr("style", "--nd-menu-sub-offset-x:" + Math.ceil(_offsetx * -1) + "px;") 100 .css({ 101 "max-width": _menuwidth, 102 "right": "auto" 103 }); 104 } 105 } else { 106 const _thissubwidth = (_subwidth + _offsetx); 107 if(_thissubwidth > _menuwidth) { 108 _this.find(".gl-menu-sub") 109 .attr("style", "--nd-menu-sub-offset-x:" + Math.ceil(_offsetx * -1) + "px;") 110 .css("max-width", _menuwidth); 111 } 112 } 113 } 114 115 if(DESIGN_OVER) { 116 if(CODE_SECTION == _datacode) { 117 _this.attr("aria-current", "page").addClass("active"); 118 119 if(DESIGN_HOLD) { 120 _this.addClass("active show"); 121 } 122 } else { 123 _indexholder(DESIGN_INDEX); 124 } 125 } 126 }); 127 128 // 2ì°¨ì¹ì 129 GLOBAL_SUBMENU_ITEM.each(function(i, e) { 130 const _this = $(e); 131 const _datacode = _this.data("menu-code"); 132 133 if(DESIGN_EFFECT) { 134 _this.closest(".gl-menu-sub").css("transition-duration", (DESIGN_SPEED * 0.001) + "s"); 135 } 136 137 // [menuOverHold]ì´ [false]ì¼ë ìë ìí¨. 138 if(!DESIGN_OVER) return true; 139 140 if(CODE_SECTION_SUB == _datacode) { 141 _this.addClass("is-current"); 142 } else { 143 _this.removeClass("is-current"); 144 } 145 }); 146 147 // hover options 148 GLOBAL_MENU_ITEM.on({ 149 "mouseenter focus": function(e) { 150 const _this = $(e.currentTarget); 151 152 e.preventDefault(); 153 GLOBAL_MENU_ITEM.removeClass("active show"); 154 _this.addClass("active show"); 155 156 if(DESIGN_DIR == "horizon") { 157 GLOBAL_NAV.addClass("active"); 158 } 159 }, 160 "mouseleave focusout": function(e) { 161 e.preventDefault(); 162 GLOBAL_MENU_ITEM.removeClass("active show"); 163 164 if((CODE_SECTION.indexOf("index") == 1 || CODE_SECTION == "/" || CODE_SECTION == "/news/articleList.html" || CODE_SECTION == "/edit/webPublishing.php") && CODE_SECTION_MULTI == "") { 165 if(DESIGN_INDEX) { 166 GLOBAL_MENU_ITEM.filter("[aria-current=page]").addClass("active"); 167 168 if(DESIGN_HOLD) { 169 GLOBAL_MENU_ITEM.filter("[aria-current=page]").addClass("show"); 170 } 171 } 172 } else { 173 if(DESIGN_OVER) { 174 GLOBAL_MENU_ITEM.filter("[aria-current=page]").addClass("active"); 175 176 if(DESIGN_HOLD) { 177 GLOBAL_MENU_ITEM.filter("[aria-current=page]").addClass("show"); 178 } 179 } 180 } 181 182 if(DESIGN_DIR == "horizon") { 183 GLOBAL_NAV.removeClass("active"); 184 } 185 } 186 }); 187});
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.