$(function(){ $('.userguestbook-content').emotionsToHtml(); $('#userguestbook_content').autoResize({ onResize:function(){ $(this).css({opacity:0.8}); }, animateCallback:function(){ $(this).css({opacity:1}); }, animateDuration:300, extraSpace:0, min:'100px' }); $(".face-icon").jqfaceedit({txtAreaObj:$("#userguestbook_content"),textareaid:'userguestbook_content',containerObj:$('#emotion_parentcontainer'),top:25,left:-27}); }); function commentCheckForm(comment_content,customContent){ var comment_name=$.trim($('#userguestbook_name').val()); var comment_email=$.trim($("#userguestbook_email").val()); var comment_url=$.trim($("#userguestbook_url").val()); if(customContent==1){ comment_content=$.trim($("#userguestbook_content").val()); } if(comment_name==""){ windsforceAlert(D.L('评论名字不能为空','__COMMON_LANG__@Common'),D.L('评论发生错误','__COMMON_LANG__@Common'),3); return false; } if(comment_name.length>25){ windsforceAlert(D.L('评论名字长度只能小于等于25个字符串','__COMMON_LANG__@Common'),D.L('评论发生错误','__COMMON_LANG__@Common'),3); return false; } if(comment_email!='' && !checkEmail(comment_email)){ windsforceAlert(D.L('评论E-mail 格式错误','__COMMON_LANG__@Common'),D.L('评论发生错误','__COMMON_LANG__@Common'),3); return false; } if(comment_url!='' && !checkUrl(comment_url)){ windsforceAlert(D.L('评论Url 格式错误','__COMMON_LANG__@Common'),D.L('评论发生错误','__COMMON_LANG__@Common'),3); return false; } if(comment_content == ""){ windsforceAlert(D.L('评论内容不能为空','__COMMON_LANG__@Common'),D.L('评论发生错误','__COMMON_LANG__@Common'),3); return false; } return true; } function commentSubmit(){ var bResult=commentCheckForm(); if(bResult===false){ return false; } $("#comment-submit").val(D.L('正在提交评论','__COMMON_LANG__@Common')); $("#comment-submit").attr("disabled", "disabled"); Dyhb.AjaxSubmit('userguestbook-commentform',D.U('home://space/add_userguestbook'),'',commentComplete); } function commentComplete(data,status){ $("#comment-submit").attr("disabled", false); $("#comment-submit").val(D.L('提交评论','__COMMON_LANG__@Common')); if(status==1){ setTimeout("window.location.replace(_SELF_);",1000); } } function userguestbookAudit(nCommentid,nStatus){ Dyhb.AjaxSend(D.U('home://space/audit_userguestbook?id='+nCommentid+'&status='+nStatus),'ajax=1','',function(data,status){ if(status==1){ setTimeout("window.location.replace(_SELF_);",1000); } }); } function showMedia(){ $('#userguestbook-media-box').toggle('fast'); } function insertUserguestbookattachment(nAttachmentid){ insertAttachmentNormal('userguestbook_content',nAttachmentid); } function insertUserguestbookvideo(sContent){ insertVideoNormal('userguestbook_content',sContent); } function insertUserguestbookmusic(sContent){ insertMusicNormal('userguestbook_content',sContent); }