Parcourir la source

merge from kosalla

visuddhinanda il y a 5 ans
Parent
commit
cff6ea339f

+ 13 - 0
app/article/mobile.css

@@ -22,3 +22,16 @@
 #main_view {
 	padding-top: 10em;
 }
+.other_tran_div > .tool_bar {
+	display: grid;
+	min-height: 3em;
+}
+.other_tran_div > .tool_bar > .tool_left {
+	width: calc(100vw - 2em - 12px);
+	max-width: 100%;
+}
+.other_tran_div > .tool_bar > .tool_right {
+	position: absolute;
+	right: 6px;
+	margin-top: 1.5em;
+}

+ 3 - 0
app/article/style.css

@@ -160,3 +160,6 @@ img {
     flex: 5;
 }
 */
+.tool_bar {
+	display: flex;
+}

+ 20 - 18
app/public/js/comm.js

@@ -161,27 +161,29 @@ function getPassDataTime(time) {
 
 	let pass = currDate.getTime() - time;
 	let strPassTime = "";
-	if (pass < 60 * 1000) {
-		//分钟内
-		strPassTime = Math.floor(pass / 1000) + "秒前";
-	} else if (pass < 3600 * 1000) {
-		//小时内
-		strPassTime = Math.floor(pass / 1000 / 60) + "分钟前";
-	} else if (pass < 3600 * 24 * 1000) {
-		//天内
-		strPassTime = Math.floor(pass / 1000 / 3600) + "小时前";
-	} else if (pass < 3600 * 24 * 7 * 1000) {
-		//周内
-		strPassTime = Math.floor(pass / 1000 / 3600 / 24) + "天前";
-	} else if (pass < 3600 * 24 * 30 * 1000) {
-		//个月内
-		strPassTime = Math.floor(pass / 1000 / 3600 / 24 / 7) + "周前";
+	if (pass < 120 * 1000) {
+		//分钟内
+		strPassTime = Math.floor(pass / 1000) + gLocal.gui.secs_ago;
+	} else if (pass < 7200 * 1000) {
+		//小时内
+		strPassTime = Math.floor(pass / 1000 / 60) + gLocal.gui.mins_ago;
+	} else if (pass < 3600 * 48 * 1000) {
+		//天内
+		strPassTime = Math.floor(pass / 1000 / 3600) + gLocal.gui.hs_ago;
+	} else if (pass < 3600 * 24 * 14 * 1000) {
+		//周内
+		strPassTime = Math.floor(pass / 1000 / 3600 / 24) + gLocal.gui.days_ago;
+	} else if (pass < 3600 * 24 * 60 * 1000) {
+		//个月内
+		strPassTime = Math.floor(pass / 1000 / 3600 / 24 / 7) + gLocal.gui.weeks_ago;
 	} else if (pass < 3600 * 24 * 365 * 1000) {
 		//一年内
-		strPassTime = Math.floor(pass / 1000 / 3600 / 24 / 30) + "月前";
+		strPassTime = Math.floor(pass / 1000 / 3600 / 24 / 30) + gLocal.gui.months_ago;
+	} else if (pass < 3600 * 24 * 730 * 1000) {
+		//超过1年小于2年
+		strPassTime = Math.floor(pass / 1000 / 3600 / 24 / 365) + gLocal.gui.year_ago;
 	} else {
-		//超过一年
-		strPassTime = Math.floor(pass / 1000 / 3600 / 24 / 365) + "年前";
+		strPassTime = Math.floor(pass / 1000 / 3600 / 24 / 365) + gLocal.gui.years_ago;
 	}
 	return strPassTime;
 }

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

@@ -614,6 +614,17 @@
 		"watching_course": "watching course",
 		"searching_instruction": "searching instruction",
 		"dict_searching_placehold": "insert “+” into a word to search them separately",
+		"copy_to": "copy to",
+		"add_tran": "add translation",
+		"no_updated": "no update",
+		"secs_ago": "secs ago",
+		"mins_ago": "mins ago",
+		"hs_ago": "hs ago",
+		"days_ago": "days ago",
+		"weeks_ago": "weeks ago",
+		"months_ago": "months ago",
+		"year_ago": "year ago",
+		"years_ago": "years ago",
 		"": ""
 	},
 	"grammastr": [

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

@@ -613,6 +613,17 @@
 		"watching_course": "watching course",
 		"searching_instruction": "searching instruction",
 		"dict_searching_placehold": "insert “+” into a word to search them separately",
+		"copy_to": "copy to",
+		"add_tran": "add translation",
+		"no_updated": "no update",
+		"secs_ago": "&nbsp;secs&nbsp;ago",
+		"mins_ago": "&nbsp;mins&nbsp;ago",
+		"hs_ago": "&nbsp;hs&nbsp;ago",
+		"days_ago": "&nbsp;days&nbsp;ago",
+		"weeks_ago": "&nbsp;weeks&nbsp;ago",
+		"months_ago": "&nbsp;months&nbsp;ago",
+		"year_ago": "&nbsp;year&nbsp;ago",
+		"years_ago": "&nbsp;years&nbsp;ago",
 		"": ""
 	},
 	"grammastr": [

+ 11 - 0
app/public/lang/my.json

@@ -613,6 +613,17 @@
 		"watching_course": "watching course",
 		"searching_instruction": "searching instruction",
 		"dict_searching_placehold": "insert “+” into a word to search them separately",
+		"copy_to": "copy to",
+		"add_tran": "add translation",
+		"no_updated": "no update",
+		"secs_ago": "&nbsp;secs ago",
+		"mins_ago": "&nbsp;mins ago",
+		"hs_ago": "&nbsp;hs ago",
+		"days_ago": "&nbsp;days ago",
+		"weeks_ago": "&nbsp;weeks ago",
+		"months_ago": "&nbsp;months ago",
+		"year_ago": "&nbsp;year ago",
+		"years_ago": "&nbsp;years ago",
 		"": ""
 	},
 	"grammastr": [

+ 11 - 0
app/public/lang/si.json

@@ -618,6 +618,17 @@
 		"watching_course": "watching course",
 		"searching_instruction": "searching instruction",
 		"dict_searching_placehold": "insert “+” into a word to search them separately",
+		"copy_to": "copy to",
+		"add_tran": "add translation",
+		"no_updated": "no update",
+		"secs_ago": "&nbsp;secs ago",
+		"mins_ago": "&nbsp;mins ago",
+		"hs_ago": "&nbsp;hs ago",
+		"days_ago": "&nbsp;days ago",
+		"weeks_ago": "&nbsp;weeks ago",
+		"months_ago": "&nbsp;months ago",
+		"year_ago": "&nbsp;year ago",
+		"years_ago": "&nbsp;years ago",
 		"": ""
 	},
 	"grammastr": [

+ 13 - 3
app/public/lang/zh-cn.json

@@ -244,7 +244,7 @@
 		"project": "工程",
 		"protection": "保护(英)",
 		"pubba_māsa": "上个月",
-		"publish": "公布",
+		"publish": "公开发布",
 		"ravi": "周日",
 		"read": "阅读",
 		"read_only": "只读",
@@ -544,7 +544,7 @@
 		"recommendation": "推荐",
 		"collection": "收藏",
 		"rates": "评分",
-		"updated": "更新",
+		"updated": "更新",
 		"my_zone": "我的空间",
 		"share_to": "分享到",
 		"EXP": "经验",
@@ -616,7 +616,17 @@
 		"watching_course": "关注的课程",
 		"searching_instruction": "查词指南",
 		"dict_searching_placehold": "单词里面添加“+”可分别查看查询结果",
-		"": "",
+		"copy_to": "复制到",
+		"add_tran": "添加译文",
+		"no_updated": "无更新",
+		"secs_ago": "秒前",
+		"mins_ago": "分钟前",
+		"hs_ago": "小时前",
+		"days_ago": "天前",
+		"weeks_ago": "周前",
+		"months_ago": "月前",
+		"year_ago": "年前",
+		"years_ago": "年前",
 		"": ""
 	},
 	"grammastr": [

+ 12 - 1
app/public/lang/zh-tw.json

@@ -244,7 +244,7 @@
 		"project": "工程",
 		"protection": "保護(英)",
 		"pubba_māsa": "上個月",
-		"publish": "公佈",
+		"publish": "公開發佈",
 		"ravi": "週日",
 		"read": "閱讀",
 		"read_only": "隻讀",
@@ -615,6 +615,17 @@
 		"watching_course": "關注的課程",
 		"searching_instruction": "查詞指南",
 		"dict_searching_placehold": "单词里面添加“+”可分别查看查询结果",
+		"copy_to": "複製到",
+		"add_tran": "新增譯文",
+		"no_updated": "無更新",
+		"secs_ago": "秒前",
+		"mins_ago": "分鐘前",
+		"hs_ago": "小時前",
+		"days_ago": "天前",
+		"weeks_ago": "週前",
+		"months_ago": "月前",
+		"year_ago": "年前",
+		"years_ago": "年前",
 		"": ""
 	},
 	"grammastr": [

+ 10 - 10
app/term/note.js

@@ -542,7 +542,7 @@ function note_json_html(in_json) {
 	//未选择的其他译文开始
 	output += "<div class='other_tran_div' sent='";
 	output += in_json.book + "-" + in_json.para + "-" + in_json.begin + "-" + in_json.end + "' >";
-	output += "<div class='tool_bar' style='display:flex;' sent='";
+	output += "<div class='tool_bar' sent='";
 	output += in_json.book + "-" + in_json.para + "-" + in_json.begin + "-" + in_json.end + "' >";
 	output += "<span class='tool_left'>";
 	//第一个按钮
@@ -553,7 +553,7 @@ function note_json_html(in_json) {
 	output += "begin='" + in_json.begin + "' ";
 	output += "end='" + in_json.end + "' ";
 	output += " >";
-	output += "<span class='' onclick='add_new_tran_button_click(this)'>+添加译文</span>";
+	output += "<span class='' onclick='add_new_tran_button_click(this)'>+"+gLocal.gui.add_tran+"</span>";
 	output += "<div class='tran_text_tool_bar'>";
 	output += "</div>";
 	output += "</span>";
@@ -744,16 +744,16 @@ function render_one_sent_tran_a(iterator) {
 		if (parseInt(iterator.mypower) >= 30 && parseInt(iterator.status) < 30) {
 			//我的私有资源 公开发布
 			commitIcon = "publish";
-			commitTipText = "公开发布";
+			commitTipText = gLocal.gui.publish;
 		} else {
 			if (parseInt(iterator.mypower) < 20) {
 				//只读资源 采纳
 				commitIcon = "accept_copy";
-				commitTipText = "采纳";
+				commitTipText = gLocal.gui.accept_copy;
 			} else {
 				//其他资源 复制到
 				commitIcon = "copy";
-				commitTipText = "复制到";
+				commitTipText = gLocal.gui.copy_to;
 			}
 		}
 		html += "<button class='icon_btn tooltip' ";
@@ -814,7 +814,7 @@ function render_one_sent_tran_a(iterator) {
 	html += "</div>";
 	html += "</div>";
 	//tool_bar 结束
-	html += '<div class="left_bar">';
+	html += '<div class="left_bar" >';
 	html += '	<div class="face">';
 	if (iterator.id != "") {
 		html += '<span class="head_img">' + iterator.editor_name.nickname.slice(0, 1) + "</span>";
@@ -848,7 +848,7 @@ function render_one_sent_tran_a(iterator) {
 	if (parseInt(iterator.mypower) < 20) {
 		html += "<b>提交修改建议</b> ";
 	}
-	html += "点击输入框外面自动<a onclick='sent_tran_edit(this)'>保存</a> 支持markdown语法";
+	html += "点击输入框外面自动<a onclick='sent_tran_edit(this)'>"+gLocal.gui.save+"</a> 支持markdown语法";
 	html += "</div>";
 	html += "</div>";
 
@@ -859,12 +859,12 @@ function render_one_sent_tran_a(iterator) {
 		html += '<span class="name">' + iterator.editor_name.nickname + "</span>";
 	}
 	if (iterator.id != "") {
-		html += '<span class="date"> ' + getPassDataTime(iterator.update_time) + "</span>";
+		html += '<span class="date"> ' + getPassDataTime(iterator.update_time) + "</span>";
 	}
 	if (iterator.id != "") {
-		html += '<span class="channel">更新了 @' + iterator.channalinfo.name + "</span>";
+		html += '<span class="channel">'+gLocal.gui.updated+' @' + iterator.channalinfo.name + "</span>";
 	} else {
-		html += '<span class="channel">无人更新 @' + iterator.channalinfo.name + "</span>";
+		html += '<span class="channel">'+gLocal.gui.no_updated+' @' + iterator.channalinfo.name + "</span>";
 	}
 
 	html += '<ul class="tag_list">';

+ 22 - 9
app/term/term.css

@@ -129,7 +129,7 @@ chapter {
 	cursor: pointer;
 }
 chapter::after {
-	content: "  ";
+	content: " > ";
 }
 chapter:hover {
 	color: var(--link-color);
@@ -137,7 +137,7 @@ chapter:hover {
 }
 para {
 	background-color: var(--drop-bg-color);
-	padding: 2px 8px;
+	padding: 0 4px;
 	text-decoration: none;
 	cursor: pointer;
 	color: var(--btn-border-color);
@@ -262,7 +262,7 @@ note > .palitext,
 	line-height: 1.5em;
 	color: #9f3a01;
 	font-weight: 500;
-	margin-bottom: 10px;
+	margin: 4px;
 }
 note n {
 	display: inline;
@@ -296,6 +296,7 @@ note .ref {
 	white-space: nowrap;
 	overflow-x: scroll;
 	max-width: 100%;
+	white-space: pre-wrap;
 }
 note:hover .ref {
 	/*border-top: solid 1px var(--border-line-color);*/
@@ -401,15 +402,23 @@ note:hover .add_new {
 	padding: 0 6px;
 	border-radius: 0 0 4px 4px;
 	cursor: pointer;
-	display: flex;
 	justify-content: space-between;
 }
+.other_tran_div > .tool_bar > .tool_left {
+	white-space: nowrap;
+}
+.other_tran_div > .tool_bar > .tool_right {
+	white-space: pre-wrap;
+	margin-left: auto;
+}
 .other_tran_div > .other_tran {
 	min-height: 1em;
 	transition: all 0.2s ease;
 	display: none;
 }
-
+.tool_bar {
+	display: flex;
+}
 .bg_color_1 {
 	background-color: #ebebeb66;
 }
@@ -438,6 +447,7 @@ pre {
 	position: relative;
 	display: none;
 	z-index: 50;
+	margin-right: 1em;
 }
 
 note:hover .note_tool_bar {
@@ -506,9 +516,10 @@ note:hover .note_tool_bar {
 	display: none;
 	margin: auto 2px;
 	color: whitesmoke;
+	padding: 0 3px;
 }
 .similar_sent_num {
-	display: unset;
+	display: inline-flex;
 }
 .separate_line {
 	border: solid 1px #e8e8e8;
@@ -548,10 +559,11 @@ pw {
 	display: flex;
 }
 .sent_tran:hover {
-	background-color: #fafafa;
+	background-color: var(--btn-border-color);
 }
 .left_bar {
-	width: 40px;
+	flex: 2;
+	display: flex;
 }
 .sent_tran .left_bar > .face {
 	display: block;
@@ -569,6 +581,7 @@ pw {
 .sent_tran_inner > .body {
 	width: 100%;
 	display: block;
+	flex: 13;
 }
 .preview {
 	font-size: 110%;
@@ -596,7 +609,7 @@ pw {
 	display: none;
 }
 .foot_bar .info {
-	color: gray;
+	color: var(--main-color);
 }
 .tool_bar > .right {
 	position: absolute;