Просмотр исходного кода

处理句子提交网络错误 提示再次发送

visuddhinanda 4 лет назад
Родитель
Сommit
eea55a42e9

+ 2 - 1
app/article/index.php

@@ -93,7 +93,8 @@ require_once "../pcdl/html_head.php";
 	else{
 	else{
 		$contentClass .= ' sent_mode ';
 		$contentClass .= ' sent_mode ';
 	}
 	}
-
+	$contentClass .= " $_mode ";
+	
 	?>
 	?>
 	</script>
 	</script>
 
 

+ 1 - 1
app/sync/login.php

@@ -36,7 +36,7 @@ if(isset($_POST["userid"]) && isset($_POST["password"]) ){
 				setcookie ( "sync_userid" ,  $_POST["userid"] , 0 ,  "/" , "" ,  false , true );
 				setcookie ( "sync_userid" ,  $_POST["userid"] , 0 ,  "/" , "" ,  false , true );
 				setcookie ( "sync_server" ,  $_POST["server"] , 0 ,  "/" , "" ,  false , true );				
 				setcookie ( "sync_server" ,  $_POST["server"] , 0 ,  "/" , "" ,  false , true );				
 				$redis->hset("sync://key",$_POST["userid"],$arrServerMsg["key"]);
 				$redis->hset("sync://key",$_POST["userid"],$arrServerMsg["key"]);
-				$output["message"]="本机登录成功<br>服务器验证成功<br>";
+				$output["message"]="本机登录成功<br>服务器验证成功<br>".$arrServerMsg["message"];
 				$output["message"].="<a href='index.php'>开始同步</a>";
 				$output["message"].="<a href='index.php'>开始同步</a>";
 			}
 			}
 			else{
 			else{

+ 7 - 0
app/term/error.svg

@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0)  -->
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="14px" height="14px" viewBox="0 0 14 14"  xml:space="preserve">
+	<path d="M7,0C3.134,0,0,3.134,0,7s3.134,7,7,7s7-3.134,7-7S10.866,0,7,0z M7,2c0.552,0,1,0.447,1,1S7.552,4,7,4S6,3.553,6,3
+	S6.448,2,7,2z M9,11H5v-1h1V6H5V5h3v5h1V11z" />
+</svg>

+ 1 - 0
app/term/loading-onequarter.svg

@@ -0,0 +1 @@
+<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1620719939833" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2297" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M512 512m-426.666667 0a426.666667 426.666667 0 1 0 853.333334 0 426.666667 426.666667 0 1 0-853.333334 0Z" fill="#959BA7" fill-opacity=".3" p-id="2298"></path><path d="M938.666667 512c0-235.648-191.018667-426.666667-426.666667-426.666667v426.666667h426.666667z" fill="#008CD1" p-id="2299"></path><path d="M512 512m-320 0a320 320 0 1 0 640 0 320 320 0 1 0-640 0Z" fill="#FFFFFF" p-id="2300"></path></svg>

BIN
app/term/loading.gif


+ 3 - 0
app/term/loading.svg

@@ -0,0 +1,3 @@
+<?xml version="1.0" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg t="1620719900640"  viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2162" xmlns:xlink="http://www.w3.org/1999/xlink" width="14px" height="14px"><defs><style type="text/css"></style></defs><path d="M512 128c211.2 0 384 172.8 384 384s-172.8 384-384 384-384-172.8-384-384 172.8-384 384-384m0-64C262.4 64 64 262.4 64 512s198.4 448 448 448 448-198.4 448-448-198.4-448-448-448z" fill="#333333" p-id="2163"></path><path d="M544 512m-32 0a32 32 0 1 0 64 0 32 32 0 1 0-64 0Z" fill="#333333" p-id="2164"></path><path d="M800 512m-32 0a32 32 0 1 0 64 0 32 32 0 1 0-64 0Z" fill="#333333" p-id="2165"></path><path d="M544 480h256v64h-256z" fill="#333333" p-id="2166"></path></svg>

BIN
app/term/loading2.gif


+ 18 - 6
app/term/note.js

@@ -933,6 +933,18 @@ function render_one_sent_tran_a(iterator) {
 	html += "</div>";
 	html += "</div>";
 	//tool_bar 结束
 	//tool_bar 结束
 	html += '<div class="left_bar" >';
 	html += '<div class="left_bar" >';
+	html += "<span class='icon_sent_status icon_sent_loading'>";
+	html +=
+		"<svg class='icon icon_spin' style='fill: var(--detail-color); '>" +
+		"<use xlink='http://www.w3.org/1999/xlink' href='../studio/svg/icon.svg#loading'></use>" +
+		"</svg>";
+	html += "</span>";
+	html += "<span class='icon_sent_status icon_sent_error' title='再次发送' onclick='tran_sent_save(this)'>";
+	html +=
+		"<svg class='icon' style='fill: red; '>" +
+		"<use xlink='http://www.w3.org/1999/xlink' href='../term/error.svg'></use>" +
+		"</svg>";
+	html += "</span>";
 	html += '	<div class="face">';
 	html += '	<div class="face">';
 	if (iterator.id != "") {
 	if (iterator.id != "") {
 		html += '<span class="head_img">' + iterator.editor_name.nickname.slice(0, 1) + "</span>";
 		html += '<span class="head_img">' + iterator.editor_name.nickname.slice(0, 1) + "</span>";
@@ -958,7 +970,7 @@ function render_one_sent_tran_a(iterator) {
 	html += "</span>";
 	html += "</span>";
 	html += '<span class="date">' + getPassDataTime(iterator.update_time) + "</span>";
 	html += '<span class="date">' + getPassDataTime(iterator.update_time) + "</span>";
 	html += "</div>";
 	html += "</div>";
-	html += "<div class='preview'><span class='icon_sent_send_status'></span>" + tranText + "</div>";
+	html += "<div class='preview'>" + tranText + "</div>";
 	html += "</div>";
 	html += "</div>";
 
 
 	html += '<div class="edit">';
 	html += '<div class="edit">';
@@ -1502,7 +1514,7 @@ function note_pr_save(obj) {
 	);
 	);
 
 
 	if (sent_tran_div) {
 	if (sent_tran_div) {
-		$(sent_tran_div).find(".preview").addClass("loading");
+		$(sent_tran_div).addClass("loading");
 	}
 	}
 }
 }
 
 
@@ -1562,8 +1574,8 @@ function note_sent_save_a(obj) {
 
 
 			let sent_tran_div = $(".sent_tran[channel='" + channal + "'][sid='" + sid + "']");
 			let sent_tran_div = $(".sent_tran[channel='" + channal + "'][sid='" + sid + "']");
 			if (sent_tran_div) {
 			if (sent_tran_div) {
-				sent_tran_div.first().children().find(".preview").first().removeClass("loading");
-				sent_tran_div.first().children().find(".preview").first().addClass("error");
+				sent_tran_div.removeClass("loading");
+				sent_tran_div.addClass("error");
 			}
 			}
 
 
 			switch (error) {
 			switch (error) {
@@ -1592,7 +1604,7 @@ function note_sent_save_a(obj) {
 		});
 		});
 
 
 	if (sent_tran_div) {
 	if (sent_tran_div) {
-		$(sent_tran_div).find(".preview").addClass("loading");
+		$(sent_tran_div).addClass("loading");
 	}
 	}
 }
 }
 function update_sent_tran(sentData) {}
 function update_sent_tran(sentData) {}
@@ -1639,7 +1651,7 @@ function sent_save_callback(data) {
 						}
 						}
 					}
 					}
 				}
 				}
-				sent_tran_div.find(".preview").removeClass("loading");
+				sent_tran_div.removeClass("loading");
 			}
 			}
 		} else if (result.commit_type == 3) {
 		} else if (result.commit_type == 3) {
 			ntf_show("已经提交修改建议");
 			ntf_show("已经提交修改建议");

+ 47 - 14
app/term/term.css

@@ -606,7 +606,7 @@ pw {
 }
 }
 .sent_tran .left_bar > .face {
 .sent_tran .left_bar > .face {
 	display: block;
 	display: block;
-	margin: auto 0.5em auto auto;
+	margin: 0 0.5em auto auto;
 }
 }
 .compact .left_bar > .face {
 .compact .left_bar > .face {
 	display: none;
 	display: none;
@@ -869,25 +869,58 @@ span.tran_sent {
 	display: block;
 	display: block;
 }
 }
 
 
-.icon_sent_send_status {
+.icon_sent_status {
 	display: none;
 	display: none;
-	width: auto;
-	min-width: 14px;
-	height: auto;
-	min-height: 14px;
+	width: 22px;
+	height: 22px;
 	background-repeat: no-repeat;
 	background-repeat: no-repeat;
 	background-size: contain;
 	background-size: contain;
 	margin: 0 6px;
 	margin: 0 6px;
 }
 }
-.loading .icon_sent_send_status {
-	display: inline-block;
-	background: url(waiting.svg);
-	fill: #6baaff;
+.icon_sent_status .icon {
+	width: 22px;
+	height: 22px;
 }
 }
-
-.error .icon_sent_send_status {
-	display: inline-block;
-	background: url(error.svg);
+.icon_sent_loading {
+	background: url(loading.gif);
+	background-size: contain;
+}
+.loading .icon_sent_loading {
+	display: block;
+}
+.loading .face {
+	display: none;
+}
+.error .left_bar > .face {
+	display: none;
+}
+.icon_sent_error {
+	display: none;
 	fill: red;
 	fill: red;
 	cursor: pointer;
 	cursor: pointer;
+	background: url(error.svg);
+	background-size: contain;
+}
+.error .icon_sent_error {
+	display: block;
+}
+.icon_spin {
+	-webkit-animation: spin 1.5s linear infinite;
+	animation: spin 1.5s linear infinite;
+}
+
+.read .bg_color_1 {
+	background-color: unset;
+}
+.read .bg_color_2 {
+	background: unset;
+}
+.read .bg_color_3 {
+	background: unset;
+}
+.read .bg_color_4 {
+	background: unset;
+}
+.read .bg_color_5 {
+	background: unset;
 }
 }

+ 7 - 0
app/term/waiting.svg

@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0)  -->
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="14px" height="14px" viewBox="0 0 14 14"  xml:space="preserve">
+	<path d="M7,0C3.134,0,0,3.134,0,7s3.134,7,7,7s7-3.134,7-7S10.866,0,7,0z M7,2c0.552,0,1,0.447,1,1S7.552,4,7,4S6,3.553,6,3
+	S6.448,2,7,2z M9,11H5v-1h1V6H5V5h3v5h1V11z" />
+</svg>

+ 4 - 0
app/usent/historay.js

@@ -1,3 +1,7 @@
+/**
+ * 显示句子历史记录窗口
+ */
+
 function historay_init() {
 function historay_init() {
 	$("body").append('<div id="sent_history_dlg" title="History"><div id="sent_history_content"></div></div>');
 	$("body").append('<div id="sent_history_dlg" title="History"><div id="sent_history_content"></div></div>');
 	$("#sent_history_dlg").dialog({
 	$("#sent_history_dlg").dialog({

+ 2 - 2
app/usent/usent_ref.js

@@ -124,7 +124,7 @@ class USentResult {
 								"_" +
 								"_" +
 								oneSent.channal
 								oneSent.channal
 						).html(
 						).html(
-							"<svg class='icon icon_spin' style='fill: var(--detail-color); '><use xlink='http://www.w3.org/1999/xlink' href='svg/icon.svg#loading'>"
+							"<svg class='icon icon_spin' style='fill: var(--detail-color); '><use xlink='http://www.w3.org/1999/xlink' href='svg/icon.svg#loading'></use></svg>"
 						);
 						);
 					}
 					}
 					$.post(
 					$.post(
@@ -151,7 +151,7 @@ class USentResult {
 											iterator.channal
 											iterator.channal
 									).html(
 									).html(
 										now_time.toLocaleTimeString() +
 										now_time.toLocaleTimeString() +
-											"<svg class='icon' style='fill: var(--detail-color);'><use xlink='http://www.w3.org/1999/xlink' href='svg/icon.svg#ic_done'>"
+											"<svg class='icon' style='fill: var(--detail-color);'><use xlink='http://www.w3.org/1999/xlink' href='svg/icon.svg#ic_done'></use></svg>"
 									);
 									);
 								}
 								}
 							}
 							}