优化单页打印

pull/295/head
Minho 2018-06-06 19:52:49 +08:00
parent c50895d6ba
commit d0d7af0ff1
4 changed files with 22 additions and 3 deletions

View File

@ -139,6 +139,7 @@ table>tbody>tr:hover{
border-right: 1px solid #ddd;
background-color: #fafafa;
}
.m-manual .manual-tab .tab-navg {
zoom:1;border-bottom: 1px solid #ddd
}
@ -467,6 +468,7 @@ table>tbody>tr:hover{
min-width: inherit;
}
}
.manual-article .article-content .article-body{
min-height: 90px;
padding: 5px;

View File

@ -2,6 +2,7 @@ body {
position: relative;
font-family: Verdana, "Lantinghei SC", "Hiragino Sans GB", "Microsoft Yahei", Helvetica, arial, \5b8b\4f53, sans-serif;
}
a{
text-decoration: none;
}

View File

@ -0,0 +1,6 @@
body {font-size: 12pt !important;}
.m-manual .manual-left,.navbar {display: none;}
.m-manual .manual-right{left: 0;}
pre, code {white-space: pre-wrap !important;word-wrap: break-word !important;}
a:link, a:visited {color: blue !important;text-decoration: underline !important;}
body a:link:after, body a:visited:after {content: " (" attr(href) ") ";}

View File

@ -15,7 +15,7 @@
<!-- Bootstrap -->
<link href="{{cdncss "/static/bootstrap/css/bootstrap.min.css"}}" rel="stylesheet">
<link href="{{cdncss "/static/font-awesome/css/font-awesome.min.css"}}" rel="stylesheet">
<link href="{{cdncss "/static/jstree/3.3.4/themes/default/style.min.css"}}" rel="stylesheet">
<link href="{{cdncss "/static/nprogress/nprogress.css"}}" rel="stylesheet">
@ -26,6 +26,8 @@
<link href="{{cdncss "/static/css/markdown.preview.css"}}" rel="stylesheet">
<link href="{{cdncss "/static/highlight/styles/vs.css"}}" rel="stylesheet">
<link href="{{cdncss "/static/katex/katex.min.css"}}" rel="stylesheet">
<link href="{{cdncss "/static/css/print.css"}}" media="print" rel="stylesheet">
<link href="{{cdncss "/static/font-awesome/css/font-awesome.min.css"}}" rel="stylesheet">
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
@ -44,6 +46,7 @@
<span style="font-size: 12px;font-weight: 100;"></span>
</div>
<div class="navbar-header pull-right manual-menu">
<button id="printSinglePage" class="btn btn-default" style="margin-right: 10px;"><i class="fa fa-print"></i> 打印</button>
{{if gt .Member.MemberId 0}}
{{if gt .Model.RelationshipId 0}}
{{if eq .Model.RoleId 0 1 2}}
@ -59,7 +62,7 @@
<div class="dropdown pull-right" style="margin-right: 10px;">
{{if eq .Model.PrivatelyOwned 0}}
{{if .Model.IsEnableShare}}
<button type="button" class="btn btn-success" data-toggle="modal" data-target="#shareProject"><i class="fa fa-share-alt" aria-hidden="true"></i> 分享</button>
<button type="button" class="btn btn-success" data-toggle="modal" data-target="#shareProject"><i class="fa fa-share-square" aria-hidden="true"></i> 分享</button>
{{end}}
{{end}}
</div>
@ -292,7 +295,14 @@ $(function () {
return $(body).highlight(window.keyword);
});
});
//打印设置
$("#printSinglePage").on("click",function () {
var body = $("body");
var bodyContent = body.html();
body.html($(".manual-right").html());
window.print();
body.html(bodyContent);
});
});
</script>