|
|
@@ -1,3 +1,5 @@
|
|
|
+//import {Like,LikeRefresh} from '../widget/like.js';
|
|
|
+var _view = "";
|
|
|
var _articel_id = "";
|
|
|
var _channal = "";
|
|
|
var _lang = "";
|
|
|
@@ -65,10 +67,17 @@ function collect_load(id) {
|
|
|
$("#article_subtitle").html(result.subtitle);
|
|
|
}
|
|
|
$("#article_author").html(result.username.nickname + "@" + result.username.username);
|
|
|
- $("#contents").html(marked(result.summary));
|
|
|
+ $("#like_div").html("<like restype='collection' resid='"+id+"'></like>");
|
|
|
+ $("#summary").html(result.summary);
|
|
|
+ $("#contents").html("<div id='content_text'></div><h3>目录</h3><div id='content_toc'></div>");
|
|
|
|
|
|
let article_list = JSON.parse(result.article_list);
|
|
|
render_article_list(article_list);
|
|
|
+ render_article_list_in_content(article_list);
|
|
|
+ $("#content_toc").fancytree("getRootNode").visit(function(node){
|
|
|
+ node.setExpanded(true);
|
|
|
+ });
|
|
|
+ Like();
|
|
|
}
|
|
|
} catch (e) {
|
|
|
console.error(e);
|
|
|
@@ -94,7 +103,6 @@ function articel_load_article_list(articleId,collectionId) {
|
|
|
if (result) {
|
|
|
let article_list = JSON.parse(result.article_list);
|
|
|
render_article_list(article_list,collectionId,articleId);
|
|
|
-
|
|
|
let strTitle = "<a href='../article/?collection=" + result.id + "'>" + result.title + "</a> / ";
|
|
|
for (const iterator of tocActivePath) {
|
|
|
strTitle += "<a href='../article/?id="+iterator.key+"&collection=" + result.id + "'>" + iterator.title + "</a> / ";
|
|
|
@@ -122,7 +130,17 @@ function render_article_list(article_list,collectId="",articleId="") {
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
-
|
|
|
+//在 正文中的目录
|
|
|
+function render_article_list_in_content(article_list,collectId="",articleId="") {
|
|
|
+ $("#content_toc").fancytree({
|
|
|
+ autoScroll: true,
|
|
|
+ source: tocGetTreeData(article_list,articleId),
|
|
|
+ activate: function(e, data) {
|
|
|
+ gotoArticle(data.node.key,collectId);
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ });
|
|
|
+}
|
|
|
function set_channal(channalid) {
|
|
|
let url = "../article/index.php?id=" + _articel_id;
|
|
|
if (_collection_id != "") {
|