1// Site ì ë°ì ì¼ë¡ ì¬ì©ëë ì¤í¬ë¦½í¸ ì ëë¤. 2 3var Site = {}; 4 5// IE íì¸ 6Site.IsIE = function () { 7 if (navigator.userAgent.toLowerCase().indexOf("chrome") != -1) return false; 8 if (navigator.userAgent.toLowerCase().indexOf("msie") != -1) return true; 9 if (navigator.userAgent.toLowerCase().indexOf("windows nt") != -1) return true; 10 return false; 11} 12 13// IE Version ì²´í¬ 14Site.GetVersionOfIE = function () { 15 16 var word; 17 18 var agent = navigator.userAgent.toLowerCase(); 19 20 // IE old version ( IE 10 or Lower ) 21 if (navigator.appName == "Microsoft Internet Explorer") word = "msie "; 22 23 // IE 11 24 else if (agent.search("trident") > -1) word = "trident/.*rv:"; 25 26 // Microsoft Edge 27 else if (agent.search("edge/") > -1) word = "edge/"; 28 29 // ê·¸ì¸, IEê° ìëë¼ë©´ ( If it's not IE or Edge ) 30 else return -1; 31 32 var reg = new RegExp(word + "([0-9]{1,})(\\.{0,}[0-9]{0,1})"); 33 34 if (reg.exec(agent) != null) return parseFloat(RegExp.$1 + RegExp.$2); 35 36 return -1; 37} 38 39// íì¬ìì¹ íì´ë¼ì´í¸ 40Site.CheckCurrentLoactionAndHighlight = function () { 41 42 var pathname = document.location.pathname.toLowerCase(); 43 44 if (pathname.length > 2 && pathname.endsWith('/')) { 45 pathname = pathname.substring(0, pathname.length - 1); 46 } 47 48 var paths = pathname.split('/'); 49 var lastPath = paths[paths.length - 1]; 50 51 // ì¸ëë°ê° ììê²½ì° ì¸ëë° ì ì¸í ë´ì©ì íì¬ìì¹ ê²ìì´ë¡ ì²ë¦¬ 52 if (lastPath.indexOf('_') > -1) { 53 paths[paths.length - 1] = lastPath.split('_')[0]; 54 pathname = paths.join('/'); 55 } 56 57 // gnb 58 $('#gnbBox').find('a').each(function () { 59 var $this = $(this); 60 var href = $this.attr('data-link'); 61 if (href) { 62 href = href.toLowerCase(); 63 64 if (href.indexOf('/', 1) == -1) { 65 pathname = '/' + pathname.split('/')[1]; 66 } 67 68 if (pathname == href) { 69 $this.parent().addClass('active'); 70 } 71 } 72 }); 73 74 // gnbm 75 $('#rightNavi').find('a').each(function () { 76 var $this = $(this); 77 var href = $this.attr('data-link'); 78 if (href) { 79 href = href.toLowerCase(); 80 if (href.indexOf('/', 1) == -1) { 81 pathname = '/' + pathname.split('/')[1]; 82 } 83 if (pathname == href) { 84 $this.parent().addClass('active'); 85 } 86 } 87 }); 88} 89 90 91// íì´ì§ 92Site.GeneratePagenation = function (containerSelector, pageIndex, pageSize, totalItemCount, nop, hrefFormat) { 93 94 var $container = $(containerSelector); 95 96 if ($container.length == 0) 97 return; 98 99 var prevIndex = null; 100 var nextIndex = null; 101 var totalPages = Math.ceil(totalItemCount / pageSize); 102 if (pageIndex < totalPages) nextIndex = pageIndex + 1; 103 if (pageIndex > 1) prevIndex = pageIndex - 1; 104 105 var start = 1; 106 if (pageIndex > nop) { 107 firstPageIndex = Math.floor(); 108 start = Math.ceil(pageIndex / nop); 109 if (start != 1) start = (start - 1) * 10 + 1; 110 } 111 var $prev = $('<a class="pre">«</a>'); 112 if (prevIndex == null) $prev.attr('href', 'javascript:void(0)'); 113 else $prev.attr('href', 'javascript:setPage(' + prevIndex + ')'); 114 $container.append($prev); 115 116 var tp = start; 117 for (var i = 0; i < nop; i++) { 118 if (tp > totalPages) { 119 break; 120 } 121 var $p = $('<a></a>'); 122 $p.html(tp); 123 if (tp === pageIndex) { 124 $p.attr('href', 'javascript:void(0)'); 125 $p.addClass('on'); 126 } 127 else { 128 $p.attr('href', 'javascript:setPage(' + tp + ')'); 129 } 130 $container.append($p); 131 tp++; 132 } 133 var $next = $('<a class="nxt">»</a>'); 134 if (nextIndex == null) $next.attr('href', 'javascript:void(0)'); 135 else $next.attr('href', 'javascript:setPage(' + nextIndex + ')'); 136 $container.append($next); 137} 138 139// íì í´ë¦ ì´ê¸°í 140Site.PopWrapping = function (e) { 141 142 e.preventDefault(); 143 144 // ë ì´ì´ íì í html elememt 145 var target = $(this).attr('data-target'); 146 147 // ë ì´ì´ íì í url 148 var url = $(this).attr('data-url'); 149 console.log('PopWrapping'); 150 // ì°ì ìì 151 // target > url 152 153 // jquery.popupoverlay 154 if (target) { 155 156 $('#' + target).popup('show'); 157 158 var onloadFunc = $(this).attr('data-onload'); 159 if (onloadFunc) { 160 setTimeout(eval(onloadFunc), 0); 161 } 162 } 163 else if (url) {
164 // urlì ìì§ íìì¹ ììì 구ííì§ ìì 165 } 166} 167 168// í´ë¦½ë³´ë ë³µì¬ 169Site.ClipboardCopy = function (content) { 170 if (Site.IsIE() && Site.GetVersionOfIE() < 10) { 171 window.clipboardData.setData("Text", content); 172 } 173 else { 174 var $dummy = $('#hdnClipboardDummy'); 175 if ($dummy.length == 0) { 176 $dummy = $('<input id="hdnClipboardDummy" type="text" style="position:absolute;top:-100px; left:-100px;" />'); 177 $dummy.val(content); 178 $('body').append($dummy); 179 } 180 $dummy.select(); 181 document.execCommand("Copy"); 182 $dummy.remove(); 183 } 184 alert('í´ë¦½ë³´ëì ë³µì¬ íììµëë¤.'); 185} 186 187// javascript a click with target _blank 188Site.LnikClickNewWIndow = function (href) { 189 // anchor clickì jqueryë¡ ì ìì ìëì´ ìë¨ 190 // native javascriptë¡ êµ¬í 191 var anchor = document.createElement('a'); 192 anchor.href = href; 193 anchor.id = 'dummyLink'; 194 anchor.target = '_blank'; 195 document.body.appendChild(anchor); 196 anchor.click(); 197 $('#dummyLink').remove(); 198} 199 200// jwt token refresh 201Site.TokenRefresh = function () { 202 $.ajax({
203 type: "POST", 204 contentType: "application/json; charset=utf-8", 205 url: '/Authentication/TokenRefresh', 206 data: null, 207 dataType: 'json' 208 }) 209 .done(function (data) { 210 if (data.result != 'ok') { 211 if (console) { 212 console.log(data); 213 } 214 } 215 }) 216 .fail(function (xhr, status, error) { 217 if (console) { 218 console.log(error); 219 } 220 }) 221 .always(function (data) { 222 }); 223} 224 225// .insert íì ìë¦¬ë¨¼í¸ focus ì²ë¦¬ 226Site.InsertElementFocused = function () { 227 var $container = $(this).parent(); 228 if (!$container.hasClass('insert')) 229 return; 230 231 if (!$container.hasClass('open')) 232 $container.addClass('open'); 233 234 $container.children("label.move").animate({ "top": "15px", "font-size": "0.9em" }, { "duration": "fast" }); 235 $container.children("p.guide").hide(); 236} 237 238// .insert íì ìë¦¬ë¨¼í¸ blur ì²ë¦¬ 239Site.InsertElementBlured = function ($item) { 240 241 var $container = $(this).parent(); 242 243 if (!$container.hasClass('insert')) 244 return; 245 246 var val = $(this).val() != undefined ? $(this).val().trim() :""; 247 248 if (val.length == 0) { 249 $container.removeClass('open'); 250 $container.children("label.move").animate({ "top": "41px", "font-size": "1.2em" }, { "duration": "fast" }); 251 if (!$container.hasClass('error')) 252 $container.children("p.guide").show(); 253 } 254 else { 255 if (!$container.hasClass('open')) 256 $container.addClass('open'); 257 $container.children("label.move").animate({ "top": "15px", "font-size": "0.9em" }, { "duration": "fast" }); 258 $container.children("p.guide").hide(); 259 } 260} 261 262// ì´ëì²ë¦¬ 263// action : ì´ëíê³ ì íë url íì 264Site.Go = function (action, method) { 265 if (!action) 266 return; 267 var $f = $('#frmGo'); 268 269 if (method) 270 $f.attr('method', method); 271 272 var method = $f.attr('method'); 273 274 //if (console) console.log("Site.Go : "); 275 276 // Allim4.0 ë©ë´ ì²ë¦¬ ì¶ê° ---------------------------- 277 var agent = navigator.userAgent.toLowerCase(); 278 var actionLow = action.toLowerCase(); 279 if (agent.indexOf("inappbrowser") > -1) { 280 if (agent.indexOf("com.chungdahm.allim") > -1) { 281 try { 282 283 // íµí©íì sub path ë¶í° ììíë ê²½ì° íì´ì§ ì´ë 284 if (actionLow.indexOf("/") == 0) { 285 ; 286 // account ë¡ ììíë ëë©ì¸ì íë¨ action ì²ë¦¬ ëëë¡ í¨ 287 } 288 else { 289 290 291 // íµí©íìì¸ ê²½ì° page ì´ëëëë¡ í¨ (ì¬ë¦¼ íµí© ë¡ê·¸ì¸ ì¬ì©) 292 if (actionLow.indexOf("/account.") == -1 && actionLow.indexOf("/account-vlc.") == -1) { 293 294 295 // ëë©ì¸ ë¶ì´ì ì¤ë ê²½ì° ì¬ë¦¼ìì ì¤ë¥ ë°ìíë¯ë¡ window.openì¼ë¡ ë³ê²½ 296 if (actionLow.indexOf("http://") == 0 || actionLow.indexOf("https://") == 0) { 297 298 try { 299 window.parent.postMessage('open:' + encodeURIComponent(JSON.stringify({ url: action })), '*'); 300 } catch (e) { 301 window.open(action); // ì¬ë¦¼ ì¸í°íì´ì¤ë¡ ìì ìì > ios ìì ëì ìí¨ 302 } 303 return; // ë¤ì ì²ë¦¬ ìëëë¡ 304 } 305 return;// ì¢ ë£ 306 } 307 308 // account ë¡ ììíë ëë©ì¸ì íë¨ action ì²ë¦¬ ëëë¡ í¨ 309 } 310 311 ////if (console) console.log("Site.Go : " + actionLow + "-------------------"); 312 //// iframe ì¸ì§ inappbrowser ì¸ì§ íì´í ìë ì°½ììë ì¤íëëë¡ ë 313 //switch (actionLow) { 314 // case "/login": 315 // window.parent.postMessage('move:Login', '*'); 316 // break; 317 // case "/join": 318 // case "/join/index": 319 // window.parent.postMessage('move:Join', '*'); 320 // break; 321 // case "/find": 322 // case "/find/id": 323 // window.parent.postMessage('move:FindId', '*'); 324 // break; 325 // case "/find/password": 326 // window.parent.postMessage('move:FindPassword', '*'); 327 // break; 328 // case "/my/relation_list": 329 // window.parent.postMessage('move:RelationList', '*'); 330 // break; 331 // case "/my/relation_add": 332 // case "/my/relation_link": 333 // window.parent.postMessage('move:RelationAdd', '*'); 334 // break; 335 // default: 336 // // íµí©íìì¸ ê²½ì° page ì´ëëëë¡ í¨ (ì¬ë¦¼ íµí© ë¡ê·¸ì¸ ì¬ì©) 337 // if (actionLow.indexOf("/account.") == -1 && actionLow.indexOf("/account-vlc.") == -1) { 338 339 340 // // ëë©ì¸ ë¶ì´ì ì¤ë ê²½ì° ì¬ë¦¼ìì ì¤ë¥ ë°ìíë¯ë¡ window.openì¼ë¡ ë³ê²½ 341 // if (actionLow.indexOf("http://") == 0 || actionLow.indexOf("https://") == 0) { 342 343 // try { 344 // window.parent.postMessage('open:' + encodeURIComponent(JSON.stringify({ url: action })), '*'); 345 // } catch (e) { 346 // window.open(action); // ì¬ë¦¼ ì¸í°íì´ì¤ë¡ ìì ìì > ios ìì ëì ìí¨ 347 // } 348 // return; // ë¤ì ì²ë¦¬ ìëëë¡ 349 // } 350 // } 351 352 // break; 353 //} 354 } catch (e) { 355 if (console) 356 console.log(e.message); 357 } 358 359 } 360 ////í¤ëë goHeaderCIClick ì¤ííëë¡ ìì í¨ 361 //else if ((agent.indexOf("com.chungdahm.nscreen") > -1 || agent.indexOf("com.chungdahm.april") > -1) && action == "https://www.chungdahm.com") { 362 // // ë·ì»´ ë¡ê³ ì´ëììë§ 363 // try { 364 // window.NI.util.openUrl( 365 // { url: action }, 366 // function () { 367 // console.log('success'); 368 // }, 369 // function () { 370 // console.log('failed'); 371 // } 372 // ); 373 // } catch (e) { 374 // if (console) 375 // console.log(e.message); 376 // } 377 // return;// ë¤ì ì¤í ë¶ê°ì²ë¦¬ 378 //} 379 } 380 // Allim4.0 ë©ë´ ì²ë¦¬ ë ------------------------------ 381 382 // getì¼ ê²½ì° íì íëë§ ì ì¡ 383 if (method == 'get') { 384 385 var form = document.createElement("form"); 386 form.setAttribute("method", method); 387 form.setAttribute("action", action); 388 389 $('input[data-is-common="1"]').each(function () { 390 var hiddenField = document.createElement("input"); 391 hiddenField.setAttribute("type", "hidden"); 392 hiddenField.setAttribute("name", $(this).attr('name')); 393 hiddenField.setAttribute("value", $(this).val()); 394 form.appendChild(hiddenField); 395 }); 396 397 document.body.appendChild(form); 398 form.submit(); 399 } 400 else { 401 $f.attr('action', action); 402 $f.submit(); 403 } 404} 405 406// ì¶ í commonì ë³í© 407function isValidMobile(mobile) { 408 mobile = mobile.autoHypenPhone();
409 // ìëë ì¼ë°ì íë²í¸ë ok 410 //var pattern = /^(01[016789]{1}|02|0[3-9]{1}[0-9]{1})-?[0-9]{3,4}-?[0-9]{4}$/; 411 // í´ëí°ë§ ok 412 var pattern = /^(01[016789]{1})-?[0-9]{3,4}-?[0-9]{4}$/; 413 return pattern.test(mobile); 414} 415// ì¼ë° ì íë ok(ë°°ì¡ì§ ìì ì¬ì©) 416function isValidMobileAndTel(mobile) { 417 mobile = mobile.autoHypenPhone(); 418 // ìëë ì¼ë°ì íë²í¸ë ok 419 var pattern = /^(01[016789]{1}|02|0[3-9]{1}[0-9]{1})-?[0-9]{3,4}-?[0-9]{4}$/; 420 return pattern.test(mobile); 421} 422 423function isValidBirthdate(birthdate) { 424 birthdate = birthdate.autoHypenBirthdate(); 425 ///[0-9]{4}-[0-9]{2}-[0-9]{2})/ 426 var pattern = /(1[0-9]{3}|2[0-9]{3})-(0[0-9]{1}|1[0-9]{1})-(0[0-9]{1}|1[0-9]{1}|2[0-9]{1}|3[0-9]{1})/; 427 return pattern.test(birthdate); 428} 429 430function autoHypenPhone(str) { 431 str = str.replace(/[^0-9]/g, ''); 432 return str.replace(/(^02.{0}|^01.{1}|[0-9]{3})([0-9]+)([0-9]{4})/, "$1-$2-$3"); 433} 434 435String.prototype.autoHypenPhone = function () { 436 var str = this.replace(/[^0-9]/g, ''); 437 return str.replace(/(^02.{0}|^01.{1}|[0-9]{3})([0-9]+)([0-9]{4})/, "$1-$2-$3"); 438} 439String.prototype.autoHypenBirthdate = function () { 440 var str = this.replace(/[^0-9]/g, ''); 441 return str.replace(/(^1.{3}|^2.{3}|[0-9]{4})([0-9]{2})([0-9]{2})/, "$1-$2-$3"); 442} 443 444function getVonMarketingToken(child_std_id) { 445 var vonToken = ""; 446 $.ajax({
447 type: "POST", 448 contentType: "application/json; charset=utf-8", 449 url: '/Login/getVonMarketingToken', 450 data: JSON.stringify({ child_std_id: child_std_id }), 451 async: false, 452 dataType: 'json' 453 }).done(function (data) { 454 if (data.result == 'ok') { 455 vonToken = data.data; 456 } 457 458 }).fail(function (xhr, status, error) { 459 460 if (console) 461 console.log(error); 462 463 }); 464 return vonToken; 465 466} 467function goVonPortalLogin(child_std_id, url, rdr, isNewWindow) { 468 var vonToken = getVonMarketingToken(child_std_id); 469 if (vonToken != "") { 470 471 var form = document.createElement("form"); 472 form.setAttribute("method", "post"); 473 form.setAttribute("action", url); 474 475 var hiddenField1 = document.createElement("input"); 476 hiddenField1.setAttribute("type", "hidden"); 477 hiddenField1.setAttribute("name", "redirect"); 478 hiddenField1.setAttribute("value", rdr); 479 form.appendChild(hiddenField1); 480 481 var hiddenField2 = document.createElement("input"); 482 hiddenField2.setAttribute("type", "hidden"); 483 hiddenField2.setAttribute("name", "auth"); 484 hiddenField2.setAttribute("value", vonToken); 485 form.appendChild(hiddenField2); 486 487 document.body.appendChild(form); 488 489 if (isNewWindow) { 490 form.setAttribute("target", "_blank"); 491 } 492 493 //window.open('', 'vonPortal'); 494 495 form.submit(); 496 497 498 } else { 499 if (console) 500 console.log("vonToken is null"); 501 } 502 503} 504 505 506 507 508 509function goPortalLoginCheck(audience, sso_url, rdr, isNewWindow, target) { 510 //audience =von_marketing 511 //PortalLoginCheck(string audience, string sso_url, string redirect = "", 512 513 var form = document.createElement("form"); 514 form.setAttribute("method", "post"); 515 form.setAttribute("action", "/Login/PortalLoginCheck"); 516 517 var hiddenField1 = document.createElement("input"); 518 hiddenField1.setAttribute("type", "hidden"); 519 hiddenField1.setAttribute("name", "redirect"); 520 hiddenField1.setAttribute("value", rdr); 521 form.appendChild(hiddenField1); 522 523 var hiddenField2 = document.createElement("input"); 524 hiddenField2.setAttribute("type", "hidden"); 525 hiddenField2.setAttribute("name", "audience"); 526 hiddenField2.setAttribute("value", audience); 527 form.appendChild(hiddenField2); 528 529 var hiddenField3 = document.createElement("input"); 530 hiddenField3.setAttribute("type", "hidden"); 531 hiddenField3.setAttribute("name", "sso_url"); 532 hiddenField3.setAttribute("value", sso_url); 533 form.appendChild(hiddenField3); 534 535 536 document.body.appendChild(form); 537 538 if (isNewWindow) { 539 if (target) 540 form.setAttribute("target", target); 541 else 542 form.setAttribute("target", "_blank"); 543 } 544 545 546 form.submit(); 547} 548 549function setConsoleErrorLog(msg) { 550 if (console) 551 console.log(msg); 552 553} 554 555function setConsolelog(txt) { 556 // ê°ë°ì¼ëë§ ë ¸ì¶ í¨ 557 //if ($('#spAppConsole') != undefined) { 558 // $('#spAppConsole').html($('#spAppConsole').html() + "<br/>" + txt); 559 //} 560} 561 562// header ì²ë´ CI í´ë¦ ì https://www.chungdahm.com ì´ë ë§í¬ ìì 563function goHeaderCIClick(action) { 564 565 if (!action) 566 return; 567 568 // Allim4.0 ë©ë´ ì²ë¦¬ ì¶ê° ---------------------------- 569 var agent = navigator.userAgent.toLowerCase(); 570 var actionLow = action.toLowerCase(); 571 if (agent.indexOf("inappbrowser") > -1) { 572 if (agent.indexOf("com.chungdahm.allim") > -1) { 573 try { 574 575 // ëë©ì¸ ë¶ì´ì ì¤ë ê²½ì° ì¬ë¦¼ìì ì¤ë¥ ë°ìíë¯ë¡ window.openì¼ë¡ ë³ê²½ 576 if (actionLow.indexOf("http://") == 0 || actionLow.indexOf("https://") == 0) { 577 578 try { 579 window.parent.postMessage('open:' + encodeURIComponent(JSON.stringify({ url: action })), '*'); 580 } catch (e) { 581 window.open(action); // ì¬ë¦¼ ì¸í°íì´ì¤ë¡ ìì ìì > ios ìì ëì ìí¨ 582 } 583 return; // ë¤ì ì²ë¦¬ ìëëë¡ 584 } 585 586 587 } catch (e) { 588 if (console) 589 console.log(e.message); 590 } 591 592 } else if (agent.indexOf("com.chungdahm.nscreen") > -1 || agent.indexOf("com.chungdahm.april") > -1 ) { 593 // ë·ì»´ ë¡ê³ ì´ëììë§ 594 window.NI.util.openUrl( 595 { url: action }, 596 function () { 597 //console.log('success'); 598 }, 599 function () { 600 console.log('failed'); 601 } 602 ); 603 return;// ë¤ì ì¤í ë¶ê°ì²ë¦¬ 604 } 605 } 606 // Allim4.0 ë©ë´ ì²ë¦¬ ë ------------------------------ 607 608 609 //ê·¸ ì¸ì ê²½ì° ê·¸ë¥ ì´ë 610 document.location.href = action; 611 612} 613 614// í¤ë ëìê°ê¸°(ì´ì ) ë²í¼ í´ë¦ ì´ë²¤í¸ 615function goBackpageClick(portalUrl, redirectUrl, isAllimJoin, isFrame) { 616 //setConsolelog("goBackpageClick start"); 617 // Allim4.0 ë©ë´ ì²ë¦¬ ì¶ê° ---------------------------- 618 var agent = navigator.userAgent.toLowerCase(); 619 var current_path = window.location.pathname.toLowerCase(); 620 var redirectUrl_low = redirectUrl.toLowerCase(); 621 //setConsolelog("goBackpageClick current_path=" + current_path ); 622 var is_go_home = false; 623 var is_go_login = false; 624 var is_go_join = false; 625 var is_go_redirect = false; 626 var home_url = "/my";//"/my/info"; 627 var join_url = "/join"; 628 var login_url = "/login"; 629 630 var mglogin_url = "/mglogin"; 631 var method = getCookieParam("authcommon", "method"); 632 //console.log("method=" + method); 633 634 //setConsolelog("learningportal app goBackpageClick test 1" ); 635 if (current_path.indexOf(home_url) > -1 && current_path != home_url) { 636 // /my íì íì´ì§ : ë´ì ë³´ë¡ ì´ë 637 is_go_home = true; 638 if (isAllimJoin != '') { 639 is_go_login = true; 640 } 641 } else if (current_path == '/login' || current_path == '/staff/login' || current_path == home_url) { 642 // redirect ë¡ ì´ë ëë ë«ê¸° : ë¡ê·¸ì¸, ì§ìë¡ê·¸ì¸ , ê°ì 첫íë©´, id/pw찾기 643 is_go_redirect = true; 644 645 if (current_path.indexOf('/login') > -1 && redirectUrl_low.indexOf(portalUrl.toLowerCase()) > -1 && redirectUrl_low.indexOf("/enter") > -1) { 646 // ë¡ê·¸ì¸ì´ íìí íì´ì§ë¡ë¶í° ì§ì í ê²½ì° ìë¸ íì´ì§ ì ì¸ë í¬í¸ë¡ ì´ë 647 redirectUrl = portalUrl; 648 } 649 650 } else if (current_path.indexOf('/find/') > -1 || current_path == "/join" || current_path == "/join/index") { 651 // ë¡ê·¸ì¸ì¼ë¡ ì´ë : ê³ì 찾기, íìê°ì 첫íë©´ 652 is_go_login = true; 653 } else if (current_path.indexOf("/join/") > -1) { 654 is_go_join = true; //íìê°ì 첫íì´ì§ë¡ ì´ë 655 if (isAllimJoin != '') { 656 is_go_login = true; 657 } 658 } 659 660 661 //setConsolelog("learningportal app goBackpageClick test 2"); 662 //setConsolelog("learningportal app goBackpageClick test is_go_home=" + is_go_home + " is_go_join="
662+ is_go_join); 663 664 if (agent.indexOf("inappbrowser") > -1) { 665 if (agent.indexOf("com.chungdahm.allim") > -1) { 666 try { 667 if (is_go_redirect) { 668 goHomeClick(portalUrl, redirectUrl); 669 } else if (is_go_login) { 670 document.location.href = login_url; 671 } else if (is_go_join) { 672 document.location.href = join_url; 673 } else { 674 document.location.href = home_url; 675 } 676 //if (isAllimJoin == "NY" || isAllimJoin == "Y") { 677 // // ë°ë¡ ë«ê¸° ì²ë¦¬ 678 // goHomeClick(portalUrl, redirectUrl); 679 //} if (isFrame == "Y") { 680 // // íë ì íë©´ ë´ìì ì´ë (í¤ë ìì) 681 // history.back(-1); 682 //} else { 683 // history.back(-1); 684 //} 685 686 687 } catch (e) { 688 setConsolelog(e.message); 689 if (console) 690 console.log(e.message); 691 } 692 return;// ë¤ì ì¤í ë¶ê° 693 694 } else if (agent.indexOf("com.chungdahm.nscreen") > -1 || agent.indexOf("com.chungdahm.april") > -1) { 695 696 setConsolelog("learningportal app goBackpageClick is_go_home=" + is_go_home + " is_go_join=" + is_go_join); 697 698 if (is_go_redirect) { 699 goHomeClick(portalUrl, redirectUrl); 700 } else if (is_go_login) { 701 document.location.href = login_url; 702 } else if (is_go_join) { 703 document.location.href = join_url; 704 } else { 705 document.location.href = home_url; 706 } 707 708 return;// ë¤ì ì¤í ë¶ 709 } 710 } 711 // Allim4.0 ë©ë´ ì²ë¦¬ ë ------------------------------ 712 713 ////// web ê° ë©ë´ ë³ë¡ ë³ë ë§í¬ ì´ëì¼ë¡ ì²ë¦¬í ê²½ì° ì¬ê¸°ì ë´ì© ì¶ê° 714 //////history.back(-1); 715 //console.log("is_go_redirect=" + is_go_redirect); 716 //console.log("is_go_join=" + is_go_join); 717 //console.log("is_go_login=" + is_go_login); 718 //console.log("home_url=" + home_url); 719 //return; 720 721 722 if (is_go_redirect) { 723 goHomeClick(portalUrl, redirectUrl); 724 } else if (is_go_join) { 725 document.location.href = join_url; 726 } else if (is_go_login && method=='WEBMG') { 727 document.location.href = mglogin_url; 728 } else if (is_go_login ) { 729 document.location.href = login_url; 730 } else { 731 document.location.href = home_url; 732 } 733 734} 735 736// í¤ë í ì´ë ë²í¼ í´ë¦ ì´ë²¤í¸ 737function goHomeClick(portalUrl, redirectUrl) { 738 739 setConsolelog("goHomeClick start"); 740 if (!redirectUrl || redirectUrl == "") { 741 redirectUrl = portalUrl; 742 } 743 744 var current_path = window.location.pathname.toLowerCase(); 745 setConsolelog("goBackpageClick current_path=" + current_path); 746 // Allim4.0 ë©ë´ ì²ë¦¬ ì¶ê° ---------------------------- 747 var agent = navigator.userAgent.toLowerCase(); 748 var actionLow = redirectUrl.toLowerCase(); 749 var isNewAllim_2024 = false; 750 if (agent.indexOf("inappbrowser") > -1) { 751 if (agent.indexOf("com.chungdahm.allim") > -1) { 752 try { 753 var allimAppInfo = agent.substring(agent.indexOf("inappbrowser"), agent.length); 754 allimAppInfo = allimAppInfo.trim(); 755 756 if (allimAppInfo.indexOf("][") > -1) { 757 var allimarr = allimAppInfo.split("]["); 758 if (allimarr.length > 1) { 759 if (allimarr[1].localeCompare("5.2.0", undefined, { numeric: true, sensitivity: 'base' }) > -1) { 760 // ê°ê±°ë í° ê²½ì° 761 isNewAllim_2024 = true; 762 } 763 } 764 } 765 766 //console.log('site > goHomeClick > ì¬ë¦¼ ì¸í°íì´ì¤ close ì¤í'); 767 const message = { 768 action: 'close' 769 } 770 var target = ''; 771 if (isNewAllim_2024) { 772 773 // ì ê· ì¹ì± ë²ì 774 target = undefined; 775 if (typeof webkit === 'undefined') { 776 target = typeof allim_iab !== 'undefined' ? allim_iab : ''; 777 } else if (typeof webkit.messageHandlers !== 'undefined' && typeof webkit.messageHandlers.allim_iab !== 'undefined') { 778 target = webkit.messageHandlers.allim_iab; 779 } 780 781 if (target != undefined && target != null && target != '') { 782 target.postMessage(JSON.stringify(message)); 783 } 784 785 } else { 786 787 // 기존 ë²ì 788 if (navigator.userAgent.toLocaleLowerCase().includes('android')) { 789 target = (cordova_iab != null && cordova_iab != undefined) ? cordova_iab : webkit.messageHandlers.cordova_iab; 790 } else { 791 target = webkit.messageHandlers.cordova_iab; 792 } 793 794 target.postMessage(JSON.stringify(message)); 795 } 796 797 798 } catch (e) { 799 800 // 기존 ë²ì 801 if (navigator.userAgent.toLocaleLowerCase().includes('android')) { 802 target = (cordova_iab != null && cordova_iab != undefined) ? cordova_iab : webkit.messageHandlers.cordova_iab; 803 } else { 804 target = webkit.messageHandlers.cordova_iab; 805 } 806 807 target.postMessage(JSON.stringify(message)); 808 809 setConsolelog(e.message); 810 if (console) 811 console.log(e.message); 812 } 813 return;// ë¤ì ì¤í ë¶ê° 814 815 } else if (agent.indexOf("com.chungdahm.nscreen") > -1 || agent.indexOf("com.chungdahm.april") > -1) { 816 817 // ì± ì¢ ë£ (os íì¼ë¡ ì´ë) 818 //if (current_path.indexOf(home_url) > -1 || current_path == "/join" || current_path == "/join/index" || current_path == '/login' || current_path.indexOf('/find/') > -1) { 819 if (current_path.indexOf('/join') > -1 || current_path.indexOf('/login') > -1 || current_path.indexOf('/find') > -1) { 820 821 setConsolelog("learningportal app > ë¡ê·¸ì¸/ê°ì /찾기 íì´ì§ìì redirectë¡ ì´ë"); 822 823 document.location.href = redirectUrl; 824 825 // ë¬ëí¬í¸ì ë¡ê·¸ì¸ íì´ì§ê° inpage ì´ë ì´ë¯ë¡ redirectë¡ ì´ë 826 ////ios ììë os íì¼ë¡ ì´ë ë¶ê° 827 //if (userAgent.indexOf("[ios]") == -1) { 828 // setConsolelog("learningportal aos app gotoHome start"); 829 // window.NI.callPluginExec("DevicePlugin" 830 // , "gotoHome" 831 // , {} 832 // , function (params) { console.log("success", params); } 833 // , function (e) { console.log("fail"); setConsolelog(e.message); } 834 // , function () { } 835 // ); 836 //} 837 } else { 838 setConsolelog("learningportal app > íì íì´ì§ìì closeThisWindow ì¤í"); 839 window.NI.callPluginExec("UtilPlugin" 840 , "closeThisWindow" 841 , { autoRefreshParentWindow: 'false' } //ë ìì ë¶ëª¨ë·°ë¥¼ ìë¡ê³ 침 ì¬ë¶ 842 , function (params) { setConsolelog("learningportal app closeThisWindow success"); } 843 , function (e) { setConsolelog(e.message); } 844 , function () { } 845 ); 846 } 847 return;// ë¤ì ì¤í ë¶ê° 848 } 849 } 850 // Allim4.0 ë©ë´ ì²ë¦¬ ë ------------------------------ 851 852 document.location.href = redirectUrl; 853 854} 855// ë¡ê·¸ì¸ ìë¨ ì ì¥(loginend.asp ëì´ê°ê¸° ì§ì ì ì ì¥, snsë¡ê·¸ì¸ ì½ë°± ëìì¨ í ì ì¥) 856function setLoginByMethod(type, isNewAllim_2024) { 857 if (isNewAllim_2024 == undefined || isNewAllim_2024 == null) { 858 isNewAllim_2024 = 'false'; 859 } 860 861 var agent = navigator.userAgent.toLowerCase(); 862 if (agent.indexOf("inappbrowser") > -1) { 863 try { 864 if (agent.indexOf("com.chungdahm.allim") > -1) { 865 866 //console.log('ì¬ë¦¼ì± ë¡ê·¸ì¸ ìë¨ ì ì¥'); 867 const message = { 868 action: 'setAppData', 869 param: { 870 dataName: 'loginmethod', 871 dataValue: type 872 } 873 }; 874 var target = ''; 875 876 try { 877 if (isNewAllim_2024.toLowerCase() == 'true') { 878 // ì ê· ì¹ì± ë²ì 879 target = undefined; 880 if (typeof webkit === 'undefined') { 881 target = typeof allim_iab !== 'undefined' ? allim_iab : ''; 882 } else if (typeof webkit.messageHandlers !== 'undefined' && typeof webkit.messageHandlers.allim_iab !== 'undefined') { 883 target = webkit.messageHandlers.allim_iab; 884 } 885 886 if (target != undefined && target != null && target != '') { 887 target.postMessage(JSON.stringify(message)); 888 } 889 890 } else { 891 //기존 ì± ë²ì ì¤í 892 if (navigator.userAgent.toLocaleLowerCase().includes('android')) { 893 target = (cordova_iab != null && cordova_iab != undefined) ? cordova_iab : webkit.messageHandlers.cordova_iab; 894 } else { 895 target = webkit.messageHandlers.cordova_iab; 896 } 897 898 target.postMessage(JSON.stringify(message)); 899 } 900 901 } catch (e1) { 902 903 //기존 ì± ë²ì ì¤í 904 if (navigator.userAgent.toLocaleLowerCase().includes('android')) { 905 target = (cordova_iab != null && cordova_iab != undefined) ? cordova_iab : webkit.messageHandlers.cordova_iab; 906 } else { 907 target = webkit.messageHandlers.cordova_iab; 908 } 909 910 target.postMessage(JSON.stringify(message)); 911 } 912 913 return; 914 915 } else if (agent.indexOf("com.chungdahm.nscreen") > -1 || agent.indexOf("com.chungdahm.april") > -1) { 916 917 918 window.NI.callPluginExec("DevicePlugin" 919 , "saveLoginType" 920 , { loginmethod: type } 921 , function (params) { 922 //console.log("success", params); 923 setConsolelog('saveLoginType success=' + JSON.stringify(params)); 924 } 925 , function (e) { setConsolelog(e.message); } 926 , function () { } 927 ); 928 929 930 //DevicePlugin.saveLoginType(params, onSuccess, onF
930ailed) 931 932 /* 933 window.NI.util.openUrl( 934 { url: action }, 935 function () { 936 //console.log('success'); 937 }, 938 function () { 939 console.log('failed'); 940 } 941 ); 942 */ 943 944 return; 945 } 946 947 } catch (e) { 948 if (console) 949 console.log(e.message); 950 951 setConsolelog('error=' + e.message); 952 } 953 } else { 954 //pc mobile web 955 localStorage.removeItem("loginmethod"); 956 localStorage.setItem("loginmethod", type); 957 958 } 959 960 961} 962// ë¡ê·¸ì¸ ìë¨ ê°ì ¸ì¤ê¸° 963function getLoginByMethod(isNewAllim_2024) { 964 if (isNewAllim_2024 == undefined || isNewAllim_2024 == null) { 965 isNewAllim_2024 = 'false'; 966 } 967 var method = ""; 968 var agent = navigator.userAgent.toLowerCase(); 969 if (agent.indexOf("inappbrowser") > -1) { 970 try { 971 if (agent.indexOf("com.chungdahm.allim") > -1) { 972 973 //console.log('ì¬ë¦¼ì± ë¡ê·¸ì¸ ìë¨ ê°ì ¸ì¤ê¸° > ì¤í í fromAllim ìì ë°ì'); 974 const message = { 975 action: 'getAppData', 976 param: { 977 dataName: 'loginmethod' 978 } 979 }; 980 var target = ''; 981 982 983 try { 984 if (isNewAllim_2024.toLowerCase() == 'true') { 985 // ì ê· ì¹ì± ë²ì 986 target = undefined; 987 if (typeof webkit === 'undefined') { 988 target = typeof allim_iab !== 'undefined' ? allim_iab : ''; 989 } else if (typeof webkit.messageHandlers !== 'undefined' && typeof webkit.messageHandlers.allim_iab !== 'undefined') { 990 target = webkit.messageHandlers.allim_iab; 991 } 992 993 if (target != undefined && target != null && target != '') { 994 target.postMessage(JSON.stringify(message)); 995 } 996 // ì¤ì ë°ì´í°ë fromAllim ìì ë°ì 997 method = ""; 998 999 } else { 1000 // 기존 ì± ë²ì 1001 if (navigator.userAgent.toLocaleLowerCase().includes('android')) { 1002 target = (cordova_iab != null && cordova_iab != undefined) ? cordova_iab : webkit.messageHandlers.cordova_iab; 1003 } else { 1004 target = webkit.messageHandlers.cordova_iab; 1005 } 1006 1007 target.postMessage(JSON.stringify(message)); 1008 // ì¤ì ë°ì´í°ë fromAllim ìì ë°ì 1009 method = ""; 1010 } 1011 } 1012 catch (e1) { 1013 // 기존 ì± ë²ì 1014 if (navigator.userAgent.toLocaleLowerCase().includes('android')) { 1015 target = (cordova_iab != null && cordova_iab != undefined) ? cordova_iab : webkit.messageHandlers.cordova_iab; 1016 } else { 1017 target = webkit.messageHandlers.cordova_iab; 1018 } 1019 1020 target.postMessage(JSON.stringify(message)); 1021 // ì¤ì ë°ì´í°ë fromAllim ìì ë°ì 1022 method = ""; 1023 1024 } 1025 1026 1027 return method; 1028 1029 } else if (agent.indexOf("com.chungdahm.nscreen") > -1 || agent.indexOf("com.chungdahm.april") > -1) { 1030 1031 1032 window.NI.callPluginExec("DevicePlugin" 1033 , "getLoginType" 1034 , {} 1035 , function (params) { 1036 //console.log("success", params); 1037 setConsolelog('getLoginType success=' + JSON.stringify(params)); 1038 setConsolelog('method=' + params.loginmethod); 1039 method = params.loginmethod; 1040 } 1041 , function (e) { setConsolelog(e.message); } 1042 , function () { } 1043 ); 1044 1045 return method; 1046 } 1047 1048 } catch (e) { 1049 setConsolelog('error=' + e.message); 1050 if (console) 1051 console.log(e.message); 1052 } 1053 } else { 1054 //pc mobile web 1055 if (localStorage.getItem("loginmethod") != undefined) 1056 method = localStorage.getItem("loginmethod"); 1057
1058 //console.log('web ë¡ê·¸ì¸ ìë¨ ê°ì ¸ì¤ê¸°'); 1059 1060 } 1061 return method; 1062} 1063 1064 1065 1066// ë¡ê·¸ì¸ ìë¨ë³ layer ë ¸ì¶/ë¹ë ¸ì¶ 1067function getLoginByMethodLayer(loginmethod) { 1068 1069 if ($('#spLastLoginKakao') == undefined || $('#spLastLoginApple') == undefined) 1070 return; 1071 1072 if (loginmethod == "kakao") { 1073 $('#spLastLoginKakao').show(); 1074 $('#spLastLoginApple').hide(); 1075 } else if (loginmethod == "apple") { 1076 $('#spLastLoginKakao').hide(); 1077 $('#spLastLoginApple').show(); 1078 } 1079 else { 1080 $('#spLastLoginKakao').hide(); 1081 $('#spLastLoginApple').hide(); 1082 } 1083} 1084 1085 1086// ë¡ê·¸ì¸ ë¸ëë ì ì¥(loginend.asp ëì´ê°ê¸° ì§ì ì ì ì¥) 1087function setLoginBrand(type) { 1088 1089 var agent = navigator.userAgent.toLowerCase(); 1090 if (agent.indexOf("inappbrowser") > -1) { 1091 try { 1092 1093 1094 if (agent.indexOf("com.chungdahm.allim") > -1) { 1095 1096 return; 1097 1098 } else if (agent.indexOf("com.chungdahm.nscreen") > -1 || agent.indexOf("com.chungdahm.april") > -1) { 1099 1100 //app ì¤í ì web ë¡ì»¬ ì¤í ë¦¬ì§ ì ì¥ 1101 localStorage.removeItem("loginbrand"); 1102 localStorage.setItem("loginbrand", type); 1103 1104 1105 /* 1106 window.NI.callPluginExec("DevicePlugin" 1107 , "saveLoginType" // ì¬ê¸° ìì íì 1108 , { loginmethod: type } // ì¬ê¸° ìì íì 1109 , function (params) { 1110 //console.log("success", params); 1111 setConsolelog('saveLoginType success=' + JSON.stringify(params)); 1112 } 1113 , function (e) { setConsolelog(e.message); } 1114 , function () { } 1115 ); 1116 */ 1117 1118 return; 1119 } 1120 1121 } catch (e) { 1122 if (console) 1123 console.log(e.message); 1124 1125 setConsolelog('error=' + e.message); 1126 } 1127 } else { 1128 //pc mobile web 1129 localStorage.removeItem("loginbrand"); 1130 localStorage.setItem("loginbrand", type); 1131 1132 } 1133 1134 1135} 1136// ë¡ê·¸ì¸ ë¸ëë ê°ì ¸ì¤ê¸° 1137function getLoginBrand() { 1138 var method = ""; 1139 var agent = navigator.userAgent.toLowerCase(); 1140 if (agent.indexOf("inappbrowser") > -1) { 1141 try { 1142 if (agent.indexOf("com.chungdahm.allim") > -1) { 1143 1144 return method; 1145 1146 } else if (agent.indexOf("com.chungdahm.nscreen") > -1 || agent.indexOf("com.chungdahm.april") > -1) { 1147 1148 //app ì¤í ì web ë¡ì»¬ ì¤í ë¦¬ì§ ì ì¥ 1149 if (localStorage.getItem("loginbrand") != undefined) 1150 method = localStorage.getItem("loginbrand"); 1151 1152 1153 /* 1154 window.NI.callPluginExec("DevicePlugin" 1155 , "getLoginType" // ì¬ê¸° ìì íì 1156 , {} // ì¬ê¸° ìì íì 1157 , function (params) { 1158 //console.log("success", params); 1159 setConsolelog('getLoginType success=' + JSON.stringify(params)); 1160 setConsolelog('method=' + params.loginmethod); 1161 method = params.loginmethod; 1162 } 1163 , function (e) { setConsolelog(e.message); } 1164 , function () { } 1165 ); 1166 */ 1167 return method; 1168 } 1169 1170 } catch (e) { 1171 setConsolelog('error=' + e.message); 1172 if (console) 1173 console.log(e.message); 1174 } 1175 } else { 1176 //pc mobile web 1177 if (localStorage.getItem("loginbrand") != undefined) 1178 method = localStorage.getItem("loginbrand"); 1179 1180 //console.log('web ë¡ê·¸ì¸ ë¸ëë ê°ì ¸ì¤ê¸°'); 1181 1182 } 1183 return method; 1184} 1185 1186 1187// ì ë ¥ì°½ì ìì ê¸°ë¥ 1188function setDeleteInputClick(obj) { 1189 try { 1190 var $btnDelete = $(obj); 1191 var $input = $('#' + $btnDelete.attr('id').replace('Delete', '')); 1192 1193 if (!$input ) { 1194 return; 1195 } 1196 //console.log($input.attr('id')); 1197 $input.val(''); 1198 //$input.trigger("change"); 1199 $btnDelete.hide(); 1200 $input.trigger("blur"); 1201 $input.focus(); 1202 } catch (e) { 1203 console.log('setDeleteInputClick:' +e.message); 1204 } 1205 1206} 1207 1208// loginidìì ì¬ì© 1209function maxLengthCheck(object) { 1210 1211 if (object.value.length > object.maxLength) { 1212 1213 object.value = object.value.slice(0, object.maxLength); 1214 1215 } 1216 1217} 1218 1219// ì¬ë¦¼ ì¸ë¶ os ë¸ë¼ì°ì ë¡ ë§í¬ ì¤í 1220function allimOpenBrowserLink(link, isNewAllim_2024) { 1221 try { 1222 if (isNewAllim_2024 == undefined || isNewAllim_2024 == null) { 1223 isNewAllim_2024 = 'false'; 1224 } 1225 1226 const message = { 1227 action: 'open:url', 1228 msg: { 1229 url: link, 1230 target: '_system' 1231 1232 } 1233 }; 1234 var target = ''; 1235 try { 1236 1237 if (isNewAllim_2024.toLowerCase() == 'true') { 1238 // ì ê· ì¹ì± ë²ì 1239 target = undefined; 1240 if (typeof webkit === 'undefined') { 1241 target = typeof allim_iab !== 'undefined' ? allim_iab : ''; 1242 } else if (typeof webkit.messageHandlers !== 'undefined' && typeof webkit.messageHandlers.allim_iab !== 'undefined') { 1243 target = webkit.messageHandlers.allim_iab; 1244 } 1245 1246 if (target != undefined && target != null && target != '') { 1247 target.postMessage(JSON.stringify(message)); 1248 } 1249 1250 } else { 1251 // 기존 ë²ì 1252 if (navigator.userAgent.toLocaleLowerCase().includes('android')) { 1253 target = (cordova_iab != null && cordova_iab != undefined) ? cordova_iab : webkit.messageHandlers.cordova_iab; 1254 } else { 1255 target = webkit.messageHandlers.cordova_iab; 1256 } 1257 1258 target.postMessage(JSON.stringify(message)); 1259 1260 } 1261 1262 } catch (e1) { 1263 // 기존 ë²ì 1264 if (navigator.userAgent.toLocaleLowerCase().includes('android')) { 1265 target = (cordova_iab != null && cordova_iab != undefined) ? cordova_iab : webkit.messageHandlers.cordova_iab; 1266 } else { 1267 target = webkit.messageHandlers.cordova_iab; 1268 } 1269 1270 target.postMessage(JSON.stringify(message)); 1271 1272 } 1273 1274 1275 1276 ////window.parent.postMessage('open:' + encodeURIComponent(JSON.stringify({ url: MPortalAdmission })), '*');//ëì ìí¨ 1277 } catch (e) { 1278 //window.open(link); // ì¬ë¦¼ ì¸í°íì´ì¤ë¡ ìì ìì > ios ìì ëì ìí¨ 1279 } 1280 1281} 1282 1283// ì¬ë¦¼ ì¸ë¶ os ë¸ë¼ì°ì ë¡ ë§í¬ ì¤í(í í° ë¡ê·¸ì¸ë ìíë¡ ì´ë) 1284function allimOpenAuthBrowserLink(link, loginType, isNewAllim_2024) { 1285 try { 1286 console.log('allimOpenAuthBrowserLink start isNewAllim_2024=' + isNewAllim_2024); 1287 if (isNewAllim_2024 == undefined || isNewAllim_2024 == null) { 1288 isNewAllim_2024 = 'false'; 1289 } 1290 1291 const message = { 1292 action: 'openUrlToken', 1293 msg: { 1294 url: link, 1295 tokenType: loginType, // S : Staff, P : Parent 1296 target: '_system' 1297 //,stdId: _ //ì¬ì©íì§ ìë ê²ì¼ë¡ ë³´ì 1298 } 1299 1300 }; 1301 var target = ''; 1302 try { 1303 1304 if (isNewAllim_2024.toLowerCase() == 'true') { 1305 // ì ê· ì¹ì± ë²ì 1306 target = undefined; 1307 if (typeof webkit === 'undefined') { 1308 target = typeof allim_iab !== 'undefined' ? allim_iab : ''; 1309 } else if (typeof webkit.messageHandlers !== 'undefined' && typeof webkit.messageHandlers.allim_iab !== 'undefined') { 1310 target = webkit.messageHandlers.allim_iab; 1311 } 1312 1313 if (target != undefined && target != null && target != '') { 1314 target.postMessage(JSON.stringify(message)); 1315 } 1316 1317 } else { 1318 // 기존 ë²ì 1319 if (navigator.userAgent.toLocaleLowerCase().includes('android')) { 1320 target = (cordova_iab != null && cordova_iab != undefined) ? cordova_iab : webkit.messageHandlers.cordova_iab; 1321 } else { 1322 target = webkit.messageHandlers.cordova_iab; 1323 } 1324 1325 target.postMessage(JSON.stringify(message)); 1326 1327 } 1328 1329 } catch (e1) { 1330 console.log(e1.message) 1331 1332 // 기존 ë²ì 1333 if (navigator.userAgent.toLocaleLowerCase().includes('android')) { 1334 target = (cordova_iab != null && cordova_iab != undefined) ? cordova_iab : webkit.messageHandlers.cordova_iab; 1335 } else { 1336 target = webkit.messageHandlers.cordova_iab; 1337 } 1338 1339 target.postMessage(JSON.stringify(message)); 1340 1341 } 1342 1343 1344 1345 1346 ////window.parent.postMessage('open:' + encodeURIComponent(JSON.stringify({ url: MPortalAdmission })), '*');//ëì ìí¨ 1347 } catch (e) { 1348 //window.open(link); // ì¬ë¦¼ ì¸í°íì´ì¤ë¡ ìì ìì > ios ìì ëì ìí¨ 1349 console.log(e.message); 1350 1351 } 1352 1353} 1354 1355function allimOpenAuthBrowserLinkWithStdId(link, loginType, isNewAllim_2024, std_id) { 1356 try { 1357 console.log('allimOpenAuthBrowserLinkWithStdId start isNewAllim_2024=' + isNewAllim_2024); 1358 if (isNewAllim_2024 == undefined || isNewAllim_2024 == null) { 1359 isNewAllim_2024 = 'false'; 1360 } 1361 1362 const message = { 1363 action: 'openUrlToken', 1364 msg: { 1365 url: link, 1366 tokenType: loginType, // S : Staff, P : Parent 1367 target: '_system' 1368 , stdId: std_id //íì íìê°ì í ì íìí ìì½ ìì°½ ë¨ê¸° ì ì¬ì© 1369 } 1370 1371 }; 1372 var target = ''; 1373 try { 1374 1375 if (isNewAllim_2024.toLowerCase() == 'true') { 1376 // ì ê· ì¹ì± ë²ì 1377 target = undefined; 1378 if (typeof webkit === 'undefined') { 1379 target = typeof allim_iab !== 'undefined' ? allim_iab : ''; 1380 } else if (typeof webkit.messageHandlers !== 'undefined' && typeof webkit.messageHandlers.allim_iab !== 'undefined') { 1381 target = webkit.messageHandlers.allim_iab; 1382 } 1383 1384 if (target != undefined && target != null && target != '') { 1385 target.postMessage(JSON.stringify(message)); 1386 } 1387 1388 } else { 1389 // 기존 ë²ì 1390 if (navigator.userAgent.toLocaleLowerCase().includes('android')) { 1391 target = (cordova_iab != null && cordova_iab != undefined) ? cordova_iab : webkit.messageHandlers.cordova_iab; 1392 } else { 1393 target = webkit.messageHandlers.cordova_iab; 1394 } 1395 1396 target.postMessage(JSON.stringify(message)); 1397 1398 } 1399 1400 } catch (e1) { 1401 console.log(e1.message) 1402 1403 // 기존 ë²ì 1404 if (navigator.userAgent.toLocaleLowerCase().includes('android')) { 1405 target = (cordova_iab != null && cordova_iab != undefined) ? cordova_iab : webkit.messageHandlers.cordova_iab; 1406 } else { 1407 target = webkit.messageHandlers.cordova_iab; 1408 } 1409 1410 target.postMessage(JSON.stringify(message)); 1411 1412 } 1413 1414 1415 1416 1417 ////window.parent.postMessage('open:' + encodeURIComponent(JSON.stringify({ url: MPortalAdmission })), '*');//ëì ìí¨ 1418 } catch (e) { 1419 //window.open(link); // ì¬ë¦¼ ì¸í°íì´ì¤ë¡ ìì ìì > ios ìì ëì ìí¨ 1420 console.log(e.message); 1421 1422 } 1423 1424} 1425 1426 1427$.fn.valid = function () { 1428 return this.each(function () { 1429 var $this = $(this); 1430 $this.find('input').removeClass('error'); 1431 $this.find('select').parent().removeClass('error'); // ë ì´ì´íì ì©select ë ìì div ì ë£ì´ì¤ 1432 $this.find('input,select').attr('data-valid', '1'); 1433 ////$this.find('input,select').each(function () { 1434 //// console.log($(this).attr('id') +' data-valid=1 completed'); 1435 ////}); 1436 $this.parent().find('div.error-message').text(''); 1437 });
1438} 1439 1440$.fn.invalid = function () { 1441 return this.each(function () { 1442 var $this = $(this); 1443 $this.find('input').addClass('error'); 1444 $this.find('select').parent().addClass('error'); // ë ì´ì´íì ì©select ë ìì div ì ë£ì´ì¤ 1445 $this.find('input,select').attr('data-valid', '0'); 1446 }); 1447} 1448 1449$.fn.invalidNoCss = function () { 1450 return this.each(function () { 1451 var $this = $(this); 1452 $this.find('input,select').attr('data-valid', '0'); 1453 //console.log('invalidNoCss ----' + $this.find('input').attr('name')); 1454 }); 1455} 1456 1457$.fn.getByte = function () { 1458 var codeByte = 0; 1459 var text = $(this).val(); 1460 for (var idx = 0; idx < text.length; idx++) { 1461 var oneChar = escape(text.charAt(idx)); 1462 if (oneChar.length == 1) { 1463 codeByte++; 1464 } else if (oneChar.indexOf("%u") != -1) { 1465 codeByte += 2; 1466 } else if (oneChar.indexOf("%") != -1) { 1467 codeByte++; 1468 } 1469 } 1470 return codeByte; 1471} 1472 1473//ë¸ëë ì í Select Box ì¤íì¼ 1474function formatState(state) { 1475 if (!state.id) { return state.text; } 1476 var baseUrl = "/assets/images/common/brand"; 1477 var $state = $( 1478 '<span><img src="' + baseUrl + '/' + state.element.value.toLowerCase() + '.svg" class="img-flag" /> ' + state.text + '</span>' 1479 ); 1480 return $state; 1481} 1482 1483function setCookie(cName, cValue, cDay, domain) { 1484 var expire = new Date(); 1485 expire.setDate(expire.getDate() + cDay); 1486 cookies = cName + '=' + escape(cValue) + '; path=/ '; 1487 if (typeof cDay != 'undefined') cookies += ';expires=' + expire.toGMTString() + ';'; 1488 if (typeof domain != 'undefined') cookies += 'domain=' + domain+ ';'; 1489 document.cookie = cookies; 1490} 1491 1492function setCookieAuthCommon(cName, cValue, cDay, domain) { 1493 var expire = new Date(); 1494 expire.setDate(expire.getDate() + cDay); 1495 //cookies = cName + '=' + escape(cValue) + '; path=/ '; 1496 cookies = cName + '=' + cValue + '; path=/ ';// 2depth ì´ë¯ë¡ ì¤ì value ì¸ì½ë© í´ì ëì´ì¤ë¯ë¡ ê·¸ëë¡ ì ì¥ 1497 if (typeof cDay != 'undefined') cookies += ';expires=' + expire.toGMTString() + ';'; 1498 if (typeof domain != 'undefined') cookies += 'domain=' + domain + ';'; 1499 document.cookie = cookies; 1500} 1501function getCookie(cName) { 1502 cName = cName + '='; 1503 var cookieData = document.cookie; 1504 var start = cookieData.indexOf(cName); 1505 var cValue = ''; 1506 if (start != -1) { 1507 start += cName.length; 1508 var end = cookieData.indexOf(';', start); 1509 if (end == -1) end = cookieData.length; 1510 cValue = cookieData.substring(start, end); 1511 } 1512 return unescape(cValue); 1513} 1514 1515function getCookieParam(cookieName, key) { 1516 var cookieValue = getCookie(cookieName); 1517 1518 if (!cookieValue) 1519 return ""; 1520 1521 var arr = cookieValue.split("&"); 1522 1523 for (var i = 0; i < arr.length; i++) { 1524 var item = arr[i].split("="); 1525 1526 if (item[0] === key) 1527 return decodeURIComponent(item[1] || ""); 1528 } 1529 1530 return ""; 1531}
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.