/** * Created by A.J on 2019/11/8. */$(document).ready(function(){var t=HE.getEditor("zhengwen",{autoHeight:!0,autoFloat:!0,topOffset:51,uploadPhoto:!0,uploadPhotoHandler:$("#upload_handyeditor_url").text(),uploadPhotoSize:2e3,uploadPhotoType:"gif,png,jpg,jpeg",uploadPhotoSizeError:$("#sizeError").text(),uploadPhotoTypeError:$("#typeError").text(),skin:"catfish"});$("#baocun").click(function(){if($.catfishcms()){$("#zhengwen").text(t.getHtml());var i=$(this);i.children("span").removeClass("hidden"),$.post("",$("#writeForm").serialize(),function(t){i.children("span").addClass("hidden"),"ok"!=t&&$.alert({title:$("#chucuo").text(),content:t,confirmButton:$("#queding").text()})})}});if(""!=$("#zstu").val()&&($("#zstudiv").html('<img src="'+$("#domain").text()+$("#zstu").val()+'" class="img-responsive">'),$("#quxiaozstu").removeClass("hidden")),""!=$("#shipin").val()&&($("#videodiv").html('<h2 class="text-success"><i class="icon-film"></i><i class="icon-ok"></i></h2>'),$("#quxiaoshipin").removeClass("hidden")),""!=$("#zutu").val()){var i=$("#zutu").val();$("#zutu").val(","+$("#zutu").val());var e=i.split(",");$.each(e,function(t,i){$("#groupdiv").html($("#groupdiv").html()+'<div class="col-sm-4 col-md-3"><div class="thumbnail"><img src="'+$("#domain").text()+i+'"><div class="caption text-center"><a href="#!" class="quxiaotupian">'+$("#cancelimage").text()+'</a><div class="hidden">'+i+"</div></div></div></div>")})}$("#zstuupload").uploadify({auto:!0,fileTypeExts:"*.jpg;*.png;*.gif;*.jpeg",multi:!0,formData:{verification:$("#verification").text()},fileSizeLimit:9999,buttonText:$("#buttonText_image").text(),showUploadedPercent:!0,showUploadedSize:!1,removeTimeout:3,uploader:$("#upload_image_url").text(),onUploadComplete:function(t,i){"data/"==i.substr(0,5)?($("#zstu").val(i),$("#zstudiv").html('<img src="'+$("#domain").text()+i+'" class="img-responsive">'),$("#quxiaozstu").removeClass("hidden")):$.alert({title:$("#alertitle").text(),content:i,confirmButton:$("#queding").text()})}}),$("#quxiaozstu").on("click",function(){$.post($("#upload_delfile_url").text(),{delfile:$("#zstu").val(),verification:$("#verification").text()},function(t){$("#zstu").val(""),$("#zstudiv").html(""),$("#quxiaozstu").addClass("hidden")})}),$("#videoupload").uploadify({auto:!0,fileTypeExts:"*.mp4;*.ogg;*.webm;*.flv;*.wav;*.avi;*.rmvb",multi:!1,formData:{verification:$("#verification").text()},fileSizeLimit:9999999,buttonText:$("#buttonText_video").text(),showUploadedPercent:!0,showUploadedSize:!1,removeTimeout:3,uploader:$("#upload_video_url").text(),onUploadComplete:function(t,i){"data/"==i.substr(0,5)?($("#shipin").val(i),$("#videodiv").html('<h2 class="text-success"><i class="icon-film"></i><i class="icon-ok"></i></h2>'),$("#quxiaoshipin").removeClass("hidden")):$.alert({title:$("#alertitle").text(),content:i,confirmButton:$("#queding").text()})}}),$("#quxiaoshipin").click(function(){$.post($("#upload_delfile_url").text(),{delfile:$("#shipin").val(),verification:$("#verification").text()},function(t){$("#shipin").val(""),$("#videodiv").html(""),$("#quxiaoshipin").addClass("hidden")})}),$("#groupupload").uploadify({auto:!0,fileTypeExts:"*.jpg;*.png;*.gif;*.jpeg",multi:!0,formData:{verification:$("#verification").text()},fileSizeLimit:9999,buttonText:$("#buttonText_image").text(),showUploadedPercent:!0,showUploadedSize:!1,removeTimeout:3,uploader:$("#upload_image_url").text(),onUploadComplete:function(t,i){"data/"==i.substr(0,5)?($("#zutu").val($("#zutu").val()+","+i),$("#groupdiv").html($("#groupdiv").html()+'<div class="col-sm-4 col-md-3"><div class="thumbnail"><img src="'+$("#domain").text()+i+'"><div class="caption text-center"><a href="#!" class="quxiaotupian">'+$("#cancelimage").text()+'</a><div class="hidden">'+i+"</div></div></div></div>")):$.alert({title:$("#alertitle").text(),content:i,confirmButton:$("#queding").text()})}}),$("#groupdiv").on("click","a",function(){var t=$(this),i=t.next().text();$.post($("#upload_delfile_url").text(),{delfile:i,verification:$("#verification").text()},function(e){var o=$("#zutu").val();$("#zutu").val(o.replace(","+i,"")),t.parent().parent().parent().remove()})})});