1/******************************************************************************* 2 * í ì¼ ëª : popup.js 3 * ì ì± ì : ì¤í´ì 4 * ì ì± ì¼ : 2016-10-10 5 * 기 ë¥ : ë ì´ì´íì 6 ******************************************************************************/ 7 var SDS_COMMON = { 8 mobileWidth: 767, 9 tabletWidth: 1024, 10 currentWidth: function() { 11 return window.innerWidth >= $(document).width() ? window.innerWidth : $(document).width(); 12 }, 13 isMobile: function() { 14 return this.currentWidth() <= this.mobileWidth; 15 }, 16 isWeb: function() { 17 return this.currentWidth() > this.tabletWidth; 18 } 19}; 20 21$(function() { 22 $('body').on('click', '.btn_vod', function(e) { 23 e.preventDefault(); 24 var src = $(this).attr('data-src'); 25 var title = $(this).attr('data-title'); 26 if (title == undefined) { 27 title = "vod" 28 } 29 if ($("html").attr("lang") == "zh") { 30 var regExp = /^.*((youku.com\/)|(v\/)|(\/u\/\w\/)|(embed\/)|(watch\?))\??v?=?([^#\&\?]*).*/; 31 var match = src.match(regExp); 32 if (match && match[7].length > 0) { 33 var player = new YKU.Player('youkuplayer', { 34 styleid: '0', 35 client_id: '2db2c373613e62cd', 36 vid: match[7], //video ID 37 newPlayer: true 38 }); 39 40 } 41 } 42 $('.layer_inner.video').find('.layer_cnt').html('<iframe class="youtube" width="100%" frameborder="0" allowfullscreen src="' + src + '" title="' + title + '"></iframe>'); 43 }) 44 $('body').on('click', '.layer_inner.video .pop_close', function(e) { 45 e.preventDefault(); 46 $('.layer_inner.video').find('.layer_cnt').html('<iframe class="youtube" width="100%" frameborder="0" allowfullscreen ></iframe>'); 47 window.history.go(-1); 48 }); 49 $('body').on('click', '.layer_inner.video2 .pop_close', function(e) { 50 e.preventDefault(); 51 $('.layer_inner.video2').find('#youkuplayer').empty(); 52 window.history.go(-1); 53 }); 54 $('body').on('click', "[onclick^='layerpop.showLayerPop']", function(e) { 55 SDS_COMMON.layerPopup = $(this); 56 }); 57}); 58 59(function($) { 60 61 layerpop = { 62 showLayerPop: function(layerId) { 63 var $windowScrollTop = $(window).scrollTop(); 64 65 var $layerId = $("#" + layerId); 66 var $layerW = $layerId.width(), 67 $layerH = $layerId.height(); 68 69 $layerId.css({ 70 marginLeft: -($layerW / 2), 71 marginTop: -($layerH / 2) 72 }); 73 74 if (!$layerId.hasClass('m_full')) { 75 $("body").bind('touchmove', function(e) { e.preventDefault() }); 76 } else if (SDS_COMMON.currentWidth() < 767) { 77 $("html, body").addClass("oh"); 78 } 79 80 if ($layerId.find("video").length) { 81 var vid = $layerId.find("video").get(0); 82 vid.currentTime = 0; 83 vid.play(); 84 }; 85 86 $(window).on("resize", function() { 87 var $layerW = $layerId.width(), 88 $layerH = $layerId.height(); 89 $layerId.css({ 90 marginLeft: -($layerW / 2), 91 marginTop: -($layerH / 2) 92 }); 93 94 $cnt = $layerId.find(".layer_cnt"); 95 $cnt.css({ top: "0", marginTop: "" }); 96 }); 97 98 $("body").append('<div id="dim"></div>'); 99 100 if ($layerId.hasClass("l_use")) { 101 $("#dim").addClass("type2"); 102 history.pushState(null, null, location.href); 103 window.onpopstate = function(event) { 104 if ($layerId.hasClass("l_use")) { 105 $layerId.hide(); 106 $("#dim").remove(); 107 $("body").unbind('touchmove'); 108 } 109 } 110 } else if ($layerId.hasClass("full")) { 111 history.pushState(null, null, location.href); 112 window.onpopstate = function(event) { 113 if ($layerId.hasClass("full")) { 114 $layerId.hide(); 115 $("#dim").remove().off("touchmove"); 116 $("html").removeClass("oh"); 117 $('.layer_inner.video').find('.layer_cnt').html('<iframe class="youtube" width="100%" frameborder="0" allowfullscreen ></iframe>'); 118 $("body").unbind('touchmove'); 119 //$("body").removeAttr("style").unbind('touchmove'); 120 if ($layerId.find("video").length) { 121 var vid = $layerId.find("video").get(0); 122 vid.currentTime = 0; 123 vid.pause(); 124 }; 125 126 // youtube stop 127 if ($layerId.find(".youtube").length) { 128 $layerId.find(".youtube")[0].contentWindow.postMessage('{"event":"command","func":"' + 'stopVideo' + '","args":""}', '*'); 129 } 130 } 131 } 132 } else { 133 $("#dim").removeClass("type2"); 134 } 135 136 (function() { 137 /* 20220331 ì¹ì ê·¼ ìì : ìì */ 138 139 // var inFocusEl = $layerId.find('a, button, input'); 140 // var getFocusEl = $layerId.find('a, button, input, iframe, .layer_tit, .tit, .descriptions'); 141 // var getFirstFocusEl = inFocusEl.first() || $layerId; 142 143 // íì ì§ì í¬ì»¤ì¤ ì¤ì 144 // function setFocusElement() { 145 // if (getFocusEl.length) { 146 // getFocusEl.each(function() { 147 // var thisEl = $(this); 148 149 // if (thisEl.is(':visible')) { 150 // if (thisEl.is('iframe')) { 151 // getFirstFocusEl = $layerId; 152 // return false;
153 // } else if (thisEl.is('.descriptions')) { 154 // getFirstFocusEl = thisEl.children().first(); 155 // return false; 156 // } else { 157 // getFirstFocusEl = thisEl; 158 // return false; 159 // } 160 // } 161 // }); 162 // } 163 // } 164 165 /* //20220331 ì¹ì ê·¼ ìì : ìì */ 166 167 // íì ì§ì í¬ì»¤ì¤ ììë¡ ì´ì ì´ë 168 function setFocus() { 169 170 /* 20220331 ì¹ì ê·¼ ìì : ìì */ 171 //$layerId.attr("tabindex", 0).focus(); //20220331 ì¹ì ê·¼ ìì : ìì 172 $layerId.focus(); //20220331 ì¹ì ê·¼ ìì : ìì 173 // getFocusEl.attr('tabindex', '0'); //20220331 ì¹ì ê·¼ ìì : ìì 174 175 176 /* ------------------------------------------------------------------------------------------------------------------------------------- */ 177 var thisPop = SDS_COMMON.layerPopup; 178 var popContents = $layerId.find(".layer_inner"); 179 var popCloseBtn = popContents.find(".layer-pop__close"); 180 var popTabFocus = popContents.find("button, input:not([type='hidden']), select, iframe, textarea, [href], [tabindex]:not([tabindex='-1'])"); 181 var popTabFirst = popTabFocus && popTabFocus.first(); 182 var popTabLast = popTabFocus && popTabFocus.last(); 183 var tabDisable; 184 185 function popClosefocus() { 186 $layerId.hide(); 187 if (tabDisable === true) lpObj.attr("tabindex", "-1"); 188 thisPop.focus(); 189 $(".pop_close, .cookiePopup_close, .close, .cancel").off('click', onClose); 190 } 191 192 popTabFocus.length ? popTabFirst.focus().on("keydown", function(event) { 193 // ë ì´ì´ ì´ë¦¬ìë§ì ì´ì ë°ì ì ìë 첫ë²ì§¸ ììë¡ ì´ì ì´ë 194 if (event.shiftKey && (event.keyCode || event.which) === 9) { 195 // Shift + Tabí¤ : ì´ì ë°ì ì ìë 첫ë²ì§¸ ìììì ë§ì§ë§ ììë¡ ì´ì ì´ë 196 event.preventDefault(); 197 popTabLast.focus(); 198 } 199 }) : lpObj.attr("tabindex", "0").focus().on("keydown", function(event) { 200 tabDisable = true; 201 if ((event.keyCode || event.which) === 9) event.preventDefault(); 202 // Tabí¤ / Shift + Tabí¤ : ì´ì ë°ì ì ìë ììê° ìì ê²½ì° ë ì´ì´ ë°ì¼ë¡ ì´ì ì´ë ìëê² 203 }); 204 205 popTabLast.on("keydown", function(event) { 206 if (!event.shiftKey && (event.keyCode || event.which) === 9) { 207 // Tabí¤ : ì´ì ë°ì ì ìë ë§ì§ë§ ìììì 첫ë²ì§¸ ììì¼ë¡ ì´ì ì´ë 208 event.preventDefault(); 209 popTabFirst.focus(); 210 } 211 }); 212 213 popCloseBtn.on("click", popClosefocus); // ë«ê¸° ë²í¼ í´ë¦ ì ë ì´ì´ ë«ê¸° 214 /* ------------------------------------------------------------------------------------------------------------------------------------- */ 215 /* //20220331 ì¹ì ê·¼ ìì : ìì */ 216 217 } 218 219 $layerId.attr({ 'role': 'alertdialog' }).show().attr('tabindex', '0').focus(); 220 221 //setFocusElement(); //20220331 ì¹ì ê·¼ ìì : ìì 222 223 setTimeout(setFocus, 300); // 210527 | ì ê·¼ì± | IOS Focus Issue ìê° 100 -> 300 ë림 224 // $layerId.find('span.blind').length && $layerId.find('span.blind').attr({"tabindex": "-1"}).focus(); 225 // $layerId.find('.ytp-title-link').length && $layerId.find('.ytp-title-link').focus(); 226 $(".pop_cont > div").unbind('touchmove'); 227 228 /* 20220331 ì¹ì ê·¼ ìì : ìì */ 229 230 // íì í¬ì»¤ì¤ ìì ë§ê¸° 231 // $layerId.on("keydown", function(e) { 232 // e.stopPropagation(); 233 234 // if ($layerId.is($(e.target))) { 235 // if (e.keyCode == 9 && e.shiftKey) getFocusEl.first().focus(); 236 // } 237 238 // if (getFocusEl.first().is($(e.target))) { 239 // if (e.keyCode == 9 && e.shiftKey) getFocusEl.last().focus(); 240 // } 241 242 // if (getFocusEl.last().is($(e.target))) { 243 // if (e.keyCode == 9 && !e.shiftKey) getFocusEl.first().focus(); 244 // } 245 // /* 210511 | ì ê·¼ì± | íì ë°ì í ì¤í¸ ì´ì ìê°ê² */ 246 // //esc key close 247 // if (e.keyCode === 27) { 248 // closeDiv(); 249 // } 250 // /* //210511 | ì ê·¼ì± | íì ë°ì í ì¤í¸ ì´ì ìê°ê² */ 251 // }) 252 253 254 /* 210511 | ì ê·¼ì± | íì ë°ì í ì¤í¸ ì´ì ìê°ê² */ 255 // var ariahidden = $('#skip_navi, header, footer > div:not(.layer_wrap), #container'); 256 // ariahidden.attr({ 257 // "aria-hidden": true, 258 // tabindex: -1 259 // }); 260 /* //210511 | ì ê·¼ì± | íì ë°ì í ì¤í¸ ì´ì ìê°ê² */ 261 262 /* //20220331 ì¹ì ê·¼ ìì : ìì */ 263 264 })(); 265 266 function onClose() { 267 if ((this.innerHTML == 'ëì' || this.innerHTML == 'Agree' || this.innerHTML == 'CONFIRM') && this.parentElement.parentElement.parentElement.parentElement.id == "term_all") { 268 var elMandChecked = $(".term_box .mand"); 269 if (elMandChecked.length) { 270 var allChecked = true; 271 elMandChecked.each(function(index, item) { 272 if (!$(item).is(":checked")) { 273 allChecked = false;
274 return false; 275 } 276 }) 277 if (allChecked) { 278 closeDiv(); 279 } 280 } else { 281 if ($("#ck_all").is(":checked") || ($("#checkbox1_1").is(":checked") && $("#checkbox2_1").is(":checked") && $("#checkbox3_1").is(":checked") && $("#checkbox4_1").is(":checked"))) { 282 closeDiv(); 283 } 284 } 285 } else if (this.innerHTML == 'close' || this.innerHTML == 'CONFIRM') { 286 closeDiv(); 287 } else if ($("#term_all .error_msg").html()) { 288 $("#term_all .error_msg").show(); 289 closeDiv(); 290 } else { 291 closeDiv(); 292 } 293 } 294 295 function closeDiv() { 296 $layerId.hide(); 297 $("#dim").remove().off("touchmove"); 298 $("html,body").removeClass("oh"); 299 300 $("body").unbind('touchmove'); 301 closeLayerPop($layerId); 302 303 $(".pop_close, .cookiePopup_close, .close, .cancel").off('click', onClose); 304 } 305 $(".pop_close, .cookiePopup_close, .close, .cancel").on("click", onClose); 306 }, 307 close: function(layerId) { 308 var $layerId = $("#" + layerId); 309 $layerId.hide(); 310 $("#dim").remove(); 311 closeLayerPop($layerId); 312 // 20200317 ì ë³´í기 ì ì¶ ì±ê³µ íì ì¤ë¥ 313 // SDS_COMMON.layerPopup.attr('tabindex', '0').focus(); 314 315 } 316 }; 317 318 function closeLayerPop(layerId) { 319 /* 210511 | ì ê·¼ì± | íì ë°ì í ì¤í¸ ì´ì ìê°ê² */ 320 var ariahidden = $('#skip_navi, header, footer > div:not(.layer_wrap), #container'); 321 ariahidden.removeAttr("tabindex"); 322 ariahidden.removeAttr("aria-hidden"); 323 /* //210511 | ì ê·¼ì± | íì ë°ì í ì¤í¸ ì´ì ìê°ê² */ 324 if (layerId.find("video").length) { 325 var vid = layerId.find("video").get(0); 326 vid.currentTime = 0; 327 vid.pause(); 328 }; 329 // youtube stop 330 if (layerId.find(".youtube").length) { 331 layerId.find(".youtube")[0].contentWindow.postMessage('{"event":"command","func":"' + 'stopVideo' + '","args":""}', '*'); 332 } 333 if (SDS_COMMON.layerPopup != null) { 334 if (SDS_COMMON.layerPopup.hasClass('btn_owl')) { 335 var parentEl = SDS_COMMON.layerPopup.closest('.owl-item'); 336 var targetEl = parentEl.hasClass('center') ? 337 parentEl.find('.im > .btn_owl') : 338 parentEl.siblings('.center').find('.im > .btn_owl'); 339 targetEl.focus(); 340 } 341 if (SDS_COMMON.layerPopup.hasClass('ip_btn') && SDS_COMMON.layerPopup.children().length) { 342 343 // SDS_COMMON.layerPopup.children(':first').attr('tabindex', '0').focus(); //20220331 ì¹ì ê·¼ ìì : listì aë§í¬ì tabindexê° ë¶ì´ì ëë² íì´ ë¬ìë ì´ì ìì 344 SDS_COMMON.layerPopup.focus(); //20220331 ì¹ì ê·¼ ìì : ìì 345 346 } else { 347 /* 210527 | ì ê·¼ì± | IOS Focus Issue settimeoutì¶ê° */ 348 setTimeout(function() { 349 SDS_COMMON.layerPopup.attr('tabindex', '0').focus(); 350 }, 300); 351 /* //210527 | ì ê·¼ì± | IOS Focus Issue settimeoutì¶ê° */ 352 } 353 } 354 } 355})(jQuery);
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.