Răsfoiți Sursa

继续完善群组

visuddhinanda 5 ani în urmă
părinte
comite
f013b0b882

+ 17 - 5
app/channal/channal.js

@@ -45,7 +45,14 @@ function my_channal_list() {
 						html += '<div style="max-width:2em;flex:1;"><input type="checkbox" /></div>';
 						html += "<div style='flex:1;'>" + key++ + "</div>";
 						html += "<div style='flex:2;'>" + iterator.name + "</div>";
-						html += "<div style='flex:2;'>" + iterator.nickname + "</div>";
+						html += "<div style='flex:2;'>";
+						if (iterator.username == getCookie("username")) {
+							html += gLocal.gui.your;
+						} else {
+							html += iterator.nickname;
+						}
+
+						html += "</div>";
 						html += "<div style='flex:2;'>";
 						let arrStatus = [
 							{ id: 0, string: gLocal.gui.disable },
@@ -65,7 +72,7 @@ function my_channal_list() {
 							"'>" +
 							gLocal.gui.edit +
 							"</a></div>";
-						html += "<div style='flex:1;'>15</div>";
+						html += "<div style='flex:1;'></div>";
 						html += "</div>";
 					}
 					$("#my_channal_list").html(html);
@@ -122,7 +129,7 @@ function my_channal_edit(id) {
 					html += "</div>";
 
 					html += '<div style="display:flex;line-height:32px;">';
-					html += '<div style="flex:2;">'+gLocal.gui.language_select+'</div>';
+					html += '<div style="flex:2;">' + gLocal.gui.language_select + "</div>";
 					html += '<div style="flex:8;">';
 					html +=
 						'<input id="channal_lang_select" type="input"  onchange="channal_lang_change()"' +
@@ -138,7 +145,7 @@ function my_channal_edit(id) {
 					html += "</div>";
 
 					html += '<div style="display:flex;line-height:32px;">';
-					html += '<div style="flex:2;">'+gLocal.gui.privacy+'</div>';
+					html += '<div style="flex:2;">' + gLocal.gui.privacy + "</div>";
 					html += '<div style="flex:8;">';
 					let arrStatus = [
 						{ id: 0, string: gLocal.gui.disable, note: gLocal.gui.disable_note },
@@ -157,7 +164,12 @@ function my_channal_edit(id) {
 					}
 
 					html += "</select>";
-					html += "<span id = 'status_help' style='margin: 0 1em;'>" + status_note + "</span><a href='#' target='_blank'>["+gLocal.gui.infomation+"]</li>";
+					html +=
+						"<span id = 'status_help' style='margin: 0 1em;'>" +
+						status_note +
+						"</span><a href='#' target='_blank'>[" +
+						gLocal.gui.infomation +
+						"]</li>";
 					html += "</div>";
 					html += "</div>";
 					html += "</div>";

+ 60 - 57
app/doc/coop.js

@@ -24,66 +24,68 @@ function username_search_keyup(e, obj) {
 }
 
 function username_search(keyword) {
-	$.get(
-		"../ucenter/get.php",
-		{
-			username: keyword,
-		},
-		function (data, status) {
-			let result;
-			try {
-				result = JSON.parse(data);
-			} catch (error) {
-				console(error);
-			}
-			let html = "<ul id='user_search_list'>";
-			if (result.length > 0) {
-				for (x in result) {
-					html +=
-						"<li><a onclick=\"coop_add('" +
-						result[x].id +
-						"')\">" +
-						result[x].username +
-						"[" +
-						result[x].email +
-						"]</a></li>";
+	let obj = document.querySelector("#cooperator_type_user");
+	if (obj && obj.checked == true) {
+		$.get(
+			"../ucenter/get.php",
+			{
+				username: keyword,
+			},
+			function (data, status) {
+				let result;
+				try {
+					result = JSON.parse(data);
+				} catch (error) {
+					console(error);
 				}
-			}
-			html += "</ul>";
-			html += "<ul id='group_search_list'>";
-			html += "</ul>";
-			$("#search_result").html(html);
-
-			$.get(
-				"../group/get_name.php",
-				{
-					name: keyword,
-				},
-				function (data, status) {
-					let result;
-					try {
-						result = JSON.parse(data);
-					} catch (error) {
-						console(error);
+				let html = "<ul id='user_search_list'>";
+				if (result.length > 0) {
+					for (x in result) {
+						html +=
+							"<li><a onclick=\"coop_add('" +
+							result[x].id +
+							"',0)\">" +
+							result[x].username +
+							"[" +
+							result[x].email +
+							"]</a></li>";
 					}
-					let html1 = "";
-					if (result.length > 0) {
-						for (const iterator of result) {
-							html1 +=
-								"<li><a onclick=\"coop_add_group('" +
-								iterator.id +
-								"')\">" +
-								iterator.name +
-								"[" +
-								iterator.username.nickname +
-								"]</a></li>";
-						}
+				}
+				html += "</ul>";
+				$("#search_result").html(html);
+			}
+		);
+	} else {
+		$.get(
+			"../group/get_name.php",
+			{
+				name: keyword,
+			},
+			function (data, status) {
+				let result;
+				try {
+					result = JSON.parse(data);
+				} catch (error) {
+					console(error);
+				}
+				let html = "<ul id='user_search_list'>";
+				if (result.length > 0) {
+					for (const iterator of result) {
+						html +=
+							"<li><a onclick=\"coop_add('" +
+							iterator.id +
+							"',1)\">" +
+							iterator.name +
+							"[" +
+							iterator.username.nickname +
+							"]</a></li>";
 					}
-					$("#group_search_list").html(html1);
 				}
-			);
-		}
-	);
+				html += "</ul>";
+				$("#search_result").html(html);
+			}
+		);
+	}
 }
 
 var coop_show_div_id = "";
@@ -106,13 +108,14 @@ function coop_list() {
 	);
 }
 
-function coop_add(userid) {
+function coop_add(userid, type) {
 	$.get(
 		"../doc/coop.php",
 		{
 			do: "add",
 			doc_id: coop_doc_id,
 			user_id: userid,
+			type: type,
 		},
 		function (data, status) {
 			$("#" + coop_show_div_id).html(data);

+ 52 - 13
app/doc/coop.php

@@ -1,3 +1,14 @@
+	<style>
+	#coop_selector_title{
+		margin-top: 15px;
+		padding-top: 10px;
+		border-top: 1px solid var(--border-line-color);		
+	}
+	#coop_u_list li{
+		display:flex;
+		justify-content: space-between;
+	}
+	</style>
 <?php
 /*
 *
@@ -10,7 +21,10 @@ set (doc_id ,userid ,value)
     require_once "../path.php";
     require_once "../public/_pdo.php";
     require_once "../public/function.php";
+    require_once "../public/load_lang.php";
     require_once "../ucenter/function.php";
+    require_once "../group/function.php";
+
 
     
     $userid="";
@@ -34,10 +48,10 @@ set (doc_id ,userid ,value)
         exit;
     } 
 
-    $powerlist["10"] = "阅读";
-    $powerlist["20"] = "建议";
-    $powerlist["30"] = "修改";
-    $powerlist["40"] = "管理员";
+    $powerlist["10"] = "阅读";
+    //$powerlist["20"] = "建议";
+    $powerlist["30"] = "修改";
+    //$powerlist["40"] = "管理员";
 
     PDO_Connect("sqlite:"._FILE_DB_FILEINDEX_);
 
@@ -55,8 +69,8 @@ set (doc_id ,userid ,value)
                     case "list":
                     break;
                     case "add":
-                        $query="INSERT INTO power ('id','doc_id','user','power','status','create_time','modify_time','receive_time') 
-                        VALUES (?,?,?,?,?,?,?,?)";
+                        $query="INSERT INTO power ('id','doc_id','user','power','status','create_time','modify_time','receive_time','type') 
+                        VALUES (?,?,?,?,?,?,?,?,?)";
                         $stmt = $PDO->prepare($query);
                         $stmt->execute( 
                             array(UUID::v4(),
@@ -66,7 +80,9 @@ set (doc_id ,userid ,value)
                             1,
                             mTime(),
                             mTime(),
-                            mTime())
+							mTime(),
+                            $_GET["type"]
+							)
                         );
                         if (!$stmt || ($stmt && $stmt->errorCode() != 0)) {
                             $error = PDO_ErrorInfo();
@@ -105,10 +121,27 @@ set (doc_id ,userid ,value)
                 $query = "SELECT * from power where doc_id = ? ";
                 $Fetch = PDO_FetchAll($query,array($_doc_id));
 
-                echo "<ul>";
+                echo "<ul id='coop_u_list'>";
                 foreach($Fetch as $row){
-                    echo "<li>";
-                    echo ucenter_getA($row["user"],"username");
+					echo "<li>";
+					echo "<span>";
+					if($row["type"]==0){
+						//个人
+						echo "<svg class='icon' style='margin: 0 5px;'>";
+						echo '<use xlink:href="./svg/icon.svg#ic_person"></use>';
+						echo "</svg>";
+						echo ucenter_getA($row["user"],"username");
+					}
+					else if($row["type"]==1){
+						//群组
+						echo "<svg class='icon' style='margin: 0 5px;'>";
+						echo '<use xlink:href="./svg/icon.svg#ic_two_person"></use>';
+						echo "</svg>";
+						echo group_get_name($row["user"]);
+					}
+					echo "</span>";
+					echo "<span>";
+					
                     echo "<select onchange=\"coop_power_change('{$row["user"]}',this)\">";
                     foreach($powerlist as $key=>$value){
                         echo "<option value='{$key}' ";
@@ -118,14 +151,20 @@ set (doc_id ,userid ,value)
                         echo ">{$value}</option>";
                     }
                     echo "</select>";
-                    echo "<button onclick=\"coop_del('{$row["user"]}')\">删除</button>";
+					echo "<button onclick=\"coop_del('{$row["user"]}')\">".$_local->gui->delete."</button>";
+					echo "</span>";
+					
                     echo "</li>";
                 }
                 echo "</ul>";
                 ?>
-                添加协作者
+				<div id="coop_selector_title">
+                <?php echo $_local->gui->add." ".$_local->gui->cooperators; ?>
+				<input type="radio" id="cooperator_type_user" name="cooperator_type" checked><?php echo $_local->gui->person; ?> 
+				<input type="radio" id="cooperator_type_group" name="cooperator_type"><?php echo $_local->gui->group; ?>
+				</div>
                 <div id="wiki_search" style="width:100%;">
-                    <div><input id="username_input" type="input" placeholder="用户名" onkeyup="username_search_keyup(event,this)"/></div>
+                    <div><input id="username_input" type="input" placeholder="<?php echo $_local->gui->username; ?>" onkeyup="username_search_keyup(event,this)"/></div>
                     <div id="search_result">
                     </div>
 			    </div>

+ 27 - 0
app/group/function.php

@@ -0,0 +1,27 @@
+<?php
+
+
+require_once "../path.php";
+require_once "../public/_pdo.php";
+require_once '../public/function.php';
+require_once '../ucenter/function.php';
+
+function group_get_name($id){
+	if(isset($id)){
+		PDO_Connect("sqlite:"._FILE_DB_GROUP_);
+		$query = "SELECT name FROM group_info  WHERE id=?";
+		$Fetch = PDO_FetchRow($query,array($id));
+		if($Fetch){
+			return $Fetch["name"];
+		}
+		else{
+			return "";
+		}
+	}
+	else{
+		return "";
+	}
+}
+
+
+?>

+ 15 - 4
app/group/get.php

@@ -15,7 +15,7 @@ if(isset($_GET["id"])){
 	if($Fetch){
 		$output["info"] = $Fetch;
 		if($Fetch["parent"]==0 ){
-			#列出小组
+			#顶级组 列出小组
 			$query = "SELECT * FROM group_info  WHERE parent = ? ";
 			$FetchList = PDO_FetchAll($query,array($id));
 			$output["children"] = $FetchList;
@@ -26,11 +26,22 @@ if(isset($_GET["id"])){
 			$parent_group = PDO_FetchRow($query,array($Fetch["parent"]));
 			$output["parent"] = $parent_group;
 		}
-		#列出文件
-		if(isset($_GET["list"]) && $_GET["list"]=="file"){
+		#列出文件
+		{
 			PDO_Connect("sqlite:"._FILE_DB_FILEINDEX_);
-			$query = "SELECT * FROM group_share  WHERE group_id = ? ";
+			$query = "SELECT * FROM power  WHERE user = ? ";
 			$fileList = PDO_FetchAll($query,array($id));
+			foreach ($fileList as $key => $value) {
+				# code...
+				$query = "SELECT title FROM fileindex  WHERE id = ? ";
+				$file = PDO_FetchRow($query,array($value["doc_id"]));
+				if($file){
+					$fileList[$key]["title"]=$file["title"];
+				}
+				else{
+					$fileList[$key]["title"]="";
+				}
+			}
 			$output["file"] = $fileList;
 		}
 	}

+ 27 - 5
app/group/group.js

@@ -82,7 +82,8 @@ function group_list(id, list) {
 					let html = "";
 					let result = JSON.parse(data);
 					let key = 1;
-					html += "<div>";
+					html += "<div class='info_block'>";
+					html += "<h2>" + gLocal.gui.introduction + "</h2>";
 					html += result.info.description;
 					html += "</div>";
 					if (result.parent) {
@@ -96,8 +97,9 @@ function group_list(id, list) {
 					}
 					$("#curr_group").html("/ <a>" + result.info.name + "</a>");
 					//子小组列表
+					html += "<div class='info_block'>";
+					html += "<h2>" + gLocal.gui.sub_group + "</h2>";
 					if (result.children && result.children.length > 0) {
-						html += "<div><a href='../group/index.php?id=" + id + "&list=file'>列出公共文件</a></div>";
 						for (const iterator of result.children) {
 							html += '<div class="file_list_row" style="padding:5px;">';
 							html += '<div style="max-width:2em;flex:1;"><input type="checkbox" /></div>';
@@ -114,8 +116,14 @@ function group_list(id, list) {
 								"&list=file'>进入</a></div>";
 							html += "</div>";
 						}
+					} else {
+						html += "尚未设置小组";
 					}
-					//文件列表
+					html += "</div>";
+
+					//共享文件列表
+					html += "<div class='info_block'>";
+					html += "<h2>" + gLocal.gui.collaborate + "</h2>";
 					if (result.file && result.file.length > 0) {
 						for (const iterator of result.file) {
 							html += '<div class="file_list_row" style="padding:5px;">';
@@ -123,8 +131,17 @@ function group_list(id, list) {
 							html += "<div style='flex:1;'>" + key++ + "</div>";
 							html += "<div style='flex:2;'>" + iterator.title + "</div>";
 							html += "<div style='flex:2;'>";
-							if (iterator.power == 1) {
-								html += "拥有者";
+							switch (iterator.power) {
+								case 10:
+									html += gLocal.gui.read_only;
+									break;
+								case 20:
+									break;
+								case 30:
+									html += gLocal.gui.write;
+									break;
+								default:
+									break;
 							}
 							html += "</div>";
 							html +=
@@ -133,7 +150,12 @@ function group_list(id, list) {
 								"'>打开</a></div>";
 							html += "</div>";
 						}
+					} else {
+						html += "没有共享文档 在译经楼中添加";
 					}
+
+					html += "</div>";
+
 					$("#my_group_list").html(html);
 				} catch (e) {
 					console.error(e);

+ 5 - 0
app/group/index.php

@@ -32,6 +32,11 @@ require_once '../studio/index_head.php';
 		color: var(--btn-color);
 		cursor:auto;
 	}
+	.info_block{
+		margin-bottom:2em;
+		padding-left:1em;
+	}
+
 	</style>
 
 	<?php

+ 7 - 1
app/group/my_group_put.php

@@ -21,7 +21,13 @@ if(isset($_COOKIE["userid"])){
 	$query="INSERT INTO group_member (  user_id  , group_id  , power , group_name , level ,  status )  
 		VALUES  (  ? , ? , ? , ? , ?  ,? ) ";
 	$sth = $PDO->prepare($query);
-	$sth->execute(array($_COOKIE["userid"] ,$newid, 1 , $_POST["name"], 0 ,1 ));
+	if($_POST["parent"]==0){
+		$level = 0;
+	}
+	else{
+		$level = 1;
+	}
+	$sth->execute(array($_COOKIE["userid"] ,$newid, 1 , $_POST["name"], $level ,1 ));
 	$respond=array("status"=>0,"message"=>"");
 	if (!$sth || ($sth && $sth->errorCode() != 0)) {
 	$error = PDO_ErrorInfo();

+ 5 - 0
app/public/lang/default.json

@@ -590,6 +590,11 @@
 		"EXP_in_total": "EXP in total",
 		"day_action": "Daily Action",
 		"action": "Actions",
+		"cooperators": "Cooperators",
+		"person": "Person",
+		"write": "Write",
+		"sub_group": "Sub-Group",
+		"your": "Your",
 		"": ""
 	},
 	"grammastr": [

+ 5 - 0
app/public/lang/en.json

@@ -589,6 +589,11 @@
 		"EXP_in_total": "EXP in total",
 		"day_action": "Daily Action",
 		"action": "Actions",
+		"cooperators": "Cooperators",
+		"person": "Person",
+		"write": "Write",
+		"sub_group": "Sub-Group",
+		"your": "Your",
 		"": ""
 	},
 	"grammastr": [

+ 5 - 1
app/public/lang/my.json

@@ -589,7 +589,11 @@
 		"EXP_in_total": "EXP in total",
 		"day_action": "Daily Action",
 		"action": "Actions",
-		"": "",
+		"cooperators": "Cooperators",
+		"person": "Person",
+		"write": "Write",
+		"sub_group": "Sub-Group",
+		"your": "Your",
 		"": ""
 	},
 	"grammastr": [

+ 5 - 1
app/public/lang/si.json

@@ -594,7 +594,11 @@
 		"EXP_in_total": "EXP in total",
 		"day_action": "Daily Action",
 		"action": "Actions",
-		"": "",
+		"cooperators": "Cooperators",
+		"person": "Person",
+		"write": "Write",
+		"sub_group": "Sub-Group",
+		"your": "Your",
 		"": ""
 	},
 	"grammastr": [

+ 5 - 0
app/public/lang/zh-cn.json

@@ -592,6 +592,11 @@
 		"EXP_in_total": "总经验",
 		"day_action": "每日操作",
 		"action": "操作",
+		"cooperators": "协作者",
+		"person": "个人",
+		"write": "可编辑",
+		"sub_group": "小组",
+		"your": "你的",
 		"": ""
 	},
 	"grammastr": [

+ 63 - 58
app/public/lang/zh-tw.json

@@ -3,7 +3,7 @@
 		"50": "50+%",
 		"3rd_dictionary": "第三方詞典",
 		"accessed": "訪問",
-		"add_to_edit_list": "加入到編輯列",
+		"add_to_edit_list": "加入到編輯列",
 		"adhivacana": "術語",
 		"all": "全部",
 		"all_select": "全選",
@@ -39,13 +39,13 @@
 		"change_position": "變更地點",
 		"chars": "個字元以內",
 		"checking": "檢索中",
-		"children": "直派生",
+		"children": "直派生",
 		"chinese": "中文",
 		"click_on": "點選",
 		"click_word_to": "點詞",
 		"code_convert": "巴利編碼轉換器",
 		"color": "顏色",
-		"column_compare": "縱",
+		"column_compare": "縱",
 		"commentary": "註疏",
 		"completely_delete": "永久移除",
 		"computer": "電腦",
@@ -53,7 +53,7 @@
 		"content": "目錄",
 		"contents": "目錄",
 		"copy": "複製",
-		"copy_to_clipboard": "複製句子連結到剪下",
+		"copy_to_clipboard": "複製句子連結到剪下",
 		"creat_a_new_file_by_yourself": "新建自定檔案",
 		"created": "建立",
 		"current": "當前",
@@ -67,7 +67,7 @@
 		"departure_in_detail": "起飛詳情",
 		"desc": "降序",
 		"detaile": "內容",
-		"dhamma_time": "會延續五年的教法",
+		"dhamma_time": "會延續五年的教法",
 		"dict": "字典",
 		"dict_match": "匹配字典資料到文件",
 		"dict_terms": "術語",
@@ -76,7 +76,7 @@
 		"dictsouce": "詞典來源",
 		"difficulty": "難度評級",
 		"done": "檢索完畢",
-		"down": "下",
+		"down": "下",
 		"download": "下載",
 		"draft": "存草稿",
 		"dawn": "黃昏",
@@ -141,7 +141,7 @@
 		"import_export": "輸入/輸出",
 		"import_the_flie_from_cscd": "從第六次結集資料匯入",
 		"include": "包含",
-		"info_panal": "功能",
+		"info_panal": "功能",
 		"infomation": "檔案資訊",
 		"inline_dictionary": "內聯詞典",
 		"innerdict": "內聯詞典",
@@ -155,7 +155,7 @@
 		"lesson": "課程",
 		"letters": "字母",
 		"level": "層級",
-		"list": "列",
+		"list": "列",
 		"load": "讀取",
 		"load_from_database": "從資料庫載入字典",
 		"load_from_wbw_file": "從逐詞解析檔案載入字典",
@@ -189,7 +189,7 @@
 		"months": "個月",
 		"more": "更多",
 		"my_book": "自定義書籍",
-		"my_dictionary": "我的單詞",
+		"my_dictionary": "我的單詞",
 		"my_document": "我的檔案",
 		"my_loc": "我的位置",
 		"name": "名稱",
@@ -211,7 +211,7 @@
 		"normal": "正文",
 		"note": "註釋",
 		"now_time": "現在",
-		"num_k": "",
+		"num_k": "",
 		"num_m": "兆",
 		"ok": "成功",
 		"order_by": "排序方式",
@@ -247,7 +247,7 @@
 		"publish": "公佈",
 		"ravi": "週日",
 		"read": "閱讀",
-		"read_only": "讀",
+		"read_only": "讀",
 		"recent_scan": "最近瀏覽",
 		"recycle_bin": "回收站",
 		"ref_dict": "參考字典",
@@ -262,7 +262,7 @@
 		"revision_mode": "修訂模式",
 		"round_1": "第",
 		"round_2": "輪",
-		"row_compare": "橫",
+		"row_compare": "橫",
 		"same_word": "個相同單詞",
 		"saṃvacchara": "年",
 		"sandhi": "黏音詞顯示",
@@ -288,7 +288,7 @@
 		"smart_spell": "智慧鍵入",
 		"sora": "週六",
 		"source": "源碼",
-		"spell": "寫",
+		"spell": "寫",
 		"statistical_data": "統計資料",
 		"style": "樣式",
 		"sub_pcode": "次要編碼",
@@ -297,11 +297,11 @@
 		"successful": "成功",
 		"sukka": "週五",
 		"sun_height_degree": "正午太陽高度",
-		"system_default": "統預設",
-		"system_dictionary": "統詞典",
+		"system_default": "統預設",
+		"system_dictionary": "統詞典",
 		"tag": "標籤",
-		"templet": "模",
-		"terms_system": "術語統",
+		"templet": "模",
+		"terms_system": "術語統",
 		"thischapter": "本章",
 		"time": "時間",
 		"title": "標題",
@@ -317,11 +317,11 @@
 		"translate_convert": "譯文對讀工具",
 		"translate1": "翻譯:",
 		"translation": "譯文",
-		"translation_templet": "模生成",
+		"translation_templet": "模生成",
 		"twilight_time": "曙光",
 		"undo_shared": "取消共享",
 		"unsplit": "黏音詞拆分",
-		"up": "上",
+		"up": "上",
 		"up_and_down": "上下對譯",
 		"update_all_wbw_to_database": "所有逐詞解析資訊上傳到資料庫",
 		"user": "使用者",
@@ -429,12 +429,12 @@
 		"forms": "種形式",
 		"add_to": "新增到",
 		"undone_function": "未完成功能",
-		"click_to_chart": "點選檢視統計圖",
+		"click_to_chart": "點選檢視統計圖",
 		"frequency": "詞頻",
-		"declension_list": "變化",
+		"declension_list": "變化",
 		"distribution": "分佈圖",
 		"statistical": "統計",
-		"chart": "圖",
+		"chart": "圖",
 		"in": "在",
 		"present": "中出現",
 		"sutta": "經",
@@ -445,7 +445,7 @@
 		"atthakatha": "義註",
 		"tika": "復註",
 		"times2": "次",
-		"co_doc": "协作文档",
+		"co_doc": "協作文檔",
 		"open": "開啟",
 		"general": "通用",
 		"username": "使用者名稱",
@@ -453,9 +453,9 @@
 		"ignore": "忽略",
 		"oversize_to_load": "尺寸過大,無法載入,請縮減載入範圍",
 		"open_doc": "如果未自動跳轉,請點此開啟",
-		"page_end": "已到達頁底端",
+		"page_end": "已到達頁底端",
 		"academy": "聖書院",
-		"interface": "介",
+		"interface": "介",
 		"preference": "個性化",
 		"appearance": "外觀",
 		"theme": "主題",
@@ -476,7 +476,7 @@
 		"sukka_pakkha": "漸盈半月",
 		"com_dict": "社羣字典",
 		"contributor": "貢獻者",
-		"interface_language": "介語言",
+		"interface_language": "介語言",
 		"translation_language": "譯文語言",
 		"magic_dict_language": "詞典語言",
 		"priority": "優先順序",
@@ -510,21 +510,21 @@
 		"num_of_lesson": "課節數",
 		"signed_up": "報名數",
 		"sign_up": "報名",
-		"watch": "關",
-		"watched": "關數",
+		"watch": "關",
+		"watched": "關數",
 		"send": "傳送",
 		"accept_copy": "採納",
 		"with_idea": "我覺得……",
 		"text_num": "文字編號",
-		"copied_to_clipboard": "已複製到剪下",
+		"copied_to_clipboard": "已複製到剪下",
 		"I_know": "我知道了",
 		"text": "著作文章",
 		"anthology": "文集",
 		"channel": "版本風格",
-		"channels": "版本風格列",
+		"channels": "版本風格列",
 		"like": "贊",
 		"blank": "空白",
-		"vocabulary_list": "詞彙列",
+		"vocabulary_list": "詞彙列",
 		"private": "私享",
 		"private_note": "僅自己可見,不推訂閱,不可搜尋",
 		"unlisted": "不公開列出",
@@ -552,7 +552,7 @@
 		"composition_structure": "文章架構",
 		"search_tools": "搜尋工具",
 		"timeline": "時間線",
-		"extension": "橫對比",
+		"extension": "橫對比",
 		"no_created": "尚未建立",
 		"create_now": "現在建立",
 		"only_this_para": "獨立顯示本段",
@@ -565,16 +565,16 @@
 		"timezone": "時區",
 		"subfield": "分欄",
 		"local": "本地",
-		"form_sent": "連詞成句到剪下",
+		"form_sent": "連詞成句到剪下",
 		"hot_topic": "熱門主題",
 		"composition_intro": "依巴利而<b>著</b><br>為明法而<b>作</b>",
-		"show_nissaya": "示nissaya",
+		"show_nissaya": "示nissaya",
 		"related_para": "相應段落",
 		"disable": "停用",
 		"disable_note": "停用",
 		"not_found": "未找到",
-		"site_intro": "想學巴利不知從何開始<br>學過巴利語法但是面對聖典無從下手<br>想要翻譯巴利但面臨種種困難<br>我們都有相關工具為您提供支援<br>降低巴利語的閱讀門檻",
-		"progress_curve": "進步線",
+		"site_intro": "想學巴利不知從何開始<br>學過巴利語法但是麵對聖典無從下手<br>想要翻譯巴利但麵臨種種睏難<br>我們都有相關工具為您提供支援<br>降低巴利語的閱讀門檻",
+		"progress_curve": "進步線",
 		"day_EXP": "當日經驗",
 		"Jan": "一月",
 		"Feb": "二月",
@@ -591,6 +591,11 @@
 		"EXP_in_total": "總經驗",
 		"day_action": "每日操作",
 		"action": "操作",
+		"cooperators": "協作者",
+		"person": "個人",
+		"write": "可編輯",
+		"sub_group": "小組",
+		"your": "你的",
 		"": ""
 	},
 	"grammastr": [
@@ -1168,31 +1173,31 @@
 		},
 		{
 			"id": ".pl.$.dat.",
-			"value": "{對於諸}~${對於}~{等}${對於}~{們}${對於}~{些}${對諸}~{來說}${對}~{等來說}${對}~{們來說}${對}~{些來說}${為了諸}~${為了}~{等}${為了}~{們}${為了}~{些}${向諸}~${向}~{等}${向}~{們}${向}~{些}${對諸}~${對}~{等}${對}~{們}${對}~{些}"
+			"value": "{對於諸}~${對於}~{等}${對於}~{們}${對於}~{些}${對諸}~{來說}${對}~{等來說}${對}~{們來說}${對}~{些來說}${為了諸}~${為了}~{等}${為了}~{們}${為了}~{些}${嚮諸}~${嚮}~{等}${嚮}~{們}${嚮}~{些}${對諸}~${對}~{等}${對}~{們}${對}~{些}"
 		},
 		{
 			"id": "$.pl.$.dat.",
-			"value": "{對於諸}~${對於}~{等}${對於}~{們}${對於}~{些}${對諸}~{來說}${對}~{等來說}${對}~{們來說}${對}~{些來說}${為了諸}~${為了}~{等}${為了}~{們}${為了}~{些}${向諸}~${向}~{等}${向}~{們}${向}~{些}${對諸}~${對}~{等}${對}~{們}${對}~{些}"
+			"value": "{對於諸}~${對於}~{等}${對於}~{們}${對於}~{些}${對諸}~{來說}${對}~{等來說}${對}~{們來說}${對}~{些來說}${為了諸}~${為了}~{等}${為了}~{們}${為了}~{些}${嚮諸}~${嚮}~{等}${嚮}~{們}${嚮}~{些}${對諸}~${對}~{等}${對}~{們}${對}~{些}"
 		},
 		{
 			"id": ".1p.$.pl.$.dat.",
-			"value": "{對於諸}~${對於}~{等}${對於}~{們}${對於}~{些}${對諸}~{來說}${對}~{等來說}${對}~{們來說}${對}~{些來說}${為了諸}~${為了}~{等}${為了}~{們}${為了}~{些}${向諸}~${向}~{等}${向}~{們}${向}~{些}${對諸}~${對}~{等}${對}~{們}${對}~{些}"
+			"value": "{對於諸}~${對於}~{等}${對於}~{們}${對於}~{些}${對諸}~{來說}${對}~{等來說}${對}~{們來說}${對}~{些來說}${為了諸}~${為了}~{等}${為了}~{們}${為了}~{些}${嚮諸}~${嚮}~{等}${嚮}~{們}${嚮}~{些}${對諸}~${對}~{等}${對}~{們}${對}~{些}"
 		},
 		{
 			"id": ".2p.$.pl.$.dat.",
-			"value": "{對於諸}~${對於}~{等}${對於}~{們}${對於}~{些}${對諸}~{來說}${對}~{等來說}${對}~{們來說}${對}~{些來說}${為了諸}~${為了}~{等}${為了}~{們}${為了}~{些}${向諸}~${向}~{等}${向}~{們}${向}~{些}${對諸}~${對}~{等}${對}~{們}${對}~{些}"
+			"value": "{對於諸}~${對於}~{等}${對於}~{們}${對於}~{些}${對諸}~{來說}${對}~{等來說}${對}~{們來說}${對}~{些來說}${為了諸}~${為了}~{等}${為了}~{們}${為了}~{些}${嚮諸}~${嚮}~{等}${嚮}~{們}${嚮}~{些}${對諸}~${對}~{等}${對}~{們}${對}~{些}"
 		},
 		{
 			"id": ".m.$.pl.$.dat.",
-			"value": "{對於諸}~${對於}~{等}${對於}~{們}${對於}~{些}${對諸}~{來說}${對}~{等來說}${對}~{們來說}${對}~{些來說}${為了諸}~${為了}~{等}${為了}~{們}${為了}~{些}${向諸}~${向}~{等}${向}~{們}${向}~{些}${對諸}~${對}~{等}${對}~{們}${對}~{些}"
+			"value": "{對於諸}~${對於}~{等}${對於}~{們}${對於}~{些}${對諸}~{來說}${對}~{等來說}${對}~{們來說}${對}~{些來說}${為了諸}~${為了}~{等}${為了}~{們}${為了}~{些}${嚮諸}~${嚮}~{等}${嚮}~{們}${嚮}~{些}${對諸}~${對}~{等}${對}~{們}${對}~{些}"
 		},
 		{
 			"id": ".nt.$.pl.$.dat.",
-			"value": "{對於諸}~${對於}~{等}${對於}~{們}${對於}~{些}${對諸}~{來說}${對}~{等來說}${對}~{們來說}${對}~{些來說}${為了諸}~${為了}~{等}${為了}~{們}${為了}~{些}${向諸}~${向}~{等}${向}~{們}${向}~{些}${對諸}~${對}~{等}${對}~{們}${對}~{些}"
+			"value": "{對於諸}~${對於}~{等}${對於}~{們}${對於}~{些}${對諸}~{來說}${對}~{等來說}${對}~{們來說}${對}~{些來說}${為了諸}~${為了}~{等}${為了}~{們}${為了}~{些}${嚮諸}~${嚮}~{等}${嚮}~{們}${嚮}~{些}${對諸}~${對}~{等}${對}~{們}${對}~{些}"
 		},
 		{
 			"id": ".f.$.pl.$.dat.",
-			"value": "{對於諸}~${對於}~{等}${對於}~{們}${對於}~{些}${對諸}~{來說}${對}~{等來說}${對}~{們來說}${對}~{些來說}${為了諸}~${為了}~{等}${為了}~{們}${為了}~{些}${向諸}~${向}~{等}${向}~{們}${向}~{些}${對諸}~${對}~{等}${對}~{們}${對}~{些}"
+			"value": "{對於諸}~${對於}~{等}${對於}~{們}${對於}~{些}${對諸}~{來說}${對}~{等來說}${對}~{們來說}${對}~{些來說}${為了諸}~${為了}~{等}${為了}~{們}${為了}~{些}${嚮諸}~${嚮}~{等}${嚮}~{們}${嚮}~{些}${對諸}~${對}~{等}${對}~{們}${對}~{些}"
 		},
 		{
 			"id": ".pl.$.gen.",
@@ -1392,31 +1397,31 @@
 		},
 		{
 			"id": ".sg.$.dat.",
-			"value": "{對於}~${對}~{來說}${為了}~${}~${對}~"
+			"value": "{對於}~${對}~{來說}${為了}~${}~${對}~"
 		},
 		{
 			"id": "$.sg.$.dat.",
-			"value": "{對於}~${對}~{來說}${為了}~${}~${對}~"
+			"value": "{對於}~${對}~{來說}${為了}~${}~${對}~"
 		},
 		{
 			"id": ".1p.$.sg.$.dat.",
-			"value": "{對於}~${對}~{來說}${為了}~${}~${對}~"
+			"value": "{對於}~${對}~{來說}${為了}~${}~${對}~"
 		},
 		{
 			"id": ".2p.$.sg.$.dat.",
-			"value": "{對於}~${對}~{來說}${為了}~${}~${對}~"
+			"value": "{對於}~${對}~{來說}${為了}~${}~${對}~"
 		},
 		{
 			"id": ".m.$.sg.$.dat.",
-			"value": "{對於}~${對}~{來說}${為了}~${}~${對}~"
+			"value": "{對於}~${對}~{來說}${為了}~${}~${對}~"
 		},
 		{
 			"id": ".nt.$.sg.$.dat.",
-			"value": "{對於}~${對}~{來說}${為了}~${}~${對}~"
+			"value": "{對於}~${對}~{來說}${為了}~${}~${對}~"
 		},
 		{
 			"id": ".f.$.sg.$.dat.",
-			"value": "{對於}~${對}~{來說}${為了}~${}~${對}~"
+			"value": "{對於}~${對}~{來說}${為了}~${}~${對}~"
 		},
 		{
 			"id": ".sg.$.gen.",
@@ -2150,24 +2155,24 @@
 		"zh_tw": "正體中文"
 	},
 	"LogType": {
-		"10": "修改版本格",
-		"11": "新建版本格",
+		"10": "修改版本格",
+		"11": "新建版本格",
 		"20": "修改文章",
 		"21": "新建文章",
 		"30": "查字典",
 		"40": "修改百科",
-		"41": "查百科",
+		"41": "查百科",
 		"42": "_TERM_IN_SENT_",
 		"50": "搜索",
-		"60": "修改逐解析",
-		"61": "关系图",
-		"62": "新建逐解析",
+		"60": "修改逐解析",
+		"61": "關係圖",
+		"62": "新建逐解析",
 		"70": "修改句子",
 		"71": "新建句子",
 		"80": "修改文集",
 		"81": "新建文集",
 		"90": "搜索nissaya",
-		"100": "打开阅读器",
-		"101": "打工作室"
+		"100": "打開閱讀器",
+		"101": "打工作室"
 	}
 }

+ 13 - 0
app/redis/function.php

@@ -0,0 +1,13 @@
+<?php
+function redis_connect(){
+	return false;
+	$redis = new redis();  
+	$r_conn = $redis->connect('127.0.0.1', 6379);  
+	if($r_conn){
+		return $redis;
+	}
+	else{
+		return false;
+	}
+}
+?>

+ 7 - 3
app/redis/upgred_pali_sent.php

@@ -17,9 +17,15 @@ $stmt = $dbh->prepare($query);
 $stmt->execute();
 $redis = new redis();  
 $r_conn = $redis->connect('127.0.0.1', 6379);  
+$stringSize = 0;
 if($r_conn){
-	
 	while($sent = $stmt->fetch(PDO::FETCH_ASSOC)){
+		$stringSize += strlen($sent["text"]);
+		if($stringSize>50000000){
+			sleep(1);
+			$stringSize=0;
+			echo $sent["book"]."_".$sent["paragraph"]."\n";
+		}
 		$result = $redis->set('pali_sent_'.$sent["book"]."_".$sent["paragraph"]."_".$sent["begin"]."_".$sent["end"],$sent["text"]);  
 	}
 	echo "完成";
@@ -28,6 +34,4 @@ else{
 	echo "连接redis失败";
 }
 
-
-
 ?>

+ 1 - 1
app/studio/editor.php

@@ -154,7 +154,7 @@ else{$currDevice="computer";}
 		background-color: #f1f1f1;		
 	}
 	.trans_text_content{
-		color: var(--main-color);
+		color: unset;
 	}
 	.trans_text_info{
 		font-size: 80%;

+ 7 - 1
app/studio/index_recent.php

@@ -178,14 +178,20 @@ require_once '../studio/index_head.php';
 
 
 	<style>
+		#rs_doc_coop_shell{
+			display:none;
+		}
 		#rs_doc_coop_win{
 			min-height: 2em;
-			width: 20em;
+			width: 30em;
 			position: absolute;
 			background-color: var(--tool-bg-color1);
 			padding: 8px;
 			border-radius: 4px;
 		}
+		#rs_doc_coop_win_foot{
+			text-align: end;
+		}
 		</style>
 	<div id="rs_doc_coop_shell" >
 	<div id="rs_doc_coop_win" >

+ 120 - 103
app/studio/js/index_mydoc.js

@@ -1,6 +1,6 @@
 var my_file_title = "";
-var my_file_status = "all";//recycle
-var my_file_order = "DESC";//ASC
+var my_file_status = "all"; //recycle
+var my_file_order = "DESC"; //ASC
 
 function file_search_keyup() {
 	file_list_refresh();
@@ -21,54 +21,55 @@ function time_standardize(date) {
 	if (Local_time && Local_time.split(":").length == 3) {
 		var Local_time_string = Local_time.split(":")[0] + ":" + Local_time.split(":")[1];
 		Local_time_string += Local_time.split(":")[2].slice(2);
+	} else {
+		var Local_time_string = d.toLocaleTimeString();
 	}
-	else {
-		var Local_time_string = d.toLocaleTimeString()
-	}
-	if (date.toLocaleDateString() == today_date.toLocaleDateString()) {//如果是今天的消息,只显示时间
-		return (Local_time_string);
-	}
-	else if (date.toLocaleDateString().slice(0, 5) == today_date.toLocaleDateString().slice(0, 5)) {//如果是今年但非今天的消息,只显示月日
+	if (date.toLocaleDateString() == today_date.toLocaleDateString()) {
+		//如果是今天的消息,只显示时间
+		return Local_time_string;
+	} else if (date.toLocaleDateString().slice(0, 5) == today_date.toLocaleDateString().slice(0, 5)) {
+		//如果是今年但非今天的消息,只显示月日
 		var date_length = date.toLocaleDateString().length;
-		return (date.toLocaleDateString().slice(5, date_length));
+		return date.toLocaleDateString().slice(5, date_length);
+	} else {
+		//如果不是今年的消息,显示年月日
+		return date.toLocaleDateString();
 	}
-	else {//如果不是今年的消息,显示年月日
-		return (date.toLocaleDateString());
-	}
-
 }
 
 //显示最近查看列表
 function file_list_refresh() {
 	var d = new Date();
-	$.get("getfilelist.php",
+	$.get(
+		"getfilelist.php",
 		{
 			t: d.getTime(),
 			keyword: my_file_title,
 			status: $("#id_index_status").val(),
 			orderby: "accese_time",
 			order: "DESC",
-			currLanguage: $("#id_language").val()
+			currLanguage: $("#id_language").val(),
 		},
 		function (data, status) {
 			try {
 				let file_list = JSON.parse(data);
 				let html = "";
 				for (x in file_list) {
-					
-					html += "<div class=\"file_list_row\">";
+					html += '<div class="file_list_row">';
 
-					html += "<div class=\"file_list_col_1\">";
-					html += "<input id='file_check_" + x + "' type=\"checkbox\" />";
-					html += "<input id='file_id_" + x + "' value='" + file_list[x].id + "' type=\"hidden\" />";
+					html += '<div class="file_list_col_1">';
+					html += "<input id='file_check_" + x + '\' type="checkbox" />';
+					html += "<input id='file_id_" + x + "' value='" + file_list[x].id + '\' type="hidden" />';
 					html += "</div>";
 
-					html += "<div class=\"file_list_col_2\">";
-					if ((file_list[x].parent_id == null || file_list[x].parent_id == "") && parseInt(file_list[x].share) == 1) {
+					html += '<div class="file_list_col_2">';
+					if (
+						(file_list[x].parent_id == null || file_list[x].parent_id == "") &&
+						parseInt(file_list[x].share) == 1
+					) {
 						//shared
 						html += "<span onclick=\"file_show_coop_win('" + file_list[x].id + "')\">";
-					}
-					else {
+					} else {
 						html += "<span>";
 					}
 
@@ -76,54 +77,62 @@ function file_list_refresh() {
 					if (file_list[x].parent_id == null || file_list[x].parent_id == "") {
 						if (parseInt(file_list[x].share) == 1) {
 							//shared
-							html += "<use xlink:href=\"./svg/icon.svg#share_to_other\"></use>";
-						}
-						else {
+							html += '<use xlink:href="./svg/icon.svg#share_to_other"></use>';
+						} else {
 							//my document
-							html += "<use xlink:href=\"./svg/icon.svg#ic_person\"></use>";
+							html += '<use xlink:href="./svg/icon.svg#ic_person"></use>';
 						}
-					}
-					else {
+					} else {
 						//fork
-						html += "<use xlink:href=\"./svg/icon.svg#other_share_to_me\"></use>";
+						html += '<use xlink:href="./svg/icon.svg#other_share_to_me"></use>';
 					}
 					html += "</svg>";
 					html += "</span>";
 
 					html += "<div id='coop_show_" + file_list[x].id + "' style='display:inline;'></div>";
-					
+
 					let $link;
 					if (file_list[x].doc_info && file_list[x].doc_info.length > 1) {
-						$link = "<a href='editor.php?op=opendb&fileid=" + file_list[x].id + "' target='_blank'>[db]";
-					}
-					else {
+						$link = "<a href='editor.php?op=opendb&fileid=" + file_list[x].id + "' target='_blank'>";
+					} else {
 						$link = "<a href='editor.php?op=open&fileid=" + file_list[x].id + "' target='_blank'>";
 					}
 
-					html += $link +"<span id='title_"+file_list[x].id+"'>"+ file_list[x].title;
+					html += $link + "<span id='title_" + file_list[x].id + "'>" + file_list[x].title;
 					html += "</span></a>";
-					
+
 					//html +="<input type='input' style='diaplay:none;' id='input_title_"+file_list[x].id+"' value='"+file_list[x].title+"' />"
-					html +='<span class="icon_btn_div hidden_function">';	
-					html +='<span class="icon_btn_tip" style="margin-top: 0.7em;margin-left: 2.5em;">'+gLocal.gui.rename+'</span>';
-					html +="<button id='edit_title' type='button' class='icon_btn' onclick=\"title_change('"+file_list[x].id+"','"+file_list[x].title+"')\" >";
-					html +='	<svg class="icon">';
-					html +='		<use xlink:href="./svg/icon.svg#ic_rename"></use>';
-					html +='	</svg>';
-					html +='</button>';
-					html +='</span>	';
+					html += '<span class="icon_btn_div hidden_function">';
+					html +=
+						'<span class="icon_btn_tip" style="margin-top: 0.7em;margin-left: 2.5em;">' +
+						gLocal.gui.rename +
+						"</span>";
+					html +=
+						"<button id='edit_title' type='button' class='icon_btn' onclick=\"title_change('" +
+						file_list[x].id +
+						"','" +
+						file_list[x].title +
+						"')\" >";
+					html += '	<svg class="icon">';
+					html += '		<use xlink:href="./svg/icon.svg#ic_rename"></use>';
+					html += "	</svg>";
+					html += "</button>";
+					html += "</span>	";
 
 					html += "</div>";
 
-					html += "<div class=\"file_list_col_3\">";
+					html += '<div class="file_list_col_3">';
 
-					if ((file_list[x].parent_id && file_list[x].parent_id.length > 10) || parseInt(file_list[x].share) == 1) {
+					if (
+						(file_list[x].parent_id && file_list[x].parent_id.length > 10) ||
+						parseInt(file_list[x].share) == 1
+					) {
 						html += "<svg class='icon'>";
-						html += "<use xlink:href=\"./svg/icon.svg#ic_two_person\"></use>";
+						html += '<use xlink:href="./svg/icon.svg#ic_two_person"></use>';
 						html += "</svg>";
 					}
 					html += "</div>";
-					html += "<div class=\"file_list_col_4\">";
+					html += '<div class="file_list_col_4">';
 					let d = new Date();
 					let today_date = d.toLocaleDateString();
 					d.setTime(file_list[x].accese_time);
@@ -150,71 +159,73 @@ function file_list_refresh() {
 						html += Local_date;
 					}
 					*/
-					html += Local_time
+					html += Local_time;
 					html += "</div>";
-					html += "<div class=\"file_list_col_5\">";
+					html += '<div class="file_list_col_5">';
 
 					if (file_list[x].file_size < 102) {
 						$str_size = file_list[x].file_size + "B";
-					}
-					else if (file_list[x].file_size < (1024 * 902)) {
+					} else if (file_list[x].file_size < 1024 * 902) {
 						$str_size = (file_list[x].file_size / 1024).toFixed(0) + "KB";
-					}
-					else {
+					} else {
 						$str_size = (file_list[x].file_size / (1024 * 1024)).toFixed(1) + "MB";
 					}
 					html += $str_size;
 					if (!(file_list[x].doc_info && file_list[x].doc_info.length > 1)) {
-						html += "<a href='../doc/pcs2db.php?doc_id=" + file_list[x].id + "' target='_blank'>转数据库格式</a>";
+						html +=
+							"<a href='../doc/pcs2db.php?doc_id=" +
+							file_list[x].id +
+							"' target='_blank'>转数据库格式</a>";
 					}
 
-
-
 					html += "</div>";
 
-					html+="<div>";
-					html +='<span class="icon_btn_div hidden_function">';	
-					html +='<span class="icon_btn_tip">'+gLocal.gui.copy_share_link+'</span>';
-					html +="<button id='edit_title' type='button' class='icon_btn' onclick=\"share_link_copy_to_clipboard('"+file_list[x].id+"')\" >";
+					html += "<div>";
+					html += '<span class="icon_btn_div hidden_function">';
+					html += '<span class="icon_btn_tip">' + gLocal.gui.copy_share_link + "</span>";
+					html +=
+						"<button id='edit_title' type='button' class='icon_btn' onclick=\"share_link_copy_to_clipboard('" +
+						file_list[x].id +
+						"')\" >";
 					//html +='	<svg class="icon">';
 					//html +='		<use xlink:href="./svg/icon.svg#ic_rename"></use>';
 					//html +='	</svg>';
-					html +='<svg  t="1611985739555" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6173" width="200" height="200"><path d="M423.198 640a83.84 83.84 0 0 1-64-28.8 259.84 259.84 0 0 1-26.88-308.48L441.118 128a261.12 261.12 0 1 1 448 272l-35.2 57.6a83.84 83.84 0 1 1-145.92-90.24l35.2-57.6a92.8 92.8 0 0 0-158.72-96.64l-107.52 176.64a92.8 92.8 0 0 0 9.6 109.44 83.84 83.84 0 0 1-64 139.52z" p-id="6174"></path><path d="M357.918 1024a261.12 261.12 0 0 1-222.72-397.44l31.36-50.56a83.84 83.84 0 1 1 144 87.68l-31.36 51.2a92.8 92.8 0 0 0 30.72 128 91.52 91.52 0 0 0 70.4 10.88 92.16 92.16 0 0 0 57.6-41.6l107.52-177.92a93.44 93.44 0 0 0-6.4-105.6 83.84 83.84 0 1 1 134.4-103.68 262.4 262.4 0 0 1 17.28 296.96L581.278 896a259.84 259.84 0 0 1-163.84 120.32 263.68 263.68 0 0 1-59.52 7.68z" p-id="6175"></path></svg>';
-					html +='</button>';
-					html +='</span>	';					
+					html +=
+						'<svg  t="1611985739555" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6173" width="200" height="200"><path d="M423.198 640a83.84 83.84 0 0 1-64-28.8 259.84 259.84 0 0 1-26.88-308.48L441.118 128a261.12 261.12 0 1 1 448 272l-35.2 57.6a83.84 83.84 0 1 1-145.92-90.24l35.2-57.6a92.8 92.8 0 0 0-158.72-96.64l-107.52 176.64a92.8 92.8 0 0 0 9.6 109.44 83.84 83.84 0 0 1-64 139.52z" p-id="6174"></path><path d="M357.918 1024a261.12 261.12 0 0 1-222.72-397.44l31.36-50.56a83.84 83.84 0 1 1 144 87.68l-31.36 51.2a92.8 92.8 0 0 0 30.72 128 91.52 91.52 0 0 0 70.4 10.88 92.16 92.16 0 0 0 57.6-41.6l107.52-177.92a93.44 93.44 0 0 0-6.4-105.6 83.84 83.84 0 1 1 134.4-103.68 262.4 262.4 0 0 1 17.28 296.96L581.278 896a259.84 259.84 0 0 1-163.84 120.32 263.68 263.68 0 0 1-59.52 7.68z" p-id="6175"></path></svg>';
+					html += "</button>";
+					html += "</span>	";
 					html += "</div>";
 
 					html += "</div>";
 				}
-				html += "<input id='file_count' type='hidden' value='" + file_list.length + "'/>"
+				html += "<input id='file_count' type='hidden' value='" + file_list.length + "'/>";
 				$("#userfilelist").html(html);
-			}
-			catch (e) {
+			} catch (e) {
 				console.error(e.message);
 			}
-		});
+		}
+	);
 }
 
 function showUserFilaList() {
 	file_list_refresh();
 }
 
-function title_change(id,title){
-	let newTitle = prompt("新的标题",title);
-	if(newTitle){
-		_doc_info_title_change(id,newTitle,function(data,status){
-		let result = JSON.parse(data);
-		if(result.error==false){
-			$("#title_"+id).text(newTitle);
-		}
-		else{
-			alert(result.message);
-		}
-	});
+function title_change(id, title) {
+	let newTitle = prompt("新的标题", title);
+	if (newTitle) {
+		_doc_info_title_change(id, newTitle, function (data, status) {
+			let result = JSON.parse(data);
+			if (result.error == false) {
+				$("#title_" + id).text(newTitle);
+			} else {
+				alert(result.message);
+			}
+		});
 	}
 }
-function share_link_copy_to_clipboard(id){
-	copy_to_clipboard("https://www.wikipali.org/app/studio/project.php?op=open&doc_id="+id)
+function share_link_copy_to_clipboard(id) {
+	copy_to_clipboard("https://www.wikipali.org/app/studio/project.php?op=open&doc_id=" + id);
 }
 function mydoc_file_select(doSelect) {
 	if (doSelect) {
@@ -226,13 +237,11 @@ function mydoc_file_select(doSelect) {
 		if ($("#id_index_status").val() == "recycle") {
 			$("#button_group_recycle").show();
 			$("#button_group_nomal").hide();
-		}
-		else {
+		} else {
 			$("#button_group_recycle").hide();
 			$("#button_group_nomal").show();
 		}
-	}
-	else {
+	} else {
 		$("#file_tools").hide();
 		$("#file_filter").show();
 		$(".file_select_checkbox").hide();
@@ -248,15 +257,17 @@ function file_del() {
 		}
 	}
 	if (file_list.length > 0) {
-		$.post("file_index.php",
+		$.post(
+			"file_index.php",
 			{
 				op: "delete",
-				file: file_list.join()
+				file: file_list.join(),
 			},
 			function (data, status) {
 				ntf_show(data);
 				file_list_refresh();
-			});
+			}
+		);
 	}
 }
 //彻底删除
@@ -269,15 +280,17 @@ function file_remove() {
 		}
 	}
 	if (file_list.length > 0) {
-		$.post("file_index.php",
+		$.post(
+			"file_index.php",
 			{
 				op: "remove",
-				file: file_list.join()
+				file: file_list.join(),
 			},
 			function (data, status) {
 				ntf_show(data);
 				file_list_refresh();
-			});
+			}
+		);
 	}
 }
 //从回收站中恢复
@@ -290,15 +303,17 @@ function file_restore() {
 		}
 	}
 	if (file_list.length > 0) {
-		$.post("file_index.php",
+		$.post(
+			"file_index.php",
 			{
 				op: "restore",
-				file: file_list.join()
+				file: file_list.join(),
 			},
 			function (data, status) {
 				ntf_show(data);
 				file_list_refresh();
-			});
+			}
+		);
 	}
 }
 function file_share(isShare) {
@@ -312,27 +327,29 @@ function file_share(isShare) {
 	if (file_list.length > 0) {
 		if (isShare) {
 			var share = 1;
-		}
-		else {
+		} else {
 			var share = 0;
 		}
-		$.post("file_index.php",
+		$.post(
+			"file_index.php",
 			{
 				op: "share",
 				share: share,
-				file: file_list.join()
+				file: file_list.join(),
 			},
 			function (data, status) {
 				alert(data);
 				//mydoc_file_select(false);
 				file_list_refresh();
-			});
+			}
+		);
 	}
 }
 
 function file_show_coop_win(doc_id) {
 	let xFileHead = document.getElementById("coop_show_" + doc_id);
 	let xCoopWin = document.getElementById("rs_doc_coop_win");
+
 	xFileHead.appendChild(xCoopWin);
 	coop_init(doc_id, "rs_doc_coop_win_inner");
 	coop_list();
@@ -342,4 +359,4 @@ function file_coop_win_close() {
 	let xShell = document.getElementById("rs_doc_coop_shell");
 	let xCoopWin = document.getElementById("rs_doc_coop_win");
 	xShell.appendChild(xCoopWin);
-}
+}

+ 1 - 1
app/studio/js/render.js

@@ -1707,7 +1707,7 @@ function render_tran_sent_block(book, para, begin, end, channal = 0, readonly =
 		if (thischannal) {
 			output += thischannal.name + "-" + thischannal.lang + "@";
 			if (thischannal.username == getCookie("username")) {
-				output += "你的";
+				output += gLocal.gui.your;
 			} else {
 				output += thischannal.nickname;
 			}

+ 25 - 11
app/term/note.php

@@ -1,8 +1,11 @@
 <?php
+require_once "../path.php";
 require_once "../public/_pdo.php";
 require_once "../public/function.php";
 require_once "../channal/function.php";
-require_once "../path.php";
+require_once "../redis/function.php";
+
+$redis = redis_connect();
 
 $_channal = new Channal();
 
@@ -108,17 +111,27 @@ foreach ($_data as $key => $value) {
 		$end=0;
 	}
 
-	$query="SELECT id,html FROM 'pali_sent' WHERE book = ? AND paragraph = ? AND begin = ? AND end = ? ";
-	$sth = $db_pali_sent->prepare($query);
-	$sth->execute(array($bookId,$para,$begin,$end));
-	$row = $sth->fetch(PDO::FETCH_ASSOC);
-	if ($row) {
-		$palitext= $row['html'];
-		$pali_text_id = $row['id'];
-	} else {
-		$palitext="";
-		$pali_text_id = 0;
+	if($redis!=false){
+		$result = $redis->get('pali_sent_'.$bookId."_".$para."_".$begin."_".$end);  
+		$palitext = $result;
+	}
+	else{
+		$query="SELECT id,html FROM 'pali_sent' WHERE book = ? AND paragraph = ? AND begin = ? AND end = ? ";
+		$sth = $db_pali_sent->prepare($query);
+		$sth->execute(array($bookId,$para,$begin,$end));
+		$row = $sth->fetch(PDO::FETCH_ASSOC);
+		if ($row) {
+			$palitext= $row['html'];
+			$pali_text_id = $row['id'];
+		} else {
+			$palitext="";
+			$pali_text_id = 0;
+		}		
 	}
+
+
+	$pali_sim=0;
+	
 	$query="SELECT count FROM 'sent_sim_index' WHERE sent_id = ? ";
 	$sth = $db_pali_sent_sim->prepare($query);
 	$sth->execute(array($pali_text_id));
@@ -129,6 +142,7 @@ foreach ($_data as $key => $value) {
 	else{
 		$pali_sim=0;
 	}
+	
 		//查询相似句
 
 	//find out translation 查询译文