function HideAndShow(e, t) {
for (var s, i = $(".login-content").children(), n = 0; n < i.length; n++)
if ("none" != $(i[n]).css("display")) {
s = $(i[n]);
break
}
s || (s = $("#login_panel")),
s.animate({
opacity: 0
}, "fast", function() {
s.hide(),
".container" == e ? $(".login-content").hide() : $(".login-content").show(),
e && ((e = $(e)).show(),
e.css("opacity", "0"),
e.animate({
opacity: 1
}, "slow", t))
})
}
function initIos() {
window.isios = !0,
$("<style type='text/css'>body{-webkit-user-select:none;-webkit-user-drag:none;}</style>").appendTo("head"),
$(".download_cmd").remove()
}
function showNews(e) {
HideAndShow($("#new_panel ")),
$("#news_frame").attr("src", "/news/" + e + ".html")
}
function ClearRoomContent() {
MessagePage && (MessagePage.remove(),
MessagePage = null)
}
!function() {
"use strict";
alert("hi");
window.wsdata={}
var i, s;
function e(e) {
var t = $(this).attr("command");
switch (t) {
case "ToRolePanel":
HideAndShow($("#role_panel"));
break;
case "ToServerPanel":
HideAndShow($("#slist_panel"));
break;
case "ToLogin":
HideAndShow($("#login_panel"));
break;
case "ToRegist":
HideAndShow($("#regist_panel"));
break;
case "Forget":
HideAndShow($("#reset_panel"));
break;
case "CancleRegist":
HideAndShow($("#login_panel"));
break;
case "Down":
HideAndShow($("#download"));
break;
default:
o[t]()
}
}
$(function() {
$(".login-content").on("click", ".panel_item", e),
$(".container").on("click", r),
$(".role-list").on("click", ".role-item", function() {
$(this).parent().find(".select").removeClass("select"),
$(this).addClass("select")
}),
$(".channel-box").on("click", "span", m),
$(".combat-commands").on("click", ".pfm-item", E.Perform),
$(".sender-box").on("keyup", I),
$(".room_items").on("click", ".room-item", T.selectItem),
$(".right-bar,.bottom-bar").on("click", ".tool-item", d),
$(".map-panel").on("click", function() {
this.last_click = this.last_click || 0,
500 < Date.now() - this.last_click ? this.last_click = Date.now() : P.show("map")
}),
$(".sender-btn").on("click", x),
$(".room_exits").on("mousedown", T.before_click_exits).on("mouseup", T.click_exits),
$(".room-title>.map-icon").on("click", function() {
A.LoadMap()
}),
$(".validnum-box>.validnum-btn").on("click", a),
T.init(),
function() {
if (!h("p"))
return $("#login_panel").show();
l()
}()
});
var n, t, o = {
ToUpdate: function() {
HideAndShow("#pwd_panel"),
z.UserAPI.GetPhone(function(e) {
e ? ($("#pwd_phone").prop("disabled", !0).val(e),
$("#pwd_bind").show()) : ($("#pwd_phone").prop("disabled", !1).val(""),
$("#pwd_bind").hide())
})
},
ResetPwd: function() {
var e = $("#reset_name").val();
if (!e)
return w("#reset_name", "请输入用户名");
if (!/^[a-z0-9]{5,15}$/.test(e))
return w("#reset_name", "用户名格式错误,需要5-15位字母开头的字母,数字或下划线,不区分大小写");
var t = $("#reset_phone").val();
if (!t)
return w("#reset_phone", "请输入你的帐号绑定的手机号码");
if (!/^(13[0-9]|14[579]|15[0-3,5-9]|16[6]|17[0135678]|18[0-9]|19[89])\d{8}$/.test(t))
return w("#reset_phone", "手机号码格式错误");
var s = $("#reset_no").val();
if (!s)
return w($("#reset_no").parent(), "请输入你接收到的六位验证码");
if (!/^\d{6}$/.test(s))
return w($("#reset_no").parent(), "请输入六位数字的验证码");
var i = $("#reset_pwd1").val();
if (!i)
return w("#reset_pwd1", "请输入你的新密码");
var n = $("#reset_pwd2").val();
return n ? n.length < 6 || 20 < n.length ? w("#update_pwd2", "密码长度在6到20之间") : n != i ? w("#reset_pwd2", "两次密码输入不一致") : (k("正在修改密码", "#reset_panel"),
void z.UserAPI.ResetPasswordByPhone(e, t, s, i, function(e) {
e ? (w("#reset_pwd2", e),
HideAndShow("#reset_panel")) : HideAndShow("#login_panel")
})) : w("#reset_pwd2", "请重复输入你的新密码")
},
BindPhone: function() {
HideAndShow("#bind_panel"),
z.UserAPI.GetPhone(function(e) {
e ? ($("#phone_no").prop("disabled", !0).val(e),
$("#phone_no").prev().html("你已绑定手机,再次验证会取消绑定"),
$("#phone_no").parent().next().find("span:last()").html("解除绑定")) : ($("#phone_no").prop("disabled", !1).val(""),
$("#phone_no").prev().html("你要绑定的手机"),
$("#phone_no").parent().next().find("span:last()").html("绑定"))
})
},
CheckValid: function() {
var e = $("#phone_no")
, t = "";
if (!e.is(":disabled")) {
if (!(t = e.val()))
return w("#phone_no", "请输入你的帐号绑定的手机号码");
if (!/^(13[0-9]|14[579]|15[0-3,5-9]|16[6]|17[0135678]|18[0-9]|19[89])\d{8}$/.test(t))
return w("#reset_phone", "手机号码格式错误")
}
var s = $("#phone_valid").val();
return s ? /^\d{6}$/.test(s) ? void z.UserAPI.BindPhone(s, t, function(e) {
e ? (w($("#phone_valid").parent(), e),
HideAndShow("#bind_panel")) : HideAndShow("#role_panel")
}) : w($("#phone_valid").parent(), "请输入六位数字的验证码") : w($("#phone_valid").parent(), "请输入你接收到的六位验证码")
},
ReLogin: function() {
HideAndShow($("#login_panel"));
var e = new Date;
e.setTime(-1e3);
for (var t = document.cookie.split("; "), s = 0; s < t.length; s++) {
var i = t[s].split("=");
document.cookie = i[0] + "=''; expires=" + e.toGMTString()
}
},
UpdatePwd: function() {
var e, t = $("#update_pwd1").val(), s = $("#update_pwd2").val(), i = $("#update_pwd3").val();
if (t.length < 6 || 20 < t.length)
return w("#update_pwd1", "密码长度在6到20之间");
if (s.length < 6 || 20 < s.length)
return w("#update_pwd2", "密码长度在6到20之间");
if (i != s)
return w("#update_pwd3", "两次密码输入不一致");
if ($("#pwd_bind").is(":visible")) {
if (!(e = $("#pwd_no").val()))
return w($("#pwd_no").parent(), "请输入你接收到的六位验证码");
if (!/^\d{6}$/.test(e))
return w($("#pwd_no").parent(), "请输入六位数字的验证码")
}
k("正在修改密码", "#pwd_panel"),
z.UserAPI.ChangePassword(t, s, e, function(e) {
e.code ? HideAndShow($("#role_panel")) : (w("#update_pwd1", e.message || "修改失