function feed_publish(e,t,a){var i,d="";for(var s in d+='
",a&&jQuery("#"+a).length)?(i=jQuery("#"+a+" > .card:first")).length>0?i.before(d):jQuery("#"+a).html(d):(i=jQuery("#comment_container > .card:first")).length>0?i.before(d):jQuery("#comment_container").html(d);jQuery("#comment_"+e.cid).slideDown(500),jQuery("#message_"+t).removeClass("writelock").removeClass("writein").val(""),jQuery("#publish_submit_"+t).removeAttr("disabled"),jQuery("#message_"+t).val(jQuery("#message_"+t).attr("tip")),jQuery("#message_"+t).css({height:25}),jQuery("#attachmentViewBox_"+t).empty(),jQuery("#comment_"+e.cid+" img[data-original]").dzzthumb();try{callback_by_comment("comment_"+e.cid,"add")}catch(e){}}function feed_reply(e){var t="";for(var a in t+='",t+=" ",document.getElementById("reply_list_"+e.pcid))jQuery("#reply_list_"+e.pcid).find(".cmt_fed:first").before(t);else{var d="";d+=' ",d+=' '+t+"
",jQuery("#comment_reply_"+e.pcid).html(d)}jQuery("#comment_"+e.cid).on("mouseenter",function(){jQuery(this).addClass("hover_cmt_fed")}).on("mouseleave",function(){jQuery(this).removeClass("hover_cmt_fed")});var s=parseInt(jQuery("#comment_reply_"+e.pcid+" .txt_cfed .num_cfed").html());s>0&&jQuery("#comment_reply_"+e.pcid+" .txt_cfed .num_cfed").html(s+1),jQuery("#message_"+e.pcid).val(""),jQuery("#pulish_submit_"+e.pcid).removeAttr("disabled"),jQuery("#reply_publish_"+e.pcid).slideUp(500),jQuery("#attachmentViewBox_"+e.pcid).empty(),jQuery("#comment_"+e.cid+" img[data-original]").dzzthumb()}function getReplyForm(e,t,a,i,d){if(jQuery("#comment_container .card .publishsharewrap").hide(),document.getElementById("reply_publish_"+e)){s=jQuery("#reply_who_"+e);t>0?(s.find(".toname_wcpsw").html(jQuery("#comment_"+t+" .avatar_mcfed").html()),s.show(),jQuery("#reply_pid_"+e).val(t)):(s.hide(),jQuery("#reply_pid_"+e).val("0")),jQuery("#reply_publish_"+e).find(".publishsharewrap").show().end().slideDown(500),jQuery("#comment_"+e+' textarea[name="message"]').val("").focus(),jQuery("#message_"+e).css("height",25)}else{var s=jQuery('').appendTo("#comment_"+e);ajaxget(DZZSCRIPT+"?mod=comment&op=ajax&do=getReplyForm&cid="+e+"&allowattach="+a+"&allowat="+i+"&allowsmiley="+d,"reply_publish_"+e,"reply_publish_"+e,"","",function(){var a=jQuery("#reply_who_"+e);t>0?(a.find(".toname_wcpsw").html(jQuery("#comment_"+t+" .avatar_mcfed").html()),a.show(),jQuery("#reply_pid_"+e).val(t)):(a.hide(),jQuery("#reply_pid_"+e).val("0")),jQuery("#comment_"+e+' textarea[name="message"]').val("").focus(),jQuery("#message_"+e).css("height",25)})}}function feed_edit(e,t,a,i){showWindow("publish_edit_"+e,DZZSCRIPT+"?mod=comment&op=ajax&do=edit&cid="+e+"&allowattach="+t+"&allowat="+a+"&allowsmiley="+i)}function feed_edit_finish(e,t,a,i){jQuery.get(DZZSCRIPT+"?mod=comment&op=ajax&do=getcommentbycid&cid="+e+"&allowattach="+t+"&allowat="+a+"&allowsmiley="+i,function(t){jQuery("#comment_"+e).replaceWith(t)})}function feed_delete(e,t,a){var i="";i=a?__lang.sure_want_delete_comment:__lang.sure_want_delete_all_comment,confirm(i)&&jQuery.getJSON(DZZSCRIPT+"?mod=comment&op=ajax&do=delete&cid="+e,function(e){jQuery("#"+t).slideUp(500,function(){if(jQuery(this).remove(),a){var e=parseInt(jQuery("#comment_reply_"+a+" .txt_cfed .num_cfed").html());e>0&&jQuery("#comment_reply_"+a+" .txt_cfed .num_cfed").html(e-1)}});try{callback_by_comment(t,"delete")}catch(e){}})}function feed_addAttach(e,t,a){var i="";i+=' ',i+='
',i+='
',e.isimage?i+='
':i+='
',i+=' \t\t
",i+="
",i+="
",i+="
",t.replaceWith(i),check_attach_share_tid(a)}function feed_downAttach(e){var t=DZZSCRIPT+"?mod=comment&op=down&qid="+e;BROWSER.ie?window.open(t):(window.frames.hidefram||jQuery('').appendTo("body"),window.frames.hideframe.location=t)}function feed_attach_saveto(e){var t=DZZSCRIPT+"?mod=comment&op=saveto&qid="+e;showWindow("saveto","index.php?mod=system&op=filewindow&type=2","get","0",function(e,a){jQuery.post(t,{fid:e},function(e){e.error?showmessage(e.error,"danger",3e3,1):showmessage(__lang.savetosuccess+a.relativepath+e.filename,"success",3e3,1)},"json")})}function feed_attach_preview(e){var t=DZZSCRIPT+"?mod=comment&op=preview&qid="+e;top._config?(window.frames.hidefram||jQuery('').appendTo("body"),window.frames.hideframe.location=t):window.open(t)}function feed_attach_del(e){DZZSCRIPT}function check_attach_share_tid(e){e||(e="0");var t=jQuery("#attachmentViewBox_"+e).find(".attachment_previewer").length,a=jQuery("#message_"+e).val(),i=/^__lang.share_the(\d+)__lang.js_a_file/gi;return t<1?""!=a&&jQuery("#message_"+e).val(a.replace(i,"")):""==a||a==jQuery("#message_"+e).attr("tip")?jQuery("#message_"+e).val(__lang.share_the+t+__lang.js_a_file):jQuery("#message_"+e).val(a.replace(i,__lang.share_the+t+__lang.js_a_file)),check_publish_enable(e),jQuery("#message_"+e).focus().caret("pos",document.getElementById("message_"+e).value.length),t}function removeAttach(e,t){e.slideUp(500,function(){jQuery(this).remove(),check_attach_share_tid(t)})}function uploadfrom_desktop(e){e||(e="0");try{var t={attach:[__lang.typename_attach,["ATTACH","IMAGE","DOCUMENT","VIDEO","LINK","DZZDOC"],""],image:[__lang.typename_image+"(*.jpg,*.jpeg,*.png,*.gif)",["IMAGE","JPG","JPEG","PNG","GIF"],""]},a=JSON.stringify(t);a=(a=(a=a.replace(/\"/g,""")).replace(/\(/g,"|")).replace(/\)/g,"$"),a=encodeURIComponent(a),showWindow("openfile","index.php?mod=system&op=filewindow&handlekey=svaefile&mulitype=1&exts="+a+"&callback=opencallback","get","0",function(t){var a=t;for(var i in a){var d=a[i],s="";s+=' ',s+='
',s+='
',s+='
',s+=' \t\t
',s+='
'+d.name+"
",s+='
"+__lang.del_adjunct+"","image"==d.type||"attach"==d.type||"document"==d.type?(s+='
',s+='
',s+='
',s+='
'):(s+='
',s+='
',s+='
',s+='
'),s+='
',s+='
',s+="
",s+="
",s+="
",s+="
",jQuery("#attachmentViewBox_"+e).append(s),check_attach_share_tid(e)}})}catch(e){}}function check_publish_enable(e){e||(e="0");var t=document.getElementById("message_"+e).value.replace(/[\r\n]/i,""),a=mb_strlen(t);a>1e3&&(a=1e3-a),document.getElementById("num_input_"+e).innerHTML=a,a>0&&a<1e3?(jQuery("#publish_submit_"+e).removeAttr("disabled","true"),jQuery("#message_"+e).addClass("writein")):(jQuery("#publish_submit_"+e).attr("disabled","true"),jQuery("#message_"+e).removeClass("writein"))}!function(e){e.fn.TextAreaExpander=function(t,a){BROWSER.ie||BROWSER.opera;function i(e){var t=(e=e.target||e).value.length,a=e.offsetWidth;if(t!=e.valLength||a!=e.boxWidth){var i=Math.max(e.expandMin,Math.min(e.scrollHeight,e.expandMax));e.style.overflow=e.scrollHeight>i?"auto":"hidden",e.style.height=i+"px",e.valLength=t,e.boxWidth=a}return!0}return this.each(function(){if("textarea"==this.nodeName.toLowerCase()){var d=this.className.match(/expand(\d+)\-*(\d+)*/i);this.expandMin=t||(d?parseInt("0"+d[1],10):0),this.expandMax=a||(d?parseInt("0"+d[2],10):99999),i(this),this.Initialized||(this.Initialized=!0,e(this).bind("keyup",i))}}),this}}(jQuery);