first commit
This commit is contained in:
@@ -0,0 +1,347 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<title>创建词条 - 动易百科</title>
|
||||
<link rel="stylesheet" href="{PE.SiteConfig.SkinPath/}encyclopedia/public.css" type="text/css">
|
||||
<link rel="stylesheet" href="{PE.SiteConfig.SkinPath/}encyclopedia/default.css" type="text/css">
|
||||
<link rel="stylesheet" href="{PE.SiteConfig.SkinPath/}encyclopedia/index.css" type="text/css">
|
||||
<script language="javascript" type="text/javascript" src="{PE.SiteConfig.ApplicationPath/}js/jquery.pack.js"></script>
|
||||
<script language="javascript" type="text/javascript" src="{PE.SiteConfig.ApplicationPath/}js/slider.js"></script>
|
||||
<!--[if lt IE 9]>
|
||||
<script language="javascript" type="text/javascript" src="{PE.SiteConfig.SkinPath/}encyclopedia/js/DD_belatedPNG_0.0.8a-min-3gmin.js"></script>
|
||||
<![endif]-->
|
||||
<script language="javascript" type="text/javascript" src="{PE.SiteConfig.ApplicationPath/}js/Common.js"></script>
|
||||
{PE.Label id="互动百科_信息提示弹出层" /}
|
||||
{PE.Label id="互动百科_弹出层初始化JS" /}
|
||||
<script type="text/javascript">
|
||||
|
||||
var ids="";
|
||||
var names="";
|
||||
|
||||
jQuery(function () {
|
||||
jQuery("#HdnCategoryIds").val(ids);
|
||||
LoadRootCategory();
|
||||
jQuery("#Txt_Name").val("@Request_name");
|
||||
});
|
||||
|
||||
function LoadRootCategory(){
|
||||
if(jQuery("#divOptions").children().length == 0){
|
||||
var x = new AjaxRequest('XML','categoryform');
|
||||
x.para = ['parentid=0'];
|
||||
x.post('getcategorylist', '{PE.SiteConfig.AjaxSitepath/}Ajax.aspx?HandlerName=EncyclopediaAjaxHandler', function(s) {
|
||||
var xml = x.createXmlDom(s);
|
||||
var categorylist = xml.getElementsByTagName("categorylist")[0].firstChild.data;
|
||||
var obj = JSON.parse(categorylist);
|
||||
var text = "";
|
||||
jQuery.each(obj,function(idx,item){
|
||||
text += "<ul id=\"ul"+item.id+"\"><li><label><input id=\"item"+item.id+"\" type=\"checkbox\" onclick=\"SelectCategory("+item.id+",'"+item.name+"')\">"+item.name+"</label>";
|
||||
if(item.childcount > 0){
|
||||
text += "<input id='icon"+item.id+"' type='image' src='{PE.SiteConfig.ApplicationPath/}Images/tree_folder4.gif' onclick='OpenClose(true,"+item.id+");'>";
|
||||
}
|
||||
|
||||
text += "</li></ul>";
|
||||
|
||||
});
|
||||
jQuery("#divOptions").append(text);
|
||||
BindCategory();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function LoadChildCategory(isRoot,id){
|
||||
var x = new AjaxRequest('XML','categoryform');
|
||||
x.para = ['parentid='+id];
|
||||
x.post('getcategorylist', '{PE.SiteConfig.AjaxSitepath/}Ajax.aspx?HandlerName=EncyclopediaAjaxHandler', function(s) {
|
||||
var xml = x.createXmlDom(s);
|
||||
var categorylist = xml.getElementsByTagName("categorylist")[0].firstChild.data;
|
||||
var obj = JSON.parse(categorylist);
|
||||
var text = "";
|
||||
jQuery.each(obj,function(idx,item){
|
||||
text += "<li class=\"childCategory\"><label><input id=\"item"+item.id+"\" type=\"checkbox\" onclick=\"SelectCategory("+item.id+",'"+item.name+"')\">"+item.name+"</label>";
|
||||
if(item.childcount > 0)
|
||||
{
|
||||
text += "<input id='icon"+item.id+"' type='image' src='{PE.SiteConfig.SkinPath/}encyclopedia/images/icon_next.gif' onclick='LoadChildCategory(false,"+item.id+");'>";
|
||||
}
|
||||
|
||||
text += "</li>";
|
||||
|
||||
});
|
||||
if(isRoot){
|
||||
jQuery("#ul"+id).after("<ul id='childul"+id+"'>"+text+"</ul>");
|
||||
jQuery("#icon"+id).attr("src","{PE.SiteConfig.ApplicationPath/}Images/tree_folder3.gif");
|
||||
}else{
|
||||
var prevId = jQuery("#icon"+id).parent().parent().prev().find("input[type='checkbox']:last").attr("id");
|
||||
var leval1 = "<li class='childCategory'><label>"+jQuery("#icon"+id).parent().parent().prev().find("label").html()+"</label></li>";
|
||||
var leval2 = "<li class='childCategory'><label>"+jQuery("#icon"+id).prev().html()+"</label></li>";
|
||||
if(jQuery("#muul").length == 0){
|
||||
jQuery("#divOptions").html("<ul id='muul'>"+leval1+"</ul>");
|
||||
}
|
||||
jQuery("#muul").append(leval2);
|
||||
jQuery("#muul").next().remove();
|
||||
jQuery("#muul").after("<ul id='itemul'>"+text+"</ul>");
|
||||
if(jQuery("#ulback").length > 0){
|
||||
jQuery("#ulback").remove();
|
||||
}
|
||||
|
||||
jQuery("#divOptions").append("<ul id=\"ulback\" class=\"uloptions\"><li class=\"childCategory\"><a href=\"javascript:ReturnBack(0);\">返回一级分类</a></li><li class=\"childCategory\"><a href=\"javascript:ReturnBack('"+prevId+"');\"><img src=\"{PE.SiteConfig.ApplicationPath/}Images/ontop9.gif\">返回上一级分类</a></li></ul>");
|
||||
}
|
||||
|
||||
BindCategory();
|
||||
});
|
||||
}
|
||||
|
||||
function BindCategory(){
|
||||
var idArray = ids.split(",");
|
||||
for(var i = 0;i < idArray.length; i++){
|
||||
var tempId = "item" + idArray[i];
|
||||
jQuery("#divOptions").find("input[type='checkbox']").each(function(){
|
||||
if(jQuery(this).attr("id") == tempId){
|
||||
jQuery(this).attr("checked","checked");
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function ReturnBack(id){
|
||||
if(id == 0 || jQuery("#muul").find("input[type='checkbox']").length == 1){
|
||||
jQuery("#divOptions").html("");
|
||||
LoadRootCategory();
|
||||
}else{
|
||||
jQuery("#muul").find("li:last").remove();
|
||||
var x = new AjaxRequest('XML','categoryform');
|
||||
x.para = ['parentid='+id.replace("item","")];
|
||||
x.post('getcategorylist', '{PE.SiteConfig.AjaxSitepath/}Ajax.aspx?HandlerName=EncyclopediaAjaxHandler', function(s) {
|
||||
var xml = x.createXmlDom(s);
|
||||
var categorylist = xml.getElementsByTagName("categorylist")[0].firstChild.data;
|
||||
var obj = JSON.parse(categorylist);
|
||||
var text = "";
|
||||
jQuery.each(obj,function(idx,item){
|
||||
text += "<li class=\"childCategory\"><label><input id=\"item"+item.id+"\" type=\"checkbox\" onclick=\"SelectCategory("+item.id+",'"+item.name+"')\">"+item.name+"</label>";
|
||||
if(item.childcount > 0)
|
||||
{
|
||||
text += "<input id='icon"+item.id+"' type='image' src='{PE.SiteConfig.SkinPath/}encyclopedia/images/icon_next.gif' onclick='LoadChildCategory(false,"+item.id+");'>";
|
||||
}
|
||||
|
||||
text += "</li>";
|
||||
});
|
||||
if(jQuery("#itemul").length > 0){
|
||||
jQuery("#itemul").remove();
|
||||
}
|
||||
|
||||
jQuery("#muul").after("<ul id='itemul'>"+text+"</ul>");
|
||||
if(jQuery("#ulback").length > 0){
|
||||
jQuery("#ulback").remove();
|
||||
}
|
||||
|
||||
var prevId = "";
|
||||
jQuery("#muul").find("input[type='checkbox']").each(function(){
|
||||
var cid = jQuery(this).attr("id");
|
||||
if(cid == id){
|
||||
return;
|
||||
}
|
||||
|
||||
prevId = cid;
|
||||
});
|
||||
jQuery("#divOptions").append("<ul id=\"ulback\" class=\"uloptions\"><li class=\"childCategory\"><a href=\"javascript:ReturnBack(0);\">返回一级分类</a></li><li class=\"childCategory\"><a href=\"javascript:ReturnBack('"+prevId+"');\"><img src=\"{PE.SiteConfig.ApplicationPath/}Images/ontop9.gif\">返回上一级分类</a></li></ul>");
|
||||
BindCategory();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function SelectCategory(id,name){
|
||||
if(jQuery("#item"+id).attr("checked")){
|
||||
if(ids != ""){
|
||||
ids += ",";
|
||||
}
|
||||
|
||||
if(names != ""){
|
||||
names += ",";
|
||||
}
|
||||
|
||||
ids += id;
|
||||
names += name;
|
||||
}else{
|
||||
var newIds="";
|
||||
var newNames="";
|
||||
var idArray = ids.split(",");
|
||||
var nameArray = names.split(",");
|
||||
for(var i = 0; i < idArray.length; i++){
|
||||
if(idArray[i] != id){
|
||||
if(newIds != ""){
|
||||
newIds += ",";
|
||||
}
|
||||
|
||||
if(newNames != ""){
|
||||
newNames += ",";
|
||||
}
|
||||
|
||||
newIds += idArray[i];
|
||||
newNames += nameArray[i];
|
||||
}
|
||||
}
|
||||
|
||||
ids = newIds;
|
||||
names = newNames;
|
||||
}
|
||||
|
||||
jQuery("#HdnCategoryIds").val(ids);
|
||||
jQuery("#spn_CategoryNames").html(names);
|
||||
jQuery("#spn_Selected").html(names);
|
||||
}
|
||||
|
||||
function ShowCatalog(){
|
||||
var pageArg = getPageSize();
|
||||
var divMask = document.getElementById("Message_mask");
|
||||
divMask.style.width = "100%";
|
||||
divMask.style.height = pageArg[0] + "px";
|
||||
divMask.style.visibility = "visible";
|
||||
var top = "";
|
||||
if (document.body.scrollTop) {
|
||||
top = (document.body.scrollTop + 281) + "px";
|
||||
}
|
||||
else {
|
||||
top = (document.documentElement.scrollTop + 281) + "px";
|
||||
}
|
||||
|
||||
jQuery("#divSelectEntry").css("top", top);
|
||||
jQuery("#divSelectEntry").show();
|
||||
}
|
||||
|
||||
function CloseCatalog(){
|
||||
jQuery("#divSelectEntry").hide();
|
||||
document.getElementById("Message_mask").style.visibility = "hidden";
|
||||
}
|
||||
|
||||
function OpenClose(isRoot,id){
|
||||
var ulid="#childul"+id;
|
||||
if(jQuery(ulid).length > 0){
|
||||
if(jQuery(ulid).css("display") == "block"){
|
||||
jQuery("#icon"+id).attr("src","{PE.SiteConfig.ApplicationPath/}Images/tree_folder4.gif");
|
||||
jQuery(ulid).hide();
|
||||
}else{
|
||||
jQuery("#icon"+id).attr("src","{PE.SiteConfig.ApplicationPath/}Images/tree_folder3.gif");
|
||||
jQuery(ulid).show();
|
||||
}
|
||||
}
|
||||
|
||||
if(jQuery(ulid).length == 0){
|
||||
LoadChildCategory(isRoot,id);
|
||||
}
|
||||
}
|
||||
|
||||
function Add(){
|
||||
var x = new AjaxRequest('XML','categoryform');
|
||||
x.para = ['cids='+jQuery("#HdnCategoryIds").val(),'name='+jQuery("#Txt_Name").val()];
|
||||
x.post('adddoc', '{PE.SiteConfig.AjaxSitepath/}Ajax.aspx?HandlerName=EncyclopediaAjaxHandler', function (s) {
|
||||
var xml = x.createXmlDom(s);
|
||||
var status = xml.getElementsByTagName("status")[0].firstChild.data;
|
||||
switch (status) {
|
||||
case "500":
|
||||
ShowMessage("error",xml.getElementsByTagName("msg")[0].firstChild.data,"");
|
||||
break;
|
||||
case "200":
|
||||
location.href = "EditDoc.aspx?id=" + xml.getElementsByTagName("id")[0].firstChild.data;
|
||||
break;
|
||||
case "401":
|
||||
break;
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="wrapper">
|
||||
<!--header-->
|
||||
{PE.Label id="互动百科_网站顶部" /}
|
||||
<div class="clear20"></div>
|
||||
<!--main-->
|
||||
<div class="mainBox">
|
||||
<!--alphabetically-->
|
||||
<div class="alphabetically browse">
|
||||
<div class="hd">
|
||||
<h3>按字母顺序浏览</h3>
|
||||
</div>
|
||||
<div class="bd">
|
||||
{PE.Label id="互动百科_通用字母浏览" letter="true" /}
|
||||
<div class="clearbox"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="clear12"></div>
|
||||
<!--path-->
|
||||
<div class="path"><a href="Index.aspx">动易百科</a>><span>创建词条</span></div>
|
||||
<!--right-->
|
||||
<div class="funBar fr">
|
||||
<!--category-->
|
||||
<div class="category">
|
||||
<div class="hd">
|
||||
<h3>词条标准规范</h3>
|
||||
</div>
|
||||
<div class="bd standard">
|
||||
<p>不可以是代修饰词的陈述性词语<br/>
|
||||
不可以是短语或句子<br/>
|
||||
不可以是讨论的话题<br/>
|
||||
不可以含有特殊符号和空格<br/>
|
||||
不可以含有错别字<br/>
|
||||
英语词必须是全称<br/>
|
||||
新闻类、技巧类文章不能作为百科词条</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!--left-->
|
||||
<div class="conBar fl">
|
||||
<!--cateContent-->
|
||||
<div class="createEntry">
|
||||
<div class="hd">
|
||||
<h4>创建词条</h4>
|
||||
</div>
|
||||
<div class="bd">
|
||||
<table width="100%" border="0" cellpadding="0" cellspacing="0">
|
||||
<tr>
|
||||
<td class="tit">词条名称:</td>
|
||||
<td colspan="2"><input id="Txt_Name" class="" type="text" value=""></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tit">词条分类:</td>
|
||||
<td class="sel"><a href="javascript:ShowCatalog();">选择/修改词条分类</a></td>
|
||||
<td>请为您要创建的词条选择一个合适的分类</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tit">已选择分类:</td>
|
||||
<td colspan="2"><span id="spn_CategoryNames"></span><input id="HdnCategoryIds" type="hidden" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="3" class="line"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="3" class="btn"><a href="javascript:Add()" title="创建词条">创建词条</a></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="clearbox"></div>
|
||||
<div class="clear12"></div>
|
||||
<!--footer-->
|
||||
<div class="footer">
|
||||
<!--friendlyLinks--><!--copyRight-->
|
||||
{PE.Label id="互动百科_网站底部" /}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="divSelectEntry" class="selectEntry">
|
||||
<div class="hd"><span><a class="png" href="javascript:CloseCatalog();" title="关闭窗口">关闭</a></span>
|
||||
<h3>词条分类</h3>
|
||||
</div>
|
||||
<div class="bd">
|
||||
<div class="selected"><strong>已选择分类:</strong>
|
||||
<div class="selectedList"><span id="spn_Selected"></span></div>
|
||||
</div>
|
||||
<div id="divOptions" class="options"></div>
|
||||
</div>
|
||||
<div class="ft"><a href="javascript:CloseCatalog();" title="确定选择">确定选择</a></div>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user