WordPress/wp-admin/js/editor-expand.min.js

2 lines
13 KiB
JavaScript
Raw Normal View History

/*! This file is auto-generated */
!function(F,I){"use strict";var L=I(F),M=I(document),V=I("#wpadminbar"),N=I("#wpfooter");I(function(){var g,e,u=I("#postdivrich"),h=I("#wp-content-wrap"),m=I("#wp-content-editor-tools"),w=I(),H=I(),b=I("#ed_toolbar"),v=I("#content"),i=v[0],o=0,x=I("#post-status-info"),y=I(),T=I(),B=I("#side-sortables"),C=I("#postbox-container-1"),E=I("#post-body"),S=F.wp.oldEditor&&F.wp.oldEditor.fullscreen,r=function(){},l=function(){},O=!1,z=!1,k=!1,A=!1,W=0,K=56,R=20,Y=300,n=h.hasClass("tmce-active")?"tinymce":"html",U=!!parseInt(F.getUserSetting("hidetb"),10),D={windowHeight:0,windowWidth:0,adminBarHeight:0,toolsHeight:0,menuBarHeight:0,visualTopHeight:0,textTopHeight:0,bottomHeight:0,statusBarHeight:0,sideSortablesHeight:0},s=F._.throttle(function(){var t=F.scrollX||document.documentElement.scrollLeft,e=F.scrollY||document.documentElement.scrollTop,o=parseInt(i.style.height,10);i.style.height=Y+"px",i.scrollHeight>Y&&(i.style.height=i.scrollHeight+"px"),void 0!==t&&F.scrollTo(t,e),i.scrollHeight<o&&p()},300);function P(){var t=i.value.length;g&&!g.isHidden()||!g&&"tinymce"===n||(t<o?s():parseInt(i.style.height,10)<i.scrollHeight&&(i.style.height=Math.ceil(i.scrollHeight)+"px",p()),o=t)}function p(t){var e,o,i,n,s,f,d,a,c,u,r,l,p;S&&S.settings.visible||(e=L.scrollTop(),o="scroll"!==(r=t&&t.type),i=g&&!g.isHidden(),n=Y,s=E.offset().top,f=h.width(),!o&&D.windowHeight||(p=L.width(),(D={windowHeight:L.height(),windowWidth:p,adminBarHeight:600<p?V.outerHeight():0,toolsHeight:m.outerHeight()||0,menuBarHeight:y.outerHeight()||0,visualTopHeight:w.outerHeight()||0,textTopHeight:b.outerHeight()||0,bottomHeight:x.outerHeight()||0,statusBarHeight:T.outerHeight()||0,sideSortablesHeight:B.height()||0}).menuBarHeight<3&&(D.menuBarHeight=0)),i||"resize"!==r||P(),u=i?(d=w,l=H,D.visualTopHeight):(d=b,l=v,D.textTopHeight),(i||d.length)&&(p=d.parent().offset().top,r=l.offset().top,l=l.outerHeight(),(i?Y+u:Y+20)+5<l?((!O||o)&&e>=p-D.toolsHeight-D.adminBarHeight&&e<=p-D.toolsHeight-D.adminBarHeight+l-n?(O=!0,m.css({position:"fixed",top:D.adminBarHeight,width:f}),i&&y.length&&y.css({position:"fixed",top:D.adminBarHeight+D.toolsHeight,width:f-2-(i?0:d.outerWidth()-d.width())}),d.css({position:"fixed",top:D.adminBarHeight+D.toolsHeight+D.menuBarHeight,width:f-2-(i?0:d.outerWidth()-d.width())})):(O||o)&&(e<=p-D.toolsHeight-D.adminBarHeight?(O=!1,m.css({position:"absolute",top:0,width:f}),i&&y.length&&y.css({position:"absolute",top:0,width:f-2}),d.css({position:"absolute",top:D.menuBarHeight,width:f-2-(i?0:d.outerWidth()-d.width())})):e>=p-D.toolsHeight-D.adminBarHeight+l-n&&(O=!1,m.css({position:"absolute",top:l-n,width:f}),i&&y.length&&y.css({position:"absolute",top:l-n,width:f-2}),d.css({position:"absolute",top:l-n+D.menuBarHeight,width:f-2-(i?0:d.outerWidth()-d.width())}))),(!z||o&&U)&&e+D.windowHeight<=r+l+D.bottomHeight+D.statusBarHeight+1?t&&0<t.deltaHeight&&t.deltaHeight<100?F.scrollBy(0,t.deltaHeight):i&&U&&(z=!0,T.css({position:"fixed",bottom:D.bottomHeight,visibility:"",width:f-2}),x.css({position:"fixed",bottom:0,width:f})):(!U&&z||(z||o)&&e+D.windowHeight>r+l+D.bottomHeight+D.statusBarHeight-1)&&(z=!1,T.attr("style",U?"":"visibility: hidden;"),x.attr("style",""))):o&&(m.css({position:"absolute",top:0,width:f}),i&&y.length&&y.css({position:"absolute",top:0,width:f-2}),d.css({position:"absolute",top:D.menuBarHeight,width:f-2-(i?0:d.outerWidth()-d.width())}),T.attr("style",U?"":"visibility: hidden;"),x.attr("style","")),C.width()<300&&600<D.windowWidth&&M.height()>B.height()+s+120&&D.windowHeight<l?(D.sideSortablesHeight+K+R>D.windowHeight||k||A?e+K<=s?(B.attr("style",""),k=A=!1):W<e?k?(k=!1,a=B.offset().top-D.adminBarHeight,(c=N.offset().top)<a+D.sideSortablesHeight+R&&(a=c-D.sideSortablesHeight-12),B.css({position:"absolute",top:a,bottom:""})):!A&&D.sideSortablesHeight+B.offset().top+R<e+D.windowHeight&&(A=!0,B.css({position:"fixed",top:"auto",bottom:R})):e<W&&(A?(A=!1,a=B.offset().top-R,(c=N.offset().top)<a+D.sideSortablesHeight+R&&(a=c-D.sideSortablesHeight-12),B.css({position:"absolute",top:a,bottom:""})):!k&&B.offset().top>=e+K&&(k=!0,B.css({p