瀏覽代碼

打印模式css

visuddhinanda 5 年之前
父節點
當前提交
d8e05c1629
共有 3 個文件被更改,包括 59 次插入22 次删除
  1. 37 9
      app/studio/css/print.css
  2. 14 7
      app/studio/editor.php
  3. 8 6
      app/studio/js/render.js

+ 37 - 9
app/studio/css/print.css

@@ -1,13 +1,20 @@
-.word_punc,
-.word {
-	page-break-inside: avoid;
+.mainview {
+	padding: 0;
 }
-
-.mean,
-.org,
-.om,
-.case {
-	page-break-after: avoid;
+.trans_text_info {
+	display: none;
+}
+.trans_text_block {
+	background-color: unset;
+}
+#btn_close_printprev {
+	display: none;
+}
+.word_head_bar {
+	display: none;
+}
+.sutta_top_blank {
+	height: 0;
 }
 #toolbar {
 	display: none;
@@ -15,4 +22,25 @@
 
 #left_tool_bar {
 	display: none;
+	visibility: hidden;
+}
+
+.sent_wbw_trans_bar {
+	display: none;
+}
+
+.in_word_button {
+	display: none;
+}
+
+.sent_wbw_trans {
+	display: block;
+}
+
+.sent_wbw_trans div {
+	page-break-inside: avoid;
+}
+
+.trans_text_block {
+	page-break-inside: avoid;
 }

+ 14 - 7
app/studio/editor.php

@@ -26,7 +26,7 @@ else{$currDevice="computer";}
 	<link type="text/css" rel="stylesheet" href="css/style.css"/>
 	<link type="text/css" rel="stylesheet" href="css/color_day.css" id="colorchange" />
 	<link type="text/css" rel="stylesheet" href="css/style_mobile.css" media="screen and (max-width:800px)">
-	<link type="text/css" rel="stylesheet" href="css/print.css" media="print" />
+	
 	<link href="https://fonts.googleapis.com/css2?family=Padauk:wght@400;700&display=swap" rel="stylesheet">
 	<link type="text/css" rel="stylesheet" href="../public/css/notify.css"/>
 	<?php
@@ -120,19 +120,22 @@ else{$currDevice="computer";}
 	
 </head>
 <body class="mainbody" id="mbody" onLoad="editor_windowsInit()">
-	<style id="display_set">
-	</style>
-
 	<style>
 	.term_link:hover .guide_contence {
 		display: inline-block;
 	}
 	
 	.trans_text_block{
-		border-left: 5px solid #d1d1d1;
-		background-color: #f1f1f1;
+		border-left: 5px solid #ccd1ff;
+		border-color: #ccd1ff;
+		background-color:unset;
 		margin-bottom: 0.5em;
 		padding: 0.5em 0.5em 0.1em 0.5em;
+		padding-top:0;
+	}
+	.translate_sent_head_content .readonly{
+		border-color: #d1d1d1;
+		background-color: #f1f1f1;		
 	}
 	.trans_text_content{
 		color: var(--main-color);
@@ -144,7 +147,9 @@ else{$currDevice="computer";}
 		color: var(--detail-color);
 		display:flex;
 		justify-content: space-between;
+		border:none;
 	}
+
 	.trans_text_info .tag{
 		font-size: 75%;
 	}
@@ -217,7 +222,9 @@ else{$currDevice="computer";}
 		margin: 0 15px 0 -8px;
 	}
 	</style>
-	
+	<link type="text/css" rel="stylesheet" href="css/print.css" media="print" />
+	<style id="display_set">
+	</style>
 	<!--左侧工具栏-->
 	<div id="left_tool_bar">
 		<div>

+ 8 - 6
app/studio/js/render.js

@@ -1650,8 +1650,10 @@ function render_tran_sent_block(book, para, begin, end, channal = 0, readonly =
 	let sent_lang = "en";
 	let objSent;
 	let thischannal;
+	let shell_class = "";
 	if (channal == 0) {
 		//百家言
+		shell_class += " channel_0";
 		if (netSent.length > 0) {
 			sender = netSent[netSent.length - 1].sender;
 			sent_text += netSent[netSent.length - 1].data.text;
@@ -1662,6 +1664,7 @@ function render_tran_sent_block(book, para, begin, end, channal = 0, readonly =
 		}
 	} else {
 		sender = "通道的名字";
+		shell_class += " mychannel";
 		objSent = _user_sent_buffer.getSentText(book, para, begin, end, channal);
 		thischannal = channal_getById(channal);
 		if (objSent == false) {
@@ -1671,7 +1674,6 @@ function render_tran_sent_block(book, para, begin, end, channal = 0, readonly =
 			objSent.id = "";
 			objSent.tag = "[]";
 			objSent.author = "{}";
-
 			sent_text = "";
 		} else {
 			sent_text = objSent.text;
@@ -1681,12 +1683,12 @@ function render_tran_sent_block(book, para, begin, end, channal = 0, readonly =
 
 	let output = "";
 
-	output += "<div class='trans_text_block' style='padding-top:0;";
-	if (readonly == false) {
-		output += "border-color: #ccd1ff;background-color:unset;";
+	if (readonly == true) {
+		shell_class += " readonly";
 	}
-	output += "'>";
-	output += "<div class='trans_text_info' style='border:none;'>";
+
+	output += "<div class='trans_text_block " + shell_class + "' channel_id='" + channal + "'>";
+	output += "<div class='trans_text_info' >";
 
 	if (channal == 0) {
 		output += "<span class='author'>" + sender + "</span><span>[滤]</span>";