Browse Source

Merge pull request #314 from visuddhinanda:master

channel 显示协作列表
visuddhinanda 5 years ago
parent
commit
4f86888fee

+ 43 - 7
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="max-width:2em;flex:1;"><input type="checkbox" /></div>';
 						html += "<div style='flex:1;'>" + key++ + "</div>";
 						html += "<div style='flex:1;'>" + key++ + "</div>";
 						html += "<div style='flex:2;'>" + iterator.name + "</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;'>";
 						html += "<div style='flex:2;'>";
 						let arrStatus = [
 						let arrStatus = [
 							{ id: 0, string: gLocal.gui.disable },
 							{ id: 0, string: gLocal.gui.disable },
@@ -65,7 +72,7 @@ function my_channal_list() {
 							"'>" +
 							"'>" +
 							gLocal.gui.edit +
 							gLocal.gui.edit +
 							"</a></div>";
 							"</a></div>";
-						html += "<div style='flex:1;'>15</div>";
+						html += "<div style='flex:1;'></div>";
 						html += "</div>";
 						html += "</div>";
 					}
 					}
 					$("#my_channal_list").html(html);
 					$("#my_channal_list").html(html);
@@ -122,7 +129,7 @@ function my_channal_edit(id) {
 					html += "</div>";
 					html += "</div>";
 
 
 					html += '<div style="display:flex;line-height:32px;">';
 					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 += '<div style="flex:8;">';
 					html +=
 					html +=
 						'<input id="channal_lang_select" type="input"  onchange="channal_lang_change()"' +
 						'<input id="channal_lang_select" type="input"  onchange="channal_lang_change()"' +
@@ -138,7 +145,7 @@ function my_channal_edit(id) {
 					html += "</div>";
 					html += "</div>";
 
 
 					html += '<div style="display:flex;line-height:32px;">';
 					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;">';
 					html += '<div style="flex:8;">';
 					let arrStatus = [
 					let arrStatus = [
 						{ id: 0, string: gLocal.gui.disable, note: gLocal.gui.disable_note },
 						{ id: 0, string: gLocal.gui.disable, note: gLocal.gui.disable_note },
@@ -157,13 +164,42 @@ function my_channal_edit(id) {
 					}
 					}
 
 
 					html += "</select>";
 					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 +
+						"]</a></li>";
 					html += "</div>";
 					html += "</div>";
 					html += "</div>";
 					html += "</div>";
 					html += "</div>";
 					html += "</div>";
 
 
-					html += "<div id='preview_div'>";
-					html += "<div id='preview_inner' ></div>";
+					html += "<div id='coop_div' style='padding:5px;'>";
+					html += "<h2>协作者</h2>";
+					html += "<button disabled>添加协作者</button>";
+					html += "<button disabled>添加协作群</button>";
+					html += "<div id='coop_inner' >";
+					if (typeof result.coop == "undefined" || result.coop.length == 0) {
+						html += "这里很安静";
+					} 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;">个人</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>移除</button>";
+							html += "</div>";
+							html += "</div>";
+						}
+					}
+					html += "</div>";
 					html += "</div>";
 					html += "</div>";
 
 
 					$("#channal_info").html(html);
 					$("#channal_info").html(html);

+ 20 - 4
app/channal/get.php

@@ -5,16 +5,27 @@ require_once "../path.php";
 require_once "../public/_pdo.php";
 require_once "../public/_pdo.php";
 require_once '../ucenter/function.php';
 require_once '../ucenter/function.php';
 
 
-$_userinfo = new UserInfo();
+# 找我加入的群
+PDO_Connect("sqlite:"._FILE_DB_GROUP_);
+$query = "SELECT group_id from group_member where user_id = ?  limit 0,100";
+$my_group = PDO_FetchAll($query,array($_COOKIE["userid"]));
+$userList = array();
+$userList[] = $_COOKIE["userid"];
+foreach ($my_group as $key => $value) {
+	# code...
+	$userList[]=$value["group_id"];
+}
 
 
+//找自己的
 PDO_Connect("sqlite:"._FILE_DB_CHANNAL_);
 PDO_Connect("sqlite:"._FILE_DB_CHANNAL_);
-$query = "SELECT * from channal where owner = ?   limit 0,100";
+$query = "SELECT * from channal where owner = ?  limit 0,100";
 $Fetch_my = PDO_FetchAll($query,array($_COOKIE["userid"]));
 $Fetch_my = PDO_FetchAll($query,array($_COOKIE["userid"]));
 
 
+$place_holders = implode(',', array_fill(0, count($userList), '?'));
 # 找协作的
 # 找协作的
 $Fetch_coop = array();
 $Fetch_coop = array();
-$query = "SELECT channal_id FROM cooperation WHERE  user_id = ? ";
-$coop_channal = PDO_FetchAll($query,array($_COOKIE["userid"]));
+$query = "SELECT channal_id FROM cooperation WHERE  user_id IN ($place_holders) ";
+$coop_channal = PDO_FetchAll($query,$userList);
 if(count($coop_channal)>0){
 if(count($coop_channal)>0){
     foreach ($coop_channal as $key => $value) {
     foreach ($coop_channal as $key => $value) {
         # code...
         # code...
@@ -26,6 +37,11 @@ if(count($coop_channal)>0){
     $Fetch_coop = PDO_FetchAll($query,$channal);
     $Fetch_coop = PDO_FetchAll($query,$channal);
 }
 }
 $all = array_merge_recursive($Fetch_my,$Fetch_coop);
 $all = array_merge_recursive($Fetch_my,$Fetch_coop);
+
+
+
+$_userinfo = new UserInfo();
+
 $output = array();
 $output = array();
 foreach ($all as $key => $value) {
 foreach ($all as $key => $value) {
     # code...
     # code...

+ 3 - 5
app/channal/my_channal_edit.php

@@ -23,9 +23,7 @@ require_once '../studio/index_head.php';
 		color: var(--btn-color);
 		color: var(--btn-color);
 		cursor:auto;
 		cursor:auto;
 	}
 	}
-	.file_list_block{
-		width:unset;
-	}
+
 	.case_dropdown-content>a {
 	.case_dropdown-content>a {
 		display:block;
 		display:block;
 	}
 	}
@@ -33,8 +31,8 @@ require_once '../studio/index_head.php';
 		background-color:gray;
 		background-color:gray;
 	}
 	}
 	.file_list_block {
 	.file_list_block {
-    max-width: 100%;
-    margin-right: 1em;
+    	max-width: 65em;
+    	margin-right: 1em;
 	}
 	}
 	.index_inner {
 	.index_inner {
     margin-left: 16em;
     margin-left: 16em;

+ 20 - 1
app/channal/my_channal_get.php

@@ -5,13 +5,32 @@ require_once "../path.php";
 require_once "../public/_pdo.php";
 require_once "../public/_pdo.php";
 require_once '../public/function.php';
 require_once '../public/function.php';
 require_once '../ucenter/function.php';
 require_once '../ucenter/function.php';
+require_once '../group/function.php';
 
 
 
 
 if(isset($_GET["id"])){
 if(isset($_GET["id"])){
     PDO_Connect("sqlite:"._FILE_DB_CHANNAL_);
     PDO_Connect("sqlite:"._FILE_DB_CHANNAL_);
     $id=$_GET["id"];
     $id=$_GET["id"];
     $query = "SELECT * FROM channal  WHERE id = ? ";
     $query = "SELECT * FROM channal  WHERE id = ? ";
-    $Fetch = PDO_FetchRow($query,array($id));
+	$Fetch = PDO_FetchRow($query,array($id));
+
+	#获取协作者
+	if($Fetch){
+		$user_info = new UserInfo();
+		$group_info = new GroupInfo();
+		$query = "SELECT * FROM cooperation  WHERE channal_id = ? ";
+		$coop = PDO_FetchAll($query,array($id));
+		foreach ($coop as $key => $value) {
+			# code...
+			if($value["type"]==0){
+				$coop[$key]["user_name"] = $user_info->getName($value["user_id"]);
+			}
+			else if($value["type"]==1){
+				$coop[$key]["user_name"] = $group_info->getName($value["user_id"]);
+			}
+		}
+		$Fetch["coop"]=$coop;
+	}
     echo json_encode($Fetch, JSON_UNESCAPED_UNICODE);
     echo json_encode($Fetch, JSON_UNESCAPED_UNICODE);
 }
 }
 else{
 else{

+ 60 - 57
app/doc/coop.js

@@ -24,66 +24,68 @@ function username_search_keyup(e, obj) {
 }
 }
 
 
 function username_search(keyword) {
 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 = "";
 var coop_show_div_id = "";
@@ -106,13 +108,14 @@ function coop_list() {
 	);
 	);
 }
 }
 
 
-function coop_add(userid) {
+function coop_add(userid, type) {
 	$.get(
 	$.get(
 		"../doc/coop.php",
 		"../doc/coop.php",
 		{
 		{
 			do: "add",
 			do: "add",
 			doc_id: coop_doc_id,
 			doc_id: coop_doc_id,
 			user_id: userid,
 			user_id: userid,
+			type: type,
 		},
 		},
 		function (data, status) {
 		function (data, status) {
 			$("#" + coop_show_div_id).html(data);
 			$("#" + 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
 <?php
 /*
 /*
 *
 *
@@ -10,7 +21,10 @@ set (doc_id ,userid ,value)
     require_once "../path.php";
     require_once "../path.php";
     require_once "../public/_pdo.php";
     require_once "../public/_pdo.php";
     require_once "../public/function.php";
     require_once "../public/function.php";
+    require_once "../public/load_lang.php";
     require_once "../ucenter/function.php";
     require_once "../ucenter/function.php";
+    require_once "../group/function.php";
+
 
 
     
     
     $userid="";
     $userid="";
@@ -34,10 +48,10 @@ set (doc_id ,userid ,value)
         exit;
         exit;
     } 
     } 
 
 
-    $powerlist["10"] = "阅读";
-    $powerlist["20"] = "建议";
-    $powerlist["30"] = "修改";
-    $powerlist["40"] = "管理员";
+    $powerlist["10"] = "阅读";
+    //$powerlist["20"] = "建议";
+    $powerlist["30"] = "修改";
+    //$powerlist["40"] = "管理员";
 
 
     PDO_Connect("sqlite:"._FILE_DB_FILEINDEX_);
     PDO_Connect("sqlite:"._FILE_DB_FILEINDEX_);
 
 
@@ -55,8 +69,8 @@ set (doc_id ,userid ,value)
                     case "list":
                     case "list":
                     break;
                     break;
                     case "add":
                     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 = $PDO->prepare($query);
                         $stmt->execute( 
                         $stmt->execute( 
                             array(UUID::v4(),
                             array(UUID::v4(),
@@ -66,7 +80,9 @@ set (doc_id ,userid ,value)
                             1,
                             1,
                             mTime(),
                             mTime(),
                             mTime(),
                             mTime(),
-                            mTime())
+							mTime(),
+                            $_GET["type"]
+							)
                         );
                         );
                         if (!$stmt || ($stmt && $stmt->errorCode() != 0)) {
                         if (!$stmt || ($stmt && $stmt->errorCode() != 0)) {
                             $error = PDO_ErrorInfo();
                             $error = PDO_ErrorInfo();
@@ -105,10 +121,27 @@ set (doc_id ,userid ,value)
                 $query = "SELECT * from power where doc_id = ? ";
                 $query = "SELECT * from power where doc_id = ? ";
                 $Fetch = PDO_FetchAll($query,array($_doc_id));
                 $Fetch = PDO_FetchAll($query,array($_doc_id));
 
 
-                echo "<ul>";
+                echo "<ul id='coop_u_list'>";
                 foreach($Fetch as $row){
                 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)\">";
                     echo "<select onchange=\"coop_power_change('{$row["user"]}',this)\">";
                     foreach($powerlist as $key=>$value){
                     foreach($powerlist as $key=>$value){
                         echo "<option value='{$key}' ";
                         echo "<option value='{$key}' ";
@@ -118,14 +151,20 @@ set (doc_id ,userid ,value)
                         echo ">{$value}</option>";
                         echo ">{$value}</option>";
                     }
                     }
                     echo "</select>";
                     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 "</li>";
                 }
                 }
                 echo "</ul>";
                 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 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 id="search_result">
                     </div>
                     </div>
 			    </div>
 			    </div>

+ 65 - 0
app/group/function.php

@@ -0,0 +1,65 @@
+<?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 "";
+	}
+}
+
+class GroupInfo
+{
+    private $dbh;
+    private $buffer;
+    public function __construct() {
+        $dns = "sqlite:"._FILE_DB_GROUP_;
+        $this->dbh = new PDO($dns, "", "",array(PDO::ATTR_PERSISTENT=>true));
+        $this->dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING);  
+        $buffer = array();
+    }
+
+    public function getName($id){
+        if(empty($id)){
+            return "";
+        }
+        if(isset($buffer[$id])){
+            return $buffer[$id];
+        }
+        if($this->dbh){
+            $query = "SELECT name FROM group_info WHERE id= ? ";
+            $stmt = $this->dbh->prepare($query);
+            $stmt->execute(array($id));
+            $user = $stmt->fetch(PDO::FETCH_ASSOC);
+            if($user){
+                $buffer[$id] = $user["name"];
+                return $buffer[$id];
+            }
+            else{
+                $buffer[$id] ="";
+                return $buffer[$id];
+            }            
+        }
+        else{
+            $buffer[$id] ="";
+            return $buffer[$id];
+        }
+    }
+}
+
+?>

+ 15 - 4
app/group/get.php

@@ -15,7 +15,7 @@ if(isset($_GET["id"])){
 	if($Fetch){
 	if($Fetch){
 		$output["info"] = $Fetch;
 		$output["info"] = $Fetch;
 		if($Fetch["parent"]==0 ){
 		if($Fetch["parent"]==0 ){
-			#列出小组
+			#顶级组 列出小组
 			$query = "SELECT * FROM group_info  WHERE parent = ? ";
 			$query = "SELECT * FROM group_info  WHERE parent = ? ";
 			$FetchList = PDO_FetchAll($query,array($id));
 			$FetchList = PDO_FetchAll($query,array($id));
 			$output["children"] = $FetchList;
 			$output["children"] = $FetchList;
@@ -26,11 +26,22 @@ if(isset($_GET["id"])){
 			$parent_group = PDO_FetchRow($query,array($Fetch["parent"]));
 			$parent_group = PDO_FetchRow($query,array($Fetch["parent"]));
 			$output["parent"] = $parent_group;
 			$output["parent"] = $parent_group;
 		}
 		}
-		#列出文件
-		if(isset($_GET["list"]) && $_GET["list"]=="file"){
+		#列出文件
+		{
 			PDO_Connect("sqlite:"._FILE_DB_FILEINDEX_);
 			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));
 			$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;
 			$output["file"] = $fileList;
 		}
 		}
 	}
 	}

+ 27 - 5
app/group/group.js

@@ -82,7 +82,8 @@ function group_list(id, list) {
 					let html = "";
 					let html = "";
 					let result = JSON.parse(data);
 					let result = JSON.parse(data);
 					let key = 1;
 					let key = 1;
-					html += "<div>";
+					html += "<div class='info_block'>";
+					html += "<h2>" + gLocal.gui.introduction + "</h2>";
 					html += result.info.description;
 					html += result.info.description;
 					html += "</div>";
 					html += "</div>";
 					if (result.parent) {
 					if (result.parent) {
@@ -96,8 +97,9 @@ function group_list(id, list) {
 					}
 					}
 					$("#curr_group").html("/ <a>" + result.info.name + "</a>");
 					$("#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) {
 					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) {
 						for (const iterator of result.children) {
 							html += '<div class="file_list_row" style="padding:5px;">';
 							html += '<div class="file_list_row" style="padding:5px;">';
 							html += '<div style="max-width:2em;flex:1;"><input type="checkbox" /></div>';
 							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>";
 								"&list=file'>进入</a></div>";
 							html += "</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) {
 					if (result.file && result.file.length > 0) {
 						for (const iterator of result.file) {
 						for (const iterator of result.file) {
 							html += '<div class="file_list_row" style="padding:5px;">';
 							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:1;'>" + key++ + "</div>";
 							html += "<div style='flex:2;'>" + iterator.title + "</div>";
 							html += "<div style='flex:2;'>" + iterator.title + "</div>";
 							html += "<div style='flex:2;'>";
 							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 += "</div>";
 							html +=
 							html +=
@@ -133,7 +150,12 @@ function group_list(id, list) {
 								"'>打开</a></div>";
 								"'>打开</a></div>";
 							html += "</div>";
 							html += "</div>";
 						}
 						}
+					} else {
+						html += "没有共享文档 在译经楼中添加";
 					}
 					}
+
+					html += "</div>";
+
 					$("#my_group_list").html(html);
 					$("#my_group_list").html(html);
 				} catch (e) {
 				} catch (e) {
 					console.error(e);
 					console.error(e);

+ 5 - 0
app/group/index.php

@@ -32,6 +32,11 @@ require_once '../studio/index_head.php';
 		color: var(--btn-color);
 		color: var(--btn-color);
 		cursor:auto;
 		cursor:auto;
 	}
 	}
+	.info_block{
+		margin-bottom:2em;
+		padding-left:1em;
+	}
+
 	</style>
 	</style>
 
 
 	<?php
 	<?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 )  
 	$query="INSERT INTO group_member (  user_id  , group_id  , power , group_name , level ,  status )  
 		VALUES  (  ? , ? , ? , ? , ?  ,? ) ";
 		VALUES  (  ? , ? , ? , ? , ?  ,? ) ";
 	$sth = $PDO->prepare($query);
 	$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"=>"");
 	$respond=array("status"=>0,"message"=>"");
 	if (!$sth || ($sth && $sth->errorCode() != 0)) {
 	if (!$sth || ($sth && $sth->errorCode() != 0)) {
 	$error = PDO_ErrorInfo();
 	$error = PDO_ErrorInfo();

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

@@ -358,7 +358,6 @@
 		"year_1": "- ",
 		"year_1": "- ",
 		"years": "&nbsp;year(s) ",
 		"years": "&nbsp;year(s) ",
 		"yes_string": "can ",
 		"yes_string": "can ",
-		"": "",
 		"continue": "continue",
 		"continue": "continue",
 		"account": "Username",
 		"account": "Username",
 		"new_to_wikipali": "New to Wikipāḷi",
 		"new_to_wikipali": "New to Wikipāḷi",
@@ -590,6 +589,11 @@
 		"EXP_in_total": "EXP in total",
 		"EXP_in_total": "EXP in total",
 		"day_action": "Daily Action",
 		"day_action": "Daily Action",
 		"action": "Actions",
 		"action": "Actions",
+		"cooperators": "Cooperators",
+		"person": "Person",
+		"write": "Write",
+		"sub_group": "Sub-Group",
+		"your": "Your",
 		"": ""
 		"": ""
 	},
 	},
 	"grammastr": [
 	"grammastr": [

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

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

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

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

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

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

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

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

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

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

+ 6 - 0
app/studio/css/style.css

@@ -4718,6 +4718,12 @@ note {
 .file_list_row:hover {
 .file_list_row:hover {
 	background-color: gray;
 	background-color: gray;
 }
 }
+.file_list_row .hover_button {
+	visibility: hidden;
+}
+.file_list_row:hover .hover_button {
+	visibility: visible;
+}
 
 
 #file_list_head {
 #file_list_head {
 	border-bottom: 2px solid var(--btn-hover-bg-color);
 	border-bottom: 2px solid var(--btn-hover-bg-color);

+ 1 - 1
app/studio/editor.php

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

+ 7 - 1
app/studio/index_recent.php

@@ -178,14 +178,20 @@ require_once '../studio/index_head.php';
 
 
 
 
 	<style>
 	<style>
+		#rs_doc_coop_shell{
+			display:none;
+		}
 		#rs_doc_coop_win{
 		#rs_doc_coop_win{
 			min-height: 2em;
 			min-height: 2em;
-			width: 20em;
+			width: 30em;
 			position: absolute;
 			position: absolute;
 			background-color: var(--tool-bg-color1);
 			background-color: var(--tool-bg-color1);
 			padding: 8px;
 			padding: 8px;
 			border-radius: 4px;
 			border-radius: 4px;
 		}
 		}
+		#rs_doc_coop_win_foot{
+			text-align: end;
+		}
 		</style>
 		</style>
 	<div id="rs_doc_coop_shell" >
 	<div id="rs_doc_coop_shell" >
 	<div id="rs_doc_coop_win" >
 	<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_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() {
 function file_search_keyup() {
 	file_list_refresh();
 	file_list_refresh();
@@ -21,54 +21,55 @@ function time_standardize(date) {
 	if (Local_time && Local_time.split(":").length == 3) {
 	if (Local_time && Local_time.split(":").length == 3) {
 		var Local_time_string = Local_time.split(":")[0] + ":" + Local_time.split(":")[1];
 		var Local_time_string = Local_time.split(":")[0] + ":" + Local_time.split(":")[1];
 		Local_time_string += Local_time.split(":")[2].slice(2);
 		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;
 		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() {
 function file_list_refresh() {
 	var d = new Date();
 	var d = new Date();
-	$.get("getfilelist.php",
+	$.get(
+		"getfilelist.php",
 		{
 		{
 			t: d.getTime(),
 			t: d.getTime(),
 			keyword: my_file_title,
 			keyword: my_file_title,
 			status: $("#id_index_status").val(),
 			status: $("#id_index_status").val(),
 			orderby: "accese_time",
 			orderby: "accese_time",
 			order: "DESC",
 			order: "DESC",
-			currLanguage: $("#id_language").val()
+			currLanguage: $("#id_language").val(),
 		},
 		},
 		function (data, status) {
 		function (data, status) {
 			try {
 			try {
 				let file_list = JSON.parse(data);
 				let file_list = JSON.parse(data);
 				let html = "";
 				let html = "";
 				for (x in file_list) {
 				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>";
 
 
-					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
 						//shared
 						html += "<span onclick=\"file_show_coop_win('" + file_list[x].id + "')\">";
 						html += "<span onclick=\"file_show_coop_win('" + file_list[x].id + "')\">";
-					}
-					else {
+					} else {
 						html += "<span>";
 						html += "<span>";
 					}
 					}
 
 
@@ -76,54 +77,62 @@ function file_list_refresh() {
 					if (file_list[x].parent_id == null || file_list[x].parent_id == "") {
 					if (file_list[x].parent_id == null || file_list[x].parent_id == "") {
 						if (parseInt(file_list[x].share) == 1) {
 						if (parseInt(file_list[x].share) == 1) {
 							//shared
 							//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
 							//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
 						//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 += "</svg>";
 					html += "</span>";
 					html += "</span>";
 
 
 					html += "<div id='coop_show_" + file_list[x].id + "' style='display:inline;'></div>";
 					html += "<div id='coop_show_" + file_list[x].id + "' style='display:inline;'></div>";
-					
+
 					let $link;
 					let $link;
 					if (file_list[x].doc_info && file_list[x].doc_info.length > 1) {
 					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'>";
 						$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 += "</span></a>";
-					
+
 					//html +="<input type='input' style='diaplay:none;' id='input_title_"+file_list[x].id+"' value='"+file_list[x].title+"' />"
 					//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>";
 
 
-					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 += "<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 += "</svg>";
 					}
 					}
 					html += "</div>";
 					html += "</div>";
-					html += "<div class=\"file_list_col_4\">";
+					html += '<div class="file_list_col_4">';
 					let d = new Date();
 					let d = new Date();
 					let today_date = d.toLocaleDateString();
 					let today_date = d.toLocaleDateString();
 					d.setTime(file_list[x].accese_time);
 					d.setTime(file_list[x].accese_time);
@@ -150,71 +159,73 @@ function file_list_refresh() {
 						html += Local_date;
 						html += Local_date;
 					}
 					}
 					*/
 					*/
-					html += Local_time
+					html += Local_time;
 					html += "</div>";
 					html += "</div>";
-					html += "<div class=\"file_list_col_5\">";
+					html += '<div class="file_list_col_5">';
 
 
 					if (file_list[x].file_size < 102) {
 					if (file_list[x].file_size < 102) {
 						$str_size = file_list[x].file_size + "B";
 						$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";
 						$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";
 						$str_size = (file_list[x].file_size / (1024 * 1024)).toFixed(1) + "MB";
 					}
 					}
 					html += $str_size;
 					html += $str_size;
 					if (!(file_list[x].doc_info && file_list[x].doc_info.length > 1)) {
 					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+="<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 +='	<svg class="icon">';
 					//html +='		<use xlink:href="./svg/icon.svg#ic_rename"></use>';
 					//html +='		<use xlink:href="./svg/icon.svg#ic_rename"></use>';
 					//html +='	</svg>';
 					//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 += "</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);
 				$("#userfilelist").html(html);
-			}
-			catch (e) {
+			} catch (e) {
 				console.error(e.message);
 				console.error(e.message);
 			}
 			}
-		});
+		}
+	);
 }
 }
 
 
 function showUserFilaList() {
 function showUserFilaList() {
 	file_list_refresh();
 	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) {
 function mydoc_file_select(doSelect) {
 	if (doSelect) {
 	if (doSelect) {
@@ -226,13 +237,11 @@ function mydoc_file_select(doSelect) {
 		if ($("#id_index_status").val() == "recycle") {
 		if ($("#id_index_status").val() == "recycle") {
 			$("#button_group_recycle").show();
 			$("#button_group_recycle").show();
 			$("#button_group_nomal").hide();
 			$("#button_group_nomal").hide();
-		}
-		else {
+		} else {
 			$("#button_group_recycle").hide();
 			$("#button_group_recycle").hide();
 			$("#button_group_nomal").show();
 			$("#button_group_nomal").show();
 		}
 		}
-	}
-	else {
+	} else {
 		$("#file_tools").hide();
 		$("#file_tools").hide();
 		$("#file_filter").show();
 		$("#file_filter").show();
 		$(".file_select_checkbox").hide();
 		$(".file_select_checkbox").hide();
@@ -248,15 +257,17 @@ function file_del() {
 		}
 		}
 	}
 	}
 	if (file_list.length > 0) {
 	if (file_list.length > 0) {
-		$.post("file_index.php",
+		$.post(
+			"file_index.php",
 			{
 			{
 				op: "delete",
 				op: "delete",
-				file: file_list.join()
+				file: file_list.join(),
 			},
 			},
 			function (data, status) {
 			function (data, status) {
 				ntf_show(data);
 				ntf_show(data);
 				file_list_refresh();
 				file_list_refresh();
-			});
+			}
+		);
 	}
 	}
 }
 }
 //彻底删除
 //彻底删除
@@ -269,15 +280,17 @@ function file_remove() {
 		}
 		}
 	}
 	}
 	if (file_list.length > 0) {
 	if (file_list.length > 0) {
-		$.post("file_index.php",
+		$.post(
+			"file_index.php",
 			{
 			{
 				op: "remove",
 				op: "remove",
-				file: file_list.join()
+				file: file_list.join(),
 			},
 			},
 			function (data, status) {
 			function (data, status) {
 				ntf_show(data);
 				ntf_show(data);
 				file_list_refresh();
 				file_list_refresh();
-			});
+			}
+		);
 	}
 	}
 }
 }
 //从回收站中恢复
 //从回收站中恢复
@@ -290,15 +303,17 @@ function file_restore() {
 		}
 		}
 	}
 	}
 	if (file_list.length > 0) {
 	if (file_list.length > 0) {
-		$.post("file_index.php",
+		$.post(
+			"file_index.php",
 			{
 			{
 				op: "restore",
 				op: "restore",
-				file: file_list.join()
+				file: file_list.join(),
 			},
 			},
 			function (data, status) {
 			function (data, status) {
 				ntf_show(data);
 				ntf_show(data);
 				file_list_refresh();
 				file_list_refresh();
-			});
+			}
+		);
 	}
 	}
 }
 }
 function file_share(isShare) {
 function file_share(isShare) {
@@ -312,27 +327,29 @@ function file_share(isShare) {
 	if (file_list.length > 0) {
 	if (file_list.length > 0) {
 		if (isShare) {
 		if (isShare) {
 			var share = 1;
 			var share = 1;
-		}
-		else {
+		} else {
 			var share = 0;
 			var share = 0;
 		}
 		}
-		$.post("file_index.php",
+		$.post(
+			"file_index.php",
 			{
 			{
 				op: "share",
 				op: "share",
 				share: share,
 				share: share,
-				file: file_list.join()
+				file: file_list.join(),
 			},
 			},
 			function (data, status) {
 			function (data, status) {
 				alert(data);
 				alert(data);
 				//mydoc_file_select(false);
 				//mydoc_file_select(false);
 				file_list_refresh();
 				file_list_refresh();
-			});
+			}
+		);
 	}
 	}
 }
 }
 
 
 function file_show_coop_win(doc_id) {
 function file_show_coop_win(doc_id) {
 	let xFileHead = document.getElementById("coop_show_" + doc_id);
 	let xFileHead = document.getElementById("coop_show_" + doc_id);
 	let xCoopWin = document.getElementById("rs_doc_coop_win");
 	let xCoopWin = document.getElementById("rs_doc_coop_win");
+
 	xFileHead.appendChild(xCoopWin);
 	xFileHead.appendChild(xCoopWin);
 	coop_init(doc_id, "rs_doc_coop_win_inner");
 	coop_init(doc_id, "rs_doc_coop_win_inner");
 	coop_list();
 	coop_list();
@@ -342,4 +359,4 @@ function file_coop_win_close() {
 	let xShell = document.getElementById("rs_doc_coop_shell");
 	let xShell = document.getElementById("rs_doc_coop_shell");
 	let xCoopWin = document.getElementById("rs_doc_coop_win");
 	let xCoopWin = document.getElementById("rs_doc_coop_win");
 	xShell.appendChild(xCoopWin);
 	xShell.appendChild(xCoopWin);
-}
+}

+ 775 - 843
app/studio/js/message.js

@@ -11,375 +11,347 @@ var msg_my_id = "sys_message";
 msgInitId:上次消息的最大id
 msgInitId:上次消息的最大id
 */
 */
 function msg_init(msgInitId, time = 3) {
 function msg_init(msgInitId, time = 3) {
-  iMsgLastUpdateId = msgInitId;
-  msgTime = time * 1000;
+	iMsgLastUpdateId = msgInitId;
+	msgTime = time * 1000;
 }
 }
 
 
 function msg_start() {
 function msg_start() {
-  msg_send();
+	msg_send();
 }
 }
 function msg_stop() {
 function msg_stop() {
-  clearTimeout(msg_timer);
+	clearTimeout(msg_timer);
 }
 }
 
 
 function msg_push(type, data, docid, time = 0, book = 0, paragraph = 0) {
 function msg_push(type, data, docid, time = 0, book = 0, paragraph = 0) {
-  /*
+	/*
 	data.type
 	data.type
 	data.data
 	data.data
 	data.doc
 	data.doc
   */
   */
-  let send_time = time;
-  if (time == 0) {
-    let d = new Date();
-    send_time = d.getTime();
-  }
-  var newMessage = {
-    type: type,
-    data: data,
-    docid: docid,
-    time: send_time,
-    book: book,
-    para: paragraph,
-  };
-  arrMsgBuffer.push(newMessage);
-
-  var obj = new Object();
-  obj.id = 0;
-  obj.sender = getCookie("username");
-  obj.type = newMessage.type;
-  obj.docid = newMessage.docid;
-  obj.time = newMessage.time / 5000;
-  obj.read = 1;
-  obj.data = JSON.parse(newMessage.data);
-  //doc_msg_push(obj);
-  msg_show_content(msg_curr_show_content_type, msg_curr_show_content_id);
+	let send_time = time;
+	if (time == 0) {
+		let d = new Date();
+		send_time = d.getTime();
+	}
+	var newMessage = {
+		type: type,
+		data: data,
+		docid: docid,
+		time: send_time,
+		book: book,
+		para: paragraph,
+	};
+	arrMsgBuffer.push(newMessage);
+
+	var obj = new Object();
+	obj.id = 0;
+	obj.sender = getCookie("username");
+	obj.type = newMessage.type;
+	obj.docid = newMessage.docid;
+	obj.time = newMessage.time / 5000;
+	obj.read = 1;
+	obj.data = JSON.parse(newMessage.data);
+	//doc_msg_push(obj);
+	msg_show_content(msg_curr_show_content_type, msg_curr_show_content_id);
 }
 }
 function msg_reload() {
 function msg_reload() {
-  iMsgLastUpdateId = 1;
+	iMsgLastUpdateId = 1;
 }
 }
 function msg_send() {
 function msg_send() {
-  $("#net_up").html("");
-  $("#msg_tool_bar").html("<svg class='icon'><use xlink:href='../studio/svg/icon.svg#upload_ms'></use></svg>");
-
-  if (arrMsgBuffer.length > 0) {
-    var operation = "send";
-  } else {
-    var operation = "get";
-  }
-
-  $.post(
-    "message.php",
-    {
-      op: operation,
-      lastid: iMsgLastUpdateId,
-      doclist: strMsgDocList,
-      data: JSON.stringify(arrMsgBuffer),
-    },
-    function (data, status) {
-      let xmlText = data;
-      console.log("receive mseeage:" + data);
-      let msgXml;
-      if (window.DOMParser) {
-        parser = new DOMParser();
-        msgXml = parser.parseFromString(xmlText, "text/xml");
-      } else {
-        // Internet Explorer
-
-        msgXml = new ActiveXObject("Microsoft.XMLDOM");
-        msgXml.async = "false";
-        msgXml.loadXML(xmlText);
-      }
-
-      if (msgXml == null) {
-        console.error("error:can not load Project. xml obj is null.");
-        return;
-      }
-      let arrMsg = msgXml.getElementsByTagName("msg");
-      var arrWordNewMsg = new Array();
-
-      //开始一个事务,关闭自动提交
-      doc_beginTransaction();
-      for (var x = 0; x < arrMsg.length; x++) {
-        switch (getNodeText(arrMsg[x], "type")) {
-          case "maxid":
-            iMsgLastUpdateId = getNodeText(arrMsg[x], "data");
-            doc_head("msg_db_max_id", iMsgLastUpdateId);
-            console.log("iMsgLastUpdateId:" + iMsgLastUpdateId);
-            break;
-          default:
-            //if (gXmlBookDataMsg)
-            {
-              var obj = new Object();
-              obj.id = getNodeText(arrMsg[x], "id");
-              obj.sender = getNodeText(arrMsg[x], "sender");
-              obj.type = getNodeText(arrMsg[x], "type");
-              obj.docid = getNodeText(arrMsg[x], "docid");
-              obj.time = getNodeText(arrMsg[x], "time");
-              obj.read = getNodeText(arrMsg[x], "read");
-              let objData = getNodeText(arrMsg[x], "data");
-              try {
-                obj.data = JSON.parse(objData);
-              } catch (e) {
-                obj.data = null;
-                console.error(
-                  "err:message.js-msg_send" + e + "data:" + objData
-                );
-                break;
-              }
-              //尝试用此消息更新文档数据
-              if (msg_apply_data(obj)) {
-                //如果已经使用此消息,xml标记为已读
-                //setNodeText(arrMsg[x], "read", "2");
-              }
-              doc_msg_push(obj);
-              msg_show_content(
-                msg_curr_show_content_type,
-                msg_curr_show_content_id
-              );
-
-              switch (obj.type) {
-                case "1": //wbw
-                  var iFind = false;
-                  for (
-                    var iWordId = 0;
-                    iWordId < arrWordNewMsg.length;
-                    iWordId++
-                  ) {
-                    if (arrWordNewMsg[iWordId] == obj.data.id) {
-                      iFind = true;
-                      break;
-                    }
-                  }
-                  if (!iFind) {
-                    arrWordNewMsg.push(obj.data.id);
-                  }
-                  break;
-                case "2":
-                  break;
-              }
-              //gXmlBookDataMsg.appendChild(arrMsg[x].cloneNode(true));
-            }
-            break;
-        }
-      }
-      //提交一个事务
-      doc_commit();
-      user_wbw_commit();
-
-      for (let i = 0; i < arrWordNewMsg.length; i++) {
-        updataWordHeadById(arrWordNewMsg[i]);
-      }
-      refreshNoteNumber();
-      msg_set_tool_bar_msg_counter();
-      msg_update_msg_list();
-      $("#net_down").html(" ");
-      $("#msg_tool_bar").html("<svg class='icon'><use xlink:href='../studio/svg/icon.svg#pause_ms'></use></svg>");
-
-    }
-  );
-
-  $("#net_up").html("");
-  $("#net_down").html("");
-  $("#msg_tool_bar").html("<svg class='icon'><use xlink:href='../studio/svg/icon.svg#download_ms'></use></svg>");
-
-  arrMsgBuffer = new Array();
-
-  msg_timer = setTimeout("msg_send()", msgTime);
+	$("#net_up").html("");
+	$("#msg_tool_bar").html("<svg class='icon'><use xlink:href='../studio/svg/icon.svg#upload_ms'></use></svg>");
+
+	if (arrMsgBuffer.length > 0) {
+		var operation = "send";
+	} else {
+		var operation = "get";
+	}
+
+	$.post(
+		"message.php",
+		{
+			op: operation,
+			lastid: iMsgLastUpdateId,
+			doclist: strMsgDocList,
+			data: JSON.stringify(arrMsgBuffer),
+		},
+		function (data, status) {
+			let xmlText = data;
+			console.log("receive mseeage:" + data);
+			let msgXml;
+			if (window.DOMParser) {
+				parser = new DOMParser();
+				msgXml = parser.parseFromString(xmlText, "text/xml");
+			} else {
+				// Internet Explorer
+
+				msgXml = new ActiveXObject("Microsoft.XMLDOM");
+				msgXml.async = "false";
+				msgXml.loadXML(xmlText);
+			}
+
+			if (msgXml == null) {
+				console.error("error:can not load Project. xml obj is null.");
+				return;
+			}
+			let arrMsg = msgXml.getElementsByTagName("msg");
+			var arrWordNewMsg = new Array();
+
+			//开始一个事务,关闭自动提交
+			doc_beginTransaction();
+			for (var x = 0; x < arrMsg.length; x++) {
+				switch (getNodeText(arrMsg[x], "type")) {
+					case "maxid":
+						iMsgLastUpdateId = getNodeText(arrMsg[x], "data");
+						doc_head("msg_db_max_id", iMsgLastUpdateId);
+						console.log("iMsgLastUpdateId:" + iMsgLastUpdateId);
+						break;
+					default:
+						//if (gXmlBookDataMsg)
+						{
+							var obj = new Object();
+							obj.id = getNodeText(arrMsg[x], "id");
+							obj.sender = getNodeText(arrMsg[x], "sender");
+							obj.type = getNodeText(arrMsg[x], "type");
+							obj.docid = getNodeText(arrMsg[x], "docid");
+							obj.time = getNodeText(arrMsg[x], "time");
+							obj.read = getNodeText(arrMsg[x], "read");
+							let objData = getNodeText(arrMsg[x], "data");
+							try {
+								obj.data = JSON.parse(objData);
+							} catch (e) {
+								obj.data = null;
+								console.error("err:message.js-msg_send" + e + "data:" + objData);
+								break;
+							}
+							//尝试用此消息更新文档数据
+							if (msg_apply_data(obj)) {
+								//如果已经使用此消息,xml标记为已读
+								//setNodeText(arrMsg[x], "read", "2");
+							}
+							doc_msg_push(obj);
+							msg_show_content(msg_curr_show_content_type, msg_curr_show_content_id);
+
+							switch (obj.type) {
+								case "1": //wbw
+									var iFind = false;
+									for (var iWordId = 0; iWordId < arrWordNewMsg.length; iWordId++) {
+										if (arrWordNewMsg[iWordId] == obj.data.id) {
+											iFind = true;
+											break;
+										}
+									}
+									if (!iFind) {
+										arrWordNewMsg.push(obj.data.id);
+									}
+									break;
+								case "2":
+									break;
+							}
+							//gXmlBookDataMsg.appendChild(arrMsg[x].cloneNode(true));
+						}
+						break;
+				}
+			}
+			//提交一个事务
+			doc_commit();
+			user_wbw_commit();
+
+			for (let i = 0; i < arrWordNewMsg.length; i++) {
+				updataWordHeadById(arrWordNewMsg[i]);
+			}
+			refreshNoteNumber();
+			msg_set_tool_bar_msg_counter();
+			msg_update_msg_list();
+			$("#net_down").html(" ");
+			$("#msg_tool_bar").html("<svg class='icon'><use xlink:href='../studio/svg/icon.svg#pause_ms'></use></svg>");
+		}
+	);
+
+	$("#net_up").html("");
+	$("#net_down").html("");
+	$("#msg_tool_bar").html("<svg class='icon'><use xlink:href='../studio/svg/icon.svg#download_ms'></use></svg>");
+
+	arrMsgBuffer = new Array();
+
+	msg_timer = setTimeout("msg_send()", msgTime);
 }
 }
-function msg_new_msg_id_push() { }
+function msg_new_msg_id_push() {}
 
 
-function msg_stop() { }
+function msg_stop() {}
 
 
 function msg_read(msg_obj, status = null) {
 function msg_read(msg_obj, status = null) {
-  if (msg_obj) {
-    if (status) {
-      let oldStatus = msg_obj.read;
-      msg_obj.read = status;
-      for (let i = 0; i < gDocMsgList.length; i++) {
-        if (gDocMsgList[i].data.id == msg_obj.id) {
-          gDocMsgList[i].read = status;
-          break;
-        }
-      }
-      return oldStatus;
-    } else {
-      return msg_obj.read;
-    }
-  }
+	if (msg_obj) {
+		if (status) {
+			let oldStatus = msg_obj.read;
+			msg_obj.read = status;
+			for (let i = 0; i < gDocMsgList.length; i++) {
+				if (gDocMsgList[i].data.id == msg_obj.id) {
+					gDocMsgList[i].read = status;
+					break;
+				}
+			}
+			return oldStatus;
+		} else {
+			return msg_obj.read;
+		}
+	}
 }
 }
 
 
 //将消息数据应用(apply)到文档
 //将消息数据应用(apply)到文档
 function msg_apply_data(obj) {
 function msg_apply_data(obj) {
-  if (obj.sender == getCookie("username")) {
-    //忽略自己的消息
-    msg_read(obj, 1); //设置为已读
-    return true;
-  }
-  doc_info.sendmsg = false; //不发送消息
-  try {
-    switch (obj.type) {
-      case "1": //逐词译
-        let wIndex = getWordIndex(obj.data.id);
-        if (wIndex >= 0) {
-          let xAllWord = gXmlBookDataBody.getElementsByTagName("word");
-          let xWord = xAllWord[wIndex];
-          let sReal = getNodeText(xWord, "real");
-          let wordStatus = parseInt(getNodeText(xWord, "status"));
-          let wordBodyChange = false;
-          let wordHeadChange = false;
-          let wordNoteChange = false;
-          let wordRelationChange = false;
-          let newWord = new Object();
-          newWord.real = sReal;
-          newWord.vaild = false;
-          let wordChanged = false;
-          if (
-            wordStatus != 7 &&
-            wordStatus != 5 &&
-            obj.sender != getCookie("username")
-          ) {
-            msg_read(obj, 2);
-            if (obj.data.real != null && obj.data.real != "") {
-              //setNodeText(xWord,"real",obj.data.real);
-              //newWord.real = obj.data.real;
-              //wordHeadChange=true;
-            }
-            if (obj.data.pali != null) {
-              //setNodeText(xWord,"pali",obj.data.pali);
-              //wordHeadChange=true;
-            }
-            if (obj.data.mean != null) {
-              setNodeText(xWord, "mean", obj.data.mean);
-              newWord.mean = obj.data.mean;
-              newWord.vaild = true;
-              wordBodyChange = true;
-              wordChanged = true;
-            }
-            if (obj.data.org != null) {
-              setNodeText(xWord, "org", obj.data.org);
-              newWord.parts = obj.data.org;
-              newWord.vaild = true;
-              wordBodyChange = true;
-              wordChanged = true;
-            }
-            if (obj.data.om != null) {
-              setNodeText(xWord, "om", obj.data.om);
-              newWord.partmean = obj.data.om;
-              newWord.vaild = true;
-              wordBodyChange = true;
-              wordChanged = true;
-            }
-            if (obj.data.case != null) {
-              setNodeText(xWord, "case", obj.data.case);
-              newWord.case = obj.data.case;
-              newWord.vaild = true;
-              wordBodyChange = true;
-              wordChanged = true;
-            }
-            if (obj.data.parent != null) {
-              setNodeText(xWord, "parent", obj.data.parent);
-              wordChanged = true;
-            }
-            if (obj.data.note != null) {
-              setNodeText(xWord, "note", obj.data.note);
-              wordNoteChange = true;
-              wordChanged = true;
-            }
-            if (obj.data.rela != null) {
-              //setNodeText(xWord,"rela",decodeURI(obj.data.rela));
-              setNodeText(xWord, "rela", obj.data.rela);
-              wordRelationChange = true;
-              wordChanged = true;
-            }
-            if (obj.data.bmc != null) {
-              setNodeText(xWord, "bmc", obj.data.bmc);
-              wordBodyChange = true;
-              wordChanged = true;
-            }
-            if (obj.data.bmt != null) {
-              setNodeText(xWord, "bmt", obj.data.bmt);
-              wordChanged = true;
-            }
-            if (obj.data.lock != null) {
-              setNodeText(xWord, "lock", obj.data.lock);
-              wordBodyChange = true;
-              wordChanged = true;
-            }
-            if (wordChanged) {
-              setNodeText(xWord, "status", 6);
-              //提交用户逐词解析数据库
-              user_wbw_push_word(obj.data.id);
-            }
-          }
-
-          if (wordHeadChange) {
-            updataWordHeadByIndex(wIndex);
-          }
-          if (wordBodyChange) {
-            modifyWordDetailByWordIndex(wIndex);
-          }
-          if (wordNoteChange || wordRelationChange) {
-            //updateWordNote(xWord);
-            refreshWordNoteDiv(xWord.parentNode.parentNode);
-          }
-
-          if (newWord.vaild) {
-            if (!mDict[sReal]) {
-              mDict[sReal] = new Array();
-            }
-            let isExsit = false;
-            for (let x in mDict[sReal]) {
-              if (
-                mDict[sReal].mean &&
-                mDict[sReal].mean == newWord.mean &&
-                mDict[sReal].parts &&
-                mDict[sReal].parts == newWord.parts &&
-                mDict[sReal].partmean &&
-                mDict[sReal].mean == newWord.partmean &&
-                mDict[sReal].case &&
-                mDict[sReal].case == newWord.case
-              ) {
-                isExsit = true;
-              }
-            }
-            if (!isExsit) {
-              mDict[sReal].push(newWord);
-            }
-          }
-        }
-        break;
-      case "2": //译文
-        let book = obj.data.book;
-        let para = obj.data.para;
-        let begin = obj.data.begin;
-        let end = obj.data.end;
-        $(
-          "[pcds='sent-net-all'][book='" +
-          book +
-          "'][para='" +
-          para +
-          "'][begin='" +
-          begin +
-          "']"
-        ).html(obj.data.text);
-
-        $(
-          "[pcds='sent-net-div'][book='" +
-          book +
-          "'][para='" +
-          para +
-          "'][begin='" +
-          begin +
-          "']"
-        )
-          .find(".author")
-          .html(obj.sender);
-        let tranBlock = doc_tran("#" + obj.data.id);
-        if (tranBlock == null) {
-          tranBlock = doc_tran("#" + obj.data.id, true);
-        }
-        if (tranBlock) {
-          /*
+	if (obj.sender == getCookie("username")) {
+		//忽略自己的消息
+		msg_read(obj, 1); //设置为已读
+		return true;
+	}
+	doc_info.sendmsg = false; //不发送消息
+	try {
+		switch (obj.type) {
+			case "1": //逐词译
+				let wIndex = getWordIndex(obj.data.id);
+				if (wIndex >= 0) {
+					let xAllWord = gXmlBookDataBody.getElementsByTagName("word");
+					let xWord = xAllWord[wIndex];
+					let sReal = getNodeText(xWord, "real");
+					let wordStatus = parseInt(getNodeText(xWord, "status"));
+					let wordBodyChange = false;
+					let wordHeadChange = false;
+					let wordNoteChange = false;
+					let wordRelationChange = false;
+					let newWord = new Object();
+					newWord.real = sReal;
+					newWord.vaild = false;
+					let wordChanged = false;
+					if (wordStatus != 7 && wordStatus != 5 && obj.sender != getCookie("username")) {
+						msg_read(obj, 2);
+						if (obj.data.real != null && obj.data.real != "") {
+							//setNodeText(xWord,"real",obj.data.real);
+							//newWord.real = obj.data.real;
+							//wordHeadChange=true;
+						}
+						if (obj.data.pali != null) {
+							//setNodeText(xWord,"pali",obj.data.pali);
+							//wordHeadChange=true;
+						}
+						if (obj.data.mean != null) {
+							setNodeText(xWord, "mean", obj.data.mean);
+							newWord.mean = obj.data.mean;
+							newWord.vaild = true;
+							wordBodyChange = true;
+							wordChanged = true;
+						}
+						if (obj.data.org != null) {
+							setNodeText(xWord, "org", obj.data.org);
+							newWord.parts = obj.data.org;
+							newWord.vaild = true;
+							wordBodyChange = true;
+							wordChanged = true;
+						}
+						if (obj.data.om != null) {
+							setNodeText(xWord, "om", obj.data.om);
+							newWord.partmean = obj.data.om;
+							newWord.vaild = true;
+							wordBodyChange = true;
+							wordChanged = true;
+						}
+						if (obj.data.case != null) {
+							setNodeText(xWord, "case", obj.data.case);
+							newWord.case = obj.data.case;
+							newWord.vaild = true;
+							wordBodyChange = true;
+							wordChanged = true;
+						}
+						if (obj.data.parent != null) {
+							setNodeText(xWord, "parent", obj.data.parent);
+							wordChanged = true;
+						}
+						if (obj.data.note != null) {
+							setNodeText(xWord, "note", obj.data.note);
+							wordNoteChange = true;
+							wordChanged = true;
+						}
+						if (obj.data.rela != null) {
+							//setNodeText(xWord,"rela",decodeURI(obj.data.rela));
+							setNodeText(xWord, "rela", obj.data.rela);
+							wordRelationChange = true;
+							wordChanged = true;
+						}
+						if (obj.data.bmc != null) {
+							setNodeText(xWord, "bmc", obj.data.bmc);
+							wordBodyChange = true;
+							wordChanged = true;
+						}
+						if (obj.data.bmt != null) {
+							setNodeText(xWord, "bmt", obj.data.bmt);
+							wordChanged = true;
+						}
+						if (obj.data.lock != null) {
+							setNodeText(xWord, "lock", obj.data.lock);
+							wordBodyChange = true;
+							wordChanged = true;
+						}
+						if (wordChanged) {
+							setNodeText(xWord, "status", 6);
+							//提交用户逐词解析数据库
+							user_wbw_push_word(obj.data.id);
+						}
+					}
+
+					if (wordHeadChange) {
+						updataWordHeadByIndex(wIndex);
+					}
+					if (wordBodyChange) {
+						modifyWordDetailByWordIndex(wIndex);
+					}
+					if (wordNoteChange || wordRelationChange) {
+						//updateWordNote(xWord);
+						refreshWordNoteDiv(xWord.parentNode.parentNode);
+					}
+
+					if (newWord.vaild) {
+						if (!mDict[sReal]) {
+							mDict[sReal] = new Array();
+						}
+						let isExsit = false;
+						for (let x in mDict[sReal]) {
+							if (
+								mDict[sReal].mean &&
+								mDict[sReal].mean == newWord.mean &&
+								mDict[sReal].parts &&
+								mDict[sReal].parts == newWord.parts &&
+								mDict[sReal].partmean &&
+								mDict[sReal].mean == newWord.partmean &&
+								mDict[sReal].case &&
+								mDict[sReal].case == newWord.case
+							) {
+								isExsit = true;
+							}
+						}
+						if (!isExsit) {
+							mDict[sReal].push(newWord);
+						}
+					}
+				}
+				break;
+			case "2": //译文
+				let book = obj.data.book;
+				let para = obj.data.para;
+				let begin = obj.data.begin;
+				let end = obj.data.end;
+				$("[pcds='sent-net-all'][book='" + book + "'][para='" + para + "'][begin='" + begin + "']").html(
+					obj.data.text
+				);
+
+				$("[pcds='sent-net-div'][book='" + book + "'][para='" + para + "'][begin='" + begin + "']")
+					.find(".author")
+					.html(obj.sender);
+				let tranBlock = doc_tran("#" + obj.data.id);
+				if (tranBlock == null) {
+					tranBlock = doc_tran("#" + obj.data.id, true);
+				}
+				if (tranBlock) {
+					/*
 					if (tranBlock.text(obj.data.begin, obj.data.end, "status") != 7) {
 					if (tranBlock.text(obj.data.begin, obj.data.end, "status") != 7) {
 						msg_read(obj, 2);//设置为自动采纳
 						msg_read(obj, 2);//设置为自动采纳
 						console.log("句子 自动采纳");
 						console.log("句子 自动采纳");
@@ -388,541 +360,501 @@ function msg_apply_data(obj) {
 						sen_save(tranBlock.info("id"), obj.data.begin, obj.data.end, obj.data.text);
 						sen_save(tranBlock.info("id"), obj.data.begin, obj.data.end, obj.data.text);
 					}
 					}
 					*/
 					*/
-        }
-
-        break;
-    }
-  } catch (e) {
-    console.error(e.message);
-    console.error(e.stack);
-  }
-  doc_info.sendmsg = true; //发送消息
-
-  if (obj.read > 0) {
-    return true;
-  } else {
-    return false;
-  }
+				}
+
+				break;
+		}
+	} catch (e) {
+		console.error(e.message);
+		console.error(e.stack);
+	}
+	doc_info.sendmsg = true; //发送消息
+
+	if (obj.read > 0) {
+		return true;
+	} else {
+		return false;
+	}
 }
 }
 
 
 function msg_word_msg_num(wid) {
 function msg_word_msg_num(wid) {
-  if (gDocMsgList == null) {
-    return;
-  }
-  var iMsg = 0;
-  for (var i = 0; i < gDocMsgList.length; i++) {
-    if (gDocMsgList[i].type == 1) {
-      if (gDocMsgList[i].data.id == wid && gDocMsgList[i].read == 0) {
-        iMsg++;
-      }
-    }
-  }
-  return iMsg;
+	if (gDocMsgList == null) {
+		return;
+	}
+	var iMsg = 0;
+	for (var i = 0; i < gDocMsgList.length; i++) {
+		if (gDocMsgList[i].type == 1) {
+			if (gDocMsgList[i].data.id == wid && gDocMsgList[i].read == 0) {
+				iMsg++;
+			}
+		}
+	}
+	return iMsg;
 }
 }
 
 
 function msg_set_tool_bar_msg_counter() {
 function msg_set_tool_bar_msg_counter() {
-  if (gDocMsgList == null) {
-    return;
-  }
-  var iMsg = 0;
-  for (var i = 0; i < gDocMsgList.length; i++) {
-    if (gDocMsgList[i].read == 0) {
-      iMsg++;
-    }
-  }
-  if (iMsg == 0) {
-    $("#icon_notify_" + msg_my_id).html("");
-    $("#icon_notify_" + msg_my_id).hide();
-  } else {
-    if (iMsg > 100) {
-      iMsg = "+99";
-    }
-    $("#icon_notify_" + msg_my_id).html(iMsg.toString());
-    $("#icon_notify_" + msg_my_id).show();
-  }
+	if (gDocMsgList == null) {
+		return;
+	}
+	var iMsg = 0;
+	for (var i = 0; i < gDocMsgList.length; i++) {
+		if (gDocMsgList[i].read == 0) {
+			iMsg++;
+		}
+	}
+	if (iMsg == 0) {
+		$("#icon_notify_" + msg_my_id).html("");
+		$("#icon_notify_" + msg_my_id).hide();
+	} else {
+		if (iMsg > 100) {
+			iMsg = "+99";
+		}
+		$("#icon_notify_" + msg_my_id).html(iMsg.toString());
+		$("#icon_notify_" + msg_my_id).show();
+	}
 }
 }
 function time_standardize(date) {
 function time_standardize(date) {
-  var today_date = new Date();
-  var Local_time = date.toLocaleTimeString();
-  //將時間去掉秒的信息
-  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();
-  }
-  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);
-  } else {
-    //如果不是今年的消息,显示年月日
-    return date.toLocaleDateString();
-  }
+	var today_date = new Date();
+	var Local_time = date.toLocaleTimeString();
+	//將時間去掉秒的信息
+	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();
+	}
+	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);
+	} else {
+		//如果不是今年的消息,显示年月日
+		return date.toLocaleDateString();
+	}
 }
 }
 
 
 //显示消息内容
 //显示消息内容
 function msg_show_content(type, id) {
 function msg_show_content(type, id) {
-  if (gDocMsgList == null) {
-    return;
-  }
-  if (type == "" || id == "") {
-    return;
-  }
-  let arrid;
-  let sen_begin, sen_end;
-  type = parseInt(type);
-
-  if (type == 2) {
-    arrid = id.split("#");
-    id = arrid[0];
-    sen_begin = arrid[1];
-    sen_end = arrid[2];
-  }
-
-  msg_curr_show_content_id = id;
-  msg_curr_show_content_type = type;
-  var iMsg = 0;
-  var outHtml = "";
-  var iLastTime = 0;
-  for (var i = 0; i < gDocMsgList.length; i++) {
-    let isFound = false;
-    switch (type) {
-      case 1:
-        if (gDocMsgList[i].type == type && gDocMsgList[i].data.id == id) {
-          isFound = true;
-        }
-        break;
-      case 2:
-        if (
-          gDocMsgList[i].type == type &&
-          gDocMsgList[i].data.id == id &&
-          gDocMsgList[i].data.begin == sen_begin &&
-          gDocMsgList[i].data.end == sen_end
-        ) {
-          isFound = true;
-        }
-        break;
-    }
-    if (isFound) {
-      iMsg++;
-      if (gDocMsgList[i].read == 0) {
-        //如果未读,设置为已读
-        msg_read(gDocMsgList[i], 1);
-      }
-
-      //三分钟之内的消息只显示一个时间标记
-      if (gDocMsgList[i].time - iLastTime > 60 * 3) {
-        var d = new Date();
-        d.setTime(gDocMsgList[i].time * 1000);
-        //var Local_date=d.toLocaleDateString().split("/");
-        var time_standardize_string = time_standardize(d);
-        outHtml +=
-          "<div class='msgbox_time'><span>" +
-          time_standardize_string +
-          "</span></div>"; //d.toLocaleeString()
-      }
-      iLastTime = gDocMsgList[i].time;
-
-      var myName = getCookie("username");
-      if (gDocMsgList[i].sender == myName) {
-        outHtml += "<div class='msgbox_div'>";
-        outHtml += "<div class='msgbox_s'>";
-        outHtml +=
-          "<div class='head'><span>" + gDocMsgList[i].sender + "</span></div>";
-      } else {
-        outHtml += "<div class='msgbox_r'>";
-        outHtml +=
-          "<div class='head'><span>" +
-          gDocMsgList[i].sender +
-          "</span><span>Apply</span></div>";
-      }
-
-      switch (parseInt(type)) {
-        case 1:
-          if (gDocMsgList[i].data.pali != null) {
-            outHtml +=
-              "<div>spell:<a onclick=\"fieldListChanged('" +
-              id +
-              "','pali','" +
-              gDocMsgList[i].data.pali +
-              "')\">" +
-              gDocMsgList[i].data.pali +
-              "</a></div>";
-          }
-          if (gDocMsgList[i].data.real != null) {
-            outHtml +=
-              "<div>real:<a onclick=\"fieldListChanged('" +
-              id +
-              "','real','" +
-              gDocMsgList[i].data.real +
-              "')\">" +
-              gDocMsgList[i].data.real +
-              "</a></div>";
-          }
-          if (gDocMsgList[i].data.mean != null) {
-            outHtml +=
-              "<div>mean:<a onclick=\"fieldListChanged('" +
-              id +
-              "','mean','" +
-              gDocMsgList[i].data.mean +
-              "')\">" +
-              gDocMsgList[i].data.mean +
-              "</a></div>";
-          }
-          if (gDocMsgList[i].data.org != null) {
-            outHtml +=
-              "<div>part:<a onclick=\"fieldListChanged('" +
-              id +
-              "','org','" +
-              gDocMsgList[i].data.org +
-              "')\">" +
-              gDocMsgList[i].data.org +
-              "</a></div>";
-          }
-          if (gDocMsgList[i].data.om != null) {
-            outHtml +=
-              "<div>part mean:<a onclick=\"fieldListChanged('" +
-              id +
-              "','om','" +
-              gDocMsgList[i].data.om +
-              "')\">" +
-              gDocMsgList[i].data.om +
-              "</a></div>";
-          }
-          if (gDocMsgList[i].data.case != null) {
-            outHtml +=
-              "<div>case:<a onclick=\"fieldListChanged('" +
-              id +
-              "','case','" +
-              gDocMsgList[i].data.case +
-              "')\">" +
-              gDocMsgList[i].data.case +
-              "</a></div>";
-          }
-          if (gDocMsgList[i].data.parent != null) {
-            outHtml +=
-              "<div>base:<a onclick=\"fieldListChanged('" +
-              id +
-              "','parent','" +
-              gDocMsgList[i].data.parent +
-              "')\">" +
-              gDocMsgList[i].data.parent +
-              "</a></div>";
-          }
-          if (gDocMsgList[i].data.note != null) {
-            outHtml +=
-              "<div>note:<a onclick=\"fieldListChanged('" +
-              id +
-              "','note','" +
-              gDocMsgList[i].data.note +
-              "')\">" +
-              gDocMsgList[i].data.note +
-              "</a></div>";
-          }
-          if (gDocMsgList[i].data.rela != null) {
-            let strRelation = decodeURI(gDocMsgList[i].data.rela);
-            outHtml +=
-              "<div>Relation:<a onclick=\"fieldListChanged('" +
-              id +
-              "','rela','" +
-              strRelation +
-              "')\">";
-            outHtml += renderWordRelationByString("", strRelation, id);
-            outHtml += "</a></div>";
-          }
-          if (gDocMsgList[i].data.lock != null) {
-            outHtml +=
-              "<div>lock:<a onclick=\"fieldListChanged('" +
-              id +
-              "','lock','" +
-              gDocMsgList[i].data.lock +
-              "')\">" +
-              gDocMsgList[i].data.lock +
-              "</a></div>";
-          }
-          if (gDocMsgList[i].data.bmc != null) {
-            outHtml +=
-              "<div>Bookmark:<a onclick=\"fieldListChanged('" +
-              id +
-              "','bmc','" +
-              gDocMsgList[i].data.bmc +
-              "')\">" +
-              gDocMsgList[i].data.bmc +
-              "</a></div>";
-          }
-          if (gDocMsgList[i].data.bmt != null) {
-            outHtml +=
-              "<div>Bookmark:<a onclick=\"fieldListChanged('" +
-              id +
-              "','bmt','" +
-              gDocMsgList[i].data.bmt +
-              "')\">" +
-              gDocMsgList[i].data.bmt +
-              "</a></div>";
-          }
-          break;
-        case 2:
-          outHtml +=
-            "<div>sentence:<a onclick=\"setTranText('" +
-            gDocMsgList[i].data.id +
-            "','" +
-            gDocMsgList[i].data.end +
-            "','" +
-            gDocMsgList[i].data.text +
-            "')\">" +
-            gDocMsgList[i].data.text +
-            "</a></div>";
-
-          break;
-      }
-      switch (gDocMsgList[i].read) {
-        case 1:
-          break;
-        case 2:
-          outHtml += "<div>已经自动采纳</div>";
-          break;
-        case 3:
-          outHtml += "<div>已被采纳</div>";
-          break;
-      }
-      outHtml += "</div></div>";
-    }
-  }
-
-  $("#msg_panal_content").html(outHtml);
-
-  switch (type) {
-    case 1:
-      updataWordHeadById(id);
-      var xAllWord = gXmlBookDataBody.getElementsByTagName("word");
-      var wordSpell = getNodeText(xAllWord[getWordIndex(id)], "real");
-      var wordId = getNodeText(xAllWord[getWordIndex(id)], "id");
-      wordSpell = "<a href='#w" + wordId + "'>" + wordSpell + "</a>";
-      $("#msg_content_title").html(wordSpell);
-      break;
-    case 2:
-      break;
-  }
-
-  msg_set_tool_bar_msg_counter();
+	if (gDocMsgList == null) {
+		return;
+	}
+	if (type == "" || id == "") {
+		return;
+	}
+	let arrid;
+	let sen_begin, sen_end;
+	type = parseInt(type);
+
+	if (type == 2) {
+		arrid = id.split("#");
+		id = arrid[0];
+		sen_begin = arrid[1];
+		sen_end = arrid[2];
+	}
+
+	msg_curr_show_content_id = id;
+	msg_curr_show_content_type = type;
+	var iMsg = 0;
+	var outHtml = "";
+	var iLastTime = 0;
+	for (var i = 0; i < gDocMsgList.length; i++) {
+		let isFound = false;
+		switch (type) {
+			case 1:
+				if (gDocMsgList[i].type == type && gDocMsgList[i].data.id == id) {
+					isFound = true;
+				}
+				break;
+			case 2:
+				if (
+					gDocMsgList[i].type == type &&
+					gDocMsgList[i].data.id == id &&
+					gDocMsgList[i].data.begin == sen_begin &&
+					gDocMsgList[i].data.end == sen_end
+				) {
+					isFound = true;
+				}
+				break;
+		}
+		if (isFound) {
+			iMsg++;
+			if (gDocMsgList[i].read == 0) {
+				//如果未读,设置为已读
+				msg_read(gDocMsgList[i], 1);
+			}
+
+			//三分钟之内的消息只显示一个时间标记
+			if (gDocMsgList[i].time - iLastTime > 60 * 3) {
+				var d = new Date();
+				d.setTime(gDocMsgList[i].time * 1000);
+				//var Local_date=d.toLocaleDateString().split("/");
+				var time_standardize_string = time_standardize(d);
+				outHtml += "<div class='msgbox_time'><span>" + time_standardize_string + "</span></div>"; //d.toLocaleeString()
+			}
+			iLastTime = gDocMsgList[i].time;
+
+			var myName = getCookie("username");
+			if (gDocMsgList[i].sender == myName) {
+				outHtml += "<div class='msgbox_div'>";
+				outHtml += "<div class='msgbox_s'>";
+				outHtml += "<div class='head'><span>" + gDocMsgList[i].sender + "</span></div>";
+			} else {
+				outHtml += "<div class='msgbox_r'>";
+				outHtml += "<div class='head'><span>" + gDocMsgList[i].sender + "</span><span>Apply</span></div>";
+			}
+
+			switch (parseInt(type)) {
+				case 1:
+					if (gDocMsgList[i].data.pali != null) {
+						outHtml +=
+							"<div>spell:<a onclick=\"fieldListChanged('" +
+							id +
+							"','pali','" +
+							gDocMsgList[i].data.pali +
+							"')\">" +
+							gDocMsgList[i].data.pali +
+							"</a></div>";
+					}
+					if (gDocMsgList[i].data.real != null) {
+						outHtml +=
+							"<div>real:<a onclick=\"fieldListChanged('" +
+							id +
+							"','real','" +
+							gDocMsgList[i].data.real +
+							"')\">" +
+							gDocMsgList[i].data.real +
+							"</a></div>";
+					}
+					if (gDocMsgList[i].data.mean != null) {
+						outHtml +=
+							"<div>mean:<a onclick=\"fieldListChanged('" +
+							id +
+							"','mean','" +
+							gDocMsgList[i].data.mean +
+							"')\">" +
+							gDocMsgList[i].data.mean +
+							"</a></div>";
+					}
+					if (gDocMsgList[i].data.org != null) {
+						outHtml +=
+							"<div>part:<a onclick=\"fieldListChanged('" +
+							id +
+							"','org','" +
+							gDocMsgList[i].data.org +
+							"')\">" +
+							gDocMsgList[i].data.org +
+							"</a></div>";
+					}
+					if (gDocMsgList[i].data.om != null) {
+						outHtml +=
+							"<div>part mean:<a onclick=\"fieldListChanged('" +
+							id +
+							"','om','" +
+							gDocMsgList[i].data.om +
+							"')\">" +
+							gDocMsgList[i].data.om +
+							"</a></div>";
+					}
+					if (gDocMsgList[i].data.case != null) {
+						outHtml +=
+							"<div>case:<a onclick=\"fieldListChanged('" +
+							id +
+							"','case','" +
+							gDocMsgList[i].data.case +
+							"')\">" +
+							gDocMsgList[i].data.case +
+							"</a></div>";
+					}
+					if (gDocMsgList[i].data.parent != null) {
+						outHtml +=
+							"<div>base:<a onclick=\"fieldListChanged('" +
+							id +
+							"','parent','" +
+							gDocMsgList[i].data.parent +
+							"')\">" +
+							gDocMsgList[i].data.parent +
+							"</a></div>";
+					}
+					if (gDocMsgList[i].data.note != null) {
+						outHtml +=
+							"<div>note:<a onclick=\"fieldListChanged('" +
+							id +
+							"','note','" +
+							gDocMsgList[i].data.note +
+							"')\">" +
+							gDocMsgList[i].data.note +
+							"</a></div>";
+					}
+					if (gDocMsgList[i].data.rela != null) {
+						let strRelation = decodeURI(gDocMsgList[i].data.rela);
+						outHtml +=
+							"<div>Relation:<a onclick=\"fieldListChanged('" + id + "','rela','" + strRelation + "')\">";
+						outHtml += renderWordRelationByString("", strRelation, id);
+						outHtml += "</a></div>";
+					}
+					if (gDocMsgList[i].data.lock != null) {
+						outHtml +=
+							"<div>lock:<a onclick=\"fieldListChanged('" +
+							id +
+							"','lock','" +
+							gDocMsgList[i].data.lock +
+							"')\">" +
+							gDocMsgList[i].data.lock +
+							"</a></div>";
+					}
+					if (gDocMsgList[i].data.bmc != null) {
+						outHtml +=
+							"<div>Bookmark:<a onclick=\"fieldListChanged('" +
+							id +
+							"','bmc','" +
+							gDocMsgList[i].data.bmc +
+							"')\">" +
+							gDocMsgList[i].data.bmc +
+							"</a></div>";
+					}
+					if (gDocMsgList[i].data.bmt != null) {
+						outHtml +=
+							"<div>Bookmark:<a onclick=\"fieldListChanged('" +
+							id +
+							"','bmt','" +
+							gDocMsgList[i].data.bmt +
+							"')\">" +
+							gDocMsgList[i].data.bmt +
+							"</a></div>";
+					}
+					break;
+				case 2:
+					outHtml +=
+						"<div>sentence:<a onclick=\"setTranText('" +
+						gDocMsgList[i].data.id +
+						"','" +
+						gDocMsgList[i].data.end +
+						"','" +
+						gDocMsgList[i].data.text +
+						"')\">" +
+						gDocMsgList[i].data.text +
+						"</a></div>";
+
+					break;
+			}
+			switch (gDocMsgList[i].read) {
+				case 1:
+					break;
+				case 2:
+					outHtml += "<div>已经自动采纳</div>";
+					break;
+				case 3:
+					outHtml += "<div>已被采纳</div>";
+					break;
+			}
+			outHtml += "</div></div>";
+		}
+	}
+
+	$("#msg_panal_content").html(outHtml);
+
+	switch (type) {
+		case 1:
+			updataWordHeadById(id);
+			var xAllWord = gXmlBookDataBody.getElementsByTagName("word");
+			var wordSpell = getNodeText(xAllWord[getWordIndex(id)], "real");
+			var wordId = getNodeText(xAllWord[getWordIndex(id)], "id");
+			wordSpell = "<a href='#w" + wordId + "'>" + wordSpell + "</a>";
+			$("#msg_content_title").html(wordSpell);
+			break;
+		case 2:
+			break;
+	}
+
+	msg_set_tool_bar_msg_counter();
 }
 }
 
 
 //刷新消息列表
 //刷新消息列表
 function msg_update_msg_list() {
 function msg_update_msg_list() {
-  if (gDocMsgList == null) {
-    return;
-  }
-  let strHtml = "";
-  let msgList = new Array();
-
-  for (var i = 0; i < gDocMsgList.length; i++) {
-    switch (gDocMsgList[i].type) {
-      case "2":
-      case "1":
-        var iFind = _msg_find_id_in_list(msgList, gDocMsgList[i].data.id);
-        if (iFind >= 0) {
-          if (gDocMsgList[i].read == 0) {
-            msgList[iFind].unread++;
-          }
-          msgList[iFind].counter++;
-          msgList[iFind].newTime = gDocMsgList[i].time;
-          msgList[iFind].sender = gDocMsgList[i].sender;
-        }
-        //没找到
-        else {
-          objMsg = new Object();
-          objMsg.id = gDocMsgList[i].data.id;
-          objMsg.data = gDocMsgList[i].data;
-          objMsg.type = gDocMsgList[i].type;
-          if (gDocMsgList[i].read == 0) {
-            objMsg.unread = 1;
-          } else {
-            objMsg.unread = 0;
-          }
-          objMsg.counter = 1;
-          objMsg.newTime = gDocMsgList[i].time;
-          objMsg.sender = gDocMsgList[i].sender;
-          msgList.push(objMsg);
-        }
-        break;
-    }
-  }
-  strHtml += "<ul class='msg_list'>";
-
-  msgList.sort(sortNumber);
-  for (var j = 0; j < 2; j++) {
-    for (var i = 0; i < msgList.length; i++) {
-      //先显示未读的 再显示已经读的
-      var times;
-      if (msgList[i].unread > 0) {
-        times = 0;
-      } else {
-        times = 1;
-      }
-      if (times == j) {
-        strHtml += "<li>";
-        var d = new Date();
-        d.setTime(msgList[i].newTime * 1000);
-        switch (msgList[i].type) {
-          case "1":
-            var xAllWord = gXmlBookDataBody.getElementsByTagName("word");
-            var wIndex = getWordIndex(msgList[i].id);
-            if (wIndex >= 0) {
-              var wordSpell = getNodeText(
-                xAllWord[getWordIndex(msgList[i].id)],
-                "real"
-              );
-            } else {
-              var wordSpell = "unkow";
-            }
-            strHtml += "<span>";
-            if (msgList[i].unread > 0) {
-              strHtml +=
-                "<span class='word_msg'  onclick=\"msg_show_msg_content('1','" +
-                msgList[i].id +
-                "')\">" +
-                msgList[i].unread +
-                "</span>";
-            }
-            strHtml += "<a href='#w" + msgList[i].id + "'>[«]</a>";
-            strHtml +=
-              "<a onclick=\"msg_show_msg_content('1','" +
-              msgList[i].id +
-              "')\">" +
-              wordSpell +
-              "</a></span>";
-            strHtml += "<span>" + time_standardize(d) + "</span>";
-            break;
-          case "2":
-            let sent_id =
-              msgList[i].id +
-              "#" +
-              msgList[i].data.begin +
-              "#" +
-              msgList[i].data.end;
-            let sent_msg_title =
-              msgList[i].data.begin +
-              "-" +
-              msgList[i].data.end +
-              "-" +
-              msgList[i].data.text.slice(0, 5);
-            strHtml +=
-              "<a onclick=\"msg_show_msg_content('2','" +
-              sent_id +
-              "')\">" +
-              sent_msg_title +
-              "</a></span>";
-            strHtml += "<span>" + time_standardize(d) + "</span>";
-            break;
-        }
-        strHtml += "</li>";
-      }
-    }
-  }
-  strHtml += "</ul>";
-
-  $("#msg_panal_list").html(strHtml);
+	if (gDocMsgList == null) {
+		return;
+	}
+	let strHtml = "";
+	let msgList = new Array();
+
+	for (var i = 0; i < gDocMsgList.length; i++) {
+		switch (gDocMsgList[i].type) {
+			case "2":
+			case "1":
+				var iFind = _msg_find_id_in_list(msgList, gDocMsgList[i].data.id);
+				if (iFind >= 0) {
+					if (gDocMsgList[i].read == 0) {
+						msgList[iFind].unread++;
+					}
+					msgList[iFind].counter++;
+					msgList[iFind].newTime = gDocMsgList[i].time;
+					msgList[iFind].sender = gDocMsgList[i].sender;
+				}
+				//没找到
+				else {
+					objMsg = new Object();
+					objMsg.id = gDocMsgList[i].data.id;
+					objMsg.data = gDocMsgList[i].data;
+					objMsg.type = gDocMsgList[i].type;
+					if (gDocMsgList[i].read == 0) {
+						objMsg.unread = 1;
+					} else {
+						objMsg.unread = 0;
+					}
+					objMsg.counter = 1;
+					objMsg.newTime = gDocMsgList[i].time;
+					objMsg.sender = gDocMsgList[i].sender;
+					msgList.push(objMsg);
+				}
+				break;
+		}
+	}
+	strHtml += "<ul class='msg_list'>";
+
+	msgList.sort(sortNumber);
+	for (var j = 0; j < 2; j++) {
+		for (var i = 0; i < msgList.length; i++) {
+			//先显示未读的 再显示已经读的
+			var times;
+			if (msgList[i].unread > 0) {
+				times = 0;
+			} else {
+				times = 1;
+			}
+			if (times == j) {
+				strHtml += "<li>";
+				var d = new Date();
+				d.setTime(msgList[i].newTime * 1000);
+				switch (msgList[i].type) {
+					case "1":
+						var xAllWord = gXmlBookDataBody.getElementsByTagName("word");
+						var wIndex = getWordIndex(msgList[i].id);
+						if (wIndex >= 0) {
+							var wordSpell = getNodeText(xAllWord[getWordIndex(msgList[i].id)], "real");
+						} else {
+							var wordSpell = "unkow";
+						}
+						strHtml += "<span>";
+						if (msgList[i].unread > 0) {
+							strHtml +=
+								"<span class='word_msg'  onclick=\"msg_show_msg_content('1','" +
+								msgList[i].id +
+								"')\">" +
+								msgList[i].unread +
+								"</span>";
+						}
+						strHtml += "<a href='#w" + msgList[i].id + "'>[«]</a>";
+						strHtml +=
+							"<a onclick=\"msg_show_msg_content('1','" +
+							msgList[i].id +
+							"')\">" +
+							wordSpell +
+							"</a></span>";
+						strHtml += "<span>" + time_standardize(d) + "</span>";
+						break;
+					case "2":
+						let sent_id = msgList[i].id + "#" + msgList[i].data.begin + "#" + msgList[i].data.end;
+						let sent_msg_title =
+							msgList[i].data.begin + "-" + msgList[i].data.end + "-" + msgList[i].data.text.slice(0, 5);
+						strHtml +=
+							"<a onclick=\"msg_show_msg_content('2','" +
+							sent_id +
+							"')\">" +
+							sent_msg_title +
+							"</a></span>";
+						strHtml += "<span>" + time_standardize(d) + "</span>";
+						break;
+				}
+				strHtml += "</li>";
+			}
+		}
+	}
+	strHtml += "</ul>";
+
+	$("#msg_panal_list").html(strHtml);
 }
 }
 function _msg_find_id_in_list(arrList, id) {
 function _msg_find_id_in_list(arrList, id) {
-  for (var i = 0; i < arrList.length; i++) {
-    if (arrList[i].id == id) {
-      return i;
-    }
-  }
-  return -1;
+	for (var i = 0; i < arrList.length; i++) {
+		if (arrList[i].id == id) {
+			return i;
+		}
+	}
+	return -1;
 }
 }
 
 
 function sortNumber(a, b) {
 function sortNumber(a, b) {
-  return b.newTime - a.newTime;
+	return b.newTime - a.newTime;
 }
 }
 
 
 function show_tran_msg(bid, begin, end) {
 function show_tran_msg(bid, begin, end) {
-  msg_show_msg_content(2, bid + "-" + begin + "-" + end);
+	msg_show_msg_content(2, bid + "-" + begin + "-" + end);
 }
 }
 
 
 function word_msg_counter_click(wordId) {
 function word_msg_counter_click(wordId) {
-  msg_show_content(1, wordId);
-  msg_show_content_panal();
-  //tab_click('msg_panal_right', 'rb_msg');
-  tab_click_b(
-    "sys_message",
-    "tab_rb_sys_message",
-    editor_show_right_tool_bar,
-    true
-  );
-  editor_show_right_tool_bar(true);
+	msg_show_content(1, wordId);
+	msg_show_content_panal();
+	//tab_click('msg_panal_right', 'rb_msg');
+	tab_click_b("sys_message", "tab_rb_sys_message", editor_show_right_tool_bar, true);
+	editor_show_right_tool_bar(true);
 }
 }
 function msg_show_msg_content(type, id) {
 function msg_show_msg_content(type, id) {
-  msg_show_content(type, id);
-  msg_show_content_panal();
-  tab_click_b(
-    "sys_message",
-    "tab_rb_sys_message",
-    editor_show_right_tool_bar,
-    true
-  );
+	msg_show_content(type, id);
+	msg_show_content_panal();
+	tab_click_b("sys_message", "tab_rb_sys_message", editor_show_right_tool_bar, true);
 }
 }
 
 
 function show_tran_net(book, para, begin, end) {
 function show_tran_net(book, para, begin, end) {
-  tab_click_b(
-    "sys_message",
-    "tab_rb_sys_message",
-    editor_show_right_tool_bar,
-    true
-  );
-  $.get(
-    "../usent/get.php",
-    {
-      book: book,
-      para: para,
-      begin: begin,
-      end: end,
-    },
-    function (data, status) {
-      let arrSent = JSON.parse(data);
-      let strHtml = "";
-      for (const iterator of arrSent) {
-        strHtml += "<div class='trans_text_block'>";
-        strHtml += "<div class='trans_text_content' >";
-        strHtml += iterator.text;
-        strHtml += "</div>";
-        strHtml +=
-          "<div class='trans_text_info'>" +
-          "<span><span class='author'>" +
-          iterator.author +
-          "</span><span class='tag'>tag</span></span>" +
-          "<span class='tools'>" +
-          "<button>采纳</button>" +
-          "</span>" +
-          "</div>";
-        strHtml += "</div>";
-      }
-      $("#msg_panal_content").html(strHtml);
-      $("#msg_panal_content").show();
-      $("#msg_panal_list").hide();
-    }
-  );
+	tab_click_b("sys_message", "tab_rb_sys_message", editor_show_right_tool_bar, true);
+	$.get(
+		"../usent/get.php",
+		{
+			book: book,
+			para: para,
+			begin: begin,
+			end: end,
+		},
+		function (data, status) {
+			let arrSent = JSON.parse(data);
+			let strHtml = "";
+			for (const iterator of arrSent) {
+				strHtml += "<div class='trans_text_block'>";
+				strHtml += "<div class='trans_text_content' >";
+				strHtml += iterator.text;
+				strHtml += "</div>";
+				strHtml +=
+					"<div class='trans_text_info'>" +
+					"<span><span class='author'>" +
+					iterator.c_name +
+					"@" +
+					iterator.c_owner.nickname +
+					"</span><span class='tag'></span></span>" +
+					"<span class='tools'>" +
+					"<button>采纳</button>" +
+					"</span>" +
+					"</div>";
+				strHtml += "</div>";
+			}
+			$("#msg_panal_content").html(strHtml);
+			$("#msg_panal_content").show();
+			$("#msg_panal_list").hide();
+		}
+	);
 }
 }
 
 
 function msg_show_list_panal() {
 function msg_show_list_panal() {
-  $("#msg_panal_content_toolbar").hide();
-  $("#msg_panal_content").hide();
+	$("#msg_panal_content_toolbar").hide();
+	$("#msg_panal_content").hide();
 
 
-  $("#msg_panal_list_toolbar").show();
-  $("#msg_panal_list").show();
+	$("#msg_panal_list_toolbar").show();
+	$("#msg_panal_list").show();
 }
 }
 function msg_show_content_panal() {
 function msg_show_content_panal() {
-  $("#msg_panal_content_toolbar").show();
-  $("#msg_panal_content").show();
+	$("#msg_panal_content_toolbar").show();
+	$("#msg_panal_content").show();
 
 
-  $("#msg_panal_list_toolbar").hide();
-  $("#msg_panal_list").hide();
+	$("#msg_panal_list_toolbar").hide();
+	$("#msg_panal_list").hide();
 }
 }

+ 12 - 3
app/studio/js/render.js

@@ -1412,7 +1412,9 @@ function renderWordParBlockInner(elementBlock) {
 				output += render_tran_sent_block(book, paragraph, sent_begin, word_id, 0, true);
 				output += render_tran_sent_block(book, paragraph, sent_begin, word_id, 0, true);
 				if (_my_channal != null) {
 				if (_my_channal != null) {
 					for (const iterator of _my_channal) {
 					for (const iterator of _my_channal) {
-						output += render_tran_sent_block(book, paragraph, sent_begin, word_id, iterator.id, false);
+						if (iterator.status > 0) {
+							output += render_tran_sent_block(book, paragraph, sent_begin, word_id, iterator.id, false);
+						}
 					}
 					}
 				}
 				}
 				//句子预览结束
 				//句子预览结束
@@ -1562,7 +1564,9 @@ function renderWordParBlockInner(elementBlock) {
 	output += render_tran_sent_block(book, paragraph, sent_begin, word_id, 0, true);
 	output += render_tran_sent_block(book, paragraph, sent_begin, word_id, 0, true);
 	if (_my_channal != null) {
 	if (_my_channal != null) {
 		for (const iterator of _my_channal) {
 		for (const iterator of _my_channal) {
-			output += render_tran_sent_block(book, paragraph, sent_begin, word_id, iterator.id, false);
+			if (iterator.status > 0) {
+				output += render_tran_sent_block(book, paragraph, sent_begin, word_id, iterator.id, false);
+			}
 		}
 		}
 	}
 	}
 
 
@@ -1701,7 +1705,12 @@ function render_tran_sent_block(book, para, begin, end, channal = 0, readonly =
 		output += "<span>";
 		output += "<span>";
 
 
 		if (thischannal) {
 		if (thischannal) {
-			output += thischannal.name + "-" + thischannal.lang;
+			output += thischannal.name + "-" + thischannal.lang + "@";
+			if (thischannal.username == getCookie("username")) {
+				output += gLocal.gui.your;
+			} else {
+				output += thischannal.nickname;
+			}
 		} else {
 		} else {
 			output += "未知的频道名";
 			output += "未知的频道名";
 		}
 		}

+ 25 - 11
app/term/note.php

@@ -1,8 +1,11 @@
 <?php
 <?php
+require_once "../path.php";
 require_once "../public/_pdo.php";
 require_once "../public/_pdo.php";
 require_once "../public/function.php";
 require_once "../public/function.php";
 require_once "../channal/function.php";
 require_once "../channal/function.php";
-require_once "../path.php";
+require_once "../redis/function.php";
+
+$redis = redis_connect();
 
 
 $_channal = new Channal();
 $_channal = new Channal();
 
 
@@ -108,17 +111,27 @@ foreach ($_data as $key => $value) {
 		$end=0;
 		$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 = ? ";
 	$query="SELECT count FROM 'sent_sim_index' WHERE sent_id = ? ";
 	$sth = $db_pali_sent_sim->prepare($query);
 	$sth = $db_pali_sent_sim->prepare($query);
 	$sth->execute(array($pali_text_id));
 	$sth->execute(array($pali_text_id));
@@ -129,6 +142,7 @@ foreach ($_data as $key => $value) {
 	else{
 	else{
 		$pali_sim=0;
 		$pali_sim=0;
 	}
 	}
+	
 		//查询相似句
 		//查询相似句
 
 
 	//find out translation 查询译文
 	//find out translation 查询译文

+ 13 - 0
app/usent/get.php

@@ -5,6 +5,8 @@
 require_once "../path.php";
 require_once "../path.php";
 require_once "../public/_pdo.php";
 require_once "../public/_pdo.php";
 require_once "../public/function.php";
 require_once "../public/function.php";
+require_once "../channal/function.php";
+require_once "../ucenter/function.php";
 
 
 	#查询有阅读权限的channel
 	#查询有阅读权限的channel
 	$channal_list = array();
 	$channal_list = array();
@@ -67,6 +69,17 @@ else{
 }
 }
 
 
 $Fetch = $stmt->fetchAll(PDO::FETCH_ASSOC);
 $Fetch = $stmt->fetchAll(PDO::FETCH_ASSOC);
+$channel_info = new  Channal();
+$user_info = new UserInfo();
+
+foreach ($Fetch as $key => $value) {
+	# code...
+	$channel = $channel_info->getChannal($value["channal"]);
+	if($channel){
+		$Fetch[$key]["c_name"] = $channel["name"];
+		$Fetch[$key]["c_owner"] = $user_info->getName($channel["owner"]);
+	}
+}
 
 
 echo json_encode($Fetch, JSON_UNESCAPED_UNICODE);
 echo json_encode($Fetch, JSON_UNESCAPED_UNICODE);