window.wp=window.wp||{},jQuery(document).ready(function(s){var l,e,f=s(window),c=s(document),u=s("#wpadminbar"),H=s("#wpfooter"),d=s("#postdivrich"),m=s("#wp-content-wrap"),b=s("#wp-content-editor-tools"),x=s(),B=s(),T=s("#ed_toolbar"),y=s("#content"),v=s('
'),C=s("#post-status-info"),O=s(),S=s(),z=s("#side-sortables"),E=s("#postbox-container-1"),A=s("#post-body"),R=window.wp.editor&&window.wp.editor.fullscreen,h=function(){},p=function(){},Y=!1,P=!1,W=!1,k=!1,U=0,X=56,F=20,K=300,o=window.getUserSetting("editor"),L={windowHeight:0,windowWidth:0,adminBarHeight:0,toolsHeight:0,menuBarHeight:0,visualTopHeight:0,textTopHeight:0,bottomHeight:0,statusBarHeight:0,sideSortablesHeight:0};function t(t){var e,o,i,n=jQuery.ui.keyCode,s=t.keyCode,d=document.createRange(),a=y[0].selectionStart,h=y[0].selectionEnd,p=v[0].firstChild;if(!a||!h||a===h){try{d.setStart(p,a),d.setEnd(p,h+1)}catch(t){}(i=d.getBoundingClientRect()).height&&(o=(e=i.top-10)+i.height+10,t=L.adminBarHeight+L.toolsHeight+L.textTopHeight,i=L.windowHeight-L.bottomHeight,e=g-L.toolsHeight-L.adminBarHeight&&e<=g-L.toolsHeight-L.adminBarHeight+w-n?(Y=!0,b.css({position:"fixed",top:L.adminBarHeight,width:d}),i&&O.length&&O.css({position:"fixed",top:L.adminBarHeight+L.toolsHeight,width:d-2-(i?0:a.outerWidth()-a.width())}),a.css({position:"fixed",top:L.adminBarHeight+L.toolsHeight+L.menuBarHeight,width:d-2-(i?0:a.outerWidth()-a.width())})):(Y||o)&&(e<=g-L.toolsHeight-L.adminBarHeight?(Y=!1,b.css({position:"absolute",top:0,width:d}),i&&O.length&&O.css({position:"absolute",top:0,width:d-2}),a.css({position:"absolute",top:L.menuBarHeight,width:d-2-(i?0:a.outerWidth()-a.width())})):e>=g-L.toolsHeight-L.adminBarHeight+w-n&&(Y=!1,b.css({position:"absolute",top:w-n,width:d}),i&&O.length&&O.css({position:"absolute",top:w-n,width:d-2}),a.css({position:"absolute",top:w-n+L.menuBarHeight,width:d-2-(i?0:a.outerWidth()-a.width())}))),(!P||o)&&e+L.windowHeight<=t+w+L.bottomHeight+L.statusBarHeight+1?(P=!0,S.css({position:"fixed",bottom:L.bottomHeight,width:d-2}),C.css({position:"fixed",bottom:0,width:d})):(P||o)&&e+L.windowHeight>t+w+L.bottomHeight+L.statusBarHeight-1&&(P=!1,S.add(C).attr("style",""))):o&&(b.css({position:"absolute",top:0,width:d}),i&&O.length&&O.css({position:"absolute",top:0,width:d-2}),a.css({position:"absolute",top:L.menuBarHeight,width:d-2-(i?0:a.outerWidth()-a.width())}),S.add(C).attr("style","")),E.width()<300&&600z.height()+s+120&&L.windowHeightL.windowHeight||W||k?e+X<=s?(z.attr("style",""),W=k=!1):U=e+X&&(W=!0,z.css({position:"fixed",top:X,bottom:""}))):(s-X<=e?z.css({position:"fixed",top:X}):z.attr("style",""),W=k=!1),U=e):(z.attr("style",""),W=k=!1),o&&(m.css({paddingTop:L.toolsHeight}),i?B.css({paddingTop:L.visualTopHeight+L.menuBarHeight}):(y.css({marginTop:L.textTopHeight}),v.width(d-20-2))))}function i(){N(),r()}function w(t){for(var e=1;e<6;e++)setTimeout(t,500*e)}function n(){window.pageYOffset&&130X&&(k=!0,window.scrollBy(0,-1),r(),window.scrollBy(0,1)),r()}).on("wp-window-resized.editor-expand",function(){l&&!l.isHidden()?l.execCommand("wpAutoResize"):N()}),y.on("focus.editor-expand input.editor-expand propertychange.editor-expand",N),y.on("keyup.editor-expand",t),h(),R&&R.pubsub.subscribe("hidden",i),l&&(l.settings.wp_autoresize_on=!0,l.execCommand("wpAutoResizeOn"),l.isHidden()||l.execCommand("wpAutoResize")),l&&!l.isHidden()||N(),r()}function a(){var t=window.getUserSetting("ed_size");window.pageYOffset&&130t&&window.scrollTo(window.pageXOffset,t-L.adminBarHeight),N(),r()},100),r()}"content"===a.id&&((l=a).settings.autoresize_min_height=K,x=m.find(".mce-toolbar-grp"),B=m.find(".mce-edit-area"),S=m.find(".mce-statusbar"),O=m.find(".mce-menubar"),h=function(){a.on("keyup",o),a.on("show",i),a.on("hide",n),a.on("setcontent wp-autoresize wp-toolbar-toggle",r),f.off("scroll.mce-float-panels").on("scroll.mce-float-panels",e)},p=function(){a.off("keyup",o),a.off("show",i),a.off("hide",n),a.off("setcontent wp-autoresize wp-toolbar-toggle",r),f.off("scroll.mce-float-panels")},d.hasClass("wp-editor-expand")&&(h(),w(r)))}),d.hasClass("wp-editor-expand")&&(n(),m.hasClass("html-active")&&w(function(){r(),N()})),s("#adv-settings .editor-expand").show(),s("#editor-expand-toggle").on("change.editor-expand",function(){s(this).prop("checked")?(n(),window.setUserSetting("editor_expand","on")):(a(),window.setUserSetting("editor_expand","off"))}),window.editorExpand={on:n,off:a}});