📄 createeditblogpost.ascx
字号:
<%@ Import Namespace = "CommunityServer.Components" %>
<%@ Register TagPrefix="CP" Namespace="CommunityServer.ControlPanel.Controls" Assembly="CommunityServer.Web" %>
<%@ Register TagPrefix="ComponentArt" Namespace="ComponentArt.Web.UI" Assembly="ComponentArt.Web.UI" %>
<%@ Register TagPrefix="Blogs" Namespace="CommunityServer.Blogs.Controls" Assembly="CommunityServer.Blogs" %>
<%@ Register TagPrefix="CS" Namespace="CommunityServer.Controls" Assembly="CommunityServer.Controls" %>
<%@ Control CodeBehind="CreateEditBlogPost.ascx.cs" Language="c#" AutoEventWireup="false" Inherits="CommunityServer.ControlPanel.Blogs.CreateEditBlogPost" %>
<%@ Register TagPrefix="TWC" Namespace="Telligent.Web.UI" Assembly="Telligent.Web.UI" %>
<script language="javascript">
function getAttachmentData(result)
{
// result = new Array(TemporaryPostAttachmentGuid, FileName, FriendlyFileName, IsRemote)
if (result != null)
{
document.getElementById('<%= ServeruploadtempID.ClientID %>').value = result[0];
document.getElementById('<%= serverfilename.ClientID %>').innerHTML = result[1];
document.getElementById('<%= Serverfriendlyfilename.ClientID %>').value = result[1];
document.getElementById('<%= RemoveAttachment.ClientID %>').style.visibility = 'visible';
}
}
function removeAttachment()
{
document.getElementById('<%= ServeruploadtempID.ClientID %>').value = '';
document.getElementById('<%= serverfilename.ClientID %>').innerHTML = '';
document.getElementById('<%= Serverfriendlyfilename.ClientID %>').value = '';
document.getElementById('<%= RemoveAttachment.ClientID %>').style.visibility = 'hidden';
}
function SelectPreview()
{
$('PreviewBody').innerHTML = '';
Element.show('loading');
CreateEditBlogPost.PreviewPost('<%= this.ClientID %>',<%= PostBody.ClientSideText %>,previewCallBack);
$('PreviewTitle').innerHTML = $('<%= PostSubject.ClientID %>').value;
InkCheck(false);
}
function previewCallBack(res)
{
Element.hide('loading');
$('PreviewBody').innerHTML = res.value;
}
function toggleInk(cb)
{
var inkEditor = $('<%= inkWeb.ClientID %>');
if(cb.checked)
{
Element.show('<%= inkWeb.ClientID %>');
}
else
{
Element.hide('<%= inkWeb.ClientID %>');
}
}
function showAdvancedTabs(show)
{
var tabbedPanes = <%=EditorTabs.ClientID%>;
var tabCount = tabbedPanes.GetTabCount();
for (var i = 1; i < tabCount - 1; i++)
tabbedPanes.GetTabAtIndex(i).Disabled = !show;
tabbedPanes.Refresh();
}
function InkHidden()
{
InkCheck(false);
}
function InkVisible()
{
InkCheck(true);
}
function InkCheck(showInk)
{
var InkCheckCB = $('<%= EnableInk.ClientID %>');
var InkCheckInkEditor = $('inkWrapper');
if(showInk && InkCheckCB.checked)
{
$('inkWrapper').style.position= 'static';
}
else
{
$('inkWrapper').style.position= 'absolute';
}
}
</script>
<div style="text-align: right">
<input id="toggleAdvanced" type="checkbox" onclick="showAdvancedTabs(this.checked);" /><label for="toggleAdvanced">Advanced Options</label>
</div>
<asp:ValidationSummary Runat = "server" ID = "valSummary" HeaderText="Your post/article has the following errors" />
<TWC:TabbedPanes id="EditorTabs" runat="server"
PanesCssClass="CommonPane"
TabSetCssClass="CommonPaneTabSet"
TabCssClasses="CommonPaneTab,CommonPaneTab1,CommonPaneTab2"
TabSelectedCssClasses="CommonPaneTabSelected,CommonPaneTabSelected1,CommonPaneTabSelected2"
TabHoverCssClasses="CommonPaneTabHover,CommonPaneTabHover1,CommonPaneTabHover2"
>
<TWC:TabbedPane runat="server">
<Tab OnClickClientFunction="InkHidden"><CP:ResourceControl resourcename="CP_BlogContentEditor_Write" runat = "Server" /></Tab>
<Content>
<div class="CommonFormFieldName">
<cp:formlabel id="tt" runat="Server" controltolabel="PostSubject" resourcename="Weblog_CreateEditBlogPost_Title" />
<asp:requiredfieldvalidator id="postSubjectValidator" runat="server" cssclass="validationWarning" controltovalidate="PostSubject" Display ="Dynamic" ErrorMessage ="A post title is required" >*</asp:requiredfieldvalidator>
</div>
<div class="CommonFormField">
<asp:textbox id="PostSubject" cssclass="ControlPanelTextInputBig" maxlength="256" runat="server" />
</div>
<div class="CommonFormFieldName">
<cp:formlabel id="Formlabel1" runat="Server" controltolabel="PostBody" resourcename="CP_Blogs_CreateEditBlogPost_Body" />
<asp:requiredfieldvalidator id="postBodyValidator" display="Dynamic" runat="server" cssclass="validationWarning"
controltovalidate="PostBody" ErrorMessage="Please add some content">*<br /></asp:requiredfieldvalidator>
</div>
<div class="CommonFormField">
<cs:editor runat="Server" id="PostBody" width="100%" />
</div>
<p />
<div class="CommonFormFieldName">
<cp:helpicon id="Helpicon1" runat="Server" resourcename="Weblog_CreateEditBlogPost_Categories_Sub" />
<cp:formlabel id="Formlabel3" runat="Server" resourcename="Weblog_CreateEditBlogPost_Categories" />
</div>
<div class="CommonFormField">
<cs:TagEditor runat="server" id="Tags" />
</div>
<p id="DefaultTagsContainer" runat="server">
<cp:resourcecontrol runat="server" resourcename="CP_Blogs_CreateEditBlogPost_DefaultTagsNotice" ID="Resourcecontrol3" NAME="Resourcecontrol3"/><br />
<asp:literal id="DefaultTags" runat="server" />
</p>
<p />
</Content>
</TWC:TabbedPane>
<TWC:TabbedPane runat="server">
<Tab Enabled="false" OnClickClientFunction="InkHidden"><CP:ResourceControl resourcename="CP_BlogContentEditor_Post_Attachments" runat = "Server" /></Tab>
<Content>
<div class="CommonFormFieldName">
<cp:formlabel id="FileOrLinkMessage" runat="Server" resourcename="CP_Blogs_CreateEditBlogPost_File" />
</div>
<div class="CommonFormField">
<asp:label id="serverfilename" runat="server" />
<input type="hidden" id="ServeruploadtempID" runat="server" name="ServeruploadtempID">
<input type="hidden" id="Serverfriendlyfilename" runat="server" name="ServeruploadtempID">
<cs:modal modaltype="Link" CssClass="CommonTextButton" url="Attachment.aspx" width="640" height="180"
runat="Server" callback="getAttachmentData" resourcename="CP_Blogs_CreateEditBlogPost_AddUpdate" ResourceFile="ControlPanelResources.xml" id="Modal2" />
<a href="#" onclick="removeAttachment(); return false;" class="CommonTextButton" runat="server"
id="RemoveAttachment"><CP:ResourceControl id = "ResourceControl1" runat="server" ResourceName="CP_Blogs_CreateEditBlogPost_RemoveAttachement"/></a>
</div>
</Content>
</TWC:TabbedPane>
<TWC:TabbedPane runat="server">
<Tab Enabled="false" OnClickClientFunction="InkHidden"><CP:ResourceControl resourcename="CP_BlogContentEditor_Video" runat = "Server" /></Tab>
<Content>
<div class="CommonFormArea" style="width: 650px">
<div class="CommonFormFieldName">
<label for "<%= VideoUrl.ClientID %>"><CS:ResourceControl runat="server" ResourceName="CreateEditPost_VideoUrl" ID="Resourcecontrol7"/></label>
</div>
<div class="CommonFormField">
<asp:textbox id="VideoUrl" runat="server" autocomplete="off" style="width:80%" />
</div>
<div class="CommonFormFieldName">
<label for "<%= VideoImageUrl.ClientID %>"><CS:ResourceControl runat="server" ResourceName="CreateEditPost_PreviewImageUrl" ID="Resourcecontrol8"/></label>
</div>
<div class="CommonFormField">
<asp:textbox id="VideoImageUrl" runat="server" autocomplete="off" style="width:80%" />
</div>
<div class="CommonFormFieldName">
<label for "<%= VideoDuration.ClientID %>"><CS:ResourceControl runat="server" ResourceName="CreateEditPost_VideoDuration" ID="Resourcecontrol9"/></label>
</div>
<div class="CommonFormField">
<asp:textbox id="VideoDuration" runat="server" autocomplete="off" style="width:80%" />
</div>
<div class="CommonFormFieldName">
<label for "<%= VideoWidth.ClientID %>"><CS:ResourceControl runat="server" ResourceName="CreateEditPost_VideoWidth" ID="Resourcecontrol4"/></label>
</div>
<div class="CommonFormField">
<asp:textbox id="VideoWidth" runat="server" autocomplete="off" style="width:80%" />
<asp:RegularExpressionValidator id="VideoWidthValidator" ControlToValidate="VideoWidth" ValidationExpression="^[0-9]*$" runat="server">*</asp:RegularExpressionValidator>
</div>
<div class="CommonFormFieldName">
<label for "<%= VideoDuration.ClientID %>"><CS:ResourceControl runat="server" ResourceName="CreateEditPost_VideoHeight" ID="Resourcecontrol5"/></label>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -