فهرست منبع

时间显示格式优化 多语言multi-language #26

Bhikkhu-Kosalla 5 سال پیش
والد
کامیت
d34b3444b9

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

@@ -449,6 +449,9 @@
 		"general": "General",
 		"username": "Login ID",
 		"change_password": "change the password",
+		"ignore": "ignore",
+		"oversize_to_load": "unable to load due to oversize, please reduce the articles range",
+		"open_doc": "如果未自动跳转,请点此打开",
 		"": ""
 	},
 	"grammastr": [

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

@@ -449,6 +449,8 @@
 		"general": "General",
 		"username": "Login ID",
 		"change_password": "change the password",
+		"ignore": "ignore",
+		"oversize_to_load": "unable to load due to oversize, please reduce the articles range",
 		"": ""
 	},
 	"grammastr": [

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

@@ -449,6 +449,8 @@
 		"general": "General",
 		"username": "Login ID",
 		"change_password": "change the password",
+		"ignore": "ignore",
+		"oversize_to_load": "unable to load due to oversize, please reduce the articles range",
 		"": "",
 		"": ""
 	},

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

@@ -454,6 +454,8 @@
 		"general": "General",
 		"username": "Login ID",
 		"change_password": "change the password",
+		"ignore": "ignore",
+		"oversize_to_load": "unable to load due to oversize, please reduce the articles range",
 		"": "",
 		"": ""
 	},

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

@@ -450,9 +450,9 @@
 		"general": "通用",
 		"username": "用户名",
 		"change_password": "修改密码",
-		"": "",
-		"": "",
-		"": "",
+		"ignore": "忽略",
+		"oversize_to_load": "尺寸过大,无法加载,请缩小加载范围",
+		"open_doc": "如果未自动跳转,请点此打开",
 		"": ""
 	},
 	"grammastr": [

+ 3 - 0
app/public/lang/zh-tw.json

@@ -450,6 +450,9 @@
 		"general": "通用",
 		"username": "使用者名稱",
 		"change_password": "修改密碼",
+		"ignore": "忽略",
+		"oversize_to_load": "尺寸過大,無法載入,請縮減載入範圍",
+		"open_doc": "如果未自動跳轉,請點此開啟",
 		"": ""
 	},
 	"grammastr": [

+ 1 - 1
app/studio/index_tool_bar.php

@@ -84,7 +84,7 @@
 			<div >
 					<div>
 						<div>
-							<input id="search_input" type="input" placeholder='<?php echo $_local->gui->search;?>' onkeyup="search_input_keyup(event,this)" style="margin-left: 0.5em;width: 40em;max-width: 80%" onfocus="search_input_onfocus()">
+							<input id="search_input" type="input" placeholder='<?php echo $_local->gui->undone_function;?>' onkeyup="search_input_keyup(event,this)" style="margin-left: 0.5em;width: 40em;max-width: 80%" onfocus="search_input_onfocus()">
 						</div>
 						<div id="pre_search_result">
 							<div id="pre_search_chapter" class="pre_serach_block">

+ 227 - 202
app/studio/js/index_mydoc.js

@@ -1,271 +1,296 @@
-var my_file_title="";
-var my_file_status="all";//recycle
-var my_file_order="DESC";//ASC
+var my_file_title = "";
+var my_file_status = "all";//recycle
+var my_file_order = "DESC";//ASC
 
-function file_search_keyup(){
+function file_search_keyup() {
 	file_list_refresh();
 }
 
-function recycleInit(){
-		ntf_init();
+function recycleInit() {
+	ntf_init();
 	file_list_refresh();
 }
-function indexInit(){
+function indexInit() {
 	ntf_init();
 	file_list_refresh();
 }
+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());
+	}
+
+}
 
 
-function file_list_refresh(){
-	var d=new Date();
+function file_list_refresh() {
+	var d = new Date();
 	$.get("getfilelist.php",
-	  {
-		t:d.getTime(),
-		keyword:my_file_title,
-		status:$("#id_index_status").val(),
-		orderby:"accese_time",
-		order:"DESC",
-		currLanguage:$("#id_language").val()
-	  },
-	  function(data,status){
-		  try{
-			let file_list = JSON.parse(data);
-			let html="";
-			for(x in file_list){
-				html += "<div class=\"file_list_row\">";
-				html += "<div class=\"file_list_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>";
-				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=open&fileid="+file_list[x].id+"' target='_blank'>";
-				}
-				html += "<div class=\"file_list_col_2\">";
-				if((file_list[x].parent_id == null || file_list[x].parent_id == "") && parseInt(file_list[x].share)==1){
-						//shared
-						html += "<span onclick=\"file_show_coop_win('"+file_list[x].id+"')\">";
-				}
-				else{
-					html += "<span>";
-				}
-				
-				html += "<svg class='icon' style='margin: 0 5px;'>";
-				if(file_list[x].parent_id == null || file_list[x].parent_id == ""){
-					if(parseInt(file_list[x].share)==1){
+		{
+			t: d.getTime(),
+			keyword: my_file_title,
+			status: $("#id_index_status").val(),
+			orderby: "accese_time",
+			order: "DESC",
+			currLanguage: $("#id_language").val()
+		},
+		function (data, status) {
+			try {
+				let file_list = JSON.parse(data);
+				let html = "";
+				for (x in file_list) {
+					html += "<div class=\"file_list_row\">";
+					html += "<div class=\"file_list_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>";
+					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=open&fileid=" + file_list[x].id + "' target='_blank'>";
+					}
+					html += "<div class=\"file_list_col_2\">";
+					if ((file_list[x].parent_id == null || file_list[x].parent_id == "") && parseInt(file_list[x].share) == 1) {
 						//shared
-						html += "<use xlink:href=\"./svg/icon.svg#share_to_other\"></use>";
+						html += "<span onclick=\"file_show_coop_win('" + file_list[x].id + "')\">";
 					}
-					else{
-					//my document
-					html += "<use xlink:href=\"./svg/icon.svg#ic_person\"></use>";							
+					else {
+						html += "<span>";
 					}
-				}
-				else{
-					//fork
-					html += "<use xlink:href=\"./svg/icon.svg#other_share_to_me\"></use>";
-				}
-				html += "</svg>";
-				html += "</span>";
-				html += "<div id='coop_show_"+file_list[x].id+"' style='display:inline;'></div>";
-				html += $link+file_list[x].title;
-				html += "</a>";
 
-				
-				html += "</div>";
-				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){
-					html += "<svg class='icon'>";
-					html += "<use xlink:href=\"./svg/icon.svg#ic_two_person\"></use>";
+					html += "<svg class='icon' style='margin: 0 5px;'>";
+					if (file_list[x].parent_id == null || file_list[x].parent_id == "") {
+						if (parseInt(file_list[x].share) == 1) {
+							//shared
+							html += "<use xlink:href=\"./svg/icon.svg#share_to_other\"></use>";
+						}
+						else {
+							//my document
+							html += "<use xlink:href=\"./svg/icon.svg#ic_person\"></use>";
+						}
+					}
+					else {
+						//fork
+						html += "<use xlink:href=\"./svg/icon.svg#other_share_to_me\"></use>";
+					}
 					html += "</svg>";
+					html += "</span>";
+					html += "<div id='coop_show_" + file_list[x].id + "' style='display:inline;'></div>";
+					html += $link + file_list[x].title;
+					html += "</a>";
+
+
+					html += "</div>";
+					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) {
+						html += "<svg class='icon'>";
+						html += "<use xlink:href=\"./svg/icon.svg#ic_two_person\"></use>";
+						html += "</svg>";
+					}
+					html += "</div>";
+					html += "<div class=\"file_list_col_4\">";
+					let d = new Date();
+					let today_date = d.toLocaleDateString();
+					d.setTime(file_list[x].accese_time);
+					let Local_time = "";
+					Local_time = time_standardize(d);
+					/*
+					if(d.getHours()<=9){
+						Local_time +=":0"+d.getHours();
+					}
+					else{
+						Local_time += ":"+d.getHours();
+					}
+					if(d.getMinutes()<=9){
+						Local_time +=":0"+d.getMinutes();
+					}
+					else{
+						Local_time += ":"+d.getMinutes();
+					}
+					let Local_date = d.toLocaleDateString();
+					if(today_date==Local_date){
+						html += gLocal.gui.today+Local_time;
+					}
+					else{
+						html += Local_date;
+					}
+					*/
+					html += Local_time
+					html += "</div>";
+					html += "<div class=\"file_list_col_5\">";
+
+					if (file_list[x].file_size < 102) {
+						$str_size = file_list[x].file_size + "B";
+					}
+					else if (file_list[x].file_size < (1024 * 902)) {
+						$str_size = (file_list[x].file_size / 1024).toFixed(0) + "KB";
+					}
+					else {
+						$str_size = (file_list[x].file_size / (1024 * 1024)).toFixed(1) + "MB";
+					}
+					html += $str_size;
+					if (!(file_list[x].doc_info && file_list[x].doc_info.length > 1)) {
+						html += "<a href='../doc/pcs2db.php?doc_id=" + file_list[x].id + "' target='_blank'>转数据库格式</a>";
+					}
+					html += "</div>";
+					html += "</div>";
 				}
-				html += "</div>";
-				html += "<div class=\"file_list_col_4\">";
-				let d = new Date();
-				let today_date=d.toLocaleDateString();
-				d.setTime(file_list[x].accese_time);
-				let Local_time = "";
-				if(d.getHours()<=9){
-					Local_time +=":0"+d.getHours();
-				}
-				else{
-					Local_time += ":"+d.getHours();
-				}
-				if(d.getMinutes()<=9){
-					Local_time +=":0"+d.getMinutes();
-				}
-				else{
-					Local_time += ":"+d.getMinutes();
-				}
-				let Local_date = d.toLocaleDateString();
-				if(today_date==Local_date){
-					html += gLocal.gui.today+Local_time;
-				}
-				else{
-					html += Local_date;
-				}
-				
-				html += "</div>";
-				html += "<div class=\"file_list_col_5\">";
-				
-				if(file_list[x].file_size<102){
-					$str_size=file_list[x].file_size+"B";
-				}
-				else if(file_list[x].file_size<(1024*902)){
-					$str_size=(file_list[x].file_size/1024).toFixed(0)+"KB";
-				}
-				else{
-					$str_size=(file_list[x].file_size/(1024*1024)).toFixed(1)+"MB";
-				}
-				html += $str_size;
-				if(!(file_list[x].doc_info && file_list[x].doc_info.length>1)){
-					html += "<a href='../doc/pcs2db.php?doc_id="+file_list[x].id+"' target='_blank'>转数据库格式</a>";
-				}
-				html += "</div>";
-				html += "</div>";
+				html += "<input id='file_count' type='hidden' value='" + file_list.length + "'/>"
+				$("#userfilelist").html(html);
+			}
+			catch (e) {
+				console.error(e.message);
 			}
-			html += "<input id='file_count' type='hidden' value='"+file_list.length+"'/>"
-			$("#userfilelist").html(html);
-		  }
-		  catch(e){
-			  console.error(e.message);
-		  }
-	  });
+		});
 }
 
-function showUserFilaList()
-{
+function showUserFilaList() {
 	file_list_refresh();
 }
 
-		
-function mydoc_file_select(doSelect){
-	if(doSelect){
+
+function mydoc_file_select(doSelect) {
+	if (doSelect) {
 		$("#file_tools").show();
 		$("#file_filter").hide();
 		$(".file_select_checkbox").show();
-		$(".file_select_checkbox").css("display","inline-block");
-		
-		if($("#id_index_status").val()=="recycle"){
+		$(".file_select_checkbox").css("display", "inline-block");
+
+		if ($("#id_index_status").val() == "recycle") {
 			$("#button_group_recycle").show();
 			$("#button_group_nomal").hide();
 		}
-		else{
+		else {
 			$("#button_group_recycle").hide();
-			$("#button_group_nomal").show();			
+			$("#button_group_nomal").show();
 		}
 	}
-	else{
+	else {
 		$("#file_tools").hide();
 		$("#file_filter").show();
 		$(".file_select_checkbox").hide();
 	}
 }
 
-function file_del(){
-	var file_list=new Array();
-	var file_count=$("#file_count").val();
-	for(var i=0;i<file_count;i++){
-		if(document.getElementById("file_check_"+i).checked){
-			file_list.push($("#file_id_"+i).val());
+function file_del() {
+	var file_list = new Array();
+	var file_count = $("#file_count").val();
+	for (var i = 0; i < file_count; i++) {
+		if (document.getElementById("file_check_" + i).checked) {
+			file_list.push($("#file_id_" + i).val());
 		}
 	}
-	if(file_list.length>0){
-	$.post("file_index.php",
-	  {
-		op:"delete",
-		file:file_list.join()
-	  },
-	  function(data,status){
-		ntf_show(data);
-		file_list_refresh();
-	  });
+	if (file_list.length > 0) {
+		$.post("file_index.php",
+			{
+				op: "delete",
+				file: file_list.join()
+			},
+			function (data, status) {
+				ntf_show(data);
+				file_list_refresh();
+			});
 	}
 }
 //彻底删除
-function file_remove(){
-	var file_list=new Array();
-	var file_count=$("#file_count").val();
-	for(var i=0;i<file_count;i++){
-		if(document.getElementById("file_check_"+i).checked){
-			file_list.push($("#file_id_"+i).val());
+function file_remove() {
+	var file_list = new Array();
+	var file_count = $("#file_count").val();
+	for (var i = 0; i < file_count; i++) {
+		if (document.getElementById("file_check_" + i).checked) {
+			file_list.push($("#file_id_" + i).val());
 		}
 	}
-	if(file_list.length>0){
-	$.post("file_index.php",
-	  {
-		op:"remove",
-		file:file_list.join()
-	  },
-	  function(data,status){
-		ntf_show(data);
-		file_list_refresh();
-	  });
+	if (file_list.length > 0) {
+		$.post("file_index.php",
+			{
+				op: "remove",
+				file: file_list.join()
+			},
+			function (data, status) {
+				ntf_show(data);
+				file_list_refresh();
+			});
 	}
 }
 //从回收站中恢复
-function file_restore(){
-	var file_list=new Array();
-	var file_count=$("#file_count").val();
-	for(var i=0;i<file_count;i++){
-		if(document.getElementById("file_check_"+i).checked){
-			file_list.push($("#file_id_"+i).val());
+function file_restore() {
+	var file_list = new Array();
+	var file_count = $("#file_count").val();
+	for (var i = 0; i < file_count; i++) {
+		if (document.getElementById("file_check_" + i).checked) {
+			file_list.push($("#file_id_" + i).val());
 		}
 	}
-	if(file_list.length>0){
-	$.post("file_index.php",
-	  {
-		op:"restore",
-		file:file_list.join()
-	  },
-	  function(data,status){
-		ntf_show(data);
-		file_list_refresh();
-	  });
+	if (file_list.length > 0) {
+		$.post("file_index.php",
+			{
+				op: "restore",
+				file: file_list.join()
+			},
+			function (data, status) {
+				ntf_show(data);
+				file_list_refresh();
+			});
 	}
 }
-function file_share(isShare){
-	var file_list=new Array();
-	var file_count=$("#file_count").val();
-	for(var i=0;i<file_count;i++){
-		if(document.getElementById("file_check_"+i).checked){
-			file_list.push($("#file_id_"+i).val());
+function file_share(isShare) {
+	var file_list = new Array();
+	var file_count = $("#file_count").val();
+	for (var i = 0; i < file_count; i++) {
+		if (document.getElementById("file_check_" + i).checked) {
+			file_list.push($("#file_id_" + i).val());
 		}
 	}
-	if(file_list.length>0){
-		if(isShare){
-			var share=1;
+	if (file_list.length > 0) {
+		if (isShare) {
+			var share = 1;
 		}
-		else{
-			var share=0;
+		else {
+			var share = 0;
 		}
 		$.post("file_index.php",
-		{
-			op:"share",
-			share:share,
-			file:file_list.join()
-		},
-		function(data,status){
-		alert(data);
-		//mydoc_file_select(false);
-		file_list_refresh();
-		});
+			{
+				op: "share",
+				share: share,
+				file: file_list.join()
+			},
+			function (data, status) {
+				alert(data);
+				//mydoc_file_select(false);
+				file_list_refresh();
+			});
 	}
 }
 
-function file_show_coop_win(doc_id){
-	let xFileHead = document.getElementById("coop_show_"+doc_id);
+function file_show_coop_win(doc_id) {
+	let xFileHead = document.getElementById("coop_show_" + doc_id);
 	let xCoopWin = document.getElementById("rs_doc_coop_win");
 	xFileHead.appendChild(xCoopWin);
-	coop_init(doc_id,"rs_doc_coop_win_inner");
+	coop_init(doc_id, "rs_doc_coop_win_inner");
 	coop_list();
 }
 
-function file_coop_win_close(){
+function file_coop_win_close() {
 	let xShell = document.getElementById("rs_doc_coop_shell");
 	let xCoopWin = document.getElementById("rs_doc_coop_win");
-	xShell.appendChild(xCoopWin);	
+	xShell.appendChild(xCoopWin);
 }

+ 64 - 64
app/studio/js/index_share.js

@@ -1,77 +1,77 @@
-function indexInit(){
+function indexInit() {
 	ntf_init();
 	file_list_refresh();
 }
 
-function file_list_refresh(){
-	var d=new Date();
+function file_list_refresh() {
+	var d = new Date();
 	$.get("../doc/coopfilelist.php",
-	  {
-		t:d.getTime()
-	  },
-	  function(data,status){
-		  try{
-			let file_list = JSON.parse(data);
-			let html="";
-			for(x in file_list){
-				html += '<div class="file_list_row" >';
-				html += '<div class="file_list_col_1" >';
-				html += "<svg class='icon' style='margin: 0 5px;'>";
-				html += '<use xlink:href="./svg/icon.svg#share_to_other"></use>';
-				html += "</svg>";
-				html += "</div>";
+		{
+			t: d.getTime()
+		},
+		function (data, status) {
+			try {
+				let file_list = JSON.parse(data);
+				let html = "";
+				for (x in file_list) {
+					html += '<div class="file_list_row" >';
+					html += '<div class="file_list_col_1" >';
+					html += "<svg class='icon' style='margin: 0 5px;'>";
+					html += '<use xlink:href="./svg/icon.svg#share_to_other"></use>';
+					html += "</svg>";
+					html += "</div>";
 
-				html += '<div class="file_list_col_2" >';
-				if(file_list[x].power_status==1){
-					//html += "[新]";
-				}
-				if(file_list[x].doc_info && file_list[x].doc_info.length>1){
-					$link="<a href='project.php?op=open&doc_id="+file_list[x].id+ "' target='_blank'>[db]";
-				}
-				else{
-					$link="<a href='editor.php?op=open&fileid="+file_list[x].id+"&filename="+file_list[x].file_name+"' target='_blank'>";
+					html += '<div class="file_list_col_2" >';
+					if (file_list[x].power_status == 1) {
+						//html += "[新]";
+					}
+					if (file_list[x].doc_info && file_list[x].doc_info.length > 1) {
+						$link = "<a href='project.php?op=open&doc_id=" + file_list[x].id + "' target='_blank'>[db]";
+					}
+					else {
+						$link = "<a href='editor.php?op=open&fileid=" + file_list[x].id + "&filename=" + file_list[x].file_name + "' target='_blank'>";
 
-				}
-                html += "<div class=\"file_list_title\">"+$link+file_list[x].title+"</a></div>";
-                
-				html += '<div class="file_list_path">';
-                html += file_list[x].path;
-				html += "</div>";
-                html += '<div class="file_list_summary">';
-                html += "</div>";
-				html += "</div>";
-				
+					}
+					html += "<div class=\"file_list_title\">" + $link + file_list[x].title + "</a></div>";
 
-				html += '<div class="file_list_col_3" >';
-				html += '<div class="file_list_owner">';
-				html += "<svg class='icon' >";
-				html += "<use xlink:href=\"./svg/icon.svg#ic_person\"></use>";
-				html += "</svg>";
-				html += file_list[x].user_name+'</div>';
+					html += '<div class="file_list_path">';
+					html += file_list[x].path;
+					html += "</div>";
+					html += '<div class="file_list_summary">';
+					html += "</div>";
+					html += "</div>";
 
- 				let d = new Date();
-				d.setTime(file_list[x].power_create_time);
-				let Local_date = d.toLocaleDateString();               
-				html += '<div class="file_list_date">'+Local_date+'</div>';
-				html += "</div>";
 
-				html += '<div class="file_list_col_4" >';
-				if(file_list[x].my_doc_id.length>20){
-					html += "<a href='editor.php?op=opendb&doc_id="+file_list[x].my_doc_id+ "' target='_blank'>[打开]</a>";
-				}
-				else{
-					html += "[复刻]";
-				}
-				html += "[忽略]";
-				html += "</div>";
-	
+					html += '<div class="file_list_col_3" >';
+					html += '<div class="file_list_owner">';
+					html += "<svg class='icon' >";
+					html += "<use xlink:href=\"./svg/icon.svg#ic_person\"></use>";
+					html += "</svg>";
+					html += file_list[x].user_name + '</div>';
 
-				html += "</div>";
+					let d = new Date();
+					d.setTime(file_list[x].power_create_time);
+					let Local_date = d.toLocaleDateString();
+					html += '<div class="file_list_date">' + Local_date + '</div>';
+					html += "</div>";
+
+					html += '<div class="file_list_col_4" >';
+					if (file_list[x].my_doc_id.length > 20) {
+						html += "<a href='editor.php?op=opendb&doc_id=" + file_list[x].my_doc_id + "' target='_blank'>[" + gLocal.gui.open + "]</a>";
+					}
+					else {
+						html += "[" + gLocal.gui.folk + "]";
+					}
+					html += "[" + gLocal.gui.ignore + "]";
+					html += "</div>";
+
+
+					html += "</div>";
+				}
+				$("#userfilelist").html(html);
+			}
+			catch (e) {
+				console.error(e.message);
 			}
-			$("#userfilelist").html(html);
-		  }
-		  catch(e){
-			  console.error(e.message);
-		  }
-	  });
+		});
 }

+ 5 - 1
app/studio/js/message.js

@@ -387,7 +387,11 @@ function time_standardize(date) {
 	if (date.toLocaleDateString() == today_date.toLocaleDateString()) {//如果是今天的消息,只显示时间
 		return (Local_time_string);
 	}
-	else {//如果不是今天的消息,只显示日期
+	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 - 1));
+	}
+	else {//如果不是今年的消息,显示年月日
 		return (date.toLocaleDateString());
 	}
 

+ 5 - 5
app/studio/project.php

@@ -59,7 +59,7 @@ switch($op){
 		$Fetch = PDO_FetchAll($query);
 		if(count($Fetch)>0){
 			if($Fetch[0]["sum_str"]>15000){
-				echo "文件过大。不能编辑。请选择小一点的章节";
+				echo $_local->gui->oversize_to_load;
 				exit;
 			}
 		}
@@ -283,7 +283,7 @@ switch($op){
 						echo "成功新建一个文件.";
 					}
 		
-					echo "<a href=\"editor.php?op=opendb&doc_id={$doc_id}\">打开</a>";
+					echo "<a href=\"editor.php?op=opendb&doc_id={$doc_id}\">{$_local->gui->open}</a>";
 				}
 				break;
 			}
@@ -777,7 +777,7 @@ switch($op){
 			$uid=$_COOKIE["uid"];
 		}
 		else{
-			echo "<h3><a href='../ucenter/index.php?op=login'>登录</a>后才可以打开文档 </h3>";
+			echo "<h3><a href='../ucenter/index.php?op=login'>{$_local->gui->login}</a>后才可以打开文档</h3>";
 			exit;
 		}
 		$db_file = _FILE_DB_FILEINDEX_;
@@ -799,9 +799,9 @@ switch($op){
 				
 				if($owner==$uid){
 					//自己的文档
-					echo "<h3>我的文档</h3>";
+					echo "<h3>{$_local->gui->my_document}</h3>";
 					$my_doc_id=$doc_id;
-					echo "正在<a href=\"editor.php?op=opendb&fileid={$doc_id}\">打开</a>文档";
+					echo "<a href=\"editor.php?op=opendb&fileid={$doc_id}\">{$_local->gui->open_doc}</a>";
 					echo "<script>";
 					echo "window.location.assign(\"editor.php?op=opendb&fileid={$doc_id}\");";
 					echo "</script>";