'; html += '
'; $("body").prepend(html); $("#uname").blur(function (e) { var params = new Object(); params.uname = $("#uname").val().trim(); $.getJSON(NCTInfo.ROOT_URL + "ajax/user-social", params, function (result) { if (typeof result.error_code != "undefined" && result.error_code == 0) { NCTOAuth.validateFieldRegister(false, "UName"); } else { var msg = ""; if (result.error_code == 1) { msg = "Tên đăng nhập tối thiểu phải 6 ký tự và tối đa 30 ký tự. Vui lòng nhập lại!"; } else if (result.error_code == 2) { msg = "Tên đăng nhập không hợp lệ. Vui lòng nhập lại!"; } else if (result.error_code == 3) { msg = "Tên đăng nhập đã tồn tại. Vui lòng nhập lại!"; } NCTOAuth.validateFieldRegister(true, "UName", msg); } }); }); $("#uname").focus(function () { $("#noteUserName").show(); }); $("#uname").blur(function () { $("#noteUserName").hide(); }); $("#email").focus(function () { $("#noteEmail").show(); }); $("#email").blur(function () { $("#noteEmail").hide(); }); } if (NCTOAuth.FACEBOOK == type) { title += " bằng tài khoản facebook"; } else if (NCTOAuth.GOOGLE == type) { title += " bằng tài khoản Google"; } $("#socialTitle").html(title); $("#uname").val(username); $("#fullName").val(fullName); $("#email").val(email); $("#htmlLoginSocial").show(); NCTOAuth.showAllSuccessFieldRegister(); }, closePopupRegister: function () { $("#htmlLoginSocial").hide(); }, validateFieldRegister: function (isError, regex, msg) { if (typeof isError == "undefined" || isError == null || typeof regex == "undefined" || regex == null || regex == "") { return; } if (isError) { $("#err_" + regex).html(msg); $("#err_" + regex).show(); $("#suc_" + regex).hide(); } else { $("#err_" + regex).hide(); $("#suc_" + regex).show(); } }, showErrorSocial: function (msg) { $("#errorSocial").show(); $("#errorSocial").html(msg); }, showAllSuccessFieldRegister: function () { $("span[id*='err_']").each(function (e) { $(this).hide(); }); $("div[id*='suc_']").each(function (e) { $(this).show(); }); $("#errorSocial").hide(); }, closePopupLogin: function () { if ($("#htmlLoginForm").is(":visible")) { $("#htmlLoginForm").addClass("hideShowCase"); } if ($("#htmlRegisterForm").is(":visible")) { $("#htmlRegisterForm").addClass("hideShowCase"); } }, isInvalidEmail: function (email) { if (email == null || email == 'undefined') { return false; } var re = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; return re.test(email); }, registerSocial: function (socialId, type) { if (!$("#checkAll").is(":checked")) { NCTOAuth.showErrorSocial("Bạn chưa chọn đồng ý điều kiện \"Thỏa thuận sử dụng\" "); return; } var userName = $("#uname").val(); var fullName = $("#fullName").val(); var email = $("#email").val(); var phone = $("#phone").val(); var ggCaptcha = $("#codegg").val(); if (typeof userName == "undefined" || userName == "") { NCTOAuth.validateFieldRegister(true, "UName", "Tên đăng nhập tối thiểu phải 6 ký tự và tối đa 30 ký tự. Vui lòng nhập lại!"); return; } if (typeof fullName == "undefined" || fullName == "") { NCTOAuth.validateFieldRegister(true, "FName", "Tên hiển thị không được để trống."); return; } if (typeof email == "undefined" || email == "") { NCTOAuth.validateFieldRegister(true, "Mail", "Email không được để trống."); return; } else if (!NCTOAuth.isInvalidEmail(email)) { NCTOAuth.validateFieldRegister(true, "Mail", "Email không không hợp lệ."); return; } if (typeof ggCaptcha == "undefined" || ggCaptcha == "") { NCTOAuth.showErrorSocial("Mã xác nhận không đúng."); return; } var user = new Object(); user.userName = userName; user.fullName = fullName; user.email = email; user.phone = phone; user.ggCaptcha = ggCaptcha; user.socialId = socialId; user.type = type; $.post(NCTInfo.ROOT_URL + "ajax/user-social", user, function (result) { if (typeof result.error_code != "undefined") { if (result.error_code == 0) { //success if ($("#htmlLoginSocial").is(":visible")) { $("#htmlLoginSocial").hide(); } NCTOAuth.showPopupRegisterSuccess(userName, fullName, type); } else { var msg = ""; if (result.error_code == 1) { msg = "Tên đăng nhập tối thiểu phải 6 ký tự và tối đa 30 ký tự. Vui lòng nhập lại!"; NCTOAuth.validateFieldRegister(true, "UName", msg); } else if (result.error_code == 2) { msg = "Tên đăng nhập không hợp lệ. Vui lòng nhập lại!"; NCTOAuth.validateFieldRegister(true, "UName", msg); } else if (result.error_code == 3) { msg = "Tên đăng nhập đã tồn tại. Vui lòng nhập lại!"; NCTOAuth.validateFieldRegister(true, "UName", msg); } else if (result.error_code == 16) { msg = "Mã xác minh đã hết hạn."; NCTOAuth.showErrorSocial(msg); } else if (result.error_code == 15) { msg = "Thông tin đăng nhập không hợp lệ. Vui lòng nhập lại!"; NCTOAuth.showErrorSocial(msg); } } } grecaptcha.reset(); }); }, showPopupRegisterSuccess: function (username, fullName, type) { var title = "Đăng ký"; if (NCTOAuth.FACEBOOK == type) { title += " bằng tài khoản facebook"; } else if (NCTOAuth.GOOGLE == type) { title += " bằng tài khoản Google"; } var html = '� � Don't ever say that again � � What's up, ayo � � There's a table in my house � � My TV doesn't have a cable � � There's nothing, I just play Lego � � I'm a person, I do it, I do it, I do it � � I order, I do it, I do it, I do it � � I do it, I do it, I do it, what's up, what's up? � � Ayo, white tiger, white tiger � � My legs are big, omo, omo � � I don't like it, I don't like it, po po � � I play yo-yo when I like to eat go-go � � Go-go, no-no, no-no, oh-oh � � Sad, sad, next to me there's only milk, do-do � � There's only milk and a Lamborghini � � I don't eat junk food, I only eat mango � � If I had to compare my score, I would be number 1 � � There's nothing, I just turn on my phone and turn on the light � � When I get on the plane, I fly in the sky � � When I get on the plane, I fly in the sky � � When I get on the plane, I fly in the sky � � They say I look like a star � � So what? � � Some people do it, some people don't � � If you don't ask, most of them are crazy � � When I go on a tour, the driver's name is P'Nong � � They say I look like P'Ong � � They say I'm not good, so I have tears � � I don't have a brain, I don't have wisdom � � I've been watching the show, It's late, My body is out of breath � � Let me go � � I'm leaving the country � � I'm leaving the country � � I'm leaving the country, It's late, Look at the time � � I'm leaving the country, It's late, Look at the time � � See you next month, I love you � � I love you � � Go home and sleep � � I'll go � � Big butts, Black and white, Like I got bunch � � Girl alright, I can get tough � � Shame me all night, Wanna move some � � Tired off, Easy ball � � Baby girl low low, She be boo'd up � � That's that talk � � Drizzy go off, Man that's tough � � Leave em on block, Ay yo � � Pretty little thing, She wanna act tough � � Got the safe on me, And that's a little much � � Got the rest on me, I be counting all my bucks � � Matter real life, Sugar motherfucker get walkin' � � If she wanna talk, Better meet me in the lock � � As I seen her over there, She wanna suckie on the top � � Chillin' on the day, Kruea summer, Big wheels summer � � Buying that one moment on my CD cover � � Now I'm rich � � I'm a boss, I'm a thug � � I look like a thug, I don't look like a thug � � When I go for a ride, I ride in the name of P'Nong � � They say I'm cool, My legs are like P'Ong � � They say I'm not good, So I have tears � � I don't have brain, I don't have wisdom � � Hey, look at the time, Now the clock has been casted on me � � And I'm going to go � � I'll go, I'll go � � Hey, look at the time, Now the clock has been casted on me � � And I'm going to go � � I'll go, I'll go � � I'll go, I'll go � � I'll go, I'll go � � I'll go, I'll go � � My boss is not like that, Baby � � Tonight let's get crazy � � Tonight I drink all night long, Tomorrow I'll sleep well � � Come closer, closer, closer, closer � � Little by little, little, little, little � � If you're not drunk yet, add another glass � � Mix it up and mix, mix, mix, mix, mix � � Alibaba � � I want to see you dance Tatiana � � You're like Rihanna � � Mira, Mira � � Tum Hiho, Mary Jan, Katara � � I'm a bad person, I'm a bad person � � If you don't ask me, I'll sell my soul � � When I go on a tour, the driver's name is P'Nong � � He told me that I'm ugly like P'Ong � � He told me that I'm not good, so I have tears � � I don't have a brain, I don't have wisdom � � Hey, look at the time, what time is it now? � � My time is up, let me go � � I'm jealous, I'm jealous � � I'm jealous, I'm jealous � � I'm jealous, I'm jealous � � Hey, look at the time, what time is it now? � � I'm jealous, I'm jealous � � I'm jealous, I'm jealous � � I'm jealous, I'm jealous � � I should go home and take a rest � �