src/pyams_skin/resources/js/ext/tinymce/dev/plugins/autoresize/plugin.min.js
changeset 557 bca7a7e058a3
equal deleted inserted replaced
-1:000000000000 557:bca7a7e058a3
       
     1 tinymce.PluginManager.add("autoresize",function(d){var c=d.settings,e=0;function b(){return d.plugins.fullscreen&&d.plugins.fullscreen.isFullscreen()}if(d.settings.inline){return}function a(o){var l,q,n,r,t=tinymce.DOM,j,h,g,m,s,i,k,p;q=d.getDoc();if(!q){return}n=q.body;r=q.documentElement;j=c.autoresize_min_height;if(!n||(o&&o.type==="setcontent"&&o.initial)||b()){if(n&&r){n.style.overflowY="auto";r.style.overflowY="auto"}return}g=d.dom.getStyle(n,"margin-top",true);m=d.dom.getStyle(n,"margin-bottom",true);s=d.dom.getStyle(n,"padding-top",true);i=d.dom.getStyle(n,"padding-bottom",true);k=d.dom.getStyle(n,"border-top-width",true);p=d.dom.getStyle(n,"border-bottom-width",true);h=n.offsetHeight+parseInt(g,10)+parseInt(m,10)+parseInt(s,10)+parseInt(i,10)+parseInt(k,10)+parseInt(p,10);if(isNaN(h)||h<=0){h=tinymce.Env.ie?n.scrollHeight:(tinymce.Env.webkit&&n.clientHeight===0?0:n.offsetHeight)}if(h>c.autoresize_min_height){j=h}if(c.autoresize_max_height&&h>c.autoresize_max_height){j=c.autoresize_max_height;n.style.overflowY="auto";r.style.overflowY="auto"}else{n.style.overflowY="hidden";r.style.overflowY="hidden";n.scrollTop=0}if(j!==e){l=j-e;t.setStyle(d.iframeElement,"height",j+"px");e=j;if(tinymce.isWebKit&&l<0){a(o)}}}function f(h,g,i){setTimeout(function(){a({});if(h--){f(h,g,i)}else{if(i){i()}}},g)}c.autoresize_min_height=parseInt(d.getParam("autoresize_min_height",d.getElement().offsetHeight),10);c.autoresize_max_height=parseInt(d.getParam("autoresize_max_height",0),10);d.on("init",function(){var h,g;h=d.getParam("autoresize_overflow_padding",1);g=d.getParam("autoresize_bottom_margin",50);if(h!==false){d.dom.setStyles(d.getBody(),{paddingLeft:h,paddingRight:h})}if(g!==false){d.dom.setStyles(d.getBody(),{paddingBottom:g})}});d.on("nodechange setcontent keyup FullscreenStateChanged",a);if(d.getParam("autoresize_on_init",true)){d.on("init",function(){f(20,100,function(){f(5,1000)})})}d.addCommand("mceAutoResize",a)});