/
okboard_view.js
168 lines (150 loc) · 4.01 KB
/
okboard_view.js
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
164
165
166
167
168
function init(){
var content = document.getElementById("centent");
if (content) {
if (content.length) {
content = content[0];
}
content.innerHTML=
content.innerHTML.replace(/a href=/gi,"a target='_balnk' href=") ;
}
}
function goPage() {
document.f1.action="/bbs";
document.f1.act.value="LIST";
document.f1.submit();
}
function goReply() {
document.f1.action="/bbs";
document.f1.act.value="REPLY";
document.f1.submit();
}
var callback = ";";
function show_passwd_layer(cb) {
lobj = document.getElementById('passwd_layer');
var yyy = document.body.scrollTop + 150;
lobj.style.top = yyy;
lobj.style.left = 300;
lobj.style.background="#D0D0FF";
callback = cb;
var submit_type_label = (cb == 'goModify')
? "수정"
: "삭제";
document.getElementById("submit_type").value = submit_type_label;
toggleMenu('passwd_layer');
if (lobj.style.display != 'none') {
document.getElementById('passwd').focus();
} else {
document.getElementById('passwd').value = "";
}
}
function submit_passwd() {
eval(callback+"()");
}
function goDelete() {
document.f1.password.value=document.getElementById("passwd").value;
if(document.f1.password.value.length>0 && document.f1.password.value!='null') {
document.f1.act.value="DELETE";
document.f1.pact.value="DELETE";
document.f1.method="POST";
document.f1.submit();
}
}
function goModify() {
document.f1.password.value=document.getElementById("passwd").value;
if(document.f1.password.value.length>0 && document.f1.password.value!='null') {
document.f1.act.value="MODIFY";
document.f1.pact.value="MODIFY";
document.f1.method="POST";
document.f1.submit();
}
}
function goBookmark() {
document.f1.act.value="BOOKMARK";
document.f1.pact.value="BOOKMARK";
document.f1.method="POST";
document.f1.submit();
}
function goPrint() {
link = document.location.href;
link = link.replace("VIEW","PRINT");
window.open(link);
}
// 검색해제
function clearKeyword() {
document.f1.act.value="VIEW";
document.f1.keyword.value="";
document.f1.method="GET";
document.f1.submit();
}
function chk_memo(mform) {
if (mform.mseq && mform.mseq.value != '') {
if (sqeeze(mform.delpass.value)==0) {
alert("입력해 주십시오.");
mform.delpass.focus();
return false;
} else {
return true;
}
}
if (sqeeze(mform.writer.value)==0) {
alert("입력해 주십시오.");
mform.writer.focus();
return false;
}
if (mform.bcomment) {
if (sqeeze(mform.bcomment.value)==0) {
alert("입력해 주십시오.");
mform.bcomment.focus();
return false;
}
// filtering
banWord = filterWord(mform.bcomment.value);
if (banWord.length > 0) {
alert(banWord +' word can\'t be used.');
return false;
}
}
mform.send.disabled=true;
return true;
}
function show_memodel(mseq) {
lobj = document.getElementById('layer_delpass');
var yyy = document.body.scrollTop + 150;
lobj.style.top = yyy;
lobj.style.left = 300;
lobj.style.background="#D0D0FF"
document.f0.mseq.value= mseq;
toggleMenu('layer_delpass');
if (lobj.style.display != 'none') {
document.f0.delpass.focus();
}
}
// 문자열 내의 공백 제거 후 길이 반환
function sqeeze(str) {
str = str.replace(/ /g, "");
return str.length;
}
// 페이지 게시물 그룹 이동
function movePage() {
document.fmove.submit();
}
/**
* tag script
*/
function saveTag() {
var url = "/jsp/tag.jsp?";
var tagObj = document.getElementById("tag");
var params = "seq=<%= one.getSeq() %>&tag="+(tagObj.value);
tagObj.disabled = true;
processAjax(url, params, "doTag");
return false;
}
function doTag(req) {
var result = req.responseText;
document.getElementById("tagSaveMsg").innerHTML = result;
var tagObj = document.getElementById("tag");
if ( 'ok' == result ) {
tagObj.value = "";
}
tagObj.disabled = false;
}