<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>历史记录</title>
<link type="text/css" href="/css/base.css" rel="stylesheet" />	
<link type="text/css" href="/css/cleditor.css" rel="stylesheet" />	
<script src="/jquery/jquery.min.js" type="text/javascript"></script>
<script src="/jquery/jquery-ui.min.js" type="text/javascript"></script>
<script src="/jquery/common.min.js" type="text/javascript"></script>

<script type="text/javascript">
	function isIE6()
	{
    	if ($.browser.msie){
        	if ($.browser.version == "6.0") return true;
	      }
    	return false;
	}
	function adjust_content_width()
	{
    	if ($.browser.msie){
        	if ($.browser.version != "6.0"){
				var content_parent = document.getElementById("content");
				$("#discuss").width(content_parent.offsetHeight > content_parent.scrollHeight ? '100%' : parseInt(content_parent.clientWidth) - 20);
			  }
		  }
	}
	function update_message(page)
	{
		if (current_page != page){
			current_page = page;
			$.ajax({
				type: "GET",
				url: "/get_message",
				async: false,
				data:{group:current_group, page:current_page},
				dataType: "json",
				success: function(data){
					var new_message = data["message"];
					var last_message_date = "";
					if (new_message != null){
						var content = '';
						$.each(new_message, function(i, item){
							if (last_message_date != item["date"]){
								last_message_date = item["date"];
								content += "<div class='date'><span>日期: " + last_message_date + "</span></div>";
							  }
							content += "<div class='info'><span>" + item["username"] + "</span><span>" + item["time"] + "</span></div><div class='text'>" + item["content"] + "</div>";
						  });
						$("#text_panel").html(content);
					  }
					pageNav.go(current_page, data["max_page"]);
				}
			});
		  }
	}

	$(function(){
		// note: 1em = 16px, 100%, 12pt
		var work_height = $(window).height()-32-28-8;
		$("#navigator").height(work_height + "px");
		$("#content").height(work_height + "px");

		// disable cache
		$.ajaxSetup({cache: false});

		// function to resize content areas when window is resized
		$(window).resize(function(){
			var work_height = $(window).height()-32-28-8;
			$("#navigator").height(work_height + "px");
			$("#content").height(work_height + "px");
			adjust_content_width();
	    });

		// load navigator
		$("#navigator").load("/navigator?id=5");
		$("#user").load("/user_panel", function(){$("#login").click(function(){login();});$("#logout").click(function(){logout();});});
		
		$("#collapse").click(function(){
			var $nav = $("#navigator");
			var $link = $("#collapse a");
			if ($nav.is(":visible")){
				$nav.hide();
				$link.html("&gt;&gt;&gt;").attr("title","展开导航窗口");
			  }else{
				$nav.show();
				$link.html("&lt;&lt;&lt;").attr("title","折叠导航窗口");
			  }
			return false;
		});

		$("button", ".button_panel").button();
		$("#clear_message").click(function(){
			if (confirm("确认清除所有记录?")){
				$.ajax({
					type: "GET",
					url: "/clear_message",
					async: false,
	  				data: {group:current_group},
					dataType: "text",
					success: function(data, status){
						// check result
						if (data.substr(0,1) == ">"){
							// refresh
							window.location.reload();
	  					  }else{
							alert(data);
	  					  }
					},
					error: function(){
						alert("无法清除记录。");
					}
				});
			  }
		});

		//initalize page nav
		pageNav.pre="上一页";
		pageNav.next="下一页";
		pageNav.fn=function(p,pn){update_message(p);};

		// initialize variables
		current_page = 0;
		<!--#include init_variables-->

		// update message
		update_message(1);
		
		// adjust content width
		adjust_content_width();
	});
</script>
<style type="text/css">
	html,body{margin:0; padding:0;}
	html{overflow:visible;}
	body{font-size:11pt;min-width:500px;overflow-y:hidden !important; overflow-x:auto !important;}
	
	#banner #logo{font:200% 黑体; float:left; padding:3px 5px 0}
	#banner #user{font:80% 宋体; float:right; padding:5px 8px}

	#user a{text-decoration:none;}
	#user span{margin:2px 0 0 5px;}

	#menubar{background-color:#555; clear:both; height:28px}
	#menubar #collapse{padding:3px 0 0 0; float:left; color:#fff;}
	#menubar a:link, #menubar a:visited{color:white; text-decoration:none; vertical-align:middle;}
	#menubar a:hover{color:red;}
	#menubar #collapse a{font-weight:bold;}
	#menubar ul{padding:3px 10px 3px 5px; margin:0; text-align: right}
	#menubar li{padding:0 5px; font:90% "黑体"; color:#fff; display:inline}
	
	#navigator{font:宋体; width:160px; float:left; margin:5px; padding:5px;}
	#navigator a{display:block; width:125px; word-break:keep-all; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; margin:2.5px;}
	#navigator a:link, #navigator a:visited{font:80% "宋体";padding:0;}
	
	#content{font-size:80%;padding:0 5px; margin:2px 0 0 0; overflow:auto; display:block;}
	#text_panel{font:10pt Arial,Verdana;padding:1px;border: 1px solid #888;}
	
	#text_panel .date span{font:90% 宋体;font-weight:bold;color:#39f;margin-left:3px;}
	#text_panel .date{margin:5px 10px 5px 0;border-bottom:1px solid #39f;}
	#text_panel .info span{font:95% 宋体;margin:0 3px;color:#33f;}
	#text_panel .text{margin-bottom:5px;margin-left:1em;}
	
	.ui-dialog-title{font-size:80%;padding:0;}
	.ui-dialog fieldset { padding:0; border:0; margin-top:10px; }
	.ui-dialog form div { margin:5px 0;}
	.ui-dialog .ui-dialog-buttonpane{margin:0.2em 0 0; padding:0.2em 1em 0.1em 0.4em;}
	.ui-dialog .ui-dialog-buttonpane button{margin:0.2em 0.4em 0.1em 0; padding:0;}
	.ui-widget .ui-widget{ font-size: 0.7em;}

	.button_panel{font:75% 宋体;margin:5px 2px;}
	.button_panel .ui-button {position: static;}

	#page{float:right;}

	.pageNum{border: 1px solid #999;padding:2px 5px;display: inline-block;}
	.cPageNum{font-weight: bold;padding:2px 5px;}
	#pageNav{font-size:90%; margin: 5px 0;}
	#pageNav a{text-decoration:none;}
	#pageNav a:hover{background: #fff4d8; }
</style>
</head>
<body id="home">
<div id="banner">
	<div id="logo">雪人CAT网络协同翻译平台</div>
	<div id="user">
	</div>
</div>
<div id="menubar">
	<ul>
		<li id="collapse"><a href="#" title="折叠导航窗口">&lt;&lt;&lt;</a></li>
		<li><a href="/index.htm" id="homepage">首页</a></li>
		<li><a href="/project.htm" id="project">项目</a></li>
		<li><a href="/articles/all/list" id="document">文档</a></li>
		<li><a href="/forum.htm" id="discuss">论坛</a></li>
		<li><a href="/message.htm" id="message">通讯</a></li>
		<li><a href="/help.htm" id="help">帮助</a></li>
	</ul>
</div>
<div class="ui-widget ui-state-default ui-corner-all" id="navigator"></div>
<div id="content">
	<div id='discuss'>
		<div id='text_panel'></div>
		<div class="button_panel" style="float:left;">
			<!--#include extra_buttons-->
		</div>
		<div id="page">
			<div id="pageNav"></div>
		</div>
	</div>
</div>
</body>
</html>
