[ Index ]

PHP Cross Reference of WordPress

title

Body

[close]

/wp-includes/js/tinymce/plugins/wpautoresize/ -> plugin.min.js (source)

   1  tinymce.PluginManager.add("wpautoresize",function(c){var f=c.settings,y=300,p=!1;function _(e){return parseInt(e,10)||0}function w(e){var t,o,n,i,a,s,l,u,r,d,g,m,h=tinymce.DOM;p&&(o=c.getDoc())&&(e=e||{},n=o.body,i=o.documentElement,a=f.autoresize_min_height,!n||e&&"setcontent"===e.type&&e.initial||c.plugins.fullscreen&&c.plugins.fullscreen.isFullscreen()?n&&i&&(n.style.overflowY="auto",i.style.overflowY="auto"):(l=c.dom.getStyle(n,"margin-top",!0),u=c.dom.getStyle(n,"margin-bottom",!0),r=c.dom.getStyle(n,"padding-top",!0),d=c.dom.getStyle(n,"padding-bottom",!0),g=c.dom.getStyle(n,"border-top-width",!0),m=c.dom.getStyle(n,"border-bottom-width",!0),(s=n.offsetHeight+_(l)+_(u)+_(r)+_(d)+_(g)+_(m))&&s<i.offsetHeight&&(s=i.offsetHeight),(isNaN(s)||s<=0)&&(s=tinymce.Env.ie?n.scrollHeight:tinymce.Env.webkit&&0===n.clientHeight?0:n.offsetHeight),s>f.autoresize_min_height&&(a=s),f.autoresize_max_height&&s>f.autoresize_max_height?(a=f.autoresize_max_height,n.style.overflowY="auto",i.style.overflowY="auto"):(n.style.overflowY="hidden",i.style.overflowY="hidden",n.scrollTop=0),a!==y&&(t=a-y,h.setStyle(c.iframeElement,"height",a+"px"),y=a,tinymce.isWebKit&&t<0&&w(e),c.fire("wp-autoresize",{height:a,deltaHeight:"nodechange"===e.type?t:null}))))}function n(e,t,o){setTimeout(function(){w(),e--?n(e,t,o):o&&o()},t)}c.settings.inline||tinymce.Env.iOS||(f.autoresize_min_height=parseInt(c.getParam("autoresize_min_height",c.getElement().offsetHeight),10),f.autoresize_max_height=parseInt(c.getParam("autoresize_max_height",0),10),f.wp_autoresize_on&&(p=!0,c.on("init",function(){c.dom.addClass(c.getBody(),"wp-autoresize")}),c.on("nodechange keyup FullscreenStateChanged",w),c.on("setcontent",function(){n(3,100)}),c.getParam("autoresize_on_init",!0)&&c.on("init",function(){n(10,200,function(){n(5,1e3)})})),c.on("show",function(){y=0}),c.addCommand("wpAutoResize",w),c.addCommand("wpAutoResizeOn",function(){c.dom.hasClass(c.getBody(),"wp-autoresize")||(p=!0,c.dom.addClass(c.getBody(),"wp-autoresize"),c.on("nodechange setcontent keyup FullscreenStateChanged",w),w())}),c.addCommand("wpAutoResizeOff",function(){var e;f.wp_autoresize_on||(p=!1,e=c.getDoc(),c.dom.removeClass(c.getBody(),"wp-autoresize"),c.off("nodechange setcontent keyup FullscreenStateChanged",w),e.body.style.overflowY="auto",e.documentElement.style.overflowY="auto",y=0)}))});


Generated: Wed Apr 8 01:00:03 2020 Cross-referenced by PHPXref 0.7.1