Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
solo-1
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
solo-1
Commits
608548d5
Unverified
Commit
608548d5
authored
Jan 25, 2020
by
Liang Ding
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
✨
Markdown 支持改进 #54
parent
fd2d2c6c
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
200 additions
and
83 deletions
+200
-83
src/main/java/org/b3log/solo/model/Option.java
src/main/java/org/b3log/solo/model/Option.java
+29
-8
src/main/java/org/b3log/solo/service/InitService.java
src/main/java/org/b3log/solo/service/InitService.java
+31
-1
src/main/java/org/b3log/solo/util/Markdowns.java
src/main/java/org/b3log/solo/util/Markdowns.java
+12
-2
src/main/resources/admin/admin-preference.ftl
src/main/resources/admin/admin-preference.ftl
+54
-1
src/main/resources/js/admin/admin.min.js
src/main/resources/js/admin/admin.min.js
+1
-1
src/main/resources/js/admin/preference.js
src/main/resources/js/admin/preference.js
+57
-66
src/main/resources/lang_en_US.properties
src/main/resources/lang_en_US.properties
+8
-2
src/main/resources/lang_zh_CN.properties
src/main/resources/lang_zh_CN.properties
+8
-2
No files found.
src/main/java/org/b3log/solo/model/Option.java
View file @
608548d5
...
...
@@ -26,7 +26,7 @@ import org.json.JSONObject;
*
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @author <a href="https://github.com/hzchendou">hzchendou</a>
* @version 1.6.0.
4, Jan 24
, 2020
* @version 1.6.0.
5, Jan 25
, 2020
* @since 0.6.0
*/
public
final
class
Option
{
...
...
@@ -52,11 +52,37 @@ public final class Option {
public
static
final
String
OPTION_CATEGORY
=
"optionCategory"
;
// oId constants
/**
* Key of inline math allow digit after open marker flag. 内联数学公式是否允许起始 $ 后紧跟数字 https://github.com/88250/solo/issues/54
*/
public
static
final
String
ID_C_IMADAOM
=
"inlineMathAllowDigitAfterOpenMarker"
;
/**
* Key of chinese punct flag. 中文后跟英文逗号句号等标点替换为中文对应标点 https://github.com/88250/solo/issues/54
*/
public
static
final
String
ID_C_CHINESE_PUNCT
=
"chinesePunct"
;
/**
* Key of fix term typo flag. 术语修正 https://github.com/88250/solo/issues/54
*/
public
static
final
String
ID_C_FIX_TERM_TYPO
=
"fixTermTypo"
;
/**
* Key of show ToC flag. 支持 ToC 显示 https://github.com/88250/solo/issues/52
* Key of auto space flag. 中西文间自动插入空格 https://github.com/88250/solo/issues/54
*/
public
static
final
String
ID_C_AUTO_SPACE
=
"autoSpace"
;
/**
* Key of show ToC flag. 支持 [ToC] https://github.com/88250/solo/issues/54
*/
public
static
final
String
ID_C_SHOW_TOC
=
"showToC"
;
/**
* Key of footnotes flag. 支持脚注 https://github.com/88250/solo/issues/54
*/
public
static
final
String
ID_C_FOOTNOTES
=
"footnotes"
;
/**
* Key of show code block line num flag. 支持代码块行号显示 https://github.com/88250/solo/issues/4
*/
...
...
@@ -310,16 +336,11 @@ public final class Option {
* Default preference.
*
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 2.3.0.
5, Jan 24
, 2020
* @version 2.3.0.
6, Jan 25
, 2020
* @since 0.3.1
*/
public
static
final
class
DefaultPreference
{
/**
* Default show ToC.
*/
public
static
final
String
DEFAULT_SHOW_TOC
=
"false"
;
/**
* Default show code block line num.
*/
...
...
src/main/java/org/b3log/solo/service/InitService.java
View file @
608548d5
...
...
@@ -472,12 +472,42 @@ public class InitService {
private
void
initOptions
(
final
JSONObject
requestJSONObject
)
throws
Exception
{
LOGGER
.
debug
(
"Initializing preference...."
);
final
JSONObject
IMADAOMOpt
=
new
JSONObject
();
IMADAOMOpt
.
put
(
Keys
.
OBJECT_ID
,
Option
.
ID_C_IMADAOM
);
IMADAOMOpt
.
put
(
Option
.
OPTION_CATEGORY
,
Option
.
CATEGORY_C_PREFERENCE
);
IMADAOMOpt
.
put
(
Option
.
OPTION_VALUE
,
"false"
);
optionRepository
.
add
(
IMADAOMOpt
);
final
JSONObject
chinesePunctOpt
=
new
JSONObject
();
chinesePunctOpt
.
put
(
Keys
.
OBJECT_ID
,
Option
.
ID_C_CHINESE_PUNCT
);
chinesePunctOpt
.
put
(
Option
.
OPTION_CATEGORY
,
Option
.
CATEGORY_C_PREFERENCE
);
chinesePunctOpt
.
put
(
Option
.
OPTION_VALUE
,
"true"
);
optionRepository
.
add
(
chinesePunctOpt
);
final
JSONObject
fixTermTypoOpt
=
new
JSONObject
();
fixTermTypoOpt
.
put
(
Keys
.
OBJECT_ID
,
Option
.
ID_C_FIX_TERM_TYPO
);
fixTermTypoOpt
.
put
(
Option
.
OPTION_CATEGORY
,
Option
.
CATEGORY_C_PREFERENCE
);
fixTermTypoOpt
.
put
(
Option
.
OPTION_VALUE
,
"true"
);
optionRepository
.
add
(
fixTermTypoOpt
);
final
JSONObject
autoSpaceOpt
=
new
JSONObject
();
autoSpaceOpt
.
put
(
Keys
.
OBJECT_ID
,
Option
.
ID_C_AUTO_SPACE
);
autoSpaceOpt
.
put
(
Option
.
OPTION_CATEGORY
,
Option
.
CATEGORY_C_PREFERENCE
);
autoSpaceOpt
.
put
(
Option
.
OPTION_VALUE
,
"true"
);
optionRepository
.
add
(
autoSpaceOpt
);
final
JSONObject
showToCOpt
=
new
JSONObject
();
showToCOpt
.
put
(
Keys
.
OBJECT_ID
,
Option
.
ID_C_SHOW_TOC
);
showToCOpt
.
put
(
Option
.
OPTION_CATEGORY
,
Option
.
CATEGORY_C_PREFERENCE
);
showToCOpt
.
put
(
Option
.
OPTION_VALUE
,
DefaultPreference
.
DEFAULT_SHOW_TOC
);
showToCOpt
.
put
(
Option
.
OPTION_VALUE
,
"false"
);
optionRepository
.
add
(
showToCOpt
);
final
JSONObject
footnotesOpt
=
new
JSONObject
();
footnotesOpt
.
put
(
Keys
.
OBJECT_ID
,
Option
.
ID_C_FOOTNOTES
);
footnotesOpt
.
put
(
Option
.
OPTION_CATEGORY
,
Option
.
CATEGORY_C_PREFERENCE
);
footnotesOpt
.
put
(
Option
.
OPTION_VALUE
,
"true"
);
optionRepository
.
add
(
footnotesOpt
);
final
JSONObject
showCodeBlockLnOpt
=
new
JSONObject
();
showCodeBlockLnOpt
.
put
(
Keys
.
OBJECT_ID
,
Option
.
ID_C_SHOW_CODE_BLOCK_LN
);
showCodeBlockLnOpt
.
put
(
Option
.
OPTION_CATEGORY
,
Option
.
CATEGORY_C_PREFERENCE
);
...
...
src/main/java/org/b3log/solo/util/Markdowns.java
View file @
608548d5
...
...
@@ -60,7 +60,7 @@ import java.util.concurrent.*;
* </p>
*
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 2.3.1.1
4, Jan 24
, 2020
* @version 2.3.1.1
5, Jan 25
, 2020
* @since 0.4.5
*/
public
final
class
Markdowns
{
...
...
@@ -113,7 +113,12 @@ public final class Markdowns {
public
static
boolean
LUTE_AVAILABLE
;
public
static
boolean
SHOW_CODE_BLOCK_LN
=
false
;
public
static
boolean
FOOTNOTES
=
false
;
public
static
boolean
SHOW_TOC
=
false
;
public
static
boolean
AUTO_SPACE
=
false
;
public
static
boolean
FIX_TERM_TYPO
=
false
;
public
static
boolean
CHINESE_PUNCT
=
false
;
public
static
boolean
IMADAOM
=
false
;
/**
* Clears cache.
...
...
@@ -269,9 +274,14 @@ public final class Markdowns {
final
URL
url
=
new
URL
(
LUTE_ENGINE_URL
);
final
HttpURLConnection
conn
=
(
HttpURLConnection
)
url
.
openConnection
();
conn
.
setRequestProperty
(
"X-CodeSyntaxHighlightLineNum"
,
String
.
valueOf
(
Markdowns
.
SHOW_CODE_BLOCK_LN
));
conn
.
setRequestProperty
(
"X-Footnotes"
,
String
.
valueOf
(
Markdowns
.
FOOTNOTES
));
conn
.
setRequestProperty
(
"X-ToC"
,
String
.
valueOf
(
Markdowns
.
SHOW_TOC
));
conn
.
setRequestProperty
(
"X-AutoSpace"
,
String
.
valueOf
(
Markdowns
.
AUTO_SPACE
));
conn
.
setRequestProperty
(
"X-FixTermTypo"
,
String
.
valueOf
(
Markdowns
.
FIX_TERM_TYPO
));
conn
.
setRequestProperty
(
"X-ChinesePunct"
,
String
.
valueOf
(
Markdowns
.
CHINESE_PUNCT
));
conn
.
setRequestProperty
(
"X-IMADAOM"
,
String
.
valueOf
(
Markdowns
.
IMADAOM
));
conn
.
setConnectTimeout
(
100
);
conn
.
setReadTimeout
(
1
000
);
conn
.
setReadTimeout
(
3
000
);
conn
.
setDoOutput
(
true
);
try
(
final
OutputStream
outputStream
=
conn
.
getOutputStream
())
{
...
...
src/main/resources/admin/admin-preference.ftl
View file @
608548d5
...
...
@@ -34,6 +34,11 @@
<a href="#tools/preference/setting">${paramSettingsLabel}</a>
</div>
</li>
<li>
<div id="tabPreference_markdown">
<a href="#tools/preference/markdown">Markdown</a>
</div>
</li>
</ul>
</div>
<div id="tabPreferencePanel" class="sub-tabs-main">
...
...
@@ -185,7 +190,7 @@
</label>
<label>
<div class="fn__flex-inline">
${s
how
ToCLabel}
${s
upport
ToCLabel}
<input id="showToC" type="checkbox" class="normalInput"/>
</div>
</label>
...
...
@@ -249,5 +254,53 @@
<button onclick="admin.preference.update()" class="fn__right">${updateLabel}</button>
<div class="fn__clear"></div>
</div>
<div id="tabPreferencePanel_markdown" class="fn__none form">
<div class="fn__clear">
${luteHTTPLabel}
</div>
<button class="fn__right" onclick="admin.preference.update()">${updateLabel}</button>
<div class="fn__flex">
<div class="fn__flex-1">
<label>
<div class="fn__flex-inline">
<input id="footnotes" type="checkbox" class="normalInput"/>
${supportFootnotesLabel}
</div>
</label>
<label>
<div class="fn__flex-inline">
<input id="showToC" type="checkbox" class="normalInput"/>
${supportToCLabel}
</div>
</label>
<label>
<div class="fn__flex-inline">
<input id="autoSpace" type="checkbox" class="normalInput"/>
${autoSpaceLabel}
</div>
</label>
<label>
<div class="fn__flex-inline">
<input id="fixTermTypo" type="checkbox" class="normalInput"/>
${fixTermTypoLabel}
</div>
</label>
<label>
<div class="fn__flex-inline">
<input id="chinesePunct" type="checkbox" class="normalInput"/>
${chinesePunctLabel}
</div>
</label>
<label>
<div class="fn__flex-inline">
<input id="inlineMathAllowDigitAfterOpenMarker" type="checkbox" class="normalInput"/>
${inlineMathAllowDigitAfterOpenMarkerLabel}
</div>
</label>
</div>
</div>
<button class="fn__right" onclick="admin.preference.update()">${updateLabel}</button>
<div class="fn__clear"></div>
</div>
</div>
${plugins}
src/main/resources/js/admin/admin.min.js
View file @
608548d5
...
...
@@ -310,7 +310,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _tab
/*! no static exports found */
/***/
(
function
(
module
,
exports
)
{
eval
(
"
/*
\r\n
* Solo - A small and beautiful blogging system written in Java.
\r\n
* Copyright (c) 2010-present, b3log.org
\r\n
*
\r\n
* This program is free software: you can redistribute it and/or modify
\r\n
* it under the terms of the GNU Affero General Public License as published by
\r\n
* the Free Software Foundation, either version 3 of the License, or
\r\n
* (at your option) any later version.
\r\n
*
\r\n
* This program is distributed in the hope that it will be useful,
\r\n
* but WITHOUT ANY WARRANTY; without even the implied warranty of
\r\n
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r\n
* GNU Affero General Public License for more details.
\r\n
*
\r\n
* You should have received a copy of the GNU Affero General Public License
\r\n
* along with this program. If not, see <https://www.gnu.org/licenses/>.
\r\n
*/
\n\n
/**
\r\n
* preference for admin.
\r\n
*
\r\n
* @author <a href=
\"
http://vanessa.b3log.org
\"
>Liyuan Li</a>
\r\n
* @author <a href=
\"
http://88250.b3log.org
\"
>Liang Ding</a>
\r\n
* @version 1.3.0.4, Jan 24, 2020
\r\n
*/
\n\n
/* preference 相关操作 */
\n
admin.preference = {
\n
locale: '',
\n\n
/*
\r\n
* 初始化
\r\n
*/
\n
init: function init() {
\n
$('#tabPreference').tabs();
\n
$.ajax({
\n
url: Label.servePath + '/console/preference/',
\n
type: 'GET',
\n
cache: false,
\n
success: function success(result, textStatus) {
\n
$('#tipMsg').text(result.msg);
\n\n
if (!result.sc) {
\n
$('#loadMsg').text('');
\n
return;
\n
}
\n\n
var preference = result.preference;
\n
$('#metaKeywords').val(preference.metaKeywords);
\n
$('#metaDescription').val(preference.metaDescription);
\n
$('#blogTitle').val(preference.blogTitle);
\n
$('#blogSubtitle').val(preference.blogSubtitle);
\n
$('#mostCommentArticleDisplayCount').val(preference.mostCommentArticleDisplayCount);
\n
$('#mostViewArticleDisplayCount').val(preference.mostViewArticleDisplayCount);
\n
$('#recentCommentDisplayCount').val(preference.recentCommentDisplayCount);
\n
$('#mostUsedTagDisplayCount').val(preference.mostUsedTagDisplayCount);
\n
$('#articleListDisplayCount').val(preference.articleListDisplayCount);
\n
$('#articleListPaginationWindowSize').val(preference.articleListPaginationWindowSize);
\n
$('#localeString').val(preference.localeString);
\n
$('#timeZoneId').val(preference.timeZoneId);
\n
$('#noticeBoard').val(preference.noticeBoard);
\n
$('#footerContent').val(preference.footerContent);
\n
$('#htmlHead').val(preference.htmlHead);
\n
$('#externalRelevantArticlesDisplayCount').val(preference.externalRelevantArticlesDisplayCount);
\n
$('#relevantArticlesDisplayCount').val(preference.relevantArticlesDisplayCount);
\n
$('#randomArticlesDisplayCount').val(preference.randomArticlesDisplayCount);
\n
$('#customVars').val(preference.customVars);
\n
'true' === preference.enableArticleUpdateHint ? $('#enableArticleUpdateHint').attr('checked', 'checked') : $('#enableArticleUpdateHint').removeAttr('checked');
\n
'true' === preference.allowVisitDraftViaPermalink ? $('#allowVisitDraftViaPermalink').attr('checked', 'checked') : $('
allowVisitDraftViaPermalink').removeAttr('checked');
\n
'true' === preference.commentable ? $('#commentable').attr('checked', 'checked') : $('commentable').removeAttr('checked');
\n
'true' === preference.syncGitHub ? $('#syncGitHub').attr('checked', 'checked') : $('syncGitHub').removeAttr('checked');
\n
'true' === preference.pullGitHub ? $('#pullGitHub').attr('checked', 'checked') : $('pullGitHub').removeAttr('checked');
\n
'true' === preference.showCodeBlockLn ? $('#showCodeBlockLn').attr('checked', 'checked') : $('showCodeBlockLn').removeAttr('checked');
\n
'true' === preference.showToC ? $('#showToC').attr('checked', 'checked') : $('showToC').removeAttr('checked');
\n
admin.preference.locale = preference.localeString; // sign
\n\n
var signs = eval('(' + preference.signs + ')');
\n\n
for (var j = 1; j < signs.length; j++) {
\n
$('#preferenceSign' + j).val(signs[j].signHTML);
\n
}
\n\n
$('#articleListDisplay').val(preference.articleListStyle);
\n
$('#hljsTheme').val(preference.hljsTheme);
\n
$('#feedOutputMode').val(preference.feedOutputMode);
\n
$('#feedOutputCnt').val(preference.feedOutputCnt);
\n
$('#faviconURL').val(preference.faviconURL);
\n
$('#loadMsg').text('');
\n
}
\n
});
\n
},
\n\n
/*
\r\n
* @description 参数校验
\r\n
*/
\n
validate: function validate() {
\n
if (!/^
\\
d+$/.test($('#mostUsedTagDisplayCount').val())) {
\n
$('#tipMsg').text('[' + Label.paramSettingsLabel + ' - ' + Label.indexTagDisplayCntLabel + '] ' + Label.nonNegativeIntegerOnlyLabel);
\n
$('#mostUsedTagDisplayCount').focus();
\n
return false;
\n
} else if (!/^
\\
d+$/.test($('#recentCommentDisplayCount').val())) {
\n
$('#tipMsg').text('[' + Label.paramSettingsLabel + ' - ' + Label.indexRecentCommentDisplayCntLabel + '] ' + Label.nonNegativeIntegerOnlyLabel);
\n
$('#recentCommentDisplayCount').focus();
\n
return false;
\n
} else if (!/^
\\
d+$/.test($('#mostCommentArticleDisplayCount').val())) {
\n
$('#tipMsg').text('[' + Label.paramSettingsLabel + ' - ' + Label.indexMostCommentArticleDisplayCntLabel + '] ' + Label.nonNegativeIntegerOnlyLabel);
\n
$('#mostCommentArticleDisplayCount').focus();
\n
return false;
\n
} else if (!/^
\\
d+$/.test($('#mostViewArticleDisplayCount').val())) {
\n
$('#tipMsg').text('[' + Label.paramSettingsLabel + ' - ' + Label.indexMostViewArticleDisplayCntLabel + '] ' + Label.nonNegativeIntegerOnlyLabel);
\n
$('#mostViewArticleDisplayCount').focus();
\n
return false;
\n
} else if (!/^
\\
d+$/.test($('#articleListDisplayCount').val())) {
\n
$('#tipMsg').text('[' + Label.paramSettingsLabel + ' - ' + Label.pageSizeLabel + '] ' + Label.nonNegativeIntegerOnlyLabel);
\n
$('#articleListDisplayCount').focus();
\n
return false;
\n
} else if (!/^
\\
d+$/.test($('#articleListPaginationWindowSize').val())) {
\n
$('#tipMsg').text('[' + Label.paramSettingsLabel + ' - ' + Label.windowSizeLabel + '] ' + Label.nonNegativeIntegerOnlyLabel);
\n
$('#articleListPaginationWindowSize').focus();
\n
return false;
\n
} else if (!/^
\\
d+$/.test($('#randomArticlesDisplayCount').val())) {
\n
$('#tipMsg').text('[' + Label.paramSettingsLabel + ' - ' + Label.randomArticlesDisplayCntLabel + '] ' + Label.nonNegativeIntegerOnlyLabel);
\n
$('#randomArticlesDisplayCount').focus();
\n
return false;
\n
} else if (!/^
\\
d+$/.test($('#relevantArticlesDisplayCount').val())) {
\n
$('#tipMsg').text('[' + Label.paramSettingsLabel + ' - ' + Label.relevantArticlesDisplayCntLabel + '] ' + Label.nonNegativeIntegerOnlyLabel);
\n
$('#relevantArticlesDisplayCount').focus();
\n
return false;
\n
} else if (!/^
\\
d+$/.test($('#externalRelevantArticlesDisplayCount').val())) {
\n
$('#tipMsg').text('[' + Label.paramSettingsLabel + ' - ' + Label.externalRelevantArticlesDisplayCntLabel + '] ' + Label.nonNegativeIntegerOnlyLabel);
\n
$('#externalRelevantArticlesDisplayCount').focus();
\n
return false;
\n
}
\n\n
return true;
\n
},
\n\n
/*
\r\n
* @description 更新
\r\n
*/
\n
update: function update() {
\n
if (!admin.preference.validate()) {
\n
return;
\n
}
\n\n
$('#tipMsg').text('');
\n
$('#loadMsg').text(Label.loadingLabel);
\n
var signs = [{
\n
'oId': 0,
\n
'signHTML': ''
\n
}, {
\n
'oId': 1,
\n
'signHTML': $('#preferenceSign1').val()
\n
}, {
\n
'oId': 2,
\n
'signHTML': $('#preferenceSign2').val()
\n
}, {
\n
'oId': 3,
\n
'signHTML': $('#preferenceSign3').val()
\n
}];
\n
var requestJSONObject = {
\n
'preference': {
\n
'metaKeywords': $('#metaKeywords').val(),
\n
'metaDescription': $('#metaDescription').val(),
\n
'blogTitle': $('#blogTitle').val(),
\n
'blogSubtitle': $('#blogSubtitle').val(),
\n
'mostCommentArticleDisplayCount': $('#mostCommentArticleDisplayCount').val(),
\n
'mostViewArticleDisplayCount': $('#mostViewArticleDisplayCount').val(),
\n
'recentCommentDisplayCount': $('#recentCommentDisplayCount').val(),
\n
'mostUsedTagDisplayCount': $('#mostUsedTagDisplayCount').val(),
\n
'articleListDisplayCount': $('#articleListDisplayCount').val(),
\n
'articleListPaginationWindowSize': $('#articleListPaginationWindowSize').val(),
\n
'localeString': $('#localeString').val(),
\n
'timeZoneId': $('#timeZoneId').val(),
\n
'noticeBoard': $('#noticeBoard').val(),
\n
'footerContent': $('#footerContent').val(),
\n
'htmlHead': $('#htmlHead').val(),
\n
'externalRelevantArticlesDisplayCount': $('#externalRelevantArticlesDisplayCount').val(),
\n
'relevantArticlesDisplayCount': $('#relevantArticlesDisplayCount').val(),
\n
'randomArticlesDisplayCount': $('#randomArticlesDisplayCount').val(),
\n
'enableArticleUpdateHint': $('#enableArticleUpdateHint').prop('checked'),
\n
'signs': signs,
\n
'allowVisitDraftViaPermalink': $('#allowVisitDraftViaPermalink').prop('checked'),
\n
'articleListStyle': $('#articleListDisplay').val(),
\n
'hljsTheme': $('#hljsTheme').val(),
\n
'feedOutputMode': $('#feedOutputMode').val(),
\n
'feedOutputCnt': $('#feedOutputCnt').val(),
\n
'faviconURL': $('#faviconURL').val(),
\n
'syncGitHub': $('#syncGitHub').prop('checked'),
\n
'pullGitHub': $('#pullGitHub').prop('checked'),
\n
'showCodeBlockLn': $('#showCodeBlockLn').prop('checked'),
\n
'showToC': $('#showToC').prop('checked'),
\n
'commentable': $('#commentable').prop('checked'),
\n
'customVars': $('#customVars').val(
)
\n
}
\n
};
\n
$.ajax({
\n
url: Label.servePath + '/console/preference/',
\n
type: 'PUT',
\n
cache: false,
\n
data: JSON.stringify(requestJSONObject),
\n
success: function success(result, textStatus) {
\n
$('#tipMsg').text(result.msg);
\n\n
if (!result.sc) {
\n
$('#loadMsg').text('');
\n
return;
\n
}
\n\n
if ($('#localeString').val() !== admin.preference.locale) {
\n
window.location.reload();
\n
}
\n\n
$('#loadMsg').text('');
\n
}
\n
});
\n
}
\n
};
\n
/*
\r\n
* 注册到 admin 进行管理
\r\n
*/
\n\n
admin.register['preference'] = {
\n
'obj': admin.preference,
\n
'init': admin.preference.init,
\n
'refresh': function refresh() {
\n
admin.clearTip();
\n
}
\n
};
\n\n
//# sourceURL=webpack:///./src/main/resources/js/admin/preference.js?
"
);
eval
(
"
/*
\r\n
* Solo - A small and beautiful blogging system written in Java.
\r\n
* Copyright (c) 2010-present, b3log.org
\r\n
*
\r\n
* This program is free software: you can redistribute it and/or modify
\r\n
* it under the terms of the GNU Affero General Public License as published by
\r\n
* the Free Software Foundation, either version 3 of the License, or
\r\n
* (at your option) any later version.
\r\n
*
\r\n
* This program is distributed in the hope that it will be useful,
\r\n
* but WITHOUT ANY WARRANTY; without even the implied warranty of
\r\n
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r\n
* GNU Affero General Public License for more details.
\r\n
*
\r\n
* You should have received a copy of the GNU Affero General Public License
\r\n
* along with this program. If not, see <https://www.gnu.org/licenses/>.
\r\n
*/
\n\n
/**
\r\n
* preference for admin.
\r\n
*
\r\n
* @author <a href=
\"
http://vanessa.b3log.org
\"
>Liyuan Li</a>
\r\n
* @author <a href=
\"
http://88250.b3log.org
\"
>Liang Ding</a>
\r\n
* @version 1.3.0.4, Jan 24, 2020
\r\n
*/
\n\n
/* preference 相关操作 */
\n
admin.preference = {
\n
locale: '',
\n\n
/*
\r\n
* 初始化
\r\n
*/
\n
init: function init() {
\n
$('#tabPreference').tabs();
\n
$.ajax({
\n
url: Label.servePath + '/console/preference/',
\n
type: 'GET',
\n
cache: false,
\n
success: function success(result, textStatus) {
\n
$('#tipMsg').text(result.msg);
\n\n
if (!result.sc) {
\n
$('#loadMsg').text('');
\n
return;
\n
}
\n\n
var preference = result.preference;
\n
$('#metaKeywords').val(preference.metaKeywords);
\n
$('#metaDescription').val(preference.metaDescription);
\n
$('#blogTitle').val(preference.blogTitle);
\n
$('#blogSubtitle').val(preference.blogSubtitle);
\n
$('#mostCommentArticleDisplayCount').val(preference.mostCommentArticleDisplayCount);
\n
$('#mostViewArticleDisplayCount').val(preference.mostViewArticleDisplayCount);
\n
$('#recentCommentDisplayCount').val(preference.recentCommentDisplayCount);
\n
$('#mostUsedTagDisplayCount').val(preference.mostUsedTagDisplayCount);
\n
$('#articleListDisplayCount').val(preference.articleListDisplayCount);
\n
$('#articleListPaginationWindowSize').val(preference.articleListPaginationWindowSize);
\n
$('#localeString').val(preference.localeString);
\n
$('#timeZoneId').val(preference.timeZoneId);
\n
$('#noticeBoard').val(preference.noticeBoard);
\n
$('#footerContent').val(preference.footerContent);
\n
$('#htmlHead').val(preference.htmlHead);
\n
$('#externalRelevantArticlesDisplayCount').val(preference.externalRelevantArticlesDisplayCount);
\n
$('#relevantArticlesDisplayCount').val(preference.relevantArticlesDisplayCount);
\n
$('#randomArticlesDisplayCount').val(preference.randomArticlesDisplayCount);
\n
$('#customVars').val(preference.customVars);
\n
'true' === preference.enableArticleUpdateHint ? $('#enableArticleUpdateHint').attr('checked', 'checked') : $('#enableArticleUpdateHint').removeAttr('checked');
\n
'true' === preference.allowVisitDraftViaPermalink ? $('#allowVisitDraftViaPermalink').attr('checked', 'checked') : $('
#allowVisitDraftViaPermalink').removeAttr('checked');
\n
'true' === preference.commentable ? $('#commentable').attr('checked', 'checked') : $('#commentable').removeAttr('checked');
\n
'true' === preference.syncGitHub ? $('#syncGitHub').attr('checked', 'checked') : $('#syncGitHub').removeAttr('checked');
\n
'true' === preference.pullGitHub ? $('#pullGitHub').attr('checked', 'checked') : $('#pullGitHub').removeAttr('checked');
\n
'true' === preference.showCodeBlockLn ? $('#showCodeBlockLn').attr('checked', 'checked') : $('#showCodeBlockLn').removeAttr('checked');
\n
'true' === preference.footnotes ? $('#footnotes').attr('checked', 'checked') : $('#footnotes').removeAttr('checked');
\n
'true' === preference.showToC ? $('#showToC').attr('checked', 'checked') : $('#showToC').removeAttr('checked');
\n
'true' === preference.autoSpace ? $('#autoSpace').attr('checked', 'checked') : $('#autoSpace').removeAttr('checked');
\n
'true' === preference.fixTermTypo ? $('#fixTermTypo').attr('checked', 'checked') : $('#fixTermTypo').removeAttr('checked');
\n
'true' === preference.chinesePunct ? $('#chinesePunct').attr('checked', 'checked') : $('#chinesePunct').removeAttr('checked');
\n
'true' === preference.inlineMathAllowDigitAfterOpenMarker ? $('#inlineMathAllowDigitAfterOpenMarker').attr('checked', 'checked') : $('#inlineMathAllowDigitAfterOpenMarker').removeAttr('checked');
\n
admin.preference.locale = preference.localeString; // sign
\n\n
var signs = eval('(' + preference.signs + ')');
\n\n
for (var j = 1; j < signs.length; j++) {
\n
$('#preferenceSign' + j).val(signs[j].signHTML);
\n
}
\n\n
$('#articleListDisplay').val(preference.articleListStyle);
\n
$('#hljsTheme').val(preference.hljsTheme);
\n
$('#feedOutputMode').val(preference.feedOutputMode);
\n
$('#feedOutputCnt').val(preference.feedOutputCnt);
\n
$('#faviconURL').val(preference.faviconURL);
\n
$('#loadMsg').text('');
\n
}
\n
});
\n
},
\n\n
/*
\r\n
* @description 参数校验
\r\n
*/
\n
validate: function validate() {
\n
if (!/^
\\
d+$/.test($('#mostUsedTagDisplayCount').val())) {
\n
$('#tipMsg').text('[' + Label.paramSettingsLabel + ' - ' + Label.indexTagDisplayCntLabel + '] ' + Label.nonNegativeIntegerOnlyLabel);
\n
$('#mostUsedTagDisplayCount').focus();
\n
return false;
\n
} else if (!/^
\\
d+$/.test($('#recentCommentDisplayCount').val())) {
\n
$('#tipMsg').text('[' + Label.paramSettingsLabel + ' - ' + Label.indexRecentCommentDisplayCntLabel + '] ' + Label.nonNegativeIntegerOnlyLabel);
\n
$('#recentCommentDisplayCount').focus();
\n
return false;
\n
} else if (!/^
\\
d+$/.test($('#mostCommentArticleDisplayCount').val())) {
\n
$('#tipMsg').text('[' + Label.paramSettingsLabel + ' - ' + Label.indexMostCommentArticleDisplayCntLabel + '] ' + Label.nonNegativeIntegerOnlyLabel);
\n
$('#mostCommentArticleDisplayCount').focus();
\n
return false;
\n
} else if (!/^
\\
d+$/.test($('#mostViewArticleDisplayCount').val())) {
\n
$('#tipMsg').text('[' + Label.paramSettingsLabel + ' - ' + Label.indexMostViewArticleDisplayCntLabel + '] ' + Label.nonNegativeIntegerOnlyLabel);
\n
$('#mostViewArticleDisplayCount').focus();
\n
return false;
\n
} else if (!/^
\\
d+$/.test($('#articleListDisplayCount').val())) {
\n
$('#tipMsg').text('[' + Label.paramSettingsLabel + ' - ' + Label.pageSizeLabel + '] ' + Label.nonNegativeIntegerOnlyLabel);
\n
$('#articleListDisplayCount').focus();
\n
return false;
\n
} else if (!/^
\\
d+$/.test($('#articleListPaginationWindowSize').val())) {
\n
$('#tipMsg').text('[' + Label.paramSettingsLabel + ' - ' + Label.windowSizeLabel + '] ' + Label.nonNegativeIntegerOnlyLabel);
\n
$('#articleListPaginationWindowSize').focus();
\n
return false;
\n
} else if (!/^
\\
d+$/.test($('#randomArticlesDisplayCount').val())) {
\n
$('#tipMsg').text('[' + Label.paramSettingsLabel + ' - ' + Label.randomArticlesDisplayCntLabel + '] ' + Label.nonNegativeIntegerOnlyLabel);
\n
$('#randomArticlesDisplayCount').focus();
\n
return false;
\n
} else if (!/^
\\
d+$/.test($('#relevantArticlesDisplayCount').val())) {
\n
$('#tipMsg').text('[' + Label.paramSettingsLabel + ' - ' + Label.relevantArticlesDisplayCntLabel + '] ' + Label.nonNegativeIntegerOnlyLabel);
\n
$('#relevantArticlesDisplayCount').focus();
\n
return false;
\n
} else if (!/^
\\
d+$/.test($('#externalRelevantArticlesDisplayCount').val())) {
\n
$('#tipMsg').text('[' + Label.paramSettingsLabel + ' - ' + Label.externalRelevantArticlesDisplayCntLabel + '] ' + Label.nonNegativeIntegerOnlyLabel);
\n
$('#externalRelevantArticlesDisplayCount').focus();
\n
return false;
\n
}
\n\n
return true;
\n
},
\n\n
/*
\r\n
* @description 更新
\r\n
*/
\n
update: function update() {
\n
if (!admin.preference.validate()) {
\n
return;
\n
}
\n\n
$('#tipMsg').text('');
\n
$('#loadMsg').text(Label.loadingLabel);
\n
var signs = [{
\n
'oId': 0,
\n
'signHTML': ''
\n
}, {
\n
'oId': 1,
\n
'signHTML': $('#preferenceSign1').val()
\n
}, {
\n
'oId': 2,
\n
'signHTML': $('#preferenceSign2').val()
\n
}, {
\n
'oId': 3,
\n
'signHTML': $('#preferenceSign3').val()
\n
}];
\n
var requestJSONObject = {
\n
'preference': {
\n
'metaKeywords': $('#metaKeywords').val(),
\n
'metaDescription': $('#metaDescription').val(),
\n
'blogTitle': $('#blogTitle').val(),
\n
'blogSubtitle': $('#blogSubtitle').val(),
\n
'mostCommentArticleDisplayCount': $('#mostCommentArticleDisplayCount').val(),
\n
'mostViewArticleDisplayCount': $('#mostViewArticleDisplayCount').val(),
\n
'recentCommentDisplayCount': $('#recentCommentDisplayCount').val(),
\n
'mostUsedTagDisplayCount': $('#mostUsedTagDisplayCount').val(),
\n
'articleListDisplayCount': $('#articleListDisplayCount').val(),
\n
'articleListPaginationWindowSize': $('#articleListPaginationWindowSize').val(),
\n
'localeString': $('#localeString').val(),
\n
'timeZoneId': $('#timeZoneId').val(),
\n
'noticeBoard': $('#noticeBoard').val(),
\n
'footerContent': $('#footerContent').val(),
\n
'htmlHead': $('#htmlHead').val(),
\n
'externalRelevantArticlesDisplayCount': $('#externalRelevantArticlesDisplayCount').val(),
\n
'relevantArticlesDisplayCount': $('#relevantArticlesDisplayCount').val(),
\n
'randomArticlesDisplayCount': $('#randomArticlesDisplayCount').val(),
\n
'enableArticleUpdateHint': $('#enableArticleUpdateHint').prop('checked'),
\n
'signs': signs,
\n
'allowVisitDraftViaPermalink': $('#allowVisitDraftViaPermalink').prop('checked'),
\n
'articleListStyle': $('#articleListDisplay').val(),
\n
'hljsTheme': $('#hljsTheme').val(),
\n
'feedOutputMode': $('#feedOutputMode').val(),
\n
'feedOutputCnt': $('#feedOutputCnt').val(),
\n
'faviconURL': $('#faviconURL').val(),
\n
'syncGitHub': $('#syncGitHub').prop('checked'),
\n
'pullGitHub': $('#pullGitHub').prop('checked'),
\n
'showCodeBlockLn': $('#showCodeBlockLn').prop('checked'),
\n
'commentable': $('#commentable').prop('checked'),
\n
'customVars': $('#customVars').val(),
\n
'footnotes': $('#footnotes').prop('checked'),
\n
'showToC': $('#showToC').prop('checked'),
\n
'autoSpace': $('#autoSpace').prop('checked'),
\n
'fixTermTypo': $('#fixTermTypo').prop('checked'),
\n
'chinesePunct': $('#chinesePunct').prop('checked'),
\n
'inlineMathAllowDigitAfterOpenMarker': $('#inlineMathAllowDigitAfterOpenMarker').prop('checked'
)
\n
}
\n
};
\n
$.ajax({
\n
url: Label.servePath + '/console/preference/',
\n
type: 'PUT',
\n
cache: false,
\n
data: JSON.stringify(requestJSONObject),
\n
success: function success(result, textStatus) {
\n
$('#tipMsg').text(result.msg);
\n\n
if (!result.sc) {
\n
$('#loadMsg').text('');
\n
return;
\n
}
\n\n
if ($('#localeString').val() !== admin.preference.locale) {
\n
window.location.reload();
\n
}
\n\n
$('#loadMsg').text('');
\n
}
\n
});
\n
}
\n
};
\n
/*
\r\n
* 注册到 admin 进行管理
\r\n
*/
\n\n
admin.register['preference'] = {
\n
'obj': admin.preference,
\n
'init': admin.preference.init,
\n
'refresh': function refresh() {
\n
admin.clearTip();
\n
}
\n
};
\n\n
//# sourceURL=webpack:///./src/main/resources/js/admin/preference.js?
"
);
/***/
}),
...
...
src/main/resources/js/admin/preference.js
View file @
608548d5
...
...
@@ -49,36 +49,35 @@ admin.preference = {
$
(
'
#metaDescription
'
).
val
(
preference
.
metaDescription
)
$
(
'
#blogTitle
'
).
val
(
preference
.
blogTitle
)
$
(
'
#blogSubtitle
'
).
val
(
preference
.
blogSubtitle
)
$
(
'
#mostCommentArticleDisplayCount
'
).
val
(
preference
.
mostCommentArticleDisplayCount
)
$
(
'
#mostViewArticleDisplayCount
'
).
val
(
preference
.
mostViewArticleDisplayCount
)
$
(
'
#recentCommentDisplayCount
'
).
val
(
preference
.
recentCommentDisplayCount
)
$
(
'
#mostCommentArticleDisplayCount
'
).
val
(
preference
.
mostCommentArticleDisplayCount
)
$
(
'
#mostViewArticleDisplayCount
'
).
val
(
preference
.
mostViewArticleDisplayCount
)
$
(
'
#recentCommentDisplayCount
'
).
val
(
preference
.
recentCommentDisplayCount
)
$
(
'
#mostUsedTagDisplayCount
'
).
val
(
preference
.
mostUsedTagDisplayCount
)
$
(
'
#articleListDisplayCount
'
).
val
(
preference
.
articleListDisplayCount
)
$
(
'
#articleListPaginationWindowSize
'
).
val
(
preference
.
articleListPaginationWindowSize
)
$
(
'
#articleListPaginationWindowSize
'
).
val
(
preference
.
articleListPaginationWindowSize
)
$
(
'
#localeString
'
).
val
(
preference
.
localeString
)
$
(
'
#timeZoneId
'
).
val
(
preference
.
timeZoneId
)
$
(
'
#noticeBoard
'
).
val
(
preference
.
noticeBoard
)
$
(
'
#footerContent
'
).
val
(
preference
.
footerContent
)
$
(
'
#htmlHead
'
).
val
(
preference
.
htmlHead
)
$
(
'
#externalRelevantArticlesDisplayCount
'
).
val
(
preference
.
externalRelevantArticlesDisplayCount
)
$
(
'
#relevantArticlesDisplayCount
'
).
val
(
preference
.
relevantArticlesDisplayCount
)
$
(
'
#randomArticlesDisplayCount
'
).
val
(
preference
.
randomArticlesDisplayCount
)
$
(
'
#externalRelevantArticlesDisplayCount
'
).
val
(
preference
.
externalRelevantArticlesDisplayCount
)
$
(
'
#relevantArticlesDisplayCount
'
).
val
(
preference
.
relevantArticlesDisplayCount
)
$
(
'
#randomArticlesDisplayCount
'
).
val
(
preference
.
randomArticlesDisplayCount
)
$
(
'
#customVars
'
).
val
(
preference
.
customVars
)
'
true
'
===
preference
.
enableArticleUpdateHint
?
$
(
'
#enableArticleUpdateHint
'
).
attr
(
'
checked
'
,
'
checked
'
)
:
$
(
'
#enableArticleUpdateHint
'
).
removeAttr
(
'
checked
'
)
'
true
'
===
preference
.
allowVisitDraftViaPermalink
?
$
(
'
#allowVisitDraftViaPermalink
'
).
attr
(
'
checked
'
,
'
checked
'
)
:
$
(
'
allowVisitDraftViaPermalink
'
).
removeAttr
(
'
checked
'
)
'
true
'
===
preference
.
commentable
?
$
(
'
#commentable
'
).
attr
(
'
checked
'
,
'
checked
'
)
:
$
(
'
commentable
'
).
removeAttr
(
'
checked
'
)
'
true
'
===
preference
.
syncGitHub
?
$
(
'
#syncGitHub
'
).
attr
(
'
checked
'
,
'
checked
'
)
:
$
(
'
syncGitHub
'
).
removeAttr
(
'
checked
'
)
'
true
'
===
preference
.
pullGitHub
?
$
(
'
#pullGitHub
'
).
attr
(
'
checked
'
,
'
checked
'
)
:
$
(
'
pullGitHub
'
).
removeAttr
(
'
checked
'
)
'
true
'
===
preference
.
showCodeBlockLn
?
$
(
'
#showCodeBlockLn
'
).
attr
(
'
checked
'
,
'
checked
'
)
:
$
(
'
showCodeBlockLn
'
).
removeAttr
(
'
checked
'
)
'
true
'
===
preference
.
showToC
?
$
(
'
#showToC
'
).
attr
(
'
checked
'
,
'
checked
'
)
:
$
(
'
showToC
'
).
removeAttr
(
'
checked
'
)
'
true
'
===
preference
.
allowVisitDraftViaPermalink
?
$
(
'
#allowVisitDraftViaPermalink
'
).
attr
(
'
checked
'
,
'
checked
'
)
:
$
(
'
#allowVisitDraftViaPermalink
'
).
removeAttr
(
'
checked
'
)
'
true
'
===
preference
.
commentable
?
$
(
'
#commentable
'
).
attr
(
'
checked
'
,
'
checked
'
)
:
$
(
'
#commentable
'
).
removeAttr
(
'
checked
'
)
'
true
'
===
preference
.
syncGitHub
?
$
(
'
#syncGitHub
'
).
attr
(
'
checked
'
,
'
checked
'
)
:
$
(
'
#syncGitHub
'
).
removeAttr
(
'
checked
'
)
'
true
'
===
preference
.
pullGitHub
?
$
(
'
#pullGitHub
'
).
attr
(
'
checked
'
,
'
checked
'
)
:
$
(
'
#pullGitHub
'
).
removeAttr
(
'
checked
'
)
'
true
'
===
preference
.
showCodeBlockLn
?
$
(
'
#showCodeBlockLn
'
).
attr
(
'
checked
'
,
'
checked
'
)
:
$
(
'
#showCodeBlockLn
'
).
removeAttr
(
'
checked
'
)
'
true
'
===
preference
.
footnotes
?
$
(
'
#footnotes
'
).
attr
(
'
checked
'
,
'
checked
'
)
:
$
(
'
#footnotes
'
).
removeAttr
(
'
checked
'
)
'
true
'
===
preference
.
showToC
?
$
(
'
#showToC
'
).
attr
(
'
checked
'
,
'
checked
'
)
:
$
(
'
#showToC
'
).
removeAttr
(
'
checked
'
)
'
true
'
===
preference
.
autoSpace
?
$
(
'
#autoSpace
'
).
attr
(
'
checked
'
,
'
checked
'
)
:
$
(
'
#autoSpace
'
).
removeAttr
(
'
checked
'
)
'
true
'
===
preference
.
fixTermTypo
?
$
(
'
#fixTermTypo
'
).
attr
(
'
checked
'
,
'
checked
'
)
:
$
(
'
#fixTermTypo
'
).
removeAttr
(
'
checked
'
)
'
true
'
===
preference
.
chinesePunct
?
$
(
'
#chinesePunct
'
).
attr
(
'
checked
'
,
'
checked
'
)
:
$
(
'
#chinesePunct
'
).
removeAttr
(
'
checked
'
)
'
true
'
===
preference
.
inlineMathAllowDigitAfterOpenMarker
?
$
(
'
#inlineMathAllowDigitAfterOpenMarker
'
).
attr
(
'
checked
'
,
'
checked
'
)
:
$
(
'
#inlineMathAllowDigitAfterOpenMarker
'
).
removeAttr
(
'
checked
'
)
admin
.
preference
.
locale
=
preference
.
localeString
...
...
@@ -103,63 +102,54 @@ admin.preference = {
*/
validate
:
function
()
{
if
(
!
/^
\d
+$/
.
test
(
$
(
'
#mostUsedTagDisplayCount
'
).
val
()))
{
$
(
'
#tipMsg
'
).
text
(
'
[
'
+
Label
.
paramSettingsLabel
+
'
-
'
+
$
(
'
#tipMsg
'
).
text
(
'
[
'
+
Label
.
paramSettingsLabel
+
'
-
'
+
Label
.
indexTagDisplayCntLabel
+
'
]
'
+
Label
.
nonNegativeIntegerOnlyLabel
)
$
(
'
#mostUsedTagDisplayCount
'
).
focus
()
return
false
}
else
if
(
!
/^
\d
+$/
.
test
(
$
(
'
#recentCommentDisplayCount
'
).
val
()))
{
$
(
'
#tipMsg
'
).
text
(
'
[
'
+
Label
.
paramSettingsLabel
+
'
-
'
+
$
(
'
#tipMsg
'
).
text
(
'
[
'
+
Label
.
paramSettingsLabel
+
'
-
'
+
Label
.
indexRecentCommentDisplayCntLabel
+
'
]
'
+
Label
.
nonNegativeIntegerOnlyLabel
)
$
(
'
#recentCommentDisplayCount
'
).
focus
()
return
false
}
else
if
(
!
/^
\d
+$/
.
test
(
$
(
'
#mostCommentArticleDisplayCount
'
).
val
()))
{
$
(
'
#tipMsg
'
).
text
(
'
[
'
+
Label
.
paramSettingsLabel
+
'
-
'
+
$
(
'
#tipMsg
'
).
text
(
'
[
'
+
Label
.
paramSettingsLabel
+
'
-
'
+
Label
.
indexMostCommentArticleDisplayCntLabel
+
'
]
'
+
Label
.
nonNegativeIntegerOnlyLabel
)
$
(
'
#mostCommentArticleDisplayCount
'
).
focus
()
return
false
}
else
if
(
!
/^
\d
+$/
.
test
(
$
(
'
#mostViewArticleDisplayCount
'
).
val
()))
{
$
(
'
#tipMsg
'
).
text
(
'
[
'
+
Label
.
paramSettingsLabel
+
'
-
'
+
$
(
'
#tipMsg
'
).
text
(
'
[
'
+
Label
.
paramSettingsLabel
+
'
-
'
+
Label
.
indexMostViewArticleDisplayCntLabel
+
'
]
'
+
Label
.
nonNegativeIntegerOnlyLabel
)
$
(
'
#mostViewArticleDisplayCount
'
).
focus
()
return
false
}
else
if
(
!
/^
\d
+$/
.
test
(
$
(
'
#articleListDisplayCount
'
).
val
()))
{
$
(
'
#tipMsg
'
).
text
(
'
[
'
+
Label
.
paramSettingsLabel
+
'
-
'
+
Label
.
pageSizeLabel
+
$
(
'
#tipMsg
'
).
text
(
'
[
'
+
Label
.
paramSettingsLabel
+
'
-
'
+
Label
.
pageSizeLabel
+
'
]
'
+
Label
.
nonNegativeIntegerOnlyLabel
)
$
(
'
#articleListDisplayCount
'
).
focus
()
return
false
}
else
if
(
!
/^
\d
+$/
.
test
(
$
(
'
#articleListPaginationWindowSize
'
).
val
()))
{
$
(
'
#tipMsg
'
).
text
(
'
[
'
+
Label
.
paramSettingsLabel
+
'
-
'
+
Label
.
windowSizeLabel
+
$
(
'
#tipMsg
'
).
text
(
'
[
'
+
Label
.
paramSettingsLabel
+
'
-
'
+
Label
.
windowSizeLabel
+
'
]
'
+
Label
.
nonNegativeIntegerOnlyLabel
)
$
(
'
#articleListPaginationWindowSize
'
).
focus
()
return
false
}
else
if
(
!
/^
\d
+$/
.
test
(
$
(
'
#randomArticlesDisplayCount
'
).
val
()))
{
$
(
'
#tipMsg
'
).
text
(
'
[
'
+
Label
.
paramSettingsLabel
+
'
-
'
+
$
(
'
#tipMsg
'
).
text
(
'
[
'
+
Label
.
paramSettingsLabel
+
'
-
'
+
Label
.
randomArticlesDisplayCntLabel
+
'
]
'
+
Label
.
nonNegativeIntegerOnlyLabel
)
$
(
'
#randomArticlesDisplayCount
'
).
focus
()
return
false
}
else
if
(
!
/^
\d
+$/
.
test
(
$
(
'
#relevantArticlesDisplayCount
'
).
val
()))
{
$
(
'
#tipMsg
'
).
text
(
'
[
'
+
Label
.
paramSettingsLabel
+
'
-
'
+
$
(
'
#tipMsg
'
).
text
(
'
[
'
+
Label
.
paramSettingsLabel
+
'
-
'
+
Label
.
relevantArticlesDisplayCntLabel
+
'
]
'
+
Label
.
nonNegativeIntegerOnlyLabel
)
$
(
'
#relevantArticlesDisplayCount
'
).
focus
()
return
false
}
else
if
(
!
/^
\d
+$/
.
test
(
$
(
'
#externalRelevantArticlesDisplayCount
'
).
val
()))
{
$
(
'
#tipMsg
'
).
text
(
'
[
'
+
Label
.
paramSettingsLabel
+
'
-
'
+
$
(
'
#tipMsg
'
).
text
(
'
[
'
+
Label
.
paramSettingsLabel
+
'
-
'
+
Label
.
externalRelevantArticlesDisplayCntLabel
+
'
]
'
+
Label
.
nonNegativeIntegerOnlyLabel
)
$
(
'
#externalRelevantArticlesDisplayCount
'
).
focus
()
...
...
@@ -190,7 +180,8 @@ admin.preference = {
},
{
'
oId
'
:
3
,
'
signHTML
'
:
$
(
'
#preferenceSign3
'
).
val
(),
}]
}
]
var
requestJSONObject
=
{
'
preference
'
:
{
...
...
@@ -198,14 +189,12 @@ admin.preference = {
'
metaDescription
'
:
$
(
'
#metaDescription
'
).
val
(),
'
blogTitle
'
:
$
(
'
#blogTitle
'
).
val
(),
'
blogSubtitle
'
:
$
(
'
#blogSubtitle
'
).
val
(),
'
mostCommentArticleDisplayCount
'
:
$
(
'
#mostCommentArticleDisplayCount
'
).
val
(),
'
mostCommentArticleDisplayCount
'
:
$
(
'
#mostCommentArticleDisplayCount
'
).
val
(),
'
mostViewArticleDisplayCount
'
:
$
(
'
#mostViewArticleDisplayCount
'
).
val
(),
'
recentCommentDisplayCount
'
:
$
(
'
#recentCommentDisplayCount
'
).
val
(),
'
mostUsedTagDisplayCount
'
:
$
(
'
#mostUsedTagDisplayCount
'
).
val
(),
'
articleListDisplayCount
'
:
$
(
'
#articleListDisplayCount
'
).
val
(),
'
articleListPaginationWindowSize
'
:
$
(
'
#articleListPaginationWindowSize
'
).
val
(),
'
articleListPaginationWindowSize
'
:
$
(
'
#articleListPaginationWindowSize
'
).
val
(),
'
localeString
'
:
$
(
'
#localeString
'
).
val
(),
'
timeZoneId
'
:
$
(
'
#timeZoneId
'
).
val
(),
'
noticeBoard
'
:
$
(
'
#noticeBoard
'
).
val
(),
...
...
@@ -213,14 +202,11 @@ admin.preference = {
'
htmlHead
'
:
$
(
'
#htmlHead
'
).
val
(),
'
externalRelevantArticlesDisplayCount
'
:
$
(
'
#externalRelevantArticlesDisplayCount
'
).
val
(),
'
relevantArticlesDisplayCount
'
:
$
(
'
#relevantArticlesDisplayCount
'
).
val
(),
'
relevantArticlesDisplayCount
'
:
$
(
'
#relevantArticlesDisplayCount
'
).
val
(),
'
randomArticlesDisplayCount
'
:
$
(
'
#randomArticlesDisplayCount
'
).
val
(),
'
enableArticleUpdateHint
'
:
$
(
'
#enableArticleUpdateHint
'
).
prop
(
'
checked
'
),
'
enableArticleUpdateHint
'
:
$
(
'
#enableArticleUpdateHint
'
).
prop
(
'
checked
'
),
'
signs
'
:
signs
,
'
allowVisitDraftViaPermalink
'
:
$
(
'
#allowVisitDraftViaPermalink
'
).
prop
(
'
checked
'
),
'
allowVisitDraftViaPermalink
'
:
$
(
'
#allowVisitDraftViaPermalink
'
).
prop
(
'
checked
'
),
'
articleListStyle
'
:
$
(
'
#articleListDisplay
'
).
val
(),
'
hljsTheme
'
:
$
(
'
#hljsTheme
'
).
val
(),
'
feedOutputMode
'
:
$
(
'
#feedOutputMode
'
).
val
(),
...
...
@@ -229,9 +215,14 @@ admin.preference = {
'
syncGitHub
'
:
$
(
'
#syncGitHub
'
).
prop
(
'
checked
'
),
'
pullGitHub
'
:
$
(
'
#pullGitHub
'
).
prop
(
'
checked
'
),
'
showCodeBlockLn
'
:
$
(
'
#showCodeBlockLn
'
).
prop
(
'
checked
'
),
'
showToC
'
:
$
(
'
#showToC
'
).
prop
(
'
checked
'
),
'
commentable
'
:
$
(
'
#commentable
'
).
prop
(
'
checked
'
),
'
customVars
'
:
$
(
'
#customVars
'
).
val
(),
'
footnotes
'
:
$
(
'
#footnotes
'
).
prop
(
'
checked
'
),
'
showToC
'
:
$
(
'
#showToC
'
).
prop
(
'
checked
'
),
'
autoSpace
'
:
$
(
'
#autoSpace
'
).
prop
(
'
checked
'
),
'
fixTermTypo
'
:
$
(
'
#fixTermTypo
'
).
prop
(
'
checked
'
),
'
chinesePunct
'
:
$
(
'
#chinesePunct
'
).
prop
(
'
checked
'
),
'
inlineMathAllowDigitAfterOpenMarker
'
:
$
(
'
#inlineMathAllowDigitAfterOpenMarker
'
).
prop
(
'
checked
'
),
},
}
...
...
src/main/resources/lang_en_US.properties
View file @
608548d5
...
...
@@ -18,13 +18,19 @@
#
# Description: Solo language configurations(en_US).
# Version: 2.3
8.0.0, Jan 24
, 2020
# Version: 2.3
9.0.0, Jan 25
, 2020
# Author: Liang Ding
# Author: Liyuan Li
# Author: Dongxu Wang
#
showToCLabel
=
Support Markdown [TOC] (need <a href="https://hacpai.com/article/1569240189601" target="_blank">Lute-HTTP</a>):
inlineMathAllowDigitAfterOpenMarkerLabel
=
Whether inline math formulas allow a starting $ followed by a number
chinesePunctLabel
=
Chinese punctuation followed by English comma and period are replaced with Chinese corresponding punctuation
fixTermTypoLabel
=
Fix term typo
autoSpaceLabel
=
Automatically insert spaces between Chinese and Western languages
supportFootnotesLabel
=
Support footnotes
supportToCLabel
=
Support [TOC]
luteHTTPLabel
=
The following features are based on <a href="https://hacpai.com/article/1569240189601" target="_blank">Lute-HTTP</a>.
showCodeBlockLnLabel
=
Show code block line num:
siteURLLabel
=
Site URL:
siteGenedLabel
=
Site generated, target dir is [{dir}]
...
...
src/main/resources/lang_zh_CN.properties
View file @
608548d5
...
...
@@ -18,13 +18,19 @@
#
# Description: Solo default language configurations(zh_CN).
# Version: 2.3
8.0.0, Jan 24
, 2020
# Version: 2.3
9.0.0, Jan 25
, 2020
# Author: Liang Ding
# Author: Liyuan Li
# Author: Dongxu Wang
#
showToCLabel
=
\u
652F
\u6301
Markdown [TOC]
\u
FF08
\u9700\u
542F
\u7528
<a href="https://hacpai.com/article/1569240189601" target="_blank">Lute-HTTP</a>
\u
FF09
\u
FF1A
inlineMathAllowDigitAfterOpenMarkerLabel
=
\u5185\u8054\u6570\u
5B66
\u
516C
\u
5F0F
\u
662F
\u5426\u5141\u
8BB8
\u
8D77
\u
59CB $
\u
540E
\u
7D27
\u
8DDF
\u6570\u
5B57
chinesePunctLabel
=
\u
4E2D
\u6587\u
540E
\u
8DDF
\u
82F1
\u6587\u9017\u
53F7
\u
53E5
\u
53F7
\u
7B49
\u6807\u
70B9
\u
66FF
\u6362\u
4E3A
\u
4E2D
\u6587\u
5BF9
\u
5E94
\u6807\u
70B9
fixTermTypoLabel
=
\u
672F
\u
8BED
\u
4FEE
\u
6B63
autoSpaceLabel
=
\u
4E2D
\u
897F
\u6587\u
95F4
\u
81EA
\u
52A8
\u
63D2
\u5165\u
7A7A
\u
683C
supportFootnotesLabel
=
\u
652F
\u6301\u
811A
\u
6CE8
supportToCLabel
=
\u
652F
\u6301
[TOC]
luteHTTPLabel
=
\u
4EE5
\u
4E0B
\u
914D
\u
7F6E
\u9879\u9700\u
542F
\u7528
<a href="https://hacpai.com/article/1569240189601" target="_blank">Lute-HTTP</a>
\u
5F15
\u
64CE
\u
624D
\u
80FD
\u
5F97
\u5230\u
652F
\u6301\u3002
showCodeBlockLnLabel
=
\u
4EE3
\u7801\u5757\u
663E
\u
793A
\u
884C
\u
53F7
\u
FF1A
siteURLLabel
=
\u
7AD9
\u
70B9
\u5730\u5740\u
FF1A
siteGenedLabel
=
\u
7AD9
\u
70B9
\u
751F
\u6210\u
5B8C
\u
6BD5
\u
FF0C
\u
8BF7
\u
67E5
\u
770B
\u
76EE
\u
5F55 [{dir}]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment