home_blog.js 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /*
  2. [Discuz!] (C)2001-2099 Comsenz Inc.
  3. This is NOT a freeware, use is subject to license terms
  4. $Id: home_blog.js 23838 2011-08-11 06:51:58Z monkey $
  5. */
  6. function validate_ajax(obj) {
  7. var subject = $('subject');
  8. if (subject) {
  9. var slen = strlen(subject.value);
  10. if (slen < 1 || slen > 80) {
  11. alert("标题长度(1~80字符)不符合要求");
  12. subject.focus();
  13. return false;
  14. }
  15. }
  16. if($('seccode')) {
  17. var code = $('seccode').value;
  18. var x = new Ajax();
  19. x.get('cp.php?ac=common&op=seccode&code=' + code, function(s){
  20. s = trim(s);
  21. if(s.indexOf('succeed') == -1) {
  22. alert(s);
  23. $('seccode').focus();
  24. return false;
  25. } else {
  26. edit_save();
  27. obj.form.submit();
  28. return true;
  29. }
  30. });
  31. } else {
  32. edit_save();
  33. obj.form.submit();
  34. return true;
  35. }
  36. }
  37. function edit_album_show(id) {
  38. var obj = $('uchome-edit-'+id);
  39. if(id == 'album') {
  40. $('uchome-edit-pic').style.display = 'none';
  41. }
  42. if(id == 'pic') {
  43. $('uchome-edit-album').style.display = 'none';
  44. }
  45. if(obj.style.display == '') {
  46. obj.style.display = 'none';
  47. } else {
  48. obj.style.display = '';
  49. }
  50. }