Commit d063bde7 authored by Liang Ding's avatar Liang Ding

Merge branch '3.6.0-dev' of https://github.com/b3log/solo into 3.6.0-dev

parents 77827a43 7f5cea3d
...@@ -88,8 +88,6 @@ markdownHelpLabel=<dl><dt>Headings</dt><dd> # First-level heading</dd><dd> #### ...@@ -88,8 +88,6 @@ markdownHelpLabel=<dl><dt>Headings</dt><dd> # First-level heading</dd><dd> ####
<dl><dt>Image</dt><dd>![alt text](/path/to/img.jpg 'Title')</dd></dl>\ <dl><dt>Image</dt><dd>![alt text](/path/to/img.jpg 'Title')</dd></dl>\
<dl><dt><a href='http://daringfireball.net/projects/markdown/syntax' target='_blank'>All Grammar</a></dt></dl> <dl><dt><a href='http://daringfireball.net/projects/markdown/syntax' target='_blank'>All Grammar</a></dt></dl>
editType1Label=Editor Type: editType1Label=Editor Type:
pageLinkLabel=Link
type1Label=Type:
typeLabel=Type typeLabel=Type
onlineVisitor1Label=Online Visitors: onlineVisitor1Label=Online Visitors:
noDataLabel=Lazy guy, has nothing! noDataLabel=Lazy guy, has nothing!
......
...@@ -88,8 +88,6 @@ markdownHelpLabel=<dl><dt>\u6807\u9898</dt><dd> # \u4E00\u7EA7\u6807\u9898</dd>< ...@@ -88,8 +88,6 @@ markdownHelpLabel=<dl><dt>\u6807\u9898</dt><dd> # \u4E00\u7EA7\u6807\u9898</dd><
<dl><dt>\u56FE\u7247</dt><dd>![alt text](/path/to/img.jpg 'Title')</dd></dl>\ <dl><dt>\u56FE\u7247</dt><dd>![alt text](/path/to/img.jpg 'Title')</dd></dl>\
<dl><dt><a href='http://daringfireball.net/projects/markdown/syntax' target='_blank'>\u5B8C\u6574\u8BED\u6CD5</a></dt></dl> <dl><dt><a href='http://daringfireball.net/projects/markdown/syntax' target='_blank'>\u5B8C\u6574\u8BED\u6CD5</a></dt></dl>
editType1Label=\u7F16\u8F91\u5668\u7C7B\u578B\uFF1A editType1Label=\u7F16\u8F91\u5668\u7C7B\u578B\uFF1A
pageLinkLabel=\u94FE\u63A5
type1Label=\u7C7B\u578B\uFF1A
typeLabel=\u7C7B\u578B typeLabel=\u7C7B\u578B
onlineVisitor1Label=\u5F53\u524D\u8BBF\u5BA2\uFF1A onlineVisitor1Label=\u5F53\u524D\u8BBF\u5BA2\uFF1A
noDataLabel=\u8BE5\u5217\u8868\u5F88\u61D2\uFF0C\u4EC0\u4E48\u90FD\u6CA1\u6709\u7559\u4E0B\u3002\u3002\u3002 noDataLabel=\u8BE5\u5217\u8868\u5F88\u61D2\uFF0C\u4EC0\u4E48\u90FD\u6CA1\u6709\u7559\u4E0B\u3002\u3002\u3002
......
...@@ -44,15 +44,7 @@ ...@@ -44,15 +44,7 @@
<option value="_blank">${targetBlankLabel}</option> <option value="_blank">${targetBlankLabel}</option>
<option value="_parent">${targetParentLabel}</option> <option value="_parent">${targetParentLabel}</option>
<option value="_top">${targetTopLabel}</option> <option value="_top">${targetTopLabel}</option>
</select>&nbsp;&nbsp;&nbsp;&nbsp; </select>
<label class="page-list__label">${type1Label}</label>
<button data-type="link" class="selected fn-type">${pageLinkLabel}</button>
<button data-type="page" class="fn-type">${pageLabel}</button>
</div>
<div id="pagePagePanel" class="fn__none">
<div id="pageContent" style="height: 430px;width: 100%;" name="pageContent"></div>
<label>${allowComment1Label}</label>
<input type="checkbox" id="pageCommentable" checked="checked" />
</div> </div>
<div class="fn__right"> <div class="fn__right">
<button onclick="admin.pageList.submit();">${saveLabel}</button> <button onclick="admin.pageList.submit();">${saveLabel}</button>
......
...@@ -104,4 +104,3 @@ $.extend(SoloEditor.prototype, { ...@@ -104,4 +104,3 @@ $.extend(SoloEditor.prototype, {
admin.editors.articleEditor = {} admin.editors.articleEditor = {}
admin.editors.abstractEditor = {} admin.editors.abstractEditor = {}
admin.editors.pageEditor = {}
...@@ -32,7 +32,6 @@ admin.pageList = { ...@@ -32,7 +32,6 @@ admin.pageList = {
currentPage: 1 currentPage: 1
}, },
id: "", id: "",
type: "link",
/* /*
* 初始化 table, pagination, comments dialog * 初始化 table, pagination, comments dialog
*/ */
...@@ -57,11 +56,6 @@ admin.pageList = { ...@@ -57,11 +56,6 @@ admin.pageList = {
text: Label.openMethodLabel, text: Label.openMethodLabel,
index: "pageTarget", index: "pageTarget",
width: 120 width: 120
}, {
style: "padding-left: 12px;",
text: Label.typeLabel,
index: "pageType",
width: 80
}, { }, {
text: Label.commentLabel, text: Label.commentLabel,
index: "comments", index: "comments",
...@@ -71,29 +65,6 @@ admin.pageList = { ...@@ -71,29 +65,6 @@ admin.pageList = {
this.tablePagination.initPagination(); this.tablePagination.initPagination();
this.tablePagination.initCommentsDialog(); this.tablePagination.initCommentsDialog();
this.getList(page); this.getList(page);
admin.editors.pageEditor = new SoloEditor({
id: "pageContent"
});
// select type
$(".fn-type").click(function () {
var $it = $(this);
if ($it.hasClass("selected")) {
return;
}
$(".fn-type").removeClass("selected");
$it.addClass("selected");
admin.pageList.type = $it.data("type");
if (admin.pageList.type === "page") {
$("#pagePagePanel").slideDown();
} else {
$("#pagePagePanel").slideUp();
}
});
}, },
/* /*
* 根据当前页码获取列表 * 根据当前页码获取列表
...@@ -149,7 +120,6 @@ admin.pageList = { ...@@ -149,7 +120,6 @@ admin.pageList = {
pageData[i].pagePermalink = "<a class='no-underline' href='" + pages[i].pagePermalink + "' target='_blank'>" pageData[i].pagePermalink = "<a class='no-underline' href='" + pages[i].pagePermalink + "' target='_blank'>"
+ pages[i].pagePermalink + "</a>"; + pages[i].pagePermalink + "</a>";
pageData[i].pageTarget = pages[i].pageOpenTarget; pageData[i].pageTarget = pages[i].pageOpenTarget;
pageData[i].pageType = pages[i].pageType;
pageData[i].comments = pages[i].pageCommentCount; pageData[i].comments = pages[i].pageCommentCount;
pageData[i].expendRow = "<span><a href='" + pages[i].pagePermalink + "' target='_blank'>" + Label.viewLabel + "</a> \ pageData[i].expendRow = "<span><a href='" + pages[i].pagePermalink + "' target='_blank'>" + Label.viewLabel + "</a> \
<a href='javascript:void(0)' onclick=\"admin.pageList.get('" + pages[i].oId + "')\">" + Label.updateLabel + "</a>\ <a href='javascript:void(0)' onclick=\"admin.pageList.get('" + pages[i].oId + "')\">" + Label.updateLabel + "</a>\
...@@ -188,15 +158,6 @@ admin.pageList = { ...@@ -188,15 +158,6 @@ admin.pageList = {
$("#pagePermalink").val(result.page.pagePermalink); $("#pagePermalink").val(result.page.pagePermalink);
$("#pageTarget").val(result.page.pageOpenTarget); $("#pageTarget").val(result.page.pageOpenTarget);
$("#pageIcon").val(result.page.pageIcon); $("#pageIcon").val(result.page.pageIcon);
if (result.page.pageType === "page") {
$($(".fn-type").get(1)).click();
} else {
$($(".fn-type").get(0)).click();
}
$("#pageCommentable").prop("checked", result.page.pageCommentable);
admin.editors.pageEditor.setContent(result.page.pageContent);
$("#loadMsg").text(""); $("#loadMsg").text("");
} }
}); });
...@@ -249,20 +210,12 @@ admin.pageList = { ...@@ -249,20 +210,12 @@ admin.pageList = {
$("#loadMsg").text(Label.loadingLabel); $("#loadMsg").text(Label.loadingLabel);
$("#tipMsg").text(""); $("#tipMsg").text("");
var pageContent = admin.editors.pageEditor.getContent(); var pagePermalink = Util.proessURL($("#pagePermalink").val().replace(/(^\s*)|(\s*$)/g, ""));
var pagePermalink = $("#pagePermalink").val().replace(/(^\s*)|(\s*$)/g, "");
if (admin.pageList.type === "link") {
pagePermalink = Util.proessURL(pagePermalink);
}
var requestJSONObject = { var requestJSONObject = {
"page": { "page": {
"pageTitle": $("#pageTitle").val(), "pageTitle": $("#pageTitle").val(),
"pageContent": pageContent,
"pagePermalink": pagePermalink, "pagePermalink": pagePermalink,
"pageCommentable": $("#pageCommentable").prop("checked"),
"pageType": admin.pageList.type,
"pageOpenTarget": $("#pageTarget").val(), "pageOpenTarget": $("#pageTarget").val(),
"pageIcon": $("#pageIcon").val() "pageIcon": $("#pageIcon").val()
} }
...@@ -284,11 +237,7 @@ admin.pageList = { ...@@ -284,11 +237,7 @@ admin.pageList = {
$("#pagePermalink").val(""); $("#pagePermalink").val("");
$("#pageTitle").val(""); $("#pageTitle").val("");
$("#pageIcon").val(""); $("#pageIcon").val("");
$("#pageCommentable").prop("cheked", false);
$("#pageTarget").val("_self"); $("#pageTarget").val("_self");
$($(".fn-type").get(0)).click();
admin.editors.pageEditor.setContent("");
if (admin.pageList.pageInfo.currentCount === Label.PAGE_SIZE && if (admin.pageList.pageInfo.currentCount === Label.PAGE_SIZE &&
admin.pageList.pageInfo.currentPage === admin.pageList.pageInfo.pageCount) { admin.pageList.pageInfo.currentPage === admin.pageList.pageInfo.pageCount) {
...@@ -314,22 +263,14 @@ admin.pageList = { ...@@ -314,22 +263,14 @@ admin.pageList = {
$("#loadMsg").text(Label.loadingLabel); $("#loadMsg").text(Label.loadingLabel);
$("#tipMsg").text(""); $("#tipMsg").text("");
var pageContent = admin.editors.pageEditor.getContent(); var pagePermalink = Util.proessURL($("#pagePermalink").val().replace(/(^\s*)|(\s*$)/g, ""));
var pagePermalink = $("#pagePermalink").val().replace(/(^\s*)|(\s*$)/g, "");
if (admin.pageList.type === "link") {
pagePermalink = Util.proessURL(pagePermalink);
}
var requestJSONObject = { var requestJSONObject = {
"page": { "page": {
"pageTitle": $("#pageTitle").val(), "pageTitle": $("#pageTitle").val(),
"oId": this.id, "oId": this.id,
"pageContent": pageContent,
"pagePermalink": pagePermalink, "pagePermalink": pagePermalink,
"pageCommentable": $("#pageCommentable").prop("checked"),
"pageType": admin.pageList.type,
"pageOpenTarget": $("#pageTarget").val(), "pageOpenTarget": $("#pageTarget").val(),
"pageIcon": $("#pageIcon").val() "pageIcon": $("#pageIcon").val()
} }
...@@ -353,12 +294,7 @@ admin.pageList = { ...@@ -353,12 +294,7 @@ admin.pageList = {
$("#pageTitle").val(""); $("#pageTitle").val("");
$("#pageIcon").val(""); $("#pageIcon").val("");
$("#pagePermalink").val(""); $("#pagePermalink").val("");
$("#pageCommentable").prop("cheked", false);
$("#pageTarget").val("_self"); $("#pageTarget").val("_self");
$($(".fn-type").get(0)).click();
admin.editors.pageEditor.setContent("");
$("#loadMsg").text(""); $("#loadMsg").text("");
} }
}); });
...@@ -371,8 +307,7 @@ admin.pageList = { ...@@ -371,8 +307,7 @@ admin.pageList = {
if ($("#pageTitle").val().replace(/\s/g, "") === "") { if ($("#pageTitle").val().replace(/\s/g, "") === "") {
$("#tipMsg").text(Label.titleEmptyLabel); $("#tipMsg").text(Label.titleEmptyLabel);
$("#pageTitle").focus(); $("#pageTitle").focus();
} else if (admin.pageList.type === "link" && } else if ($("#pagePermalink").val().replace(/\s/g, "") === "") {
$("#pagePermalink").val().replace(/\s/g, "") === "") {
$("#tipMsg").text(Label.linkEmptyLabel); $("#tipMsg").text(Label.linkEmptyLabel);
} else { } else {
return true; return true;
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
* *
* @author <a href="http://vanessa.b3log.org">Liyuan Li</a> * @author <a href="http://vanessa.b3log.org">Liyuan Li</a>
* @author <a href="http://88250.b3log.org">Liang Ding</a> * @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 2.2.0.2, Apr 2, 2019 * @version 2.2.0.3, Apr 18, 2019
*/ */
var Page = function (tips) { var Page = function (tips) {
this.currentCommentId = '' this.currentCommentId = ''
...@@ -322,11 +322,7 @@ $.extend(Page.prototype, { ...@@ -322,11 +322,7 @@ $.extend(Page.prototype, {
*/ */
submitComment: function () { submitComment: function () {
var that = this, var that = this,
tips = this.tips, tips = this.tips
type = 'article'
if (tips.externalRelevantArticlesDisplayCount === undefined) {
type = 'page'
}
if (vditor.getValue().length > 1 && vditor.getValue().length < 500) { if (vditor.getValue().length > 1 && vditor.getValue().length < 500) {
$('#soloEditorAdd').attr('disabled', 'disabled') $('#soloEditorAdd').attr('disabled', 'disabled')
...@@ -341,7 +337,7 @@ $.extend(Page.prototype, { ...@@ -341,7 +337,7 @@ $.extend(Page.prototype, {
$.ajax({ $.ajax({
type: 'POST', type: 'POST',
url: Label.servePath + '/' + type + '/comments', url: Label.servePath + '/article/comments',
cache: false, cache: false,
contentType: 'application/json', contentType: 'application/json',
data: JSON.stringify(requestJSONObject), data: JSON.stringify(requestJSONObject),
......
...@@ -558,10 +558,6 @@ button#submitArticle:hover { ...@@ -558,10 +558,6 @@ button#submitArticle:hover {
border-color: #ec6459; border-color: #ec6459;
} }
#pagePagePanel {
margin-top: 0;
}
/* end article */ /* end article */
/* start preference */ /* start preference */
......
Subproject commit 0d277a9b0eab083a0daf007f8b9674747182c1b5 Subproject commit c699f2ff8542bf20f1660b9f981f139745406529
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