layui.define(function(l){var o,i,a=layui.$,n=(layui.layer,layui.form),r=layui.fly,e=layui.util,t=(a(".layui-fixbar").remove(),e.fixbar({}),a("#FLY-docs-editor")),c=a("#FLY-docs-preview"),s=a(".fly-docs-preview"),e=a("#FLY-docs-id").val(),d="layui-auth-product-"+e;t[0]&&((o=window.markdownit({html:!0,typographer:!0,linkify:!0,breaks:!0})).renderer.rules.table_open=function(){return'<table class="layui-table">\n'},i=function(){var l=t.val(),l=o.render(l);c.html(l),window.hljs&&hljs.highlightAll()},e||t.val(layui.data(d).content),i(),t.on("keyup",function(){var l=t.val();layui.data(d,{key:"content",value:l})}).on("change",i).on("scroll",function(){!function(l){var o=a(this),i=o.prop("scrollHeight"),o=o.scrollTop()*l.prop("scrollHeight")/i;l.scrollTop(o)}.call(this,s)}),n.on("submit(FLY-docs-send)",function(l){return r.json(l.form.action,l.field,function(l){location.href="/docs/"+l.data.id+"/"}),!1})),a("#FLY-spread-dir").on("click",function(){return a("body").addClass("fly-docs-spread"),!1}),a("body").on("click",function(){a(this).removeClass("fly-docs-spread")}),l("docs",{})});