96 lines
2.6 KiB
HTML
96 lines
2.6 KiB
HTML
<!DOCTYPE HTML>
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
<meta name="viewport" content="user-scalable=no, initial-scale=1.0, maximum-scale=1.0"/>
|
|
<meta name="apple-mobile-web-app-capable" content="yes"/>
|
|
<meta name="apple-mobile-web-app-status-bar-style" content="black">
|
|
<title>leanote sign in</title>
|
|
|
|
<link href="/public/css/font-awesome-4.0.3/css/font-awesome.css" rel="mobile/csssheet">
|
|
<link href="/public/css/bootstrap.css" rel="stylesheet" />
|
|
|
|
<style>
|
|
.alert {
|
|
padding: 10px;
|
|
margin-bottom: 10px;
|
|
border-radius: 3px;
|
|
}
|
|
.form-control {
|
|
border-radius: 0;
|
|
-webkit-box-shadow: none;
|
|
box-shadow: none;
|
|
-webkit-transition: nonoe;
|
|
transition: none;
|
|
}
|
|
</style>
|
|
|
|
</head>
|
|
|
|
<body>
|
|
<div style="text-align: center">
|
|
<img src="/public/mobile/images/blog01.jpg" style="width: 100%"/>
|
|
<form id="loginForm" style="width: 90%; margin: auto;">
|
|
<div class="form-group">
|
|
<h2 style="margin-top:10px">leanote {{msg . "login"}}</h2>
|
|
</div>
|
|
<div class="alert alert-danger" id="loginMsg" style="display: none"></div>
|
|
<div class="form-group">
|
|
<input class="form-control" id="email" name="email" placeholder="{{msg . "usernameOrEmail"}}" value="">
|
|
</div>
|
|
<div class="form-group">
|
|
<input type="password" class="form-control" id="pwd" name="pwd" placeholder="{{msg . "password"}}">
|
|
</div>
|
|
<button id="loginBtn" class="btn btn-success" style="width: 100%">{{msg . "login"}}</button>
|
|
</form>
|
|
</div>
|
|
|
|
<script type="text/javascript" src="/public/js/jquery-1.9.0.min.js"></script>
|
|
<script>
|
|
$(function() {
|
|
$("#status").fadeOut(); // will first fade out the loading animation
|
|
$("#preloader").delay(350).fadeOut("slow"); // will fade out the white DIV that covers the website.
|
|
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();
|
|
var pwd = $("#pwd").val();
|
|
if(!email) {
|
|
showMsg("{{msg . "inputUsername"}}", "email");
|
|
return;
|
|
}
|
|
if(!pwd) {
|
|
showMsg("{{msg . "inputPassword"}}", "pwd");
|
|
return;
|
|
} else {
|
|
if(pwd.length < 6) {
|
|
showMsg("{{msg . "wrongPassword"}}", "pwd");
|
|
return;
|
|
}
|
|
}
|
|
|
|
$("#loginBtn").html("{{msg . "logining"}}...").addClass("disabled");
|
|
// hideMsg();
|
|
|
|
$.post("/doLogin", {email: email, pwd: pwd}, function(e) {
|
|
$("#loginBtn").html("{{msg . "login"}}").removeClass("disabled");
|
|
if(e.Ok) {
|
|
$("#loginBtn").html("{{msg . "loginSuccess"}}...");
|
|
location.href = '/mobile/index';
|
|
} else {
|
|
showMsg(e.Msg, "pwd");
|
|
}
|
|
});
|
|
|
|
});
|
|
});
|
|
</script>
|
|
</body>
|
|
</html> |