mirror of
https://github.com/mindoc-org/mindoc.git
synced 2025-08-25 08:40:16 +08:00
commit
4e4035b27a
10
TODO
Normal file
10
TODO
Normal file
@ -0,0 +1,10 @@
|
||||
1、把 log 提取出 dbgout 之类的方法;已改作 beego.Info() 调用;
|
||||
2、把源代码里的 TODO 完成;
|
||||
3、Export 的两个 URL 应该可以合并,用是否有 :id 来区分;这样 0 号文档输出整个 book 更顺;已完成;
|
||||
4、统一代码风格,空格、命名之类的;
|
||||
5、美化 PDF 的输出格式;
|
||||
6、自动登录新开标签页而且并不能跳转至起始请求页的问题;
|
||||
7、用户分组管理;
|
||||
8、[自动]展示历史版本;增强历史版本对比显示的能力;
|
||||
9、[自动]展示作者信息;也许可以和上一需求合并考虑;
|
||||
10、查看了解评论功能;
|
File diff suppressed because it is too large
Load Diff
@ -34,7 +34,6 @@ func init() {
|
||||
beego.Router("/manager/attach/detailed/:id", &controllers.ManagerController{}, "*:AttachDetailed")
|
||||
beego.Router("/manager/attach/delete", &controllers.ManagerController{}, "post:AttachDelete")
|
||||
|
||||
|
||||
beego.Router("/setting", &controllers.SettingController{}, "*:Index")
|
||||
beego.Router("/setting/password", &controllers.SettingController{}, "*:Password")
|
||||
beego.Router("/setting/upload", &controllers.SettingController{}, "*:Upload")
|
||||
@ -73,7 +72,8 @@ func init() {
|
||||
beego.Router("/docs/:key", &controllers.DocumentController{}, "*:Index")
|
||||
beego.Router("/docs/:key/:id", &controllers.DocumentController{}, "*:Read")
|
||||
beego.Router("/docs/:key/search", &controllers.DocumentController{}, "post:Search")
|
||||
beego.Router("/export/:key", &controllers.DocumentController{},"*:Export")
|
||||
beego.Router("/export/:key", &controllers.DocumentController{}, "*:ExportBook")
|
||||
beego.Router("/export/:key/:id", &controllers.DocumentController{}, "*:ExportDoc")
|
||||
beego.Router("/qrcode/:key.png", &controllers.DocumentController{}, "get:QrCode")
|
||||
|
||||
beego.Router("/attach_files/:key/:attach_id", &controllers.DocumentController{}, "get:DownloadAttachment")
|
||||
@ -87,4 +87,3 @@ func init() {
|
||||
beego.Router("/tag/:key", &controllers.LabelController{}, "get:Index")
|
||||
beego.Router("/tags", &controllers.LabelController{}, "get:List")
|
||||
}
|
||||
|
||||
|
@ -417,7 +417,8 @@ table>tbody>tr:hover{
|
||||
}
|
||||
.manual-article .article-head {
|
||||
position: relative;
|
||||
zoom:1;padding: 10px 20px
|
||||
zoom: 1;
|
||||
padding: 10px 20px
|
||||
}
|
||||
.manual-reader .book-title{
|
||||
color: #333333;
|
||||
@ -430,7 +431,7 @@ table>tbody>tr:hover{
|
||||
.manual-article .article-head h1 {
|
||||
margin: 0;
|
||||
font-size: 20px;
|
||||
font-weight: 200;
|
||||
font-weight: 300;
|
||||
text-align: center;
|
||||
line-height: 30px;
|
||||
overflow: hidden;
|
||||
@ -438,6 +439,17 @@ table>tbody>tr:hover{
|
||||
white-space: nowrap;
|
||||
color: #444
|
||||
}
|
||||
.manual-article .article-head h3 {
|
||||
margin: 0;
|
||||
font-size: 12px;
|
||||
font-weight: 200;
|
||||
text-align: center;
|
||||
line-height: 18px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
color: #444
|
||||
}
|
||||
.manual-article .article-content{
|
||||
min-width: 980px;
|
||||
max-width: 98%;
|
||||
|
@ -12,15 +12,17 @@ function loadDocument($url,$id,$callback) {
|
||||
var body = events.data('body_' + $id);
|
||||
var title = events.data('title_' + $id);
|
||||
var doc_title = events.data('doc_title_' + $id);
|
||||
var doc_info = events.data('doc_info_' + $id);
|
||||
|
||||
if (body && title && doc_title) {
|
||||
|
||||
if (typeof $callback === "function") {
|
||||
body = $callback(body);
|
||||
}
|
||||
|
||||
$("#page-content").html(body);
|
||||
$("title").text(title);
|
||||
$("#article-title").text(doc_title);
|
||||
$("#article-info").text(doc_info);
|
||||
|
||||
events.trigger('article.open', { $url : $url, $init : false, $id : $id });
|
||||
|
||||
@ -33,21 +35,26 @@ function loadDocument($url,$id,$callback) {
|
||||
var body = res.data.body;
|
||||
var doc_title = res.data.doc_title;
|
||||
var title = res.data.title;
|
||||
var doc_info = res.data.doc_info;
|
||||
|
||||
$body = body;
|
||||
if (typeof $callback === "function" ) {
|
||||
$body = $callback(body);
|
||||
}
|
||||
|
||||
$("#page-content").html($body);
|
||||
$("title").text(title);
|
||||
$("#article-title").text(doc_title);
|
||||
$("#article-info").text(doc_info);
|
||||
|
||||
events.data('body_' + $id, body);
|
||||
events.data('title_' + $id, title);
|
||||
events.data('doc_title_' + $id, doc_title);
|
||||
events.data('doc_info_' + $id, doc_info);
|
||||
|
||||
events.trigger('article.open', { $url : $url, $init : true, $id : $id });
|
||||
|
||||
} else if (res.errcode === 6000) {
|
||||
window.location.href = "/";
|
||||
} else {
|
||||
layer.msg("加载失败");
|
||||
}
|
||||
@ -103,8 +110,8 @@ $(function () {
|
||||
if (url === window.location.href) {
|
||||
return false;
|
||||
}
|
||||
loadDocument(url,selected.node.id);
|
||||
|
||||
loadDocument(url, selected.node.id);
|
||||
});
|
||||
|
||||
$("#slidebar").on("click", function () {
|
||||
@ -128,17 +135,16 @@ $(function () {
|
||||
|
||||
// 处理打开事件
|
||||
events.on('article.open', function (event, $param) {
|
||||
|
||||
if ('pushState' in history) {
|
||||
if ($param.$init === false) {
|
||||
window.history.replaceState($param, $param.$id, $param.$url);
|
||||
} else {
|
||||
window.history.pushState($param, $param.$id, $param.$url);
|
||||
}
|
||||
|
||||
} else {
|
||||
window.location.hash = $param.$url;
|
||||
}
|
||||
|
||||
initHighlighting();
|
||||
$(".manual-right").scrollTop(0);
|
||||
});
|
||||
@ -184,7 +190,6 @@ $(function () {
|
||||
});
|
||||
|
||||
window.onpopstate = function (e) {
|
||||
|
||||
var $param = e.state;
|
||||
console.log($param);
|
||||
if($param.hasOwnProperty("$url")) {
|
||||
|
@ -58,7 +58,8 @@
|
||||
{{if eq .Model.PrivatelyOwned 0}}
|
||||
<li><a href="javascript:" data-toggle="modal" data-target="#shareProject">项目分享</a> </li>
|
||||
<li role="presentation" class="divider"></li>
|
||||
<li><a href="{{urlfor "DocumentController.Export" ":key" .Model.Identify "output" "pdf"}}" target="_blank">项目导出PDF</a> </li>
|
||||
<li><a href="javascript:void(0);" onclick="ExportPdfDoc()">文档导出为 PDF</a> </li>
|
||||
<li><a href="{{urlfor "DocumentController.ExportBook" ":key" .Model.Identify "output" "pdf"}}" target="_blank">项目导出为 PDF</a> </li>
|
||||
{{end}}
|
||||
|
||||
<li><a href="{{urlfor "HomeController.Index"}}" title="返回首页">返回首页</a> </li>
|
||||
@ -127,6 +128,7 @@
|
||||
</div>
|
||||
<div class="col-md-8 text-center">
|
||||
<h1 id="article-title">{{.Title}}</h1>
|
||||
<h3 id="article-info">{{.Info}}</h3>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
</div>
|
||||
@ -234,6 +236,13 @@
|
||||
<script type="text/javascript" src="/static/js/jquery.highlight.js"></script>
|
||||
<script type="text/javascript" src="/static/js/kancloud.js"></script>
|
||||
<script type="text/javascript">
|
||||
active_book_id = {{.Model.Identify}};
|
||||
active_doc_id = {{.DocumentId}};
|
||||
$(function () {
|
||||
$("body").on('article.open', function (event, $param) {
|
||||
active_doc_id = $param.$id;
|
||||
});
|
||||
});
|
||||
$(function () {
|
||||
$("#searchList").on("click","a",function () {
|
||||
var id = $(this).attr("data-id");
|
||||
@ -245,6 +254,12 @@ $(function () {
|
||||
});
|
||||
});
|
||||
});
|
||||
function ExportPdfDoc() {
|
||||
var id = active_book_id;
|
||||
if(active_doc_id != "0")
|
||||
id += "/" + active_doc_id;
|
||||
window.location.href = "/export/" + id + "?output=pdf";
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in New Issue
Block a user