mayn.Portlet.login_style = mayn.Portlet.extend({ __version : "1.0.0.0", __id : "LoginStyle", doLoginMember : function(mid, mpw) { this._DoPost('doLoginMember', { 'mid' : mid, 'mpwd' : mpw }, this.tpl_compile_$doLoginMember); }, tpl_compile_$doLoginMember : function(a_data) { switch(a_data) { case 'STR_ERROR': showErrorStatus(a_data); break; case 'NONE_USER': showErrorStatus(a_data); break; case 'INVALID_USER': showErrorStatus(a_data); break; case 'NOT_ACTIVATE_USER': showErrorStatus(a_data); break; case 'BLOCK_USER': showErrorStatus(a_data); break; case 'NONICK': showErrorStatus(a_data); break; case 'BAN_USER': showErrorStatus(a_data); break; case 'BAN_IP': showErrorStatus(a_data); break; default: showErrorStatus(a_data); } }, doLogin : function(mid, mpw) { this._DoPost('doLogin', { 'mid' : mid, 'mpwd' : mpw }, this.tpl_compile_$doLogin); }, tpl_compile_$doLogin : function(a_data) { switch(a_data) { case 'STR_ERROR': showErrorStatus(a_data); break; case 'NONE_USER': showErrorStatus(a_data); break; case 'INVALID_USER': showErrorStatus(a_data); break; case 'BLOCK_USER': showErrorStatus(a_data); break; case 'BAN_USER': //document.location.href = "http://www.mayngames.com/ban/banuser"; showErrorStatus(a_data); break; case 'BAN_IP': //document.location.href = "http://www.mayngames.com/ban/banip"; showErrorStatus(a_data); break; case 'NONICK': //document.location.href = "http://account.mayngames.com/account/regist"; showErrorStatus(a_data); break; case 'AGREE': //document.location.href = "http://account.mayngames.com/account/agree"; showErrorStatus(a_data); break; default: $("#top_myblog1").show(); $("#top_myblog2").show(); if(typeof _afterlogin_func == "undefined") ;//alert('function load error : _afterlogin_func'); else _afterlogin_func(); $("#loginfo_container").html(a_data); showErrorStatus("success"); } }, doLogout : function() { this._DoGet('doLogout', '', this.tpl_compile_$doLogout); }, tpl_compile_$doLogout : function(a_data) { $("#top_myblog1").hide(); $("#top_myblog2").hide(); if(typeof _afterlogout_func == "undefined") ;//alert('function load error : _afterlogout_func'); else _afterlogout_func(); $("#loginfo_container").html(a_data); }, doLoginNoDesign : function(mid, mpw) { this._DoPost('doLoginNoDesign', { 'mid' : mid, 'mpwd' : mpw }, this.tpl_compile_$doLoginNoDesign); }, tpl_compile_$doLoginNoDesign : function(a_data) { if(a_data == 'SUCCESS') _successlogin_func(); else _faillogin_func(); }, doFacebookConnect : function(mid, mpw, uid) { this._DoPost('doFacebookConnect', {mid : mid, mpw : mpw, uid : uid}, this.tpl_compile_$doFacebookConnect); }, tpl_compile_$doFacebookConnect : function(a_data) { if(a_data == 'success'){ __message = "Your account has been linked to FaceBook."; setTimeout("CompleateLoading('"+__message+"');UrlMoveUse('/');", 500); }else if(a_data == 'already'){ __message = "Facebook ID already taken."; setTimeout("CompleateLoading('"+__message+"')", 500); }else{ __message = "Invalid information entered."; setTimeout("CompleateLoading('"+__message+"')", 500); } }, showloginBox : function() { this._DoGet('showloginBox', '', this.tpl_compile_$showloginBox) }, tpl_compile_$showloginBox : function(a_data){ $.nyroModalManual({ modal : true, content: a_data }); }, reCover : function() { this._DoGet('reCover', '', this.tpl_compile_$reCover) }, tpl_compile_$reCover : function(a_data){ $.nyroModalManual({ modal : true, content: a_data }); // ie bug... $("#id_recover_acc_submit").click(function(evt){ var a_email = $("#acc_txtEmail").val(); var a_month = $("#acc_ddlMonth").val(); var a_day = $("#acc_ddlDay").val(); var a_year = $("#acc_txtYear").val(); if($.trim(a_email) == ""){ $("#input_acc_email_ERR").show(); $("#input_acc_email_ERR [class='msg']").html("Please input another Email."); return; }else{$("#input_acc_email_ERR").hide();} if(a_month == ""){ $("#input_acc_bday_ERR").show(); $("#input_acc_bday_ERR [class='msg']").html("Please select month (DOB)."); return; }else{$("#input_acc_bday_ERR").hide();} if(a_day == ""){ $("#input_acc_bday_ERR").show(); $("#input_acc_bday_ERR [class='msg']").html("Please select day (DOB)."); return; }else{$("#input_acc_bday_ERR").hide();} if($.trim(a_year) == "" || $.trim(a_year).length != 4){ $("#input_acc_bday_ERR").show(); $("#input_acc_bday_ERR [class='msg']").html("Please input year (DOB)."); return; }else{$("#input_acc_bday_ERR").hide();} var a_bday = a_year + "-" + a_month + "-" + a_day; evt.preventDefault(); $.nyroModalManual({ type: 'iframe', url: '/main/processBar', endShowContent : function(elt, settings){ $("#loading_message").html("Saving..."); objAccount.findID(a_email, a_bday); } }); }); $("#id_recover_pwd_submit").click(function(evt){ var a_account = $("#pwd_txtAccount").val(); var a_month = $("#pwd_ddlMonth").val(); var a_day = $("#pwd_ddlDay").val(); var a_year = $("#pwd_txtYear").val(); if($.trim(a_account) == ""){ $("#input_pwd_account_ERR").show(); $("#input_pwd_account_ERR [class='msg']").html("Please input another Email."); return; }else{$("#input_pwd_account_ERR").hide();} if(a_month == ""){ $("#input_pwd_bday_ERR").show(); $("#input_pwd_bday_ERR [class='msg']").html("Please select month (DOB)."); return; }else{$("#input_pwd_bday_ERR").hide();} if(a_day == ""){ $("#input_pwd_bday_ERR").show(); $("#input_pwd_bday_ERR [class='msg']").html("Please select day (DOB)."); return; }else{$("#input_pwd_bday_ERR").hide();} if($.trim(a_year) == "" || $.trim(a_year).length != 4){ $("#input_pwd_bday_ERR").show(); $("#input_pwd_bday_ERR [class='msg']").html("Please input year (DOB)."); return; }else{$("#input_pwd_bday_ERR").hide();} var a_bday = a_year + "-" + a_month + "-" + a_day; evt.preventDefault(); $.nyroModalManual({ url: '/main/processBar', endShowContent : function(elt, settings){ $("#loading_message").html("Saving..."); objAccount.findPW(a_account, a_bday); } }); }); $("#id_recover_act_submit").click(function(evt){ var a_email = $("#act_txtEmail").val(); var a_account = $("#act_txtAccount").val(); var a_month = $("#act_ddlMonth").val(); var a_day = $("#act_ddlDay").val(); var a_year = $("#act_txtYear").val(); if($.trim(a_account) == ""){ $("#input_act_account_ERR").show(); $("#input_act_account_ERR [class='msg']").html("Please input another Account."); return; }else{$("#input_act_account_ERR").hide();} if($.trim(a_email) == ""){ $("#input_act_email_ERR").show(); $("#input_act_email_ERR [class='msg']").html("Please input another Email."); return; }else{$("#input_act_email_ERR").hide();} //evt.preventDefault(); $.nyroModalManual({ url: '/main/processBar', endShowContent : function(elt, settings){ $("#loading_message").html("Saving..."); objAccount.resendAct(a_account, a_email); } }); return false; }); $(".id_recover_acc, .id_recover_pwd, .id_recover_act").click(function(){ a_obj = $(this).attr("class"); $("#id_recover_acc, #id_recover_pwd, #id_recover_act").hide(); $("#" + a_obj).show(); }); } });