ARBITER.init('LOGIN', ['layerpopup.resp', 'ajax'], function(dom, arbi) { var publicObj, view; var mySwiper; var tabIndicator; /** * ¿ÜºÎ¿¡¼­ ÂüÁ¶ ÇØ¾ß ÇÒ ÇÔ¼ö°¡ ÀÖ´Â °æ¿ì À̰÷¿¡ Á¤ÀÇ ÇϽʽÿÀ. * ex) arbi.get('MEMBER_LISTS').test(); */ publicObj = { }; function initialize() { initView(); attachEventHandler(); } function initView() { // ÅÇ ÀεðÄÉÀÌÅÍ tabIndicator = $(".tab-indicator"); tabIndicator.css({ "width" : tabIndicator.siblings(".tab").find("li").width(), "left" : tabIndicator.siblings(".tab").find("li.act").position().left, }); // ¹è³Ê mySwiper = new Swiper('.banner', { loop: true, centeredSlides: true, autoplay: true, touchRatio: 0, pagination: { el: ".swiper-pagination", clickable: true, }, navigation: { nextEl: ".ph-arrow-circle-right", prevEl: ".ph-arrow-circle-left", }, autoplay: { delay: 5000, }, }); // ¿øÀå/°­»ç ·Î±×ÀÎ ½ÇÆÐ ¸ð´Þ var sType = $.trim($("#sType").val()); if (sType != "" && sType != null) { $("[data-role=oNullCheck]").removeClass('error'); $('[data-role=oTab]').closest('li').removeClass(); $('[data-role=oTab][data-value=2]').closest('li').addClass('act'); $('#oLoginTeacher').show(); $('#oLoginStudent').hide(); tabIndicator.css({ "width" : tabIndicator.siblings(".tab").find("li").width(), "left" : tabIndicator.siblings(".tab").find("li.act").position().left, }); arbi.layerpopup.resp({ opacity : 1, modalColor : 'rgba(44, 45, 68, 0.6)', closeClass : 'close', fadeSpeed : 0, closeBtn : false, popClass : 'error', loadUrl :'/Member/login/loginError?sType='+ sType, onClose : function() {} }); } } function attachEventHandler() { // ÅÇ º¯°æ $('[data-role=oTab]').on('click', function() { $("[data-role=oNullCheck]").removeClass('error'); $('[data-role=oTab]').each(function(index, item) { $(this).closest('li').removeClass(); }); $(this).closest('li').addClass('act'); if ($(this).attr('data-value') === "1") { $('#oLoginStudent').show(); $('#oLoginTeacher').hide(); } else { $('#oLoginTeacher').show(); $('#oLoginStudent').hide(); } tabIndicator.css({ "width" : tabIndicator.siblings(".tab").find("li").width(), "left" : tabIndicator.siblings(".tab").find("li.act").position().left, }); return false; }); // ¾ÆÀ̵ð/ºñ¹Ð¹øÈ£ ÀԷ½à null üũ $("[data-role=oInput]").on("input", function () { if ($.trim($(this).val()) != '') { $(this).closest("[data-role=oNullCheck]").removeClass('error'); } return false; }); //Çлý ·Î±×ÀÎ ¿£ÅÍŰ À̺¥Æ® $('input[name=sPass]').on('keypress', function(e) { if ($(".bModal").length > 0) { return false; } if(e.keyCode == '13'){ if ($(".bModal").length == 0) { sLoginAction(); } return false; } }); //Çлý ·Î±×ÀÎ $('#btnSLogin').on('click', function(e) { if ($(".bModal").length > 0) { return false; } sLoginAction(); return false; }); //¿øÀå´Ô / ¼±»ý´Ô ·Î±×ÀÎ ¿£ÅÍŰ À̺¥Æ® $('input[name=teacher_pw]').on('keypress', function(e) { if ($(".bModal").length > 0) { return false; } if(e.keyCode == '13'){ if ($(".bModal").length == 0) { tLoginAction(); } return false; } }); //¿øÀå´Ô / ¼±»ý´Ô ·Î±×ÀÎ $('#btnTLogin').on('click', function(e) { if ($(".bModal").length > 0) { return false; } tLoginAction(); return false; }); // ¿øÀå´Ô / ¼±»ý´Ô ¾ÆÀ̵ð/ºñ¹Ð¹øÈ£ ã±â $("#oBtnAccount").on("click", function() { window.location.href = '/Member/account'; return false; }); //Çпø ȸ¿ø °¡ÀÔ $('#btnLmsJoin').on('click', function(e) { // Çлý°áÁ¦·Î ȸ¿ø°¡ÀÔÇÒ¶§ ÆäÀ̹é Á¤º¸¶§¹®¿¡ ssl Ÿ¾ßÇÔ window.location.href = 'https://newlms.elsd.co.kr/Member/join'; return false; }); // ½½¶óÀÌµå ¹è³Ê °ü·Ã js $(".slide-count i").click(function () { $(".ph-play").addClass("act"); $(".ph-pause").removeClass("act"); }); // ½½¶óÀÌµå ¹è³Ê °ü·Ã js $(".play-state i").click(function () { $(this).removeClass("act"); $(this).siblings().addClass("act"); if ($(".ph-pause").hasClass("act")) { mySwiper.autoplay.start(); } else { mySwiper.autoplay.stop(); } }); } function sLoginAction(){ if ($.trim($('input[name=sId]').val()) == '' || $.trim($('input[name=sPass]').val()) == '') { if ($.trim($('input[name=sId]').val()) == '') { $("#sNullSId").closest('label').addClass('error'); } if ($.trim($('input[name=sPass]').val()) == '') { $("#sNullSPass").closest('label').addClass('error'); } return false; } var now = new Date(); var Year = now.getUTCFullYear(); var Month = now.getMonth() + 1; Month = ((Month < 10) ? "0" : "") + Month; var Day = now.getDate(); Day = ((Day < 10) ? "0" : "") + Day; var now_date = Year + "" + Month + "" + Day; $('#sDate').val(now_date); var oForm = $("#studentform"); var aParams = oForm.serializeArray(); arbi.ajax("/Member/login/loginActionElsd", aParams, function(ret) { var ret = $.parseJSON(ret); if (ret.sCode == '200') { window.location.href=ret.rtnurl; } else { arbi.layerpopup.resp({ opacity : 1, modalColor : 'rgba(44, 45, 68, 0.6)', closeClass : 'close', fadeSpeed : 0, closeBtn : false, popClass : 'error', loadUrl :'/Member/login/loginError?sType='+ ret.sCode, onClose : function() { if (ret.sCode == '001') { $("#sId, #sPass").val(""); $("#sId").focus(); } else if (ret.sCode == '002') { $("#sPass").val(""); $("#sPass").focus(); } } }); } }); return false; } function tLoginAction(){ if ($.trim($('input[name=teacher_id]').val()) == '' || $.trim($('input[name=teacher_pw]').val()) == '') { if ($.trim($('input[name=teacher_id]').val()) == '') { $("#sNullTId").closest('label').addClass('error'); } if ($.trim($('input[name=teacher_pw]').val()) == '') { $("#sNullTPass").closest('label').addClass('error'); } return false; } $("[data-role=oNullCheck]").removeClass('error'); var now = new Date(); var Year = now.getUTCFullYear(); var Month = now.getMonth() + 1; Month = ((Month < 10) ? "0" : "") + Month; var Day = now.getDate(); Day = ((Day < 10) ? "0" : "") + Day; var now_date = Year + "" + Month + "" + Day; $('#date').val(now_date); var oForm = $("#teacherform"); var aParams = oForm.serializeArray(); arbi.ajax("/Member/login/loginActionLms", aParams, function(ret) { var ret = $.parseJSON(ret); if (ret.sCode == '200') { $('#teacherform').submit(); } else { arbi.layerpopup.resp({ opacity : 1, modalColor : 'rgba(44, 45, 68, 0.6)', closeClass : 'close', fadeSpeed : 0, closeBtn : false, popClass : 'error', loadUrl :'/Member/login/loginError?sType='+ ret.sCode, onClose : function() { if (ret.sCode == '001') { $("#teacher_id, #teacher_pw").val(""); $("#teacher_id").focus(); } else if (ret.sCode == '002') { $("#teacher_pw").val(""); $("#teacher_pw").focus(); } } }); } }); return false; } // ÃʱâÈ­ ÇÔ¼ö ½ÇÇà initialize(); return publicObj; });