/*** Created by A.J on 2021/5/17.*/$(document).ready(function(){var item = ['bold','italic','strike','underline','fontSize','fontName','paragraph','color','backColor','|','center','left','right','full','indent','outdent','|','link','unlink','textBlock','code','selectAll','removeFormat','trash','|','image','expression','subscript','superscript','horizontal','orderedList','unorderedList','|','undo','redo','|','about'];var daitupian = parseInt($("#daitupian").text()), dailianjie = parseInt($("#dailianjie").text()), uploadPhoto = true;if(dailianjie == 0){item = ['bold','italic','strike','underline','fontSize','fontName','paragraph','color','backColor','|','center','left','right','full','indent','outdent','|','textBlock','code','selectAll','removeFormat','trash','|','image','expression','subscript','superscript','horizontal','orderedList','unorderedList','|','undo','redo','|','about'];}if(daitupian == 0){uploadPhoto = false;}var he = HE.getEditor('zhengwen',{height : '320px',autoHeight : true,autoFloat : true,topOffset : 57,uploadPhoto : uploadPhoto,uploadPhotoHandler : $("#upload_handyeditor_url").text(),uploadPhotoSize : 2048,uploadPhotoType : 'gif,png,jpg,jpeg,svg',uploadPhotoSizeError : $("#sizeError").text(),uploadPhotoTypeError : $("#typeError").text(),item : item,skin : 'jianyuluntan'});$("#formsubmit").css({"position": "relative","z-index": 1200}).click(function(){$("#zhengwen").text(he.getHtml());if(he.getText().length > 597){$("#zhaiyao").val(he.getText().replace(/\n/g, " ").substr(0,597)+'...');}else{$("#zhaiyao").val(he.getText().replace(/\n/g, " "));}$("#newpostform").submit();});if($('#captcha').length > 0){$("#captcha, #resetcaptcha").click(function(){$("#captcha").attr("src",$("#captcha").attr("src")+"?"+Math.random());$("#captchain").val("");});}if(window.history.replaceState){window.history.replaceState(null, null, window.location.href);}});