<%@ Page Language="C#" Inherits="LiveServer.Pages.UserCenter.BlogAdd" enableEventValidation="false" %>
<%@ Register TagPrefix="bairong" Namespace="BaiRong.Controls" Assembly="BaiRong.Controls" %>
<%@ Register TagPrefix="user" Namespace="UserCenter.Controls" Assembly="UserCenter.Pages" %>
<%@ Register TagPrefix="live" Namespace="LiveServer.Controls" Assembly="LiveServer.Controls" %>
<%@ Register TagPrefix="live" Namespace="LiveServer.Blog.Controls" Assembly="LiveServer.Blog" %>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="../style/comm.css" />
<link rel="stylesheet" type="text/css" href="../themes/<%=UcTheme%>/style.css"/>
<bairong:Code type="Calendar" runat="server" />
<bairong:Code type="Prototype" runat="server" />
<bairong:Code type="Scriptaculous" runat="server" />
<bairong:Code type="GlobalScript" runat="server" />
<script language="javascript" src="../js/script.js"></script>
<script language="javascript" src="../js/auxiliary.js"></script>
<script language="javascript" src="../js/contentpicker.js"></script>
<script language="javascript" charset="gb2312" src="../../sitefiles/bairong/Scripts/validate.js"></script>
<script>top.switchFolder('folder_blog');</script>
</head>
<body class="tbody" style="overflow:auto">
<user:custom type="showpopwin" runat="server" />
<form runat="server" id="myForm" enctype="multipart/form-data">
  <bairong:Message runat="server"></bairong:Message>
  <table cellspacing="0" cellpadding="0" border="0" class="composetab">
    <tr>
      <td>
        <div class="composetab_img"></div>
        <div class="composetab_sel">
          <div>撰写日志</div>
        </div>
      </td>
    </tr>
  </table>
  <div id="toolbar">
    <table width="100%" border="0" cellspacing="0" cellpadding="2" class="toolbg">
      <tr>
        <td align="left" nowrap class="barspace toolbgline">
温馨提示：如果您发布日志失败或是在编辑过程中不小心关闭了窗口，可以重新进入编辑页面，按Ctrl＋V，您最后编辑的日志就恢复了
        </td>
      </tr>
    </table>
  </div>
  <div class="readmailinfo" style="border-bottom:1px solid #fff;">
    <table cellpadding="0" cellspacing="0" width="100%" border="0" align="center" >
      <tr height="120">
        <td class="tdbg">
          <table width="98%" align="center" cellpadding="3" cellspacing="3">
            <tr>
              <td width="60">
                日志标题:</td>
              <td>
                <asp:TextBox id="Title" class="txt input_subt"
				MaxLength="200"
				style="width:480px;"
				runat="server"/>
        		<asp:RequiredFieldValidator
                ControlToValidate="Title"
                ErrorMessage=" 标题不能为空"
                Display="Dynamic"
                runat="server"
                />              </td>
            </tr>
            <tr>
              <td width="60">
              	日志分类:              </td>
              <td>
                <asp:DropDownList ID="CategoryName" CssClass="text" DataTextField="CategoryName" DataValueField="CategoryName" runat="server"></asp:DropDownList>
                <input type="hidden" id="NewCategoryNames" runat="server" /><input type="hidden" id="SelectCategoryName" runat="server" />
                <script>
				function showAddSetBox(){
					$('link_addSet').hide();
					$('span_addSet').show();
				}
				function hideAddSetBox(){
					$('link_addSet').show();
					$('span_addSet').hide();
				}
				function addSet(){
					if ($('input_addSet').value){
						$('CategoryName').options[$('CategoryName').options.length]=new Option($('input_addSet').value, $('input_addSet').value);
						$('CategoryName').selectedIndex = $('CategoryName').options.length - 1;
						$('NewCategoryNames').value = $('NewCategoryNames').value + "," + $('input_addSet').value;
						$('SelectCategoryName').value = $('input_addSet').value;
						$('input_addSet').value = '';
					}
					hideAddSetBox();
				}
				function categoryChanged(){
					var value = $('CategoryName').options[$('CategoryName').selectedIndex].value;
					$('SelectCategoryName').value = value;
				}
				</script>
                <a id="link_addSet" href="javascript:undefined;" onClick="showAddSetBox()">新增分类</a>
                <SPAN id="span_addSet" style="display:none"><INPUT id="input_addSet" class="txt input_subt" maxLength="32" value="" /> <INPUT class="btn" onClick="addSet();" type="button" value="新增" /> <INPUT class="btn" type="button" value="取消" onClick="hideAddSetBox()" /></SPAN>

              </td>
            </tr>
            <tr>
              <td colspan="2">
              <user:xHtmlEditor id="Content" runat="server"></user:xHtmlEditor></td>
            </tr>
            <tr>
              <td width="60">
              	内容标签：
              </td>
              <td>
                <asp:TextBox class="txt input_subt" onfocus="ShowTagsPanel();" id="Tags"	MaxLength="50" style="width:260px;" runat="server"/>
                <SPAN style="BORDER-BOTTOM: #ccc 1px solid; BORDER-LEFT: #ccc 1px solid; PADDING-BOTTOM: 0px; PADDING-LEFT: 4px; PADDING-RIGHT: 4px; BORDER-TOP: #ccc 1px solid; CURSOR: pointer; FONT-WEIGHT: bold; BORDER-RIGHT: #ccc 1px solid; PADDING-TOP: 0px; background-color:#FFFFFF" title="什么是标签？" onClick="Element.toggle($('tagHelp'))">?</SPAN>
(请用“,”或“;”分隔多个标签) </td>
            </tr>
            <tr id="tagHelp" style="display:none;">
              <td>&nbsp;</td>
              <td><div class="tip">您可以填写关键词作为日志的标签，方便日志被检索到。</div></td>
            </tr>
            <tr>
            	<td colspan="2">
                <A onClick="$('advPlus').innerHTML=($('advPlus').innerHTML=='+')?'-':'+';Element.toggle($('artItem-infoBox'));" href="javascript:undefined;"><SPAN id="advPlus">+</SPAN><STRONG>高级选项</STRONG></A>

                </td>
            </tr>
            <tr>
            	<td colspan="2">
            <table id="artItem-infoBox" style="display:none" cellpadding="3" cellspacing="3" width="100%" border="0" align="center" >
            <tr>
              <td width="60">
              	评论:              </td>
              <td>
                <asp:CheckBox ID="IsCommentable" Checked="true" Text="允许评论" runat="server"></asp:CheckBox>
              </td>
            </tr>
            <tr>
              <td width="60">
              	引用通告:              </td>
              <td>
                <asp:TextBox ID="TrackbackUrls" class="txt input_subt"
				size="60"
				runat="server" /><br>
（若要引用另一个用户的网络日志项，请输入以上网络日志项的引用通告 URL。用分号(;)分隔多个地址。）</td>
            </tr>
            <tr>
              <td width="60">
              	摘要:
              </td>
              <td>
                <asp:TextBox class="txt input_subt" id="Summary"
				TextMode="MultiLine" style="WIDTH: 400px; HEIGHT: 60px"
				runat="server" />              </td>
            </tr>
            </table>
                </td>
            </tr>
          </table>
        </td>
      </tr>
    </table>
    <table width="100%" border="0" cellspacing="3" cellpadding="4">
    <tr>
      <td align="center">
        <asp:Button class="button submit" id="Submit2" text="发布日志" onclick="Submit_OnClick" runat="server"/>
         &nbsp; <asp:Button ID="SaveAsDraft" runat="server" OnClick="SaveAsDraft_OnClick" Text="暂存为草稿" CssClass="button"></asp:Button> &nbsp; 
        <input class="button" type="button" onClick="location.href='blog.aspx';return false;" value="返 回" />
      </td>
    </tr>
  </table>
  </div>
</form>
<!--标题颜色-->
<div  id="ColorPicker" title="ColorPicker" style="display:none;cursor:crosshair;border: black 1px solid;position: absolute; z-index: 10;background-color: aliceblue; width:250px;background: #FFFFFF;padding: 4px; margin-left:150px;" onMouseOver="ShowColorPanel();">
  <table border="0" cellPadding="0" cellSpacing="10" onMouseOver="ShowColorPanel();">
    <tr>
      <td>
        <table border="0" cellPadding="0" cellSpacing="0" id="ColorTable" style="cursor:crosshair;"  onmouseover="ShowColorPanel();">
          <script type="text/javascript">outputColor1();</script>
        </table>
      </td>
      <td>
        <table border="0" cellPadding="0" cellSpacing="0" id="GrayTable" style="CURSOR: hand;cursor:crosshair;"  onmouseover="ShowColorPanel();">
          <script type="text/javascript">outputColor2();</script>
        </table>
      </td>
    </tr>
  </table>
  <table border="0" cellPadding="0" cellSpacing="10" onMouseOver="ShowColorPanel();">
    <tr>
      <td rowSpan="2">选中色彩
        <table border="1" cellPadding="0" cellSpacing="0" height="30" id="ShowColor" width="40" bgcolor="">
          <tr>
            <td></td>
          </tr>
        </table>
      </td>
      <td rowSpan=2>基色: <span id="RGB"></span><br />
        亮度: <span id="GRAY">120</span><br />
        代码:
        <input id="SelColor" size="7" value="" border="0" name="SelColor" />
      </TD>
      <td>
        <input type="button" onClick="javascript:ColorPickerOK();" value="确定" ID="ok" class="lightbutton" />
      </td>
    </tr>
    <tr>
      <td>
        <input type="button" onClick="javascript:document.getElementById('formatColor').value='';document.getElementById('s_bgcolor').style.background='#FFFFFF';HideColorPanel();" value="取消" ID="Button2" NAME="Button2" class="lightbutton"  />
      </td>
    </tr>
  </table>
</div>
<!--标签-->
<style type="text/css">
.set-r{ float:left; width:230px; margin:12px 15px 0 0}
.trigon{ width:9px; border-right:1px solid #ccc; height:318px; float:left; position:relative;}
.trigonar { width:10px; height:18px; background:url(../images/tags_bg_ico.gif) no-repeat; overflow:hidden; position:absolute; bottom:55px;}
.se{ float:left; height:318px; border-top:1px solid #ccc; border-right:1px solid #ccc; border-bottom:1px solid #ccc; background:white; width:220px; overflow:auto; word-break:break-all; overflow-x:hidden; padding:4px;}
.se h2{ width:210px; line-height:25px; border-bottom:1px dotted #a9a9a9; font-size:12px; font-weight:normal;margin-top:5px;}
.se h2 span{ color:#666;}
.se p{ width:210px; margin:5px auto; padding-right:10px; line-height:20px; text-align:left;font-family:arial} 
.se p a:link, .se p a:visited{ FONT-WEIGHT: bold;	FONT-SIZE: 12px; COLOR: #104d6c;}

.tag_popularity_1{	FONT-SIZE: 12px; font-weight:normal !important; COLOR: #104d6c;}
.tag_popularity_2 {FONT-WEIGHT: bold; COLOR: #104d6c;}
.tag_popularity_3 {FONT-WEIGHT: bold; COLOR: #ff0f6f !important; font-size:14px !important;}
.tag_popularity_4 {FONT-WEIGHT: bold; font-size:16px !important;  COLOR: #ff0f6f !important}

.se p a:hover{background:#104d6c !important; color:white; text-decoration:none;}
.selected {background:#104d6c !important; color:white  !important; text-decoration:none;}
</style>
<div  id="TagPicker" style="position: absolute; z-index: 10;display:none">
  <table border="0" cellPadding="0" cellSpacing="0">
    <tr>
      <td>
        <div class="set-r">
          <div class="trigon">
            <div class="trigonar"></div>
          </div>
          <div class="se">
            <p><img src="../../sitefiles/bairong/Icons/tags.gif" align="absmiddle">&nbsp;选择标签</p>
            <p>
              <asp:Literal ID="TagsList" runat="server"></asp:Literal>
            </p>
            <p style="text-align:center">
              <input class="button" type="button" onClick="HideTagsPanel();return false;" value="关 闭" />
            </p>
          </div>
        </div>
      </td>
    </tr>
  </table>
</div>
<script>
document.body.onkeydown = function (moz_ev) 
{ 
		var ev = null; 
		if (window.event){ 
				ev = window.event; 
		}else{ 
				ev = moz_ev; 
		} 
		if (ev != null && ev.ctrlKey && ev.keyCode == 13) 
	    { 
			   document.getElementById("Submit").click(); 
	    } 
}
</script>
</body>
</html>
