home_blog.js
1.12 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
/*
[Discuz!] (C)2001-2099 Comsenz Inc.
This is NOT a freeware, use is subject to license terms
$Id: home_blog.js 23838 2011-08-11 06:51:58Z monkey $
*/
function validate_ajax(obj) {
var subject = $('subject');
if (subject) {
var slen = strlen(subject.value);
if (slen < 1 || slen > 80) {
alert("标题长度(1~80字符)不符合要求");
subject.focus();
return false;
}
}
if($('seccode')) {
var code = $('seccode').value;
var x = new Ajax();
x.get('cp.php?ac=common&op=seccode&code=' + code, function(s){
s = trim(s);
if(s.indexOf('succeed') == -1) {
alert(s);
$('seccode').focus();
return false;
} else {
edit_save();
obj.form.submit();
return true;
}
});
} else {
edit_save();
obj.form.submit();
return true;
}
}
function edit_album_show(id) {
var obj = $('uchome-edit-'+id);
if(id == 'album') {
$('uchome-edit-pic').style.display = 'none';
}
if(id == 'pic') {
$('uchome-edit-album').style.display = 'none';
}
if(obj.style.display == '') {
obj.style.display = 'none';
} else {
obj.style.display = '';
}
}