Van
2019-02-21 18:16:59 +08:00
parent d7e9db917c
commit 755eb33471
134 changed files with 1846 additions and 1598 deletions

File diff suppressed because one or more lines are too long

View File

@@ -1 +1,18 @@
/*
* Solo - A small and beautiful blogging system written in Java.
* Copyright (c) 2010-2019, b3log.org & hacpai.com
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
function convertEntities(t){var e,n;if(e=function(t){if(/&[^;]+;/.test(t)){var e=document.createElement("div");return e.innerHTML=t,e.firstChild?e.firstChild.nodeValue:t}return t},"string"==typeof t)return e(t);if("object"==typeof t)for(n in t)"string"==typeof t[n]&&(t[n]=e(t[n]));return t}

View File

@@ -83,7 +83,7 @@ $.extend(Page.prototype, {
* @param {String} state 用于区别回复评论还是对文章的评论
*/
validateComment: function (state) {
if (Util.isLoggedIn()) {
if (latkeConfig.isLoggedIn === "true") {
var commenterContent = $("#comment" + state).val().replace(/(^\s*)|(\s*$)/g, "");
if (2 > commenterContent.length || commenterContent.length > 500) {
$("#commentErrorTip" + state).html(this.tips.commentContentCannotEmptyLabel);
@@ -412,7 +412,7 @@ $.extend(Page.prototype, {
$(this).attr("src", latkeConfig.servePath + "/captcha.do?code=" + Math.random());
});
// cookie
if (!Util.isLoggedIn()) {
if (latkeConfig.isLoggedIn !== "true") {
$("#commentEmail").val(Cookie.readCookie("commentEmail"));
$("#commentURL").val(Cookie.readCookie("commentURL"));
$("#commentName").val(Cookie.readCookie("commentName"));
@@ -560,7 +560,7 @@ $.extend(Page.prototype, {
"commentContent": $("#comment" + state).val().replace(/(^\s*)|(\s*$)/g, "")
};
if (!Util.isLoggedIn()) {
if (latkeConfig.isLoggedIn !== "true") {
requestJSONObject = {
"oId": tips.oId,
"commentContent": $("#comment" + state).val().replace(/(^\s*)|(\s*$)/g, ""),
@@ -590,7 +590,7 @@ $.extend(Page.prototype, {
$("#commentErrorTip" + state).html(result.msg);
$("#commentValidate" + state).val('');
$("#captcha" + state).click();
if (!Util.isLoggedIn()) {
if (latkeConfig.isLoggedIn !== "true") {
$("#captcha" + state).attr("src", latkeConfig.servePath + "/captcha.do?code=" + Math.random());
}
@@ -601,7 +601,7 @@ $.extend(Page.prototype, {
$("#commentName" + state).val(result.commentName); // Server processed XSS
result.replyNameHTML = "";
if (!Util.isLoggedIn()) {
if (latkeConfig.isLoggedIn !== "true") {
$("#captcha" + state).attr("src", latkeConfig.servePath + "/captcha.do?code=" + Math.random());
if ($("#commentURL" + state).val().replace(/\s/g, "") === "") {
result.replyNameHTML = '<a>' + $("#commentName" + state).val() + '</a>';
@@ -612,8 +612,8 @@ $.extend(Page.prototype, {
result.userName = result.commentName;
} else {
result.replyNameHTML = '<a href="' + window.location.host +
'" target="_blank">' + Util.getUserName() + '</a>';
result.userName = Util.getUserName();
'" target="_blank">' + latkeConfig.userName + '</a>';
result.userName = latkeConfig.userName;
}
if (typeof(addComment) === "undefined") { // https://github.com/b3log/solo/issues/12246

File diff suppressed because one or more lines are too long

View File

@@ -1 +1,18 @@
/*
* Solo - A small and beautiful blogging system written in Java.
* Copyright (c) 2010-2019, b3log.org & hacpai.com
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
!function(){var o=function(o){layer.msg(o,{time:2e3})},i=function(o){return Cookie.readCookie(o)},n=function(o,i,n){Cookie.createCookie(o,i,n)};750<$("body").width()&&""==i("showTips")&&""==i("isShowTips")&&"/"==top.location.pathname&&navigator.cookieEnabled&&layer.confirm("客官您好,<b> "+$("#logofont").text()+" </b>欢迎您的访问,已默认为您开启图标悬浮提示,是否需要显示悬浮提示?",{btn:["留着吧","消失一周","再想想"],closeBtn:!1,time:9999,title:!1,success:function(o){o.find(".layui-layer-btn .layui-layer-btn0").css({"border-color":"#333","background-color":"#666"})}},function(){n("isShowTips","1",90),o("<b>好嘞~</b>")},function(){n("showTips","0",7),o("<b><i>7</i> 天内访问将不再提示!<b>")},function(){layer.closeAll()})}();

View File

@@ -1 +1,18 @@
/*
* Solo - A small and beautiful blogging system written in Java.
* Copyright (c) 2010-2019, b3log.org & hacpai.com
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
var Yilia={init:function(){Util.killIE(),this._initToc(),this.resetTags(),$(window).scroll(function(){0<$("article").length&&0===$("article.post").length&&$("article:not(.show)").each(function(){$(this).offset().top<=$(window).scrollTop()+$(window).height()-$(this).height()/7&&$(this).addClass("show")}),$(window).scrollTop()>$(window).height()?$(".icon-goup").show():$(".icon-goup").hide(),$(document).height()-$("body").height()-300<$(window).scrollTop()?$("#backBtm").hide():$("#backBtm").show(),1===$("article.post").length&&$("article.post").addClass("show")}),$(window).scroll()},_initToc:function(){if(0===$(".b3-solo-list li").length)return!1;$(".side footer").after('<div class="toc"><a href="javascript:$(\'.side .toc\').hide()" class="close">X</a></div>'),$(".side .toc a").after($(".b3-solo-list")),$(".side .toc-btn").show()},resetTags:function(){$("a.tag").each(function(t){$(this).addClass("color"+Math.ceil(4*Math.random()))})},share:function(){$(".share span").click(function(){var t=$(this).data("type"),i=encodeURIComponent($("title").text()),o=$(".post-title a").attr("href")?$(".post-title a").attr("href"):location,e=$(".post-content img:eq(0)").attr("src"),s={};s.qq="http://connect.qq.com/widget/shareqq/index.html?title="+i+"&url="+o,s.tencent="http://share.v.t.qq.com/index.php?c=share&a=index&title="+i+"&url="+o+"&pic="+e,s.weibo="http://v.t.sina.com.cn/share/share.php?title="+i+"&url="+o+"&pic="+e,s.google="https://plus.google.com/share?url="+o,s.twitter="https://twitter.com/intent/tweet?status="+i+" "+o,window.open(s[t],"_blank","top=100,left=200,width=720,height=618")})}};Yilia.init();