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> ####
<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>
editType1Label=Editor Type:
pageLinkLabel=Link
type1Label=Type:
typeLabel=Type
onlineVisitor1Label=Online Visitors:
noDataLabel=Lazy guy, has nothing!
......
......@@ -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><a href='http://daringfireball.net/projects/markdown/syntax' target='_blank'>\u5B8C\u6574\u8BED\u6CD5</a></dt></dl>
editType1Label=\u7F16\u8F91\u5668\u7C7B\u578B\uFF1A
pageLinkLabel=\u94FE\u63A5
type1Label=\u7C7B\u578B\uFF1A
typeLabel=\u7C7B\u578B
onlineVisitor1Label=\u5F53\u524D\u8BBF\u5BA2\uFF1A
noDataLabel=\u8BE5\u5217\u8868\u5F88\u61D2\uFF0C\u4EC0\u4E48\u90FD\u6CA1\u6709\u7559\u4E0B\u3002\u3002\u3002
......
......@@ -44,15 +44,7 @@
<option value="_blank">${targetBlankLabel}</option>
<option value="_parent">${targetParentLabel}</option>
<option value="_top">${targetTopLabel}</option>
</select>&nbsp;&nbsp;&nbsp;&nbsp;
<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" />
</select>
</div>
<div class="fn__right">
<button onclick="admin.pageList.submit();">${saveLabel}</button>
......
......@@ -104,4 +104,3 @@ $.extend(SoloEditor.prototype, {
admin.editors.articleEditor = {}
admin.editors.abstractEditor = {}
admin.editors.pageEditor = {}
......@@ -32,8 +32,7 @@ admin.pageList = {
currentPage: 1
},
id: "",
type: "link",
/*
/*
* 初始化 table, pagination, comments dialog
*/
init: function (page) {
......@@ -57,11 +56,6 @@ admin.pageList = {
text: Label.openMethodLabel,
index: "pageTarget",
width: 120
}, {
style: "padding-left: 12px;",
text: Label.typeLabel,
index: "pageType",
width: 80
}, {
text: Label.commentLabel,
index: "comments",
......@@ -71,29 +65,6 @@ admin.pageList = {
this.tablePagination.initPagination();
this.tablePagination.initCommentsDialog();
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 = {
pageData[i].pagePermalink = "<a class='no-underline' href='" + pages[i].pagePermalink + "' target='_blank'>"
+ pages[i].pagePermalink + "</a>";
pageData[i].pageTarget = pages[i].pageOpenTarget;
pageData[i].pageType = pages[i].pageType;
pageData[i].comments = pages[i].pageCommentCount;
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>\
......@@ -188,15 +158,6 @@ admin.pageList = {
$("#pagePermalink").val(result.page.pagePermalink);
$("#pageTarget").val(result.page.pageOpenTarget);
$("#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("");
}
});
......@@ -249,20 +210,12 @@ admin.pageList = {
$("#loadMsg").text(Label.loadingLabel);
$("#tipMsg").text("");
var pageContent = admin.editors.pageEditor.getContent();
var pagePermalink = $("#pagePermalink").val().replace(/(^\s*)|(\s*$)/g, "");
if (admin.pageList.type === "link") {
pagePermalink = Util.proessURL(pagePermalink);
}
var pagePermalink = Util.proessURL($("#pagePermalink").val().replace(/(^\s*)|(\s*$)/g, ""));
var requestJSONObject = {
"page": {
"pageTitle": $("#pageTitle").val(),
"pageContent": pageContent,
"pagePermalink": pagePermalink,
"pageCommentable": $("#pageCommentable").prop("checked"),
"pageType": admin.pageList.type,
"pageOpenTarget": $("#pageTarget").val(),
"pageIcon": $("#pageIcon").val()
}
......@@ -284,11 +237,7 @@ admin.pageList = {
$("#pagePermalink").val("");
$("#pageTitle").val("");
$("#pageIcon").val("");
$("#pageCommentable").prop("cheked", false);
$("#pageTarget").val("_self");
$($(".fn-type").get(0)).click();
admin.editors.pageEditor.setContent("");
if (admin.pageList.pageInfo.currentCount === Label.PAGE_SIZE &&
admin.pageList.pageInfo.currentPage === admin.pageList.pageInfo.pageCount) {
......@@ -314,22 +263,14 @@ admin.pageList = {
$("#loadMsg").text(Label.loadingLabel);
$("#tipMsg").text("");
var pageContent = admin.editors.pageEditor.getContent();
var pagePermalink = $("#pagePermalink").val().replace(/(^\s*)|(\s*$)/g, "");
if (admin.pageList.type === "link") {
pagePermalink = Util.proessURL(pagePermalink);
}
var pagePermalink = Util.proessURL($("#pagePermalink").val().replace(/(^\s*)|(\s*$)/g, ""));
var requestJSONObject = {
"page": {
"pageTitle": $("#pageTitle").val(),
"oId": this.id,
"pageContent": pageContent,
"pagePermalink": pagePermalink,
"pageCommentable": $("#pageCommentable").prop("checked"),
"pageType": admin.pageList.type,
"pageOpenTarget": $("#pageTarget").val(),
"pageIcon": $("#pageIcon").val()
}
......@@ -353,12 +294,7 @@ admin.pageList = {
$("#pageTitle").val("");
$("#pageIcon").val("");
$("#pagePermalink").val("");
$("#pageCommentable").prop("cheked", false);
$("#pageTarget").val("_self");
$($(".fn-type").get(0)).click();
admin.editors.pageEditor.setContent("");
$("#loadMsg").text("");
}
});
......@@ -371,8 +307,7 @@ admin.pageList = {
if ($("#pageTitle").val().replace(/\s/g, "") === "") {
$("#tipMsg").text(Label.titleEmptyLabel);
$("#pageTitle").focus();
} else if (admin.pageList.type === "link" &&
$("#pagePermalink").val().replace(/\s/g, "") === "") {
} else if ($("#pagePermalink").val().replace(/\s/g, "") === "") {
$("#tipMsg").text(Label.linkEmptyLabel);
} else {
return true;
......
......@@ -20,7 +20,7 @@
*
* @author <a href="http://vanessa.b3log.org">Liyuan Li</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) {
this.currentCommentId = ''
......@@ -322,11 +322,7 @@ $.extend(Page.prototype, {
*/
submitComment: function () {
var that = this,
tips = this.tips,
type = 'article'
if (tips.externalRelevantArticlesDisplayCount === undefined) {
type = 'page'
}
tips = this.tips
if (vditor.getValue().length > 1 && vditor.getValue().length < 500) {
$('#soloEditorAdd').attr('disabled', 'disabled')
......@@ -341,7 +337,7 @@ $.extend(Page.prototype, {
$.ajax({
type: 'POST',
url: Label.servePath + '/' + type + '/comments',
url: Label.servePath + '/article/comments',
cache: false,
contentType: 'application/json',
data: JSON.stringify(requestJSONObject),
......
......@@ -558,10 +558,6 @@ button#submitArticle:hover {
border-color: #ec6459;
}
#pagePagePanel {
margin-top: 0;
}
/* end article */
/* 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