Files
g.hnyhua.cn/Mtxfw.shop/bbs/add.aspx

331 lines
14 KiB
Plaintext
Raw Normal View History

<%@ Page Title="" Language="C#" MasterPageFile="~/Telesa0.Master" AutoEventWireup="true" CodeBehind="add.aspx.cs" Inherits="Mtxfw.shop.bbs.add" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MyHead" runat="server">
<link href="/css/bbs.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" charset="utf-8" src="/artDialog/ueditor.config2.js"></script>
<script type="text/javascript" charset="utf-8" src="/artDialog/ueditor.all.min.js"> </script>
<!--建议手动加在语言避免在ie下有时因为加载语言失败导致编辑器加载失败-->
<!--这里加载的语言文件会覆盖你在配置项目里添加的语言类型,比如你在配置项目里配置的是英文,这里加载的中文,那最后就是中文-->
<script type="text/javascript" charset="utf-8" src="/artDialog/lang/zh-cn/zh-cn.js"></script>
<script type="text/javascript">
function checkForm() {
$("#<%=Hidd_myEditor.ClientID %>").val(UE.getEditor('editor').getContent());
if ($("#<%=Text_Title.ClientID %>").val() == "") {
alert("请输入标题");
return false;
}
if ($("#<%=B_pid.ClientID %>").val() == "0") {
alert("您选择的分类包含下级,请选择下一级");
return false;
}
if ($("#<%=Hidd_myEditor.ClientID %>").val() == '') {
alert("请输入内容");
return false;
}
if ($("#<%=Hidd_myEditor.ClientID %>").val().length < 5) {
alert("内容太短");
return false;
}
}
</script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MyContent" runat="server">
<form runat="server">
<div id="main">
<div id="Location"><div class="title">当前位置: <a href="/">首页</a> &gt; <a href="/bbs/">社区论坛</a> &gt; <%=strposition%></div></div>
<div class="bbs_particularbox">
<asp:HiddenField ID="Hidd_Url" runat="server" />
<table class="divTable">
<tr>
<th class="addth">
<div align="right"><a name="reback"></a></div>
</th>
<td style=" text-align:left; font-size:20px; font-weight:bold;">
&nbsp;<%=strtitle %>
</td>
</tr>
<tr>
<th class="addth">
<div align="right"><a name="reback"></a></div>
</th>
<td style=" text-align:left; color:Red;">
&nbsp;发表新帖操作+2金币+4积分
</td>
</tr>
<tr>
<th class="addth">
<div align="right">主题:</div>
</th>
<td style=" text-align:left;"> <asp:TextBox ID="Text_Title" CssClass="addTitle" placeholder="请输入您的标题" runat="server"></asp:TextBox>
</td>
</tr>
<asp:Panel ID="showPanel" runat="server">
<tr>
<th class="addth">
<div align="right">主题颜色:</div>
</th>
<td style=" text-align:left;">
<select name="B_TitleColor" id="B_TitleColor" runat="server">
<option value="" selected>文字颜色</option>
<OPTION VALUE="#000000" style="BACKGROUND-COLOR: Black;COLOR: #ffffff">黑色</OPTION>
<OPTION VALUE="#7FFFD4" style="BACKGROUND-COLOR: aquamarine">碧绿色</OPTION>
<OPTION VALUE="#0000FF" style="BACKGROUND-COLOR: blue">蓝色</OPTION>
<OPTION VALUE="#000080" style="BACKGROUND-COLOR: navy;COLOR: #ffffff">海军蓝</OPTION>
<OPTION VALUE="#800080" style="BACKGROUND-COLOR: purple;COLOR: #ffffff">紫色</OPTION>
<OPTION VALUE="#FF1493" style="BACKGROUND-COLOR: deeppink">紫红色</OPTION>
<OPTION VALUE="#EE82EE" style="BACKGROUND-COLOR: violet">紫罗兰色</OPTION>
<OPTION VALUE="#FFC0CB" style="BACKGROUND-COLOR: pink">粉红色</OPTION>
<OPTION VALUE="#006400" style="BACKGROUND-COLOR: darkgreen;COLOR: #ffffff">深绿色</OPTION>
<OPTION VALUE="#008000" style="BACKGROUND-COLOR: green;COLOR: #ffffff">绿色</OPTION>
<OPTION VALUE="#9ACD32" style="BACKGROUND-COLOR: yellowgreen">草绿色</OPTION>
<OPTION VALUE="#FFFF00" style="BACKGROUND-COLOR: yellow">黄色</OPTION>
<OPTION VALUE="#FFA500" style="BACKGROUND-COLOR: orange">橙色</OPTION>
<OPTION VALUE="#FF0000" style="BACKGROUND-COLOR: red">红色</OPTION>
<OPTION VALUE="#A52A2A" style="BACKGROUND-COLOR: brown">红棕色</OPTION>
<OPTION VALUE="#DEB887" style="BACKGROUND-COLOR: burlywood">棕色</OPTION>
<OPTION VALUE="#F5F5DC" style="BACKGROUND-COLOR: beige">浅褐色</OPTION>
</select>
</td>
</tr>
<tr>
<tr>
<th class="addth"><div align="right">分类版块:</div></th>
<td style=" text-align:left;">
<asp:DropDownList ID="B_pid" runat="server"></asp:DropDownList>
</td>
</tr>
<th class="addth"><div align="right">发布类型:</div></th>
<td style=" text-align:left;">
<asp:DropDownList ID="B_TType" runat="server">
<asp:ListItem Value="0">普通</asp:ListItem>
<asp:ListItem Value="1">贴图</asp:ListItem>
<asp:ListItem Value="2">转贴</asp:ListItem>
<asp:ListItem Value="3">原创</asp:ListItem>
</asp:DropDownList>
</td>
</tr>
<!--tr>
<th class="addth"><div align="right">默认图片:</div></th>
<td style=" text-align:left;">
<asp:FileUpload ID="File_PicTrue" runat="server" style=" border:1px solid #ccc;" />
<br><span style="color:Red;">自动生成缩略图</span><br/>
<asp:Image ID="Image_PicTrue" style=" margin-top:4px; width:120px;" Visible="false" runat="server" />
<asp:HiddenField ID="Hidd_PicTrue" runat="server" />
</td>
</tr-->
<tr>
<th class="addth"><div align="right">权限属性:</div></th>
<td style=" text-align:left;">
<asp:CheckBox ID="B_IFReBack" runat="server" />不允许回复
<asp:CheckBox ID="B_IFLogin" runat="server" />登录才能看见内容
<asp:CheckBox ID="B_IFShow" runat="server" />回复才能看见内容
</td>
</tr></asp:Panel>
<tr>
<th class="addth">
<div align="right">内容:</div>
</th>
<td style=" text-align:left;" class="myEditor_body"> <script id="editor" type="text/plain" style="width:98%;height:400px;"><%=strBody %></script>
<asp:HiddenField ID="Hidd_myEditor" runat="server" />
<asp:HiddenField ID="Hidd_C" runat="server" />
<asp:HiddenField ID="Hidd_ForumId" runat="server" />
</td>
</tr
<tr>
<th class="addth">
<div align="right"></div>
</th>
<td style=" text-align:left;">
<asp:Button ID="Btn_Insert" runat="server" CssClass="btn" Text="添加"
OnClientClick="return checkForm();" onclick="Btn_Insert_Click" />
<asp:Button ID="Btn_Update" runat="server" CssClass="btn" Text="更新"
OnClientClick="return checkForm();" onclick="Btn_Update_Click" />
<input id="btn_back" type="reset" value="返回" onclick="history.go(-1)" class="btn" />
</td>
</tr>
</table>
</div>
</div>
</form>
<script type="text/javascript">
//实例化编辑器
//建议使用工厂方法getEditor创建和引用编辑器实例如果在某个闭包下引用该编辑器直接调用UE.getEditor('editor')就能拿到相关的实例
UE.getEditor('editor');
UE.plugins['contextmenu'] = function () {
var me = this,
lang = me.getLang("contextMenu"),
menu,
items = me.options.contextMenu || [
{ label: lang['copy'], cmdName: 'copy',
exec: function () {
// var me = this,body = me.body,
// copyeText = me.selection.getText();
//   window.clipboardData.setData('text',copyeText);
// window.clipboardData.clearData();
var caretpos = me.document.selection.createRange();
caretpos.select();
caretpos.execCommand("copy", false, null);
},
query: function () {
return 0;
}
},
{
label: lang['paste'],
cmdName: 'paste',
exec: function () {
var caretpos = document.selection.createRange();
caretpos.execCommand("paste");
return;
// var caretpos=me.selection.getRange();
// var editorText=GetHtmlEditorValue();
// var editorTextStart=editorText.substring(0,caretpos.startOffset);
// var editorTextEnd=editorText.substring(caretpos.endOffset,editorText.length);
// editorText= editorText.substring(3,editorText.length-4);
// var editorText= edtior.getContent();
// var copyText=window.clipboardData.getData('text');
// if(copyText!=null)
// {
// editorText=editorTextStart+copyText+editorTextEnd;
// SetHtmlEditorValue(editorText);
// }
// else
// {
// SetHtmlEditorValue(editorText);
// }
//
},
query: function () {
return 0;
}
}
];
};
function isFocus(e) {
alert(UE.getEditor('editor').isFocus());
UE.dom.domUtils.preventDefault(e)
}
function setblur(e) {
UE.getEditor('editor').blur();
UE.dom.domUtils.preventDefault(e)
}
function insertHtml() {
var value = prompt('插入html代码', '');
UE.getEditor('editor').execCommand('insertHtml', value)
}
function createEditor() {
enableBtn();
UE.getEditor('editor');
};
function getAllHtml() {
document.getElementById("Hidd_myEditor").value = UE.getEditor('editor').getAllHtml();
alert(UE.getEditor('editor').getAllHtml());
}
function getContent() {
document.getElementById("Hidd_myEditor").value = UE.getEditor('editor').getContent();
}
function getPlainTxt() {
var arr = [];
arr.push("使用editor.getPlainTxt()方法可以获得编辑器的带格式的纯文本内容");
arr.push("内容为:");
arr.push(UE.getEditor('editor').getPlainTxt());
alert(arr.join('\n'))
}
function setContent(isAppendTo) {
//var arr = [];
//arr.push("使用editor.setContent('欢迎使用ueditor')方法可以设置编辑器的内容");
UE.getEditor('editor').setContent('欢迎使用ueditor', isAppendTo);
//alert(arr.join("\n"));
}
function setDisabled() {
UE.getEditor('editor').setDisabled('fullscreen');
disableBtn("enable");
}
function setEnabled() {
UE.getEditor('editor').setEnabled();
enableBtn();
}
function getText() {
//当你点击按钮时编辑区域已经失去了焦点如果直接用getText将不会得到内容所以要在选回来然后取得内容
var range = UE.getEditor('editor').selection.getRange();
range.select();
var txt = UE.getEditor('editor').selection.getText();
alert(txt)
}
function getContentTxt() {
var arr = [];
arr.push("使用editor.getContentTxt()方法可以获得编辑器的纯文本内容");
arr.push("编辑器的纯文本内容为:");
arr.push(UE.getEditor('editor').getContentTxt());
alert(arr.join("\n"));
}
function hasContent() {
var arr = [];
arr.push("使用editor.hasContents()方法判断编辑器里是否有内容");
arr.push("判断结果为:");
arr.push(UE.getEditor('editor').hasContents());
alert(arr.join("\n"));
}
function setFocus() {
UE.getEditor('editor').focus();
}
function deleteEditor() {
disableBtn();
UE.getEditor('editor').destroy();
}
function disableBtn(str) {
var div = document.getElementById('btns');
var btns = domUtils.getElementsByTagName(div, "button");
for (var i = 0, btn; btn = btns[i++]; ) {
if (btn.id == str) {
domUtils.removeAttributes(btn, ["disabled"]);
} else {
btn.setAttribute("disabled", "true");
}
}
}
function enableBtn() {
var div = document.getElementById('btns');
var btns = domUtils.getElementsByTagName(div, "button");
for (var i = 0, btn; btn = btns[i++]; ) {
domUtils.removeAttributes(btn, ["disabled"]);
}
}
function getLocalData() {
alert(UE.getEditor('editor').execCommand("getlocaldata"));
}
function clearLocalData() {
UE.getEditor('editor').execCommand("clearlocaldata");
alert("已清空草稿箱")
}
</script>
</asp:Content>