Переглянути джерело

Merge branch 'laravel' into nissaya-channel

visuddhinanda@gmail.com 4 роки тому
батько
коміт
7b57cdf162

+ 1 - 0
.gitignore

@@ -18,3 +18,4 @@ yarn-error.log
 /yarn.lock
 /composer.lock
 *.swp
+*.log

+ 5 - 1
change-logs.md

@@ -56,4 +56,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
 ## [1.0.7] - 2022-02-01
 
 - add REDIS_NAMESPACE to .env.example
-- add redis namespace to config.sample.php
+- add redis namespace to config.sample.php
+
+## [1.0.8] - 2022-02-24
+
+- 优化打印显示效果 去掉channel列表 逐句首字母大写

+ 12 - 4
public/app/article/article.js

@@ -395,10 +395,18 @@ function palicanon_load() {
 						$("#article_author").html(result.username.nickname + "@" + result.username.username);
 						$("#contents").html(note_init(result.content));
 						note_refresh_new(function () {
-							document.querySelector("#para_focus").scrollIntoView({
-								block: "end",
-								behavior: "smooth",
-							});
+                            if(document.querySelector("#para_focus")){
+                                document.querySelector("#para_focus").scrollIntoView({
+                                    block: "end",
+                                    behavior: "smooth",
+                                });                                
+                            }
+
+                            $.get('templiates/glossary.tpl',function(data){
+                                let TermData = term_get_used();
+                                let rendered = Mustache.render(data,TermData);
+                                $("#glossary").html(rendered);                                
+                            });
 						});
 						reader_draw_para_menu();
 						guide_init();

+ 15 - 0
public/app/article/print.css

@@ -39,4 +39,19 @@ note > .tran {
 
 .main_view {
 	margin-left: auto;
+}
+
+note {
+    border: unset;
+}
+
+.contents_div {
+    width: auto;
+}
+
+#right_pannal {
+    display: none;
+}
+.note_foot{
+    display:none;
 }

+ 1 - 1
public/app/article/templiates/glossary.tpl

@@ -1,7 +1,7 @@
 <h2>Glossary</h2>
 {{#glossary.word}}
 <div>
-<b>{{pali}}</b>:{{meaning}}
+<b>{{pali}}</b>:{{meaning}}; {{meaning2}}
 </div>
 {{/glossary.word}}
 

+ 1 - 1
public/app/term/note.js

@@ -89,7 +89,7 @@ function note_init(input,channel="",editor="",lang="en") {
 
 		output += "</div>";
 
-		let newString = output.replace(/\{\{/g, '<span class="note_shell"><note style="border: solid 2px var(--btn-bg-color);" info="');
+		let newString = output.replace(/\{\{/g, '<span class="note_shell"><note style="" info="');
 		newString = newString.replace(/\}\}/g, '" ></note></span>');
 
 		return newString;

+ 12 - 2
public/app/term/term.css

@@ -404,6 +404,10 @@ note {
 	display: block;
 	background-color: #80808014;
 	position: relative;
+    border: solid 2px var(--btn-bg-color);
+}
+.read note {
+    border:unset;
 }
 note > .bottm_tool_button {
 	border-radius: 5px;
@@ -670,10 +674,10 @@ pw {
     width: -webkit-fill-available;
 }
 .preview::first-letter {
-	text-transform:uppercase;
+	text-transform:capitalize;
 }
 .sent_tran > p::first-letter {
-	text-transform:uppercase;
+	text-transform:capitalize;
 }
 .compact .body > .head_bar {
 	display: flex;
@@ -938,6 +942,9 @@ span.keybutton {
 span.sent_tran {
 	line-height: 1.7em;
 }
+.sent_mode span.sent_tran {
+    display: inline-block;
+}
 .sent_tran ul,
 .sent_tran li {
 	list-style-type: unset;
@@ -1119,4 +1126,7 @@ pali>p {
 .preview .nissaya .nsy_word .meaning{
     display:inline;
     font-weight: 500;
+}
+span.sent_tran::first-letter {
+    text-transform: capitalize;
 }

+ 5 - 7
public/app/term/term.js

@@ -712,12 +712,8 @@ function term_get_dict(callback=null) {
 		},
 		function (data, status) {
 			if (data.length > 0) {
-				try {
-					arrMyTerm = JSON.parse(data);
-					term_updata_translation(callback);
-				} catch (e) {
-					console.error(e.error + " data:" + data);
-				}
+				arrMyTerm = JSON.parse(data);
+				term_updata_translation(callback);
 			}
 		}
 	);
@@ -728,11 +724,13 @@ function term_get_used(){
     $("term").each(function () {
         let word = $(this).attr("pali");
         let meaning = $(this).attr("mean");
+        let meaning2 = $(this).attr("mean2");
         if(word !== ""){
             output[word] = {
                 pali:word,
                 pali_en:com_getPaliEn(word),
-                meaning:meaning
+                meaning:meaning,
+                meaning2:meaning2
             };
         }