init
This commit is contained in:
1 parent
fac05a7b6c
commit
476ade10e7
1085 files changed
+259628
No files matched your search
@@ -0,0 +1,83 @@
|
||||
{{template "home/header_box.html" .}}
|
||||
|
||||
<style>
|
||||
</style>
|
||||
<section id="box">
|
||||
<div>
|
||||
<h1>leanote | {{msg . "findPassword"}}</h1>
|
||||
<form class="form-inline" id="boxForm">
|
||||
<div class="alert alert-danger" id="loginMsg"></div>
|
||||
<table style="width: 100%">
|
||||
<tr>
|
||||
<td style="width: 110px"><label for="email">{{msg . "email"}}</label>
|
||||
<input type="text" class="form-control" id="email" name="email" value="{{.email}}"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<button id="loginBtn" class="btn btn-success" style="width: 100%">{{msg . "findPassword"}}</button>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
<div id="quickLinks">
|
||||
<a href="/login">{{msg . "login"}}</a>
|
||||
|
||||
<a href="/index">{{msg . "home"}}</a>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<script src="/js/jquery-1.9.0.min.js"></script>
|
||||
<script src="/js/bootstrap.js"></script>
|
||||
<script src="/js/common.js"></script>
|
||||
|
||||
<script>
|
||||
$(function() {
|
||||
$("#email").focus();
|
||||
if($("#email").val()) {
|
||||
$("#pwd").focus();
|
||||
}
|
||||
function showMsg(msg, id) {
|
||||
$("#loginMsg").html(msg).show();
|
||||
if(id) {
|
||||
$("#" + id).focus();
|
||||
}
|
||||
}
|
||||
function hideMsg() {
|
||||
$("#loginMsg").hide();
|
||||
}
|
||||
$("#loginBtn").click(function(e){
|
||||
e.preventDefault();
|
||||
var email = $("#email").val();
|
||||
if(!email) {
|
||||
showMsg("{{msg . "inputEmail"}}", "email");
|
||||
return;
|
||||
} else {
|
||||
var myreg = /^([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/;
|
||||
if(!myreg.test(email)) {
|
||||
showMsg("{{msg . "wrongEmail"}}", "email");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
$("#loginBtn").html("{{msg . "ing"}}...").addClass("disabled");
|
||||
// hideMsg();
|
||||
|
||||
$.post("/doFindPassword", {email: email}, function(e) {
|
||||
$("#loginBtn").html("{{msg . "findPassword"}}").removeClass("disabled");
|
||||
if(e.Ok) {
|
||||
var msg = "{{msg . "findPasswordSendEmailOver"}}";
|
||||
var loginAddress = getEmailLoginAddress(email);
|
||||
if(loginAddress) {
|
||||
msg += ' <a target="_blank" href="' + loginAddress + '">{{msg . "checkEmai"}}</a>';
|
||||
}
|
||||
$("#loginMsg").html(msg).show().removeClass("alert-danger").addClass("alert-success");
|
||||
} else {
|
||||
showMsg(e.Msg, "email");
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in new issue
Block a user