Explorar el Código

:bug: studio 译文列表显示不出来

visuddhinanda hace 5 años
padre
commit
6affbb2135
Se han modificado 3 ficheros con 40 adiciones y 11 borrados
  1. 3 3
      app/channal/get.php
  2. 4 0
      app/share/function.php
  3. 33 8
      app/studio/js/render.js

+ 3 - 3
app/channal/get.php

@@ -28,12 +28,12 @@ $channelList = array();
 
 //找自己的
 PDO_Connect(""._FILE_DB_CHANNAL_);
-$query = "SELECT id,owner,name FROM channal WHERE owner = ?  LIMIT 0,100";
+$query = "SELECT id,owner,name,status,lang FROM channal WHERE owner = ?  LIMIT 0,100";
 $Fetch_my = PDO_FetchAll($query,array($_COOKIE["userid"]));
 
 foreach ($Fetch_my as $key => $value) {
 	# code...
-	$channelList[$value["id"]]=array("id"=>$value["id"],"owner"=>$value["owner"],"name"=>$value["name"],"power"=>30);
+	$channelList[$value["id"]]=array("id"=>$value["id"],"owner"=>$value["owner"],"name"=>$value["name"],"power"=>30,"status"=>$value["status"],"lang"=>$value["lang"]);
 }
 
 # 找协作的
@@ -47,7 +47,7 @@ foreach ($coop_channal as $key => $value) {
 		}
 	}
 	else{
-		$channelList[$value["res_id"]]=array("id"=>$value["res_id"],"owner"=>$value["res_owner_id"],"name"=>$value["res_title"],"power"=>(int)$value["power"]);
+		$channelList[$value["res_id"]]=array("id"=>$value["res_id"],"owner"=>$value["res_owner_id"],"name"=>$value["res_title"],"power"=>(int)$value["power"],"status"=>(int)$value["status"],"lang"=>(int)$value["lang"]);
 	}
 }
 

+ 4 - 0
app/share/function.php

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

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

@@ -1705,8 +1705,8 @@ function render_tran_sent_block(book, para, begin, end, channal = 0, readonly =
 		output += "<span>";
 
 		if (thischannal) {
-			output += thischannal.name + "-<b>" + thischannal.lang + "</b>@";
-			if (thischannal.username == getCookie("username")) {
+			output += "<b>" + thischannal.name + "</b>@";
+			if (parseInt(thischannal.power) >= 30) {
 				output += gLocal.gui.your;
 			} else {
 				output += thischannal.nickname;
@@ -1714,6 +1714,7 @@ function render_tran_sent_block(book, para, begin, end, channal = 0, readonly =
 		} else {
 			output += "未知的频道名";
 		}
+		output += "-[" + thischannal.lang + "]";
 		output += "</span>";
 		output +=
 			"<span style='margin-left: auto;' class='send_status' id='send_" +
@@ -2206,8 +2207,16 @@ function renderWordDetailByElement_edit_a(xmlElement) {
 		_txtOutDetail += "<svg class='edit_icon';'><use xlink:href='svg/icon.svg#ic_more'></use></svg>";
 		_txtOutDetail += '<div class="case_dropdown-content">';
 		newWord = removeFormula_B(orgMeaning);
-		_txtOutDetail += "<a onclick='fieldListChanged(\"" + wordID + '","mean","[]' + newWord + "\")'>["+gLocal.gui.none+"]</a>";
-		_txtOutDetail += "<a onclick='fieldListChanged(\"" + wordID + '","mean","' + newWord + "\")'>["+gLocal.gui.auto+"]</a>";
+		_txtOutDetail +=
+			"<a onclick='fieldListChanged(\"" +
+			wordID +
+			'","mean","[]' +
+			newWord +
+			"\")'>[" +
+			gLocal.gui.none +
+			"]</a>";
+		_txtOutDetail +=
+			"<a onclick='fieldListChanged(\"" + wordID + '","mean","' + newWord + "\")'>[" + gLocal.gui.auto + "]</a>";
 		for (var i in arrFormula) {
 			newWord = removeFormula_B(orgMeaning);
 			newWord = arrFormula[i].replace("~", newWord);
@@ -2741,8 +2750,16 @@ function renderWordDetailByElement(xmlElement) {
 		_txtOutDetail += "<svg class='edit_icon';'><use xlink:href='svg/icon.svg#ic_more'></use></svg>";
 		_txtOutDetail += '<div class="case_dropdown-content">';
 		newWord = removeFormula_B(orgMeaning);
-		_txtOutDetail += "<a onclick='fieldListChanged(\"" + wordID + '","mean","[]' + newWord + "\")'>["+gLocal.gui.none+"]</a>";
-		_txtOutDetail += "<a onclick='fieldListChanged(\"" + wordID + '","mean","' + newWord + "\")'>["+gLocal.gui.auto+"]</a>";
+		_txtOutDetail +=
+			"<a onclick='fieldListChanged(\"" +
+			wordID +
+			'","mean","[]' +
+			newWord +
+			"\")'>[" +
+			gLocal.gui.none +
+			"]</a>";
+		_txtOutDetail +=
+			"<a onclick='fieldListChanged(\"" + wordID + '","mean","' + newWord + "\")'>[" + gLocal.gui.auto + "]</a>";
 		for (var i in arrFormula) {
 			newWord = removeFormula_B(orgMeaning);
 			newWord = arrFormula[i].replace("~", newWord);
@@ -3139,8 +3156,16 @@ function renderWordDetailByElement(xmlElement) {
 		_txtOutDetail += "<svg class='edit_icon';'><use xlink:href='svg/icon.svg#ic_more'></use></svg>";
 		_txtOutDetail += '<div class="case_dropdown-content">';
 		newWord = removeFormula_B(orgMeaning);
-		_txtOutDetail += "<a onclick='fieldListChanged(\"" + wordID + '","mean","[]' + newWord + "\")'>["+gLocal.gui.none+"]</a>";
-		_txtOutDetail += "<a onclick='fieldListChanged(\"" + wordID + '","mean","' + newWord + "\")'>["+gLocal.gui.auto+"]</a>";
+		_txtOutDetail +=
+			"<a onclick='fieldListChanged(\"" +
+			wordID +
+			'","mean","[]' +
+			newWord +
+			"\")'>[" +
+			gLocal.gui.none +
+			"]</a>";
+		_txtOutDetail +=
+			"<a onclick='fieldListChanged(\"" + wordID + '","mean","' + newWord + "\")'>[" + gLocal.gui.auto + "]</a>";
 		for (var i in arrFormula) {
 			newWord = removeFormula_B(orgMeaning);
 			newWord = arrFormula[i].replace("~", newWord);