"use strict";
$((function(){if($(".help").hover((function(){$(this).next().show()}),(function(){$(this).next().hide()})),$(".helpcon").hover((function(){$(this).show()}),(function(){$(this).hide()})),$(".tmain .layoutset label").click((function(){$(this).addClass("on").siblings("label").removeClass("on")})),$.fn.smartFloat=function(){return $(this).each((function(){var t,e;t=$(this),e=t.position().top,t.css("position"),$(window).scroll((function(){var i=$(this).scrollTop();i>e?window.XMLHttpRequest?t.css({position:"fixed",top:0}):t.css({top:i}):t.css({position:"absolute",top:e})}))}))},$("aside.left").smartFloat(),$(".tmain dd.half:odd").addClass("right"),$(".uploadimg,.uploadfile").length>0){var t,e,i,n,o=document.createElement("script");if($(o).attr("type","text/plain").attr("id","img_editor"),$("body").append(o),window.UE)(t=UE.getEditor("img_editor",{autoHeightEnabled:!1})).ready((function(){t.hide(),$(".uploadimg").bind("click",(function(){e=$(this).parents("p,tr").find(".metasrc"),i=$(this).parents("p,tr").find(".thumbimg"),n=$(this).parents("p,tr").find(".thumbsrc"),t.getDialog("insertimage").open(),t.addListener("beforeInsertImage",(function(t,o){e.attr("value",o[0].src),i.attr("src",o[0].src),n.attr("value",o[0].src)}))})),$(".uploadfile").bind("click",(function(){e=$(this).parents("p,tr").find(".metasrc"),n=$(this).parents("p,tr").find(".thumbsrc"),t.getDialog("attachment").open(),t.addListener("afterinsertfile",(function(t,i){e.attr("value",i[0].url),n.attr("value",i[0].url)}))}))}))}!function(t){t.fn.hoverDelay=function(e){var i,n,o={hoverDuring:200,outDuring:200,hoverEvent:function(){t.noop()},outEvent:function(){t.noop()}},s=t.extend(o,e||{}),a=this;return t(this).each((function(){t(this).hover((function(){clearTimeout(n),i=setTimeout((function(){s.hoverEvent.apply(a)}),s.hoverDuring)}),(function(){clearTimeout(i),n=setTimeout((function(){s.outEvent.apply(a)}),s.outDuring)}))}))}}(jQuery),$.toast=function(t,e,i){var n;n=$('<div class="toast '+i+'"><div class="toasttext">'+t+"</div></div>"),$("body").append(n),setTimeout((()=>{n.find(".toasttext").addClass("toastclose"),setTimeout((()=>{n.remove()}),200)}),e)},$(".togglelabel").click((function(){$(this).parents(".introbox").toggleClass("on")})),$(".ckbox").sortable({revert:!0}),$(".checkui").click((function(t){if($(this).is(".ui-sortable-helper"))return!1;$(this).hasClass("on")?($(this).removeClass("on"),$(this).find("input").val("0")):($(this).addClass("on"),$(this).find("input").val("1"))}));var s=$("#PostFILTERCATEGORY"),a=$(".PostFILTERCATEGORYID"),r=$("#PostFILTERCATEGORYID");function c(){"0"===s.val()?(a.show(),r.attr("name","PostFILTERCATEGORY"),s.removeAttr("name")):(a.hide(),r.removeAttr("name"),s.attr("name","PostFILTERCATEGORY"))}s.change((function(){c()})),c(),$("[data-stretch]").each((function(){var t=$(this).data("stretch");$(this).find(".imgcheck").bind("click",(function(){$(this).hasClass("imgcheck-on")?$("."+t+"info").hide():$("."+t+"info").show()}))})),document.onkeydown=function(t){if(83==((t=t||event||window.event).keyCode||t.which||t.charCode)&&(t.ctrlKey||t.metaKey))return $(".setbtn").click(),!1},theme.ajaxpost&&$(".setting [type=submit]").click((function(){let t=$(this),e=t.parents("form"),i=e.attr("action"),n=t.val();return t.attr("disabled","disabled").val("正在保存..."),$.post(i,e.serialize(),(function(e,i){t.removeAttr("disabled").val(n),"success"==i?$.toast("保存成功！",2e3,"center"):$.toast("保存失败！",2e3,"center")})),!1}))}));