story.js
3.81 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
<!--
function ShowAddCatalog(){
$Obj('addCatalog').style.display='block';
}
function CloseAddCatalog(){
$Obj('addCatalog').style.display='none';
}
function CloseEditCatalog(){
$Obj('editCatalog').style.display='none';
}
function DelCatalog(cid){
if(window.confirm("你确实要删除这个分类么?"))
{
location.href='story_catalog.php?catid='+cid+'&action=del';
}
}
function DelStory(bid){
if(window.confirm("你确实要删除这本图书么?")){
location.href='story_do.php?bid='+bid+'&action=delbook';
}
}
function DelStoryContent(cid){
if(window.confirm("删除内容后章节的其它内容排列序号不会发生变化,\r\n这可能导致管理混乱,你确实要删除这篇内容么?")){
location.href='story_do.php?cid='+cid+'&action=delcontent';
}
}
function CloseLayer(layerid){
$Obj(layerid).style.display='none';
}
//预览内容
function PreViewCt(cid,booktype){
if(booktype==0){
window.open("../book/story.php?id="+cid);
}else{
window.open("../book/show-photo.php?id="+cid);
}
}
//编辑栏目
function EditCatalog(cid){
$Obj('editCatalog').style.display='block';
var myajax = new DedeAjax($Obj('editCatalogBody'),false,true,"","","请稍候,正在载入...");
myajax.SendGet2('story_catalog.php?catid='+cid+'&action=editload');
DedeXHTTP = null;
}
//图书章节,反向选择
function ReSelChapter(){
var ems = document.getElementsByName('ids[]');
for(var i=0;i<ems.length;i++){
if(!ems[i].checked) ems[i].checked = true;
else ems[i].checked = false;
}
}
//删除整章节图书内容
function DelStoryChapter(cid){
if(window.confirm("删除章节会删除章节下的所有内容,你确实要删除么?")){
location.href='story_do.php?cid='+cid+'&action=delChapter';
}
}
//增加图书的检查
function checkSubmitAdd()
{
if(document.form1.catid.value==0){
alert("请选择连载内容的栏目!");
document.form1.bookname.focus();
return false;
}
if(document.form1.bookname.value==""){
alert("连载图书名称不能为空!");
document.form1.bookname.focus();
return false;
}
}
//增加小说内容的检查
function checkSubmitAddCt()
{
if(document.form1.title.value==0){
alert("文章标题不能为空!");
document.form1.title.focus();
return false;
}
if(document.form1.chapterid.selectedIndex==-1 && document.form1.chapternew.value==''){
alert("文章所属章节和新章节名称不能同时为空!");
return false;
}
}
//增加漫画内容的检查
function checkSubmitAddPhoto()
{
if(document.form1.chapterid.selectedIndex==-1 && document.form1.chapternew.value==''){
alert("文章所属章节和新章节名称不能同时为空!");
return false;
}
document.form1.photonum.value = endNum;
}
//显示选择框与新增章节选项
function ShowHideSelChapter(selfield,newfield)
{
if(document.form1.addchapter.checked){
$Obj(selfield).style.display = 'none';
$Obj(newfield).style.display = 'block';
}else{
$Obj(selfield).style.display = 'block';
$Obj(newfield).style.display = 'none';
}
}
function selAll()
{
for(i=0;i<document.form2.ids.length;i++)
{
if(!document.form2.ids[i].checked){
document.form2.ids[i].checked=true;
}
}
}
function noSelAll()
{
for(i=0;i<document.form2.ids.length;i++)
{
if(document.form2.ids[i].checked){
document.form2.ids[i].checked=false;
}
}
}
//获得选中文件的文件名
function getCheckboxItem()
{
var allSel="";
if(document.form2.ids.value) return document.form2.ids.value;
for(i=0;i<document.form2.ids.length;i++)
{
if(document.form2.ids[i].checked){
allSel += (allSel=='' ? document.form2.ids[i].value : ","+document.form2.ids[i].value);
}
}
return allSel;
}
//删除多选
function DelAllBooks()
{
if(window.confirm("你确实要删除这些图书么?")){
var selbook = getCheckboxItem();
location.href='story_do.php?bid='+selbook+'&action=delbook';
}
}
-->