Procházet zdrojové kódy

Merge branch 'laravel' of https://github.com/iapt-platform/mint into laravel

bhikkhu-kosalla-china před 4 roky
rodič
revize
da74103426

+ 33 - 42
public/app/channal/channal.js

@@ -1,6 +1,12 @@
 var _my_channal = null;
 var gChannelId;
 var get_channel_list_callback = null;
+var enumChannelType = [
+    {id:'translation',title:'translation',icon:''},    
+    {id:'original',title:'original',icon:''},
+    {id:'nissaya',title:'nissaya',icon:''},
+    {id:'commentary',title:'commentary',icon:''},
+]
 channal_list();
 var share_win;
 function channal_list_init() {
@@ -47,6 +53,7 @@ function my_channal_list() {
 					html += '<div style="max-width:2em;flex:1;"><input type="checkbox" /></div>';
 					html += "<div style='flex:0.5;'>No.</div>";
 					html += "<div style='flex:2;'>" + gLocal.gui.title + "</div>";
+					html += "<div style='flex:1;'>" + gLocal.gui.type + "</a></div>";                    
 					html += "<div style='flex:2;'>" + gLocal.gui.owner + "</div>";
 					html += "<div style='flex:1;'>" + gLocal.gui.privacy + "</div>";
 					html += "<div style='flex:1;'>" + gLocal.gui.permission + "</a></div>";
@@ -59,11 +66,17 @@ function my_channal_list() {
 						html += '<div class="file_list_row" style="padding:5px;">';
 						html += '<div style="max-width:2em;flex:1;"><input type="checkbox" /></div>';
 						html += "<div style='flex:0.5;'>" + key++ + "</div>";
+                        //title
 						html += "<div style='flex:2;'>";
 						html += "<guide url='../channal/card.php' gid='" + iterator.uid + "'>";
 						html += iterator.name;
 						html += "</guide>";
 						html += "</div>";
+                        //type
+						html += "<div style='flex:1;'>";
+						html += iterator.type;
+						html += "</div>";
+                        //owner
 						html += "<div style='flex:2;'>";
 						if (parseInt(iterator.power) == 30) {
 							html += gLocal.gui.your;
@@ -74,6 +87,7 @@ function my_channal_list() {
 						}
 
 						html += "</div>";
+                        //privacy
 						html += "<div style='flex:1;'>";
 						let arrStatus = [
 							{ id: 0, string: gLocal.gui.disable },
@@ -205,6 +219,21 @@ function my_channal_edit(id) {
 					html += "</div>";
 					html += "</div>";
 
+					html += '<div style="display:flex;line-height:32px;">';
+					html += '<div style="flex:2;">' + gLocal.gui.privacy + "</div>";
+					html += '<div style="flex:8;">';
+                    html += "<select id = 'type'  name = 'type'>";
+					for (const iterator of enumChannelType) {
+						html += "<option ";
+						if (result.type == iterator.id) {
+							html += " selected ";
+						}
+						html += " value='" + iterator.id + "'>" + iterator.title + "</option>";
+					}
+					html += "</select>";
+                    html += "</div>";
+                    html += "</div>";
+
 					html += '<div style="display:flex;line-height:32px;">';
 					html += '<div style="flex:2;">' + gLocal.gui.privacy + "</div>";
 					html += '<div style="flex:8;">';
@@ -223,60 +252,22 @@ function my_channal_edit(id) {
 						}
 						html += " value='" + iterator.id + "'>" + iterator.string + "</option>";
 					}
-
 					html += "</select>";
 					html +=
 						"<span id = 'status_help' style='margin: 0 1em;'>" +
 						status_note +
-						"</span><a href='#' target='_blank'>[" +
+						"</span>"+
+                        "<a href='#' target='_blank'>[" +
 						gLocal.gui.infomation +
-						"]</a></li>";
+						"]</a>"+
+                        "</li>";
 					html += "</div>";
 					html += "</div>";
 					html += "</div>";
-					/*
-					旧的channel分享方式 删除
-					html += "<div id='coop_div' style='padding:5px;position: relative;'>";
-					html += "<h2>" + gLocal.gui.cooperators + "</h2>";
-
-					html +=
-						"<button onclick='add_coop_user()'>" + gLocal.gui.add + gLocal.gui.cooperators + "</button>";
-					html += "<div id='add_coop_user_dlg' class='float_dlg' style='left: 0;'></div>";
-
-					html +=
-						"<button onclick='add_coop_group()' >" +
-						gLocal.gui.add +
-						gLocal.gui.cooperate_group +
-						"</button>";
-					html += "<div id='add_coop_group_dlg' class='float_dlg' style='left: 0;'></div>";
-					html += "<div id='coop_inner' >";
-					if (typeof result.coop == "undefined" || result.coop.length == 0) {
-						html += gLocal.gui.empty_null_mark;
-					} else {
-						for (const coop of result.coop) {
-							html += '<div class="file_list_row" style="padding:5px;">';
-							if (coop.type == 0) {
-								html += '<div style="flex:1;">' + gLocal.gui.personal + "</div>";
-								html += "<div style='flex:3;'>" + coop.user_name.nickname + "</div>";
-							} else {
-								html += '<div style="flex:1;">' + gLocal.gui.group + "</div>";
-								html += "<div style='flex:3;'>" + coop.user_name.name + "</div>";
-							}
 
-							html += "<div style='flex:3;'>" + coop.power + "</div>";
-							html += "<div class='hover_button' style='flex:3;'>";
-							html += "<button>" + gLocal.gui.remove + "</button>";
-							html += "</div>";
-							html += "</div>";
-						}
-					}
-					html += "</div>";
-					html += "</div>";
-*/
 					$("#channal_info").html(html);
 					user_select_dlg_init("add_coop_user_dlg");
 					tran_lang_select_init("channal_lang_select");
-					//$("#aritcle_status").html(render_status(result.status));
 					$("#channal_title").html(result.name);
 					$("#preview_inner").html();
 				} catch (e) {

+ 19 - 3
public/app/channal/get.php

@@ -28,13 +28,21 @@ $channelList = array();
 
 //找自己的
 PDO_Connect(_FILE_DB_CHANNAL_,_DB_USERNAME_,_DB_PASSWORD_);
-$query = "SELECT uid,owner_uid,name,status,lang FROM "._TABLE_CHANNEL_." WHERE owner_uid = ?  LIMIT 100";
+$query = "SELECT uid,owner_uid,name,status,lang,type FROM "._TABLE_CHANNEL_." WHERE owner_uid = ? order by updated_at DESC LIMIT 200";
 $Fetch_my = PDO_FetchAll($query,array($_COOKIE["user_uid"]));
 
 #去掉重复的
 foreach ($Fetch_my as $key => $value) {
 	# code...
-	$channelList[$value["uid"]]=array("uid"=>$value["uid"],"owner_uid"=>$value["owner_uid"],"name"=>$value["name"],"power"=>30,"status"=>$value["status"],"lang"=>$value["lang"]);
+	$channelList[$value["uid"]]=array(
+        "uid"=>$value["uid"],
+        "owner_uid"=>$value["owner_uid"],
+        "name"=>$value["name"],
+        "power"=>30,
+        "type"=>$value["type"],
+        "status"=>$value["status"],
+        "lang"=>$value["lang"]
+        );
 }
 
 # 找协作的
@@ -47,7 +55,15 @@ foreach ($coop_channal as $key => $value) {
 		}
 	}
 	else{
-		$channelList[$value["res_id"]]=array("uid"=>$value["res_id"],"owner_uid"=>$value["res_owner_id"],"name"=>$value["res_title"],"power"=>(int)$value["power"],"status"=>(int)$value["status"],"lang"=>(int)$value["lang"]);
+		$channelList[$value["res_id"]]=array(
+            "uid"=>$value["res_id"],
+            "owner_uid"=>$value["res_owner_id"],
+            "name"=>$value["res_title"],
+            "power"=>(int)$value["power"],
+            "type"=>(int)$value["type"],
+            "status"=>(int)$value["status"],
+            "lang"=>(int)$value["lang"]
+            );
 	}
 }
 

+ 9 - 2
public/app/channal/my_channal_post.php

@@ -31,11 +31,18 @@ if($channelPower<30){
     exit;
 }
 
+if(!isset($_POST["type"])){
+    $respond["status"] = 1;
+    $respond["message"] = 'Error: no [type]  ';
+    echo json_encode($respond, JSON_UNESCAPED_UNICODE);
+    exit;
+}
+
 $channelOldInfo = $channel->getChannal($_POST["id"]);
 
-$query="UPDATE "._TABLE_CHANNEL_." SET editor_id=?, name = ? ,  summary = ?,  status = ? , lang = ? , updated_at = now()  , modify_time= ?   where uid = ?  ";
+$query="UPDATE "._TABLE_CHANNEL_." SET editor_id=?, name = ? ,  summary = ?, type = ?, status = ? , lang = ? , updated_at = now()  , modify_time= ?   where uid = ?  ";
 $sth = $PDO->prepare($query);
-$sth->execute(array($_COOKIE["user_id"],$_POST["name"] , $_POST["summary"], $_POST["status"] , $_POST["lang"] ,  mTime() , $_POST["id"]));
+$sth->execute(array($_COOKIE["user_id"],$_POST["name"] , $_POST["summary"], $_POST["type"], $_POST["status"] , $_POST["lang"] ,  mTime() , $_POST["id"]));
 $respond=array("status"=>0,"message"=>"");
 if (!$sth || ($sth && $sth->errorCode() != 0)) {
 	$error = PDO_ErrorInfo();

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 57 - 0
public/app/public/images/svg/oil-lamp.svg


+ 2 - 0
public/app/share/function.php

@@ -81,12 +81,14 @@ function share_res_list_get($userid,$res_type=-1){
 				if($channelInfo){
 					$resList[$key]["res_title"]=$channelInfo["name"];
 					$resList[$key]["res_owner_id"]=$channelInfo["owner_uid"];
+					$resList[$key]["type"]=$channelInfo["type"];
 					$resList[$key]["status"]=$channelInfo["status"];
 					$resList[$key]["lang"]=$channelInfo["lang"];
 				}
 				else{
 					$resList[$key]["res_title"]="_unkown_";
 					$resList[$key]["res_owner_id"]="_unkown_";
+					$resList[$key]["type"]=$channelInfo["type"];
 					$resList[$key]["status"]="0";
 					$resList[$key]["lang"]="unkow";
 				}

+ 188 - 62
public/app/term/note.js

@@ -212,7 +212,8 @@ function note_refresh_new(callback = null) {
 						splite_pali_word();
 						//处理编辑框消息
 						tran_sent_textarea_event_init();
-
+                        //处理鼠标移入显示菜单消息
+                        setSentToolBarEvent();
 						//初始化mermaid
 						mermaid.initialize({startOnLoad:true});
 
@@ -470,7 +471,7 @@ function edition_list_changed(channelId){
 }
 function find_channal(id) {
 	for (const iterator of _channalData) {
-		if (id == iterator.id) {
+		if (id == iterator.id || id == iterator.uid) {
 			return iterator;
 		}
 	}
@@ -713,17 +714,18 @@ function note_json_html(in_json) {
 	//译文开始
 	output += "<div class='sent_tran_div'>";
 	for (const iterator of in_json.translation) {
-		output += render_one_sent_tran_a(iterator);
+        if(iterator.channalinfo.type != "commentary"){
+            output += render_one_sent_tran_a(iterator);
+        }
 	}
 	output += "</div>";
 	//译文结束
 	output += "</div>"; /**note_body end */
 
 	//工具栏开始
-	output += "<div class='other_tran_div' sent='";
-	output += in_json.book + "-" + in_json.para + "-" + in_json.begin + "-" + in_json.end + "' >";
-	output += "<div class='tool_bar' sent='";
-	output += in_json.book + "-" + in_json.para + "-" + in_json.begin + "-" + in_json.end + "' >";
+    let sent_id = in_json.book + "-" + in_json.para + "-" + in_json.begin + "-" + in_json.end;
+	output += "<div class='other_tran_div' sent='" + sent_id + "' >";
+	output += "<div class='tool_bar' sent='" + sent_id + "' >";
 	output += "<span class='tool_left'>";
 	//第一个按钮
 	//新增译文按钮开始
@@ -738,13 +740,17 @@ function note_json_html(in_json) {
 	output += "</div>";
 	output += "</span>";
 	//新增译文按钮结束
+
+    //分隔线
 	output += "<span class='separate_line'></span>";
-	//第二个按钮
+
+	
 	output += "<span class='more_tran icon_expand'></span>";
-	//其他译文工具条
-	output += "<span class='other_bar'  >";
+
+	//第二个按钮其他译文
+	output += "<span class='other_bar' sent='"+sent_id+"' channel_type='translation'>";
 	output +=
-		"<span class='other_tran_span' title='🧲" +
+		"<span class='other_tran_span' title='" +
 		gLocal.gui.other +
 		gLocal.gui.translation +
 		"'>";
@@ -755,37 +761,65 @@ function note_json_html(in_json) {
 	output += "</span>";
 	output += "<span class='other_tran_num'></span>";
 	output += "</span>";
+    //第二个按钮结束
+
+    //分割线
+	output += "<span class='separate_line'></span>";
+
+    //nissaya
+	output += "<span class='other_bar' sent='"+sent_id+"' channel_type='nissaya' >";
+	output +=
+		"<span class='other_nissaya_span' title='" +
+		gLocal.gui.other +
+		gLocal.gui.translation +
+		"'>";
+	output += "<svg class='icon' style='fill: var(--box-bg-color1)'>";
+	output += "<use xlink:href='../../node_modules/bootstrap-icons/bootstrap-icons.svg#sun'>";
+	output += "</svg>" ;
+	output += "Nissaya" ;
+	output += "</span>";
+	output += "<span class='other_tran_num'></span>";
+	output += "</span>";
+
+    //分割线
 	output += "<span class='separate_line'></span>";
 
 	//手工义注
-	output += "<span class='other_bar disable'>";
+	output += "<span class='other_bar'  sent='"+sent_id+"' channel_type='commentary' >";
 	output +=
 		"<span class='other_tran_span commentray' title='📔" +
 		gLocal.gui.vannana +
-		"'>🪔" +
-		gLocal.gui.commentary +
+		"'>";
+	output += "<svg class='icon' style='fill: var(--box-bg-color1)'>";
+	output += "<use xlink:href='../public/images/svg/oil-lamp.svg#oil-lamp'>";
+	output += "</svg>" ;
+	output += gLocal.gui.commentary +
 		"</span>";
-	output += "<span class='other_comm_num'></span>";
+	output += "<span class='other_tran_num'></span>";
 	output += "</span>";
+
+    //分割线
 	output += "<span class='separate_line'></span>";
 
 	//第三个按钮 相似句
 	if (parseInt(in_json.sim) > 0) {
-		output += "<span class='other_bar' >";
+		output += "<span class='sim_bar' >";
 		output +=
 			"<span class='similar_sent_span' onclick=\"note_show_pali_sim('" +
 			in_json.pali_sent_id +
 			"')\" title='" +
 			gLocal.gui.similar_sentences +
-			"'>🧬" +
-			gLocal.gui.similar +
-			"</span>";
+			"'>";
+        	output += "<svg class='icon' style='fill: var(--box-bg-color1)'>";
+            output += "<use xlink:href='../../node_modules/bootstrap-icons/bootstrap-icons.svg#hdd-stack'>";
+            output += "</svg>" ;
+			output += gLocal.gui.similar + "</span>";
 		output += "<span class='similar_sent_num'>" + in_json.sim + "</span>";
 		output += "</span>";
 		output += "<span class='separate_line'></span>";
 	}
-
 	//第三个按钮 相似句结束
+
 	output += "</span>";
 
 	output += "<span class='tool_right'>";
@@ -961,11 +995,21 @@ function render_one_sent_tran_a(iterator, diff = false) {
 			tranText = str_diff(orgText, iterator.text);
 		} else {
 			//note_init处理句子链接
-			tranText = note_init(term_std_str_to_tran(showText, iterator.channal, iterator.editor, iterator.lang));
+            if(iterator.type=='nissaya' || iterator.channalinfo.type=='nissaya'){
+                tranText = renderNissayaPreview(iterator.text);
+            }else{
+                tranText = iterator.text;
+            }
+			tranText = note_init(term_std_str_to_tran(tranText, iterator.channal, iterator.editor, iterator.lang));
+            if(iterator.type=='nissaya' || iterator.channalinfo.type=='nissaya'){
+                tranText = "<div class='nissaya'>"+tranText+"</div>";
+            }
 		}
 	}
+
 	let html = "";
 	html += "<div class='sent_tran ";
+    html += iterator.channalinfo.type;
 	if (typeof iterator.is_pr != "undefined" && iterator.is_pr == true) {
 		html += " pr ";
 	}
@@ -1211,7 +1255,33 @@ function render_one_sent_tran_a(iterator, diff = false) {
 	html += "</div>";
 	return html;
 }
-
+function renderNissayaPreview(str){
+    let html ='';
+    //html +="<div class='nissaya'>";
+    const sent = str.split("\n");
+    for (const iterator of sent) {
+        const word =  iterator.split("=");
+        if(iterator.indexOf('=')>=0){
+            html += "<span class='nsy_word'>"
+            html += "<span class='org'>";
+            switch (getCookie('language')) {
+                case 'my':
+                    html +=  $.trim(word[0]) + "၊";
+                    break;
+                default:
+                    html += my_to_roman(word[0]);
+                    break;
+            }
+            html += "</span>";
+            html += "<span class='meaning'>"+ word[1]+"</span>";
+            html += "</span>";
+        }else{
+            html += iterator;
+        }
+    }
+    //html += "</div>";
+    return html;
+}
 function tran_sent_textarea_event_init() {
 	let textarea = document.querySelectorAll(".tran_sent_textarea");
 	for (let iterator of textarea) {
@@ -1550,43 +1620,60 @@ function new_sentence(book, para, begin, end, channel, obj) {
 
 //显示更多译文按钮动作
 function set_more_button_display() {
-	$(".other_tran_div").each(function () {
+	$(".other_bar").each(function () {
 		const sentid = $(this).attr("sent").split("-");
+		const channelType = $(this).attr("channel_type");
 
 		const book = sentid[0];
 		const para = sentid[1];
 		const begin = sentid[2];
 		const end = sentid[3];
 		let count = 0;
+        let commentaryChannel=0;
+        if(channelType=='commentary'){
+            for (const iterator of _channal.split(',')) {
+                let thisChannel = find_channal(iterator);
+                if(thisChannel && thisChannel.type=='commentary'){
+                    commentaryChannel++;
+                }
+            }            
+        }
+
+        
 		for (const iterator of _channalData) {
-			if (iterator.final) {
+			if (iterator.final && iterator.type==channelType) {
 				for (const onesent of iterator.final) {
 					let id = onesent.id.split("-");
 					if (book == id[0] && para == id[1] && begin == id[2] && end == id[3] && onesent.final) {
-						if (_channal.indexOf(iterator.id) == -1) {
-							count++;
-						}
+                        if(channelType=='commentary'){
+                            count++;
+                        }else{
+                            if (_channal.indexOf(iterator.id) == -1) {
+                                count++;
+                            }
+                        }
 					}
 				}
 			}
 		}
-		if (count > 0) {
+		if (count > 0 || commentaryChannel>0) 
+        {
 			$(this).find(".other_tran_num").html(count);
 			$(this).find(".other_tran_num").attr("style", "display:inline-flex;");
-			$(this)
-				.find(".other_bar")
-				.click(function () {
-					const sentid = $(this).parent().parent().attr("sent").split("-");
+			$(this).off('click')
+				.on('click',function () {
+					const sentid = $(this).attr("sent").split("-");
+		            const channelType = $(this).attr("channel_type");
 					const book = sentid[0];
 					const para = sentid[1];
 					const begin = sentid[2];
 					const end = sentid[3];
-					let sentId = $(this).parent().parent().attr("sent");
-					if ($(this).parent().parent().siblings(".other_tran").first().css("display") == "none") {
-						$(".other_tran_div[sent='" + sentId + "']")
-							.children(".other_tran")
-							.slideDown();
-						$(this).siblings(".more_tran ").css("transform", "unset");
+					let sentId = $(this).attr("sent");
+                    let otherSentDiv = $(this).parent().parent().siblings(".other_tran").first();
+					if (otherSentDiv.css("display") == "none") {
+						otherSentDiv.slideDown();
+                        //加号复位
+						//$(this).siblings(".more_tran ").css("transform", "unset");
 						$.get(
 							"../usent/get.php",
 							{
@@ -1594,42 +1681,57 @@ function set_more_button_display() {
 								para: para,
 								begin: begin,
 								end: end,
+                                type:channelType,
 							},
 							function (data, status) {
 								let arrSent = JSON.parse(data);
-								let html = "<div class='compact'>";
+								let html = "<div class='compact "+channelType+"'>";
+                                if(channelType==='commentary'){
+                                    //先渲染被选择的channel
+                                    if (_channal != "") {
+                                        //for(const channel of _channal.split(","))
+                                        {
+                                            for (const sent of _arrData) {
+                                                if (sent.book == book && sent.para==para && sent.begin==begin && sent.end==end) {
+                                                    for (const tran of sent.translation) {
+                                                        if(tran.channalinfo.type=='commentary'){
+                                                            html += render_one_sent_tran_a(tran);
+                                                        }
+                                                    }
+                                                    break;
+                                                }
+                                            }
+                                        }
+                                    }
+                                }
+                                //然后渲染没有被选择的
 								for (const iterator of arrSent) {
 									if (_channal.indexOf(iterator.channal) == -1) {
 										html += render_one_sent_tran_a(iterator);
 									}
 								}
 								html += "</div>";
-								let sentId =
-									arrSent[0].book +
-									"-" +
-									arrSent[0].paragraph +
-									"-" +
-									arrSent[0].begin +
-									"-" +
-									arrSent[0].end;
-								$(".other_tran_div[sent='" + sentId + "']")
-									.children(".other_tran")
-									.html(html);
+								otherSentDiv.html(html);
+                                if(channelType==='commentary'){
+                                    note_refresh_new();
+                                }
+
 								//初始化文本编辑框消息处理
 								tran_sent_textarea_event_init();
 							}
 						);
 					} else {
-						$(".other_tran_div[sent='" + sentId + "']")
-							.children(".other_tran")
-							.slideUp();
+						otherSentDiv.slideUp();
 						$(this).siblings(".more_tran ").css("transform", "rotate(-90deg)");
 					}
+
+                    return false;    //  阻止事件冒泡
 				});
-		} else {
+		}else 
+        {
 			//隐藏自己
 			//$(this).hide();
-			$(this).find(".other_tran_span").addClass("disable"); //gLocal.gui.no + gLocal.gui.other + gLocal.gui.translation
+			$(this).addClass("disable");
 			//$(this).find(".more_tran").hide();
 		}
 	});
@@ -1681,7 +1783,8 @@ function tran_sent_edit_cancel(obj) {
 function tran_sent_save(obj) {
 	let sentDiv = find_sent_tran_div(obj);
 	if (sentDiv) {
-		let textarea = $(sentDiv).children().find(".tran_sent_textarea").first();
+		let textarea = $(sentDiv).children('.sent_tran_inner').first().children('.body').first().children('.edit').find(".tran_sent_textarea").first();
+		//let textarea = $(sentDiv).children().find(".tran_sent_textarea").first();
 		let isPr = $(textarea).attr("is_pr");
 		if (isPr == "true") {
 			note_pr_save(textarea);
@@ -1806,19 +1909,15 @@ function sent_save_callback(data) {
 			ntf_show("成功修改");
 			if (sent_tran_div) {
 				let divPreview = sent_tran_div.find(".preview").first();
+                let thisChannel = find_channal(result.channal);
 				if (result.text == "") {
+                    //内容为空
 					let channel_info = "Empty";
-					let thisChannel = find_channal(result.channal);
 					if (thisChannel) {
 						channel_info = thisChannel.name + "-" + thisChannel.nickname;
 					}
 					divPreview.html("<span style='color:var(--border-line-color);'>" + channel_info + "</span>");
 				} else {
-					divPreview.html(
-						marked(term_std_str_to_tran(result.text, result.channal, result.editor, result.lang))
-					);
-					term_updata_translation();
-					popup_init();
 					for (const iterator of _arrData) {
 						if (
 							iterator.book == result.book &&
@@ -1834,6 +1933,24 @@ function sent_save_callback(data) {
 							}
 						}
 					}
+                    switch (thisChannel.type) {
+                        case 'nissaya':
+                            divPreview.html(renderNissayaPreview(result.text));
+                            break;
+                        case 'commentary':
+                            divPreview.html(
+                                note_init(result.text, result.channal, result.editor, result.lang)
+                            );
+                            note_refresh_new();
+                        break;
+                        default:
+                            divPreview.html(
+                                marked(term_std_str_to_tran(result.text, result.channal, result.editor, result.lang))
+                            );
+                            term_updata_translation();                        
+                            break;
+                    }
+					popup_init();
 				}
 			}
 		} else if (result.commit_type == 3) {
@@ -2439,3 +2556,12 @@ function term_parent(paliword) {
 	}
 	return output;
 }
+
+function setSentToolBarEvent(){
+    $('.sent_tran_inner').not('.commentary').off('mouseenter').on('mouseenter',function(){
+        $(this).children('.tool_bar').first().children('.right').show();
+    });
+    $('.sent_tran_inner').not('.commentary').off('mouseleave').on('mouseleave',function(){
+        $(this).children('.tool_bar').first().children('.right').hide();
+    })
+}

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

@@ -671,6 +671,7 @@ pw {
 }
 .preview {
 	font-size: 110%;
+    width: -webkit-fill-available;
 }
 .preview::first-letter {
 	text-transform:capitalize;
@@ -726,15 +727,32 @@ pw {
 	padding: 3px;
 	/*margin-right: 20px;*/
 }
+.commentary .tool_bar > .right{
+    /*left: 8em;*/
+    width: 8em;
+}
+.translation>.sent_tran_inner>.tool_bar > .right{
+    right: 2em;
+}
+
 .sent_tran_inner:hover .tool_bar > .right {
-	display: block;
+	/*display: block;*/
 }
 .list_with_head:hover .tool_bar > .right {
-	display: block;
+	/*display: block;*/
 }
 .list_with_head {
 	position: relative;
 }
+
+.commentary>.sent_tran_inner>.tool_bar > .right {
+    display: block;
+    left:6.2em;
+    margin-top: calc(-2.1em - 8px);
+}
+.sent_tran.commentary>.sent_tran_inner{
+    padding-top: 2.2em;
+}
 .body > .edit {
 	display: none;
 }
@@ -817,6 +835,7 @@ li.active {
 }
 .disable {
 	cursor: not-allowed;
+    filter: grayscale(100%);
 }
 .channel_name {
 	white-space: nowrap;
@@ -1107,6 +1126,20 @@ pali>p {
 	background-color: var(--btn-border-color);
 }
 
+.preview .nissaya{
+    display:inline;
+}
+.preview .nissaya .nsy_word{
+    padding-right:10px;
+}
+.preview .nissaya .nsy_word .org{
+    display:inline;
+    font-weight: 700;
+}
+.preview .nissaya .nsy_word .meaning{
+    display:inline;
+    font-weight: 500;
+}
 span.sent_tran::first-letter {
     text-transform: capitalize;
 }

+ 32 - 19
public/app/usent/get.php

@@ -53,28 +53,41 @@ if (isset($_GET["sentences"])) {
     $stmt->execute($arrSent);
 } else {
     $book = $_GET["book"];
-    $para = $_GET["para"];
+    if(isset($_GET["par"])){
+        $para = $_GET["par"];
+    }
+    if(isset($_GET["para"])){
+        $para = $_GET["para"];
+    }
+    
     $begin = $_GET["begin"];
     $end = $_GET["end"];
-    $query = "SELECT uid as id,
-					parent_uid as parent,
-					block_uid as block_id,
-					channel_uid as channal,
-					book_id as book,
-					paragraph,
-					word_start as begin,
-					word_end as end,
-					author,
-					editor_uid as editor,
-					content as text,
-					language,
-					version as ver,
-					status,
-					strlen,
-					modify_time
-					FROM "._TABLE_SENTENCE_." WHERE (book_id = ?  AND paragraph = ? AND word_start = ? AND word_end = ? and strlen >0 and (status = 30 {$channel_query} ) ) order by modify_time DESC  ";
+    if(isset($_GET["type"])){
+        $type = $_GET["type"];
+    }else{
+        $type = "translation";
+    }
+    
+    $query = "SELECT sent.uid as id,
+					sent.parent_uid as parent,
+					sent.block_uid as block_id,
+					sent.channel_uid as channal,
+					sent.book_id as book,
+					sent.paragraph,
+					sent.word_start as begin,
+					sent.word_end as end,
+					sent.author,
+					sent.editor_uid as editor,
+					sent.content as text,
+					sent.language,
+					sent.version as ver,
+					sent.status,
+					sent.strlen,
+					sent.modify_time,
+                    channel.type
+					FROM "._TABLE_SENTENCE_. " as sent LEFT JOIN "._TABLE_CHANNEL_." as channel ON sent.channel_uid=channel.uid  WHERE (channel.type= ? AND sent.book_id = ?  AND sent.paragraph = ? AND sent.word_start = ? AND sent.word_end = ? and sent.strlen >0 and (sent.status = 30 {$channel_query} ) ) order by sent.modify_time DESC  ";
     $stmt = $dbh->prepare($query);
-    $parm = array($book, $para, $begin, $end);
+    $parm = array($type,$book, $para, $begin, $end);
     $parm = array_merge_recursive($parm, $channal_list);
     $stmt->execute($parm);
 }

Některé soubory nejsou zobrazeny, neboť je v těchto rozdílových datech změněno mnoho souborů