Commit 95e7c08f authored by Liang's avatar Liang

💄 update common page

parent 54295024
<!DOCTYPE html> <#include "macro-common-page.ftl">
<html>
<head>
<meta charset="utf-8" />
<title>${articleViewPwdLabel}</title>
<meta name="keywords" content="Solo,Java 博客,开源" />
<meta name="description" content="An open source blog with Java. Java 开源博客" />
<meta name="owner" content="B3log Team" />
<meta name="author" content="B3log Team" />
<meta name="generator" content="Solo" />
<meta name="copyright" content="B3log" />
<meta name="revised" content="B3log, ${year}" />
<meta name="robots" content="noindex, follow" />
<meta http-equiv="Window-target" content="_top" />
<link type="text/css" rel="stylesheet" href="${staticServePath}/css/default-init${miniPostfix}.css?${staticResourceVersion}" charset="utf-8" />
<link rel="icon" type="image/png" href="${staticServePath}/favicon.png" />
<script type="text/javascript" src="${staticServePath}/js/lib/jquery/jquery.min.js" charset="utf-8"></script>
</head>
<body>
<div class="wrapper">
<div class="wrap">
<div class="content">
<div class="logo">
<a href="http://b3log.org" target="_blank">
<img border="0" width="153" height="56" alt="B3log" title="B3log" src="${staticServePath}/images/logo.jpg"/>
</a>
</div>
<div class="main article-pwd">
<h2>
${articleTitle}
</h2>
<div>
${articleAbstract}
</div>
<#if msg??>
<div>${msg}</div>
</#if>
<form method="POST" action="${servePath}/console/article-pwd">
<label for="pwdTyped">访问密码:</label>
<input type="password" id="pwdTyped" name="pwdTyped" />
<input type="hidden" name="articleId" value="${articleId}" />
<button id="confirm" type="submit">${confirmLabel}</button>
</form>
<a href="http://b3log.org" target="_blank">
<img border="0" class="icon" alt="B3log" title="B3log" src="${staticServePath}/favicon.png"/>
</a>
</div>
<span class="clear"></span>
</div>
</div>
<div class="footerWrapper"> <@commonPage "${articleViewPwdLabel}">
<div class="footer"> <h2>
&copy; ${year} - <a href="${servePath}">${blogTitle}</a><br/> ${articleTitle}
Powered by <a href="http://b3log.org" target="_blank">B3log 开源</a><a href="https://hacpai.com/tag/solo" target="_blank">Solo</a> ${version} </h2>
</div> <br>
</div> <#if msg??>
</div> <div>${msg}</div>
</body> </#if>
</html> <form method="POST" action="${servePath}/console/article-pwd">
<label for="pwdTyped">访问密码:</label>
<input type="password" id="pwdTyped" name="pwdTyped" />
<input type="hidden" name="articleId" value="${articleId}" />
<button id="confirm" type="submit">${confirmLabel}</button>
</form>
</@commonPage>
\ No newline at end of file
...@@ -23,7 +23,6 @@ ...@@ -23,7 +23,6 @@
html { html {
height: 100%; height: 100%;
overflow: hidden;
} }
html,body { html,body {
...@@ -32,7 +31,7 @@ html,body { ...@@ -32,7 +31,7 @@ html,body {
} }
body { body {
background-color: #F3F1E5; background-color: #fff;
color: #333; color: #333;
font-family: \5fae\8f6f\96c5\9ed1; font-family: \5fae\8f6f\96c5\9ed1;
font-size: small; font-size: small;
...@@ -40,7 +39,7 @@ body { ...@@ -40,7 +39,7 @@ body {
} }
h2 { h2 {
background-color:#ECECEC; background-color: #F3F1E5;
border-radius: 4px 4px 0 0; border-radius: 4px 4px 0 0;
font-size: 16px; font-size: 16px;
margin: 0; margin: 0;
...@@ -129,14 +128,6 @@ button:active { ...@@ -129,14 +128,6 @@ button:active {
display: none; display: none;
} }
.main .icon {
position: absolute;
right: 0px;
top: 0px;
width:16px;
height:16px;
}
.solo { .solo {
color: orangered; color: orangered;
font-weight: bold; font-weight: bold;
...@@ -144,32 +135,22 @@ button:active { ...@@ -144,32 +135,22 @@ button:active {
.logo { .logo {
float: left; float: left;
padding: 162px 12px 0; padding: 142px 12px 0;
width: 217px; width: 217px;
text-align: center; text-align: center;
} }
.wrapper {
height: auto;
min-height: 100%;
position: relative;
}
.wrap { .wrap {
border-top: 5px solid #E6E5D9; border-top: 5px solid #E6E5D9;
min-height: 400px; min-height: 400px;
padding: 110px 0;
background-color: #F3F1E5;
} }
.content { .content {
background: url("../images/zz.jpg") repeat-x scroll center bottom white; background-color: #fff;
border-color: #E6E5D9;
border-style: solid solid none;
border-width: 1px;
margin: 0 auto; margin: 0 auto;
padding: 0 0 28px 0;
position: relative;
width: 760px; width: 760px;
top: 60px;
} }
.main { .main {
...@@ -179,7 +160,7 @@ button:active { ...@@ -179,7 +160,7 @@ button:active {
margin: 24px 0; margin: 24px 0;
padding: 12px 24px; padding: 12px 24px;
width: 470px; width: 470px;
height: 338px; min-height: 300px;
} }
.main a { .main a {
...@@ -193,11 +174,8 @@ button:active { ...@@ -193,11 +174,8 @@ button:active {
.footerWrapper { .footerWrapper {
background-color: #FFFFFF; background-color: #FFFFFF;
border-top: 1px solid #E6E5D9; border-top: 1px solid #E6E5D9;
bottom: 0;
padding: 12px 0; padding: 12px 0;
position: absolute;
text-align: center; text-align: center;
width: 100%;
} }
.footerWrapper a { .footerWrapper a {
...@@ -220,7 +198,6 @@ button:active { ...@@ -220,7 +198,6 @@ button:active {
/* start 403/404/500 */ /* start 403/404/500 */
.img-403, .img-500 { .img-403, .img-500 {
box-shadow: 0 0 5px #E6E5D9;
margin: 20px 0 0 45px; margin: 20px 0 0 45px;
padding: 5px; padding: 5px;
} }
...@@ -270,7 +247,6 @@ button:active { ...@@ -270,7 +247,6 @@ button:active {
/* start init */ /* start init */
#init { #init {
position: absolute; position: absolute;
top: 81px;
width: 470px; width: 470px;
} }
......
<!DOCTYPE html> <#include "../macro-common-page.ftl">
<html>
<head> <@commonPage "403 Forbidden!">
<meta charset="utf-8" /> <h2>403 Forbidden!</h2>
<meta name="robots" content="none" /> <img class="img-403" src="${staticServePath}/images/403.png" alt="403: forbidden" title="403: forbidden" />
<title>${blogTitle} - 403 Forbidden!</title> <div class="a-403">
<link type="text/css" rel="stylesheet" href="${staticServePath}/css/default-init${miniPostfix}.css?${staticResourceVersion}" charset="utf-8" /> <a href="${servePath}">Index</a> |
<link rel="icon" type="image/png" href="${staticServePath}/favicon.png" /> <a href="${loginURL}">Login</a>
</head> </div>
<body> </@commonPage>
<div class="wrapper">
<div class="wrap">
<div class="content">
<div class="logo">
<a href="http://b3log.org" target="_blank">
<img border="0" width="153" height="56" alt="B3log" title="B3log" src="${staticServePath}/images/logo.jpg"/>
</a>
</div>
<div class="main">
<h2>403 Forbidden!</h2>
<img class="img-403" src="${staticServePath}/images/403.png" alt="403: forbidden" title="403: forbidden" />
<div class="a-403">
<a href="${servePath}">Index</a> |
<a href="${loginURL}">Login</a>
</div>
<a href="http://b3log.org" target="_blank">
<img border="0" class="icon" alt="B3log" title="B3log" src="${staticServePath}/favicon.png"/>
</a>
</div>
<span class="clear"></span>
</div>
</div>
</div>
<div class="footerWrapper">
<div class="footer">
&copy; ${year}
Powered by <a href="http://b3log.org" target="_blank">B3log 开源</a>, ver ${version}
</div>
</div>
</body>
</html>
<!DOCTYPE html> <#include "../macro-common-page.ftl">
<html>
<head> <@commonPage "404 Not Found!">
<meta charset="utf-8" /> <h2>${title}</h2>
<meta name="robots" content="none" /> <img class="img-t0t" width="488" src="${staticServePath}/images/404.gif" title="404" alt="${title}"/>
<title>${blogTitle} - 404 Not Found!</title> <div class="a-404">
<link type="text/css" rel="stylesheet" href="${staticServePath}/css/default-init${miniPostfix}.css?${staticResourceVersion}" charset="utf-8" /> 欢迎访问
<link rel="icon" type="image/png" href="${staticServePath}/favicon.png" /> <a href="https://hacpai.com">黑客与画家</a>
</head> </div>
<body> </@commonPage>
<div class="wrapper"> \ No newline at end of file
<div class="wrap">
<div class="content">
<div class="logo">
<a href="http://b3log.org" target="_blank">
<img border="0" width="153" height="56" alt="B3log" title="B3log" src="${staticServePath}/images/logo.jpg"/>
</a>
</div>
<div class="main">
<h2>404 Not Found!</h2>
<img class="img-t0t" width="488" src="${staticServePath}/images/404.gif" title="404" alt="500: not found!" />
<div class="a-404">
欢迎访问
<a href="https://hacpai.com">黑客与画家</a>
</div>
<a href="http://b3log.org" target="_blank">
<img border="0" class="icon" alt="B3log" title="B3log" src="${staticServePath}/favicon.png"/>
</a>
</div>
<span class="clear"></span>
</div>
</div>
</div>
<div class="footerWrapper">
<div class="footer">
&copy; ${year}
Powered by <a href="http://b3log.org" target="_blank">B3log 开源</a>, ver ${version}
</div>
</div>
</body>
</html>
<!DOCTYPE html> <#include "../macro-common-page.ftl">
<html>
<head> <@commonPage "500 Internal Server Error!">
<meta charset="utf-8" /> <h2>500 Internal Server Error!</h2>
<title>${blogTitle} - 500 Internal Server Error!</title> <img class="img-500" src="${staticServePath}/images/500.png" title="500: internal error" alt="500: internal error" />
<link type="text/css" rel="stylesheet" href="${staticServePath}/css/default-init${miniPostfix}.css?${staticResourceVersion}" charset="utf-8" /> <div class="a-500">
<link rel="icon" type="image/png" href="${staticServePath}/favicon.png" /> Please
</head> <a href="https://github.com/b3log/solo/issues/new">report</a> it to help us.
<body> Return to <a href="${servePath}">Index</a>.
<div class="wrapper"> </div>
<div class="wrap"> </@commonPage>
<div class="content"> \ No newline at end of file
<div class="logo">
<a href="http://b3log.org" target="_blank">
<img border="0" width="153" height="56" alt="B3log" title="B3log" src="${staticServePath}/images/logo.jpg"/>
</a>
</div>
<div class="main">
<h2>500 Internal Server Error!</h2>
<img class="img-500" src="${staticServePath}/images/500.png" title="500: internal error" alt="500: internal error" />
<div class="a-500">
Please
<a href="https://github.com/b3log/solo/issues/new">report</a> it to help us.
Return to <a href="${servePath}">Index</a>.
</div>
<a href="http://b3log.org" target="_blank">
<img border="0" class="icon" alt="B3log" title="B3log" src="${staticServePath}/favicon.png"/>
</a>
</div>
<span class="clear"></span>
</div>
</div>
</div>
<div class="footerWrapper">
<div class="footer">
&copy; ${year}
Powered by <a href="http://b3log.org" target="_blank">B3log 开源</a>, ver ${version}
</div>
</div>
</body>
</html>
<!DOCTYPE html> <#include "macro-common-page.ftl">
<html>
<head> <@commonPage "${welcomeToSoloLabel}!">
<meta charset="utf-8" /> <h2>
<title>${welcomeToSoloLabel} Solo!</title> <span>${welcomeToSoloLabel}</span>
<meta name="keywords" content="Solo,Java 博客,开源" /> <a target="_blank" href="http://b3log.org">
<meta name="description" content="An open source blog with Java. Java 开源博客" /> <span class="solo">&nbsp;Solo</span>
<meta name="owner" content="B3log Team" /> </a>
<meta name="author" content="B3log Team" /> </h2>
<meta name="generator" content="Solo" /> <div id="init">
<meta name="copyright" content="B3log" /> <div id="user" class="form">
<meta name="revised" content="B3log, ${year}" /> <label for="userEmail">
<meta name="robots" content="noindex, follow" /> ${commentEmail1Label}
<meta http-equiv="Window-target" content="_top" /> </label>
<link type="text/css" rel="stylesheet" href="${staticServePath}/css/default-init${miniPostfix}.css?${staticResourceVersion}" charset="utf-8" /> <input id="userEmail" />
<link rel="icon" type="image/png" href="${staticServePath}/favicon.png" /> <label for="userName">
<style> ${userName1Label}
*,html,body { </label>
margin: 0; <input id="userName" />
padding: 0; <label for="userPassword">
} ${userPassword1Label}
</label>
html { <input type="password" id="userPassword" />
height: 100%; <label for="userPasswordConfirm">
overflow: hidden; ${userPasswordConfirm1Label}
} </label>
<input type="password" id="userPasswordConfirm" />
body { <button onclick='getUserInfo();'>${nextStepLabel}</button>
background-color: #F3F1E5; <span id="tip"></span>
color: #4D505D; </div>
font-family: \5fae\8f6f\96c5\9ed1; <div id="sys" class="none">
font-size: small; ${initIntroLabel}
height: 100%; <button onclick='initSys();' id="initButton">${initLabel}</button>
overflow: hidden; <button onclick='returnTo();'>${previousStepLabel}</button>
} <span id="tipInit"></span>
<span class="clear"></span>
.wrapper { </div>
height: 400px; </div>
min-height: 100%; <script type="text/javascript" src="${staticServePath}/js/lib/jquery/jquery.min.js" charset="utf-8"></script>
position: relative; <script type="text/javascript">
} var validate = function() {
var userName = $("#userName").val().replace(/(^\s*)|(\s*$)/g, "");
.contentError { if (!/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i.test($("#userEmail").val())) {
background-color: #FFFFFF; $("#tip").text("${mailInvalidLabel}");
border: 1px solid #E6E5D9; $("#userEmail").focus();
height: 300px; } else if (2 > userName.length || userName.length > 20) {
margin: 0 auto; $("#tip").text("${nameTooLongLabel}");
padding: 50px; $("#userName").focus();
position: relative; } else if ($("#userPassword").val().replace(/\s/g, "") === "") {
top: 60px; $("#tip").text("${passwordEmptyLabel}");
width: 600px; $("#userPassword").focus();
} } else if ($("#userPassword").val() !== $("#userPasswordConfirm").val()) {
$("#tip").text("${passwordNotMatchLabel}");
.footerWrapper { $("#userPasswordConfirm").focus();
background-color: #FFFFFF; } else {
border-top: 1px solid #E6E5D9; $("#tip").text("");
bottom: 0; return true;
padding: 12px 0; }
position: absolute; return false;
text-align: center; };
width: 100%;
} var getUserInfo = function() {
if (validate()) {
.footerWrapper a { $("#init").animate({
text-decoration: none; "top": -100
} });
</style>
</head> $("#user").animate({
<body> "opacity": 0
<div class="wrapper"> });
<div class="wrap">
<div class="content" id="main"> $("#sys").css({
<div class="logo"> "display": "block",
<a href="http://b3log.org" target="_blank"> "opacity": 1
<img border="0" width="153" height="56" alt="B3log" title="B3log" src="${staticServePath}/images/logo.jpg"/> });
</a>
</div> $(window).unbind().keydown(function(e) {
<div class="main"> if (e.keyCode === 27) {// esc
<h2> returnTo();
<span>${welcomeToSoloLabel}</span> $(window).unbind();
<a target="_blank" href="http://b3log.org"> } else if (e.keyCode === 13) {// enter
<span class="solo">&nbsp;Solo</span> initSys();
</a> }
</h2> });
<div id="init"> }
<div id="user" class="form"> };
<label for="userEmail">
${commentEmail1Label} var returnTo = function() {
</label> $("#init").animate({
<input id="userEmail" /> "top": 190
<label for="userName"> });
${userName1Label}
</label> $("#user").animate({
<input id="userName" /> "opacity": 1
<label for="userPassword"> });
${userPassword1Label}
</label> $("#sys").animate({
<input type="password" id="userPassword" /> "opacity": 0
<label for="userPasswordConfirm"> }, 800, function() {
${userPasswordConfirm1Label} this.style.display = "none";
</label> });
<input type="password" id="userPasswordConfirm" /> };
<button onclick='getUserInfo();'>${nextStepLabel}</button>
<span id="tip"></span> var initSys = function() {
</div> var requestJSONObject = {
<div id="sys" class="none"> "userName": $("#userName").val(),
${initIntroLabel} "userEmail": $("#userEmail").val(),
<button onclick='initSys();' id="initButton">${initLabel}</button> "userPassword": $("#userPassword").val()
<button onclick='returnTo();'>${previousStepLabel}</button> };
<span id="tipInit"></span>
<span class="clear"></span> if (confirm("${confirmInitLabel}")) {
</div> $(window).unbind();
</div> $("#tipInit").html("<img src='${staticServePath}/images/loading.gif'/> loading...");
<a href="http://b3log.org" target="_blank">
<img border="0" class="icon" alt="B3log" title="B3log" src="${staticServePath}/favicon.png"/> $.ajax({
</a> url: "${servePath}/init",
</div> type: "POST",
<span class="clear"></span> data: JSON.stringify(requestJSONObject),
</div> success: function(result, textStatus) {
</div> if (!result.sc) {
$("#tipInit").text(result.msg);
<div class="footerWrapper"> return;
<div class="footer"> }
&copy; ${year}
Powered by <a href="http://b3log.org" target="_blank">B3log 开源</a><a href="https://hacpai.com/tag/solo" target="_blank">Solo</a> ${version} window.location.href = "${servePath}/admin-index.do#main";
</div> }
</div> });
</div> }
<script type="text/javascript" src="${staticServePath}/js/lib/jquery/jquery.min.js" charset="utf-8"></script> };
<script type="text/javascript">
var validate = function() { (function() {
var userName = $("#userName").val().replace(/(^\s*)|(\s*$)/g, ""); try {
if (!/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i.test($("#userEmail").val())) { $("#userEmail").focus();
$("#tip").text("${mailInvalidLabel}"); $("input").keypress(function(event) {
$("#userEmail").focus(); if (event.keyCode === 13) {
} else if (2 > userName.length || userName.length > 20) { event.preventDefault();
$("#tip").text("${nameTooLongLabel}"); }
$("#userName").focus(); });
} else if ($("#userPassword").val().replace(/\s/g, "") === "") {
$("#tip").text("${passwordEmptyLabel}"); $("#userPasswordConfirm").keypress(function(event) {
$("#userPassword").focus(); if (event.keyCode === 13) {
} else if ($("#userPassword").val() !== $("#userPasswordConfirm").val()) { getUserInfo();
$("#tip").text("${passwordNotMatchLabel}"); }
$("#userPasswordConfirm").focus(); });
} else { } catch (e) {
$("#tip").text(""); document.getElementById("main").innerHTML = "${staticErrorLabel}";
return true; document.getElementById("main").className = "contentError";
} }
return false;
}; // if no JSON, add it.
try {
var getUserInfo = function() { JSON
if (validate()) { } catch (e) {
$("#init").animate({ document.write("<script src=\"${staticServePath}/js/lib/json2.js\"><\/script>");
"top": -178 }
});
$('.main').css({
$("#user").animate({ height: '336px',
"opacity": 0 'overflow': 'hidden'
}); })
})();
$("#sys").css({
"display": "block", </script>
"opacity": 1 </@commonPage>
}); \ No newline at end of file
$(window).unbind().keydown(function(e) {
if (e.keyCode === 27) {// esc
returnTo();
$(window).unbind();
} else if (e.keyCode === 13) {// enter
initSys();
}
});
}
};
var returnTo = function() {
$("#init").animate({
"top": 81
});
$("#user").animate({
"opacity": 1
});
$("#sys").animate({
"opacity": 0
}, 800, function() {
this.style.display = "none";
});
};
var initSys = function() {
var requestJSONObject = {
"userName": $("#userName").val(),
"userEmail": $("#userEmail").val(),
"userPassword": $("#userPassword").val()
};
if (confirm("${confirmInitLabel}")) {
$(window).unbind();
$("#tipInit").html("<img src='${staticServePath}/images/loading.gif'/> loading...");
$.ajax({
url: "${servePath}/init",
type: "POST",
data: JSON.stringify(requestJSONObject),
success: function(result, textStatus) {
if (!result.sc) {
$("#tipInit").text(result.msg);
return;
}
window.location.href = "${servePath}/admin-index.do#main";
}
});
}
};
(function() {
try {
$("#userEmail").focus();
$("input").keypress(function(event) {
if (event.keyCode === 13) {
event.preventDefault();
}
});
$("#userPasswordConfirm").keypress(function(event) {
if (event.keyCode === 13) {
getUserInfo();
}
});
} catch (e) {
document.getElementById("main").innerHTML = "${staticErrorLabel}";
document.getElementById("main").className = "contentError";
}
// if no JSON, add it.
try {
JSON
} catch (e) {
document.write("<script src=\"${staticServePath}/js/lib/json2.js\"><\/script>");
}
})();
</script>
</body>
</html>
<!DOCTYPE html> <#include "macro-common-page.ftl">
<html>
<head> <@commonPage "403 Forbidden!">
<meta charset="utf-8" /> ${killBrowserLabel}
<title>${blogTitle}</title> <br/>
<meta name="keywords" content="Solo,Java 博客,开源" /> &nbsp; &nbsp;&nbsp; <button onclick="closeIframe();">${closeLabel}</button> &nbsp; &nbsp;
<meta name="description" content="An open source blog with Java. Java 开源博客" /> <button onclick="closeIframeForever();">${closeForeverLabel}</button>
<meta name="owner" content="B3log Team" /> <img src='${staticServePath}/images/kill-browser.png' title='Kill IE6' style="float: right;
<meta name="author" content="B3log Team" /> margin: -171px 0 0 0;" alt='Kill IE6'/>
<meta name="generator" content="Solo" /> <script>
<meta name="copyright" content="B3log" /> var closeIframe = function () {
<meta name="revised" content="B3log, ${year}" /> window.parent.$("iframe").prev().remove();
<meta http-equiv="Window-target" content="_top" /> window.parent.$("iframe").remove();
<link type="text/css" rel="stylesheet" href="${staticServePath}/css/default-init${miniPostfix}.css?${staticResourceVersion}" charset="utf-8" /> };
<link rel="icon" type="image/png" href="${staticServePath}/favicon.png" />
</head> var closeIframeForever = function () {
<body> window.parent.Cookie.createCookie("showKill", true, 365);
<div class="wrapper"> closeIframe();
<div class="wrap"> };
<div class="content" style="top:-6px"> </script>
<div class="logo"> </@commonPage>
<a href="http://b3log.org" target="_blank"> \ No newline at end of file
<img border="0" width="153" height="56" alt="B3log" title="B3log" src="${staticServePath}/images/logo.jpg"/>
</a>
</div>
<div class="main kill" style="height: 385px;">
${killBrowserLabel}
<br/>
&nbsp; &nbsp;&nbsp; <button onclick="closeIframe();">${closeLabel}</button> &nbsp; &nbsp;
<button onclick="closeIframeForever();">${closeForeverLabel}</button>
<img src='${staticServePath}/images/kill-browser.png' title='Kill IE6' alt='Kill IE6'/>
<a href="http://b3log.org" target="_blank">
<img border="0" class="icon" alt="B3log" title="B3log" src="${staticServePath}/favicon.png"/>
</a>
</div>
<span class="clear"></span>
</div>
</div>
</div>
<script>
var closeIframe = function () {
window.parent.$("iframe").prev().remove();
window.parent.$("iframe").remove();
};
var closeIframeForever = function () {
window.parent.Cookie.createCookie("showKill", true, 365);
closeIframe();
};
</script>
</body>
</html>
<!DOCTYPE html> <#include "macro-common-page.ftl">
<html>
<head>
<meta charset="utf-8" />
<title>${welcomeToSoloLabel} Solo!</title>
<meta name="keywords" content="Solo,Java 博客,开源" />
<meta name="description" content="An open source blog with Java. Java 开源博客" />
<meta name="owner" content="B3log Team" />
<meta name="author" content="B3log Team" />
<meta name="generator" content="Solo" />
<meta name="copyright" content="B3log" />
<meta name="revised" content="B3log, ${year}" />
<meta name="robots" content="noindex, follow" />
<meta http-equiv="Window-target" content="_top" />
<link type="text/css" rel="stylesheet" href="${staticServePath}/css/default-init${miniPostfix}.css?${staticResourceVersion}" charset="utf-8" />
<link rel="icon" type="image/png" href="${staticServePath}/favicon.png" />
</head>
<body>
<div class="wrapper">
<div class="wrap">
<div class="content">
<div class="logo">
<a href="http://b3log.org" target="_blank">
<img border="0" width="153" height="56" alt="B3log" title="B3log" src="${staticServePath}/images/logo.jpg"/>
</a>
</div>
<div class="main">
<h2>
${loginLabel}
</h2>
<div class="form">
<label for="userEmail">
${commentEmailLabel}
</label>
<input id="userEmail" tabindex="1" />
<label for="userPassword">
${userPasswordLabel} <a href="/forgot">(${forgotLabel})</a>
</label>
<input type="password" id="userPassword" tabindex="2" />
<button onclick='login();'>${loginLabel}</button>
<span id="tip">${resetMsg}</span>
</div>
<a href="http://b3log.org" target="_blank">
<img border="0" class="icon" alt="B3log" title="B3log" src="${staticServePath}/favicon.png"/>
</a>
</div>
<span class="clear"></span>
</div>
</div>
<div class="footerWrapper">
<div class="footer">
&copy; ${year} - <a href="${servePath}">${blogTitle}</a><br/>
Powered by <a href="http://b3log.org" target="_blank">B3log 开源</a><a href="https://hacpai.com/tag/solo" target="_blank">Solo</a> ${version}
</div>
</div>
</div>
<script type="text/javascript" src="${staticServePath}/js/lib/jquery/jquery.min.js" charset="utf-8"></script>
<script type="text/javascript">
(function() {
$("#userEmail").focus();
$("#userPassword, #userEmail").keypress(function(event) { <@commonPage "${welcomeToSoloLabel}!">
if (13 === event.keyCode) { // Enter pressed <h2>
login(); ${loginLabel}
} </h2>
}); <div class="form">
<label for="userEmail">
${commentEmailLabel}
</label>
<input id="userEmail" tabindex="1" />
<label for="userPassword">
${userPasswordLabel} <a href="/forgot">(${forgotLabel})</a>
</label>
<input type="password" id="userPassword" tabindex="2" />
<button onclick='login();'>${loginLabel}</button>
<span id="tip">${resetMsg}</span>
</div>
<script type="text/javascript" src="${staticServePath}/js/lib/jquery/jquery.min.js" charset="utf-8"></script>
<script type="text/javascript">
(function() {
$("#userEmail").focus();
// if no JSON, add it. $("#userPassword, #userEmail").keypress(function(event) {
try { if (13 === event.keyCode) { // Enter pressed
JSON login();
} catch (e) { }
document.write("<script src=\"${staticServePath}/js/lib/json2.js\"><\/script>"); });
}
})();
var login = function() { // if no JSON, add it.
if (!/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i.test($("#userEmail" + status).val())) { try {
$("#tip").text("${mailInvalidLabel}"); JSON
$("#userEmail").focus(); } catch (e) {
return; document.write("<script src=\"${staticServePath}/js/lib/json2.js\"><\/script>");
} }
})();
if ($("#userPassword").val() === "") { var login = function() {
$("#tip").text("${passwordEmptyLabel}"); if (!/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i.test($("#userEmail" + status).val())) {
$("#userPassword").focus(); $("#tip").text("${mailInvalidLabel}");
return; $("#userEmail").focus();
} return;
}
var requestJSONObject = { if ($("#userPassword").val() === "") {
"userEmail": $("#userEmail").val(), $("#tip").text("${passwordEmptyLabel}");
"userPassword": $("#userPassword").val() $("#userPassword").focus();
}; return;
}
$("#tip").html("<img src='${staticServePath}/images/loading.gif'/> loading...")
$.ajax({ var requestJSONObject = {
url: "${servePath}/login", "userEmail": $("#userEmail").val(),
type: "POST", "userPassword": $("#userPassword").val()
contentType: "application/json", };
data: JSON.stringify(requestJSONObject),
error: function() {
// alert("Login error!");
},
success: function(data, textStatus) {
if (!data.isLoggedIn) {
$("#tip").text(data.msg);
return;
}
window.location.href = data.to; $("#tip").html("<img src='${staticServePath}/images/loading.gif'/> loading...")
}
}); $.ajax({
}; url: "${servePath}/login",
</script> type: "POST",
</body> contentType: "application/json",
</html> data: JSON.stringify(requestJSONObject),
error: function() {
// alert("Login error!");
},
success: function(data, textStatus) {
if (!data.isLoggedIn) {
$("#tip").text(data.msg);
return;
}
window.location.href = data.to;
}
});
};
</script>
</@commonPage>
\ No newline at end of file
<#macro commonPage title>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<meta name="robots" content="none"/>
<title><#if blogTitle??>${blogTitle} - </#if>${title}</title>
<link type="text/css" rel="stylesheet"
href="${staticServePath}/css/default-init${miniPostfix}.css?${staticResourceVersion}" charset="utf-8"/>
<link rel="icon" type="image/png" href="${staticServePath}/favicon.png"/>
</head>
<body>
<div class="wrap">
<div class="content">
<div class="logo">
<a href="http://b3log.org" target="_blank">
<img border="0" alt="Solo" title="Solo" src="${staticServePath}/images/logo.jpg"/>
</a>
</div>
<div class="main">
<#nested >
</div>
<span class="clear"></span>
</div>
</div>
<div class="footerWrapper">
<div class="footer">
Powered by <a href="http://b3log.org" target="_blank">B3log 开源</a> • Solo ${version}
</div>
</div>
</body>
</html>
</#macro>
<!DOCTYPE html> <#include "macro-common-page.ftl">
<html>
<head>
<meta charset="utf-8" />
<title>${blogTitle}</title>
<meta name="keywords" content="Solo,Java 博客,开源" />
<meta name="description" content="An open source blog with Java. Java 开源博客" />
<meta name="owner" content="B3log Team" />
<meta name="author" content="B3log Team" />
<meta name="generator" content="Solo" />
<meta name="copyright" content="B3log" />
<meta name="revised" content="B3log, ${year}" />
<meta http-equiv="Window-target" content="_top" />
<link type="text/css" rel="stylesheet" href="${staticServePath}/css/default-init${miniPostfix}.css?${staticResourceVersion}" charset="utf-8" />
<link rel="icon" type="image/png" href="${staticServePath}/favicon.png" />
</head>
<body>
<div class="wrapper">
<div class="wrap">
<div class="content">
<div class="logo">
<a href="http://b3log.org" target="_blank">
<img border="0" width="153" height="56" alt="B3log" title="B3log" src="${staticServePath}/images/logo.jpg"/>
</a>
</div>
<div class="main register">
<h2>${registerSoloUserLabel}</h2>
<div class="form">
<label for="userEmail">
${commentEmail1Label}
</label>
<input id="userEmail" />
<label for="userName">
${userName1Label}
</label>
<input id="userName" />
<label for="userURL">
${userURL1Label}
</label>
<input id="userURL" />
<label for="userPassword">
${userPassword1Label}
</label>
<input type="password" id="userPassword" />
<label for="userPasswordConfirm">
${userPasswordConfirm1Label}
</label>
<input type="password" id="userPasswordConfirm" />
<button onclick='getUserInfo();'>${saveLabel}</button>
<span id="tip" ></span>
</div>
</div>
<span class="clear"></span>
</div>
</div>
<div class="footerWrapper"> <@commonPage "${registerSoloUserLabel}!">
<div class="footer"> <h2>${registerSoloUserLabel}</h2>
&copy; ${year} - <a href="${servePath}">${blogTitle}</a><br/> <div class="form">
Powered by <a href="http://b3log.org" target="_blank">B3log 开源</a><a href="https://hacpai.com/tag/solo" target="_blank">Solo</a> ${version} <label for="userEmail">
</div> ${commentEmail1Label}
</div> </label>
</div> <input id="userEmail" />
<script type="text/javascript" src="${staticServePath}/js/lib/jquery/jquery.min.js" charset="utf-8"></script> <label for="userName">
<script type="text/javascript"> ${userName1Label}
var validate = function() { </label>
var userName = $("#userName").val().replace(/(^\s*)|(\s*$)/g, ""); <input id="userName" />
if (!/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i.test($("#userEmail").val())) { <label for="userURL">
$("#tip").text("${mailInvalidLabel}"); ${userURL1Label}
$("#userEmail").focus(); </label>
} else if (2 > userName.length || userName.length > 20) { <input id="userURL" />
$("#tip").text("${nameTooLongLabel}"); <label for="userPassword">
$("#userName").focus(); ${userPassword1Label}
} else if ($("#userPassword").val() === "") { </label>
$("#tip").text("${passwordEmptyLabel}"); <input type="password" id="userPassword" />
$("#userPassword").focus(); <label for="userPasswordConfirm">
} else if ($("#userPassword").val() !== $("#userPasswordConfirm").val()) { ${userPasswordConfirm1Label}
$("#tip").text("${passwordNotMatchLabel}"); </label>
$("#userPasswordConfirm").focus(); <input type="password" id="userPasswordConfirm" />
} else { <button onclick='getUserInfo();'>${saveLabel}</button>
$("#tip").text(""); <span id="tip" ></span>
return true; </div>
} <script type="text/javascript" src="${staticServePath}/js/lib/jquery/jquery.min.js" charset="utf-8"></script>
return false; <script type="text/javascript">
}; var validate = function() {
var userName = $("#userName").val().replace(/(^\s*)|(\s*$)/g, "");
if (!/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i.test($("#userEmail").val())) {
$("#tip").text("${mailInvalidLabel}");
$("#userEmail").focus();
} else if (2 > userName.length || userName.length > 20) {
$("#tip").text("${nameTooLongLabel}");
$("#userName").focus();
} else if ($("#userPassword").val() === "") {
$("#tip").text("${passwordEmptyLabel}");
$("#userPassword").focus();
} else if ($("#userPassword").val() !== $("#userPasswordConfirm").val()) {
$("#tip").text("${passwordNotMatchLabel}");
$("#userPasswordConfirm").focus();
} else {
$("#tip").text("");
return true;
}
return false;
};
var getUserInfo = function() { var getUserInfo = function() {
if (validate()) { if (validate()) {
var requestJSONObject = { var requestJSONObject = {
"userName": $("#userName").val(), "userName": $("#userName").val(),
"userEmail": $("#userEmail").val(), "userEmail": $("#userEmail").val(),
"userURL": $("#userURL").val(), "userURL": $("#userURL").val(),
"userPassword": $("#userPassword").val() "userPassword": $("#userPassword").val()
}; };
$("#tip").html("<img src='${staticServePath}/images/loading.gif'/> loading...") $("#tip").html("<img src='${staticServePath}/images/loading.gif'/> loading...")
$.ajax({ $.ajax({
url: "${servePath}" + "/console/user/", url: "${servePath}" + "/console/user/",
type: "POST", type: "POST",
cache: false, cache: false,
data: JSON.stringify(requestJSONObject), data: JSON.stringify(requestJSONObject),
success: function(result, textStatus) { success: function(result, textStatus) {
$("#tip").text(result.msg); $("#tip").text(result.msg);
if (!result.sc) { if (!result.sc) {
return; return;
} }
setTimeout(function() { setTimeout(function() {
window.location.href = "${servePath}"; window.location.href = "${servePath}";
}, 1000); }, 1000);
} }
}) })
} }
} }
$(function() { $(function() {
$("#userPasswordConfirm").keypress(function(event) { $("#userPasswordConfirm").keypress(function(event) {
if (event.keyCode === 13) { if (event.keyCode === 13) {
getUserInfo(); getUserInfo();
} }
}); });
});
</script> $('.wrap').css('padding', "40px 0");
</body> });
</html>
</script>
</@commonPage>
\ No newline at end of file
<!DOCTYPE html> <#include "macro-common-page.ftl">
<html>
<head>
<meta charset="utf-8"/>
<title>${forgotLabel} Solo!</title>
<meta name="keywords" content="Solo,Java 博客,开源" />
<meta name="description" content="An open source blog with Java. Java 开源博客" />
<meta name="owner" content="B3log Team"/>
<meta name="author" content="B3log Team"/>
<meta name="generator" content="Solo"/>
<meta name="copyright" content="B3log"/>
<meta name="revised" content="B3log, ${year}"/>
<meta name="robots" content="noindex, follow"/>
<meta http-equiv="Window-target" content="_top"/>
<link type="text/css" rel="stylesheet"
href="${staticServePath}/css/default-init${miniPostfix}.css?${staticResourceVersion}" charset="utf-8"/>
<link rel="icon" type="image/png" href="${staticServePath}/favicon.png"/>
</head>
<body>
<div class="wrapper">
<div class="wrap">
<div class="content">
<div class="logo">
<a href="http://b3log.org" target="_blank">
<img border="0" width="153" height="56" alt="B3log" title="B3log"
src="${staticServePath}/images/logo.jpg"/>
</a>
</div>
<div class="main">
<h2>
${forgotLabel}
</h2>
<#if "email" == inputType>
<div class="form">
<label for="emailOrPassword">
${commentEmailLabel}
</label>
<input id="emailOrPassword"/>
<button id="sendBtn" onclick='forgot();'>${sendLabel}</button>
<span id="tip"></span>
</div>
<#else>
<div class="form">
<label for="emailOrPassword">
${userPasswordLabel}
</label>
<input id="emailOrPassword"/>
<input type="hidden" id="userEmailHidden" value="${userEmailHidden}" />
<button id="sendBtn" onclick='reset();'>${ok}</button>
<span id="tip"></span>
</div>
</#if>
<a href="http://b3log.org" target="_blank"> <@commonPage "${forgotLabel}!">
<img border="0" class="icon" alt="B3log" title="B3log" src="${staticServePath}/favicon.png"/> <h2>
</a> ${forgotLabel}
</div> </h2>
<span class="clear"></span> <#if "email" == inputType>
</div> <div class="form">
</div> <label for="emailOrPassword">
<div class="footerWrapper"> ${commentEmailLabel}
<div class="footer"> </label>
&copy; ${year} - <a href="${servePath}">${blogTitle}</a><br/> <input id="emailOrPassword"/>
Powered by <a href="http://b3log.org" target="_blank">B3log 开源</a><a href="https://hacpai.com/tag/solo" target="_blank">Solo</a> ${version} <button id="sendBtn" onclick='forgot();'>${sendLabel}</button>
</div> <span id="tip"></span>
</div> </div>
</div> <#else>
<script type="text/javascript" src="${staticServePath}/js/lib/jquery/jquery.min.js" charset="utf-8"></script> <div class="form">
<script type="text/javascript"> <label for="emailOrPassword">
(function() { ${userPasswordLabel}
$("#emailOrPassword").focus(); </label>
<input id="emailOrPassword"/>
<input type="hidden" id="userEmailHidden" value="${userEmailHidden}" />
<button id="sendBtn" onclick='reset();'>${ok}</button>
<span id="tip"></span>
</div>
</#if>
$("#emailOrPassword").keypress(function(event) { <script type="text/javascript" src="${staticServePath}/js/lib/jquery/jquery.min.js" charset="utf-8"></script>
if (13 === event.keyCode) { // Enter pressed <script type="text/javascript">
$('#sendBtn').click(); (function() {
} $("#emailOrPassword").focus();
});
// if no JSON, add it. $("#emailOrPassword").keypress(function(event) {
try { if (13 === event.keyCode) { // Enter pressed
JSON $('#sendBtn').click();
} catch (e) { }
document.write("<script src=\"${staticServePath}/js/lib/json2.js\"><\/script>"); });
}
})();
var reset = function() { // if no JSON, add it.
if ($("#emailOrPassword").val() === "") { try {
$("#tip").text("${passwordEmptyLabel}"); JSON
$("#emailOrPassword").focus(); } catch (e) {
return; document.write("<script src=\"${staticServePath}/js/lib/json2.js\"><\/script>");
} }
var requestJSONObject = { })();
"newPwd": $("#emailOrPassword").val(),
"userEmail": $("#userEmailHidden").val()
};
$("#tip").html("<img src='${staticServePath}/images/loading.gif'/> loading..."); var reset = function() {
$.ajax({ if ($("#emailOrPassword").val() === "") {
url: "${servePath}/reset", $("#tip").text("${passwordEmptyLabel}");
type: "POST", $("#emailOrPassword").focus();
contentType: "application/json", return;
data: JSON.stringify(requestJSONObject), }
error: function() { var requestJSONObject = {
// alert("reset password error!"); "newPwd": $("#emailOrPassword").val(),
}, "userEmail": $("#userEmailHidden").val()
success: function(data, textStatus) { };
if (data.succeed) {
window.location.href = data.to;
} else {
$("#tip").text(data.msg);
}
}
});
};
var forgot = function() { $("#tip").html("<img src='${staticServePath}/images/loading.gif'/> loading...");
if (!/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i.test($("#emailOrPassword" + status).val())) { $.ajax({
$("#tip").text("${mailInvalidLabel}"); url: "${servePath}/reset",
$("#emailOrPassword").focus(); type: "POST",
return; contentType: "application/json",
data: JSON.stringify(requestJSONObject),
error: function() {
// alert("reset password error!");
},
success: function(data, textStatus) {
if (data.succeed) {
window.location.href = data.to;
} else {
$("#tip").text(data.msg);
} }
}
});
};
var requestJSONObject = { var forgot = function() {
"userEmail": $("#emailOrPassword").val() if (!/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i.test($("#emailOrPassword" + status).val())) {
}; $("#tip").text("${mailInvalidLabel}");
$("#emailOrPassword").focus();
return;
}
$("#tip").html("<img src='${staticServePath}/images/loading.gif'/> loading...") var requestJSONObject = {
$.ajax({ "userEmail": $("#emailOrPassword").val()
url: "${servePath}/forgot", };
type: "POST",
contentType: "application/json", $("#tip").html("<img src='${staticServePath}/images/loading.gif'/> loading...")
data: JSON.stringify(requestJSONObject), $.ajax({
error: function() { url: "${servePath}/forgot",
// alert("reset password error!"); type: "POST",
}, contentType: "application/json",
success: function(data, textStatus) { data: JSON.stringify(requestJSONObject),
if (data.succeed) { error: function() {
window.location.href = data.to; // alert("reset password error!");
} else { },
$("#tip").text(data.msg); success: function(data, textStatus) {
} if (data.succeed) {
} window.location.href = data.to;
}); } else {
}; $("#tip").text(data.msg);
</script> }
</body> }
</html> });
};
</script>
</@commonPage>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment