diff --git a/wp-admin/edit-form-advanced.php b/wp-admin/edit-form-advanced.php index 4fa7e85e09..9356b1a245 100644 --- a/wp-admin/edit-form-advanced.php +++ b/wp-admin/edit-form-advanced.php @@ -496,7 +496,7 @@ if ( post_type_supports($post_type, 'editor') ) { 'dfw' => true, 'drag_drop_upload' => true, 'tabfocus_elements' => 'insert-media-button-1,save-post', - 'editor_height' => 360, + 'editor_height' => 300, 'tinymce' => array( 'resize' => false, 'wp_autoresize_on' => ( ! empty( $_wp_autoresize_on ) && get_user_setting( 'editor_expand', 'on' ) === 'on' ), diff --git a/wp-admin/js/editor-expand.js b/wp-admin/js/editor-expand.js index b244059104..4e3dbf8541 100644 --- a/wp-admin/js/editor-expand.js +++ b/wp-admin/js/editor-expand.js @@ -34,6 +34,7 @@ jQuery( document ).ready( function($) { pageYOffsetAtTop = 130, pinnedToolsTop = 56, autoresizeMinHeight = 300, + initialMode = window.getUserSetting( 'editor' ), // These are corrected when adjust() runs, except on scrolling if already set. heights = { windowHeight: 0, @@ -119,7 +120,7 @@ jQuery( document ).ready( function($) { } function textEditorResize() { - if ( mceEditor && ! mceEditor.isHidden() ) { + if ( ( mceEditor && ! mceEditor.isHidden() ) || ( ! mceEditor && initialMode === 'tinymce' ) ) { return; } diff --git a/wp-admin/js/editor-expand.min.js b/wp-admin/js/editor-expand.min.js index 764f2696e0..89be1b8b6c 100644 --- a/wp-admin/js/editor-expand.min.js +++ b/wp-admin/js/editor-expand.min.js @@ -1 +1 @@ -window.wp=window.wp||{},jQuery(document).ready(function(a){function b(){var a=m.width();P={windowHeight:m.height(),windowWidth:a,adminBarHeight:a>600?o.outerHeight():0,toolsHeight:s.outerHeight()||0,menuBarHeight:z.outerHeight()||0,visualTopHeight:t.outerHeight()||0,textTopHeight:v.outerHeight()||0,bottomHeight:y.outerHeight()||0,statusBarHeight:A.outerHeight()||0,sideSortablesHeight:B.height()||0},P.menuBarHeight<3&&(P.menuBarHeight=0)}function c(a){var b,c,d,e,f,g=jQuery.ui.keyCode,h=a.keyCode,i=document.createRange(),j=w[0].selectionStart,k=w[0].selectionEnd,l=x[0].firstChild,m=10;if(!j||!k||j===k){try{i.setStart(l,j),i.setEnd(l,k+1)}catch(n){}b=i.getBoundingClientRect(),b.height&&(c=b.top-m,d=c+b.height+m,e=P.adminBarHeight+P.toolsHeight+P.textTopHeight,f=P.windowHeight-P.bottomHeight,e>c&&(h===g.UP||h===g.LEFT||h===g.BACKSPACE)?window.scrollTo(window.pageXOffset,c+window.pageYOffset-e):d>f&&window.scrollTo(window.pageXOffset,d+window.pageYOffset-f))}}function d(){if(!k||k.isHidden()){var a,b=w.height();x.width(w.width()-22),x.text(w.val()+" "),a=x.height(),O>a&&(a=O),a!==b&&(w.height(a),e())}}function e(a){if(!E||!E.settings.visible){var c,e,f,g,h,i,j,l,o,q=m.scrollTop(),F="scroll"!==a,G=k&&!k.isHidden(),M=O,Q=D.offset().top,R=1,S=r.width();(F||!P.windowHeight)&&b(),G||"resize"!==a||d(),G?(c=t,e=u,j=P.visualTopHeight):(c=v,e=w,j=P.textTopHeight),i=c.parent().offset().top,l=e.offset().top,o=e.outerHeight(),h=G?O+j:O+20,h=o>h+5,h?((!H||F)&&q>=i-P.toolsHeight-P.adminBarHeight&&q<=i-P.toolsHeight-P.adminBarHeight+o-M?(H=!0,s.css({position:"fixed",top:P.adminBarHeight,width:S}),G&&z.length&&z.css({position:"fixed",top:P.adminBarHeight+P.toolsHeight,width:S-2*R-(G?0:c.outerWidth()-c.width())}),c.css({position:"fixed",top:P.adminBarHeight+P.toolsHeight+P.menuBarHeight,width:S-2*R-(G?0:c.outerWidth()-c.width())})):(H||F)&&(q<=i-P.toolsHeight-P.adminBarHeight?(H=!1,s.css({position:"absolute",top:0,width:S}),G&&z.length&&z.css({position:"absolute",top:0,width:S-2*R}),c.css({position:"absolute",top:P.menuBarHeight,width:S-2*R-(G?0:c.outerWidth()-c.width())})):q>=i-P.toolsHeight-P.adminBarHeight+o-M&&(H=!1,s.css({position:"absolute",top:o-M,width:S}),G&&z.length&&z.css({position:"absolute",top:o-M,width:S-2*R}),c.css({position:"absolute",top:o-M+P.menuBarHeight,width:S-2*R-(G?0:c.outerWidth()-c.width())}))),(!I||F)&&q+P.windowHeight<=l+o+P.bottomHeight+P.statusBarHeight+R?(I=!0,A.css({position:"fixed",bottom:P.bottomHeight,width:S-2*R}),y.css({position:"fixed",bottom:0,width:S})):(I||F)&&q+P.windowHeight>l+o+P.bottomHeight+P.statusBarHeight-R&&(I=!1,A.add(y).attr("style",""))):F&&(s.css({position:"absolute",top:0,width:S}),G&&z.length&&z.css({position:"absolute",top:0,width:S-2*R}),c.css({position:"absolute",top:P.menuBarHeight,width:S-2*R-(G?0:c.outerWidth()-c.width())}),A.add(y).attr("style","")),C.width()<300&&P.windowWidth>600&&n.height()>B.height()+Q+120&&P.windowHeightP.windowHeight||J||K?Q>=q+N?(B.attr("style",""),J=K=!1):q>L?J?(J=!1,f=B.offset().top-P.adminBarHeight,g=p.offset().top,gq&&(K?(K=!1,f=B.offset().top-20,g=p.offset().top,g=q+N&&(J=!0,B.css({position:"fixed",top:N,bottom:""}))):(q>=Q-N?B.css({position:"fixed",top:N}):B.attr("style",""),J=K=!1),L=q):(B.attr("style",""),J=K=!1),F&&(r.css({paddingTop:P.toolsHeight}),G?u.css({paddingTop:P.visualTopHeight+P.menuBarHeight}):(w.css({marginTop:P.textTopHeight}),x.width(S-20-2*R)))}}function f(){d(),e()}function g(a){for(var b=1;6>b;b++)setTimeout(a,500*b)}function h(){clearTimeout(l),l=setTimeout(e,100)}function i(){window.pageYOffset&&window.pageYOffset>M&&window.scrollTo(window.pageXOffset,0),q.addClass("wp-editor-expand"),m.on("scroll.editor-expand resize.editor-expand",function(a){e(a.type),h()}),n.on("wp-collapse-menu.editor-expand postboxes-columnchange.editor-expand editor-classchange.editor-expand",e).on("postbox-toggled.editor-expand",function(){!J&&!K&&window.pageYOffset>20&&(K=!0,window.scrollBy(0,-1),e(),window.scrollBy(0,1)),e()}),w.on("focus.editor-expand input.editor-expand propertychange.editor-expand",d),w.on("keyup.editor-expand",c),F(),E&&E.pubsub.subscribe("hidden",f),k&&(k.settings.wp_autoresize_on=!0,k.execCommand("wpAutoResizeOn"),k.isHidden()||k.execCommand("wpAutoResize")),(!k||k.isHidden())&&d(),e()}function j(){var b=window.getUserSetting("ed_size");window.pageYOffset&&window.pageYOffset>M&&window.scrollTo(window.pageXOffset,0),q.removeClass("wp-editor-expand"),m.off(".editor-expand"),n.off(".editor-expand"),w.off(".editor-expand"),G(),E&&E.pubsub.unsubscribe("hidden",f),a.each([t,v,s,z,y,A,r,u,w,B],function(a,b){b&&b.attr("style","")}),H=I=J=K=!1,k&&(k.settings.wp_autoresize_on=!1,k.execCommand("wpAutoResizeOff"),k.isHidden()||(w.hide(),b&&k.theme.resizeTo(null,b))),b&&w.height(b)}var k,l,m=a(window),n=a(document),o=a("#wpadminbar"),p=a("#wpfooter"),q=a("#postdivrich"),r=a("#wp-content-wrap"),s=a("#wp-content-editor-tools"),t=a(),u=a(),v=a("#ed_toolbar"),w=a("#content"),x=a('
'),y=a("#post-status-info"),z=a(),A=a(),B=a("#side-sortables"),C=a("#postbox-container-1"),D=a("#post-body"),E=window.wp.editor&&window.wp.editor.fullscreen,F=function(){},G=function(){},H=!1,I=!1,J=!1,K=!1,L=0,M=130,N=56,O=300,P={windowHeight:0,windowWidth:0,adminBarHeight:0,toolsHeight:0,menuBarHeight:0,visualTopHeight:0,textTopHeight:0,bottomHeight:0,statusBarHeight:0,sideSortablesHeight:0};x.insertAfter(w),x.css({"font-family":w.css("font-family"),"font-size":w.css("font-size"),"line-height":w.css("line-height"),"white-space":"pre-wrap","word-wrap":"break-word"}),n.on("tinymce-editor-init.editor-expand",function(b,c){function f(){var a,b,d=c.selection.getNode();return b=c.plugins.wpview&&(a=c.plugins.wpview.getView(d))?a.getBoundingClientRect():d.getBoundingClientRect(),b.height?b:!1}function h(a){var b,d,e,g,h=tinymce.util.VK,i=a.keyCode,j=f(),k=10;j&&(b=j.top+c.iframeElement.getBoundingClientRect().top,d=b+j.height,b-=k,d+=k,e=P.adminBarHeight+P.toolsHeight+P.menuBarHeight+P.visualTopHeight,g=P.windowHeight-P.bottomHeight-P.statusBarHeight,g-eb&&(i===h.UP||i===h.LEFT||i===h.BACKSPACE)?window.scrollTo(window.pageXOffset,b+window.pageYOffset-e):d>g&&window.scrollTo(window.pageXOffset,d+window.pageYOffset-g)))}function i(){setTimeout(function(){c.execCommand("wpAutoResize"),e()},300)}function j(){var b=a("#wpwrap").height();d(),b&&m.scrollTop()>b&&window.scrollTo(window.pageXOffset,b-1),e()}"content"===c.id&&(k=c,c.settings.autoresize_min_height=O,t=r.find(".mce-toolbar-grp"),u=r.find(".mce-edit-area"),A=r.find(".mce-statusbar"),z=r.find(".mce-menubar"),F=function(){c.on("keyup",h),c.on("show",i),c.on("hide",j),c.on("setcontent wp-autoresize wp-toolbar-toggle",e)},G=function(){c.off("keyup",h),c.off("show",i),c.off("hide",j),c.off("setcontent wp-autoresize wp-toolbar-toggle",e)},q.hasClass("wp-editor-expand")&&(F(),g(e)))}),q.hasClass("wp-editor-expand")&&(i(),r.hasClass("html-active")&&g(function(){e(),d()})),a("#adv-settings .editor-expand").show(),a("#editor-expand-toggle").on("change.editor-expand",function(){a(this).prop("checked")?(i(),window.setUserSetting("editor_expand","on")):(j(),window.setUserSetting("editor_expand","off"))}),window.editorExpand={on:i,off:j}}); \ No newline at end of file +window.wp=window.wp||{},jQuery(document).ready(function(a){function b(){var a=m.width();Q={windowHeight:m.height(),windowWidth:a,adminBarHeight:a>600?o.outerHeight():0,toolsHeight:s.outerHeight()||0,menuBarHeight:z.outerHeight()||0,visualTopHeight:t.outerHeight()||0,textTopHeight:v.outerHeight()||0,bottomHeight:y.outerHeight()||0,statusBarHeight:A.outerHeight()||0,sideSortablesHeight:B.height()||0},Q.menuBarHeight<3&&(Q.menuBarHeight=0)}function c(a){var b,c,d,e,f,g=jQuery.ui.keyCode,h=a.keyCode,i=document.createRange(),j=w[0].selectionStart,k=w[0].selectionEnd,l=x[0].firstChild,m=10;if(!j||!k||j===k){try{i.setStart(l,j),i.setEnd(l,k+1)}catch(n){}b=i.getBoundingClientRect(),b.height&&(c=b.top-m,d=c+b.height+m,e=Q.adminBarHeight+Q.toolsHeight+Q.textTopHeight,f=Q.windowHeight-Q.bottomHeight,e>c&&(h===g.UP||h===g.LEFT||h===g.BACKSPACE)?window.scrollTo(window.pageXOffset,c+window.pageYOffset-e):d>f&&window.scrollTo(window.pageXOffset,d+window.pageYOffset-f))}}function d(){if(!(k&&!k.isHidden()||!k&&"tinymce"===P)){var a,b=w.height();x.width(w.width()-22),x.text(w.val()+" "),a=x.height(),O>a&&(a=O),a!==b&&(w.height(a),e())}}function e(a){if(!E||!E.settings.visible){var c,e,f,g,h,i,j,l,o,q=m.scrollTop(),F="scroll"!==a,G=k&&!k.isHidden(),M=O,P=D.offset().top,R=1,S=r.width();(F||!Q.windowHeight)&&b(),G||"resize"!==a||d(),G?(c=t,e=u,j=Q.visualTopHeight):(c=v,e=w,j=Q.textTopHeight),i=c.parent().offset().top,l=e.offset().top,o=e.outerHeight(),h=G?O+j:O+20,h=o>h+5,h?((!H||F)&&q>=i-Q.toolsHeight-Q.adminBarHeight&&q<=i-Q.toolsHeight-Q.adminBarHeight+o-M?(H=!0,s.css({position:"fixed",top:Q.adminBarHeight,width:S}),G&&z.length&&z.css({position:"fixed",top:Q.adminBarHeight+Q.toolsHeight,width:S-2*R-(G?0:c.outerWidth()-c.width())}),c.css({position:"fixed",top:Q.adminBarHeight+Q.toolsHeight+Q.menuBarHeight,width:S-2*R-(G?0:c.outerWidth()-c.width())})):(H||F)&&(q<=i-Q.toolsHeight-Q.adminBarHeight?(H=!1,s.css({position:"absolute",top:0,width:S}),G&&z.length&&z.css({position:"absolute",top:0,width:S-2*R}),c.css({position:"absolute",top:Q.menuBarHeight,width:S-2*R-(G?0:c.outerWidth()-c.width())})):q>=i-Q.toolsHeight-Q.adminBarHeight+o-M&&(H=!1,s.css({position:"absolute",top:o-M,width:S}),G&&z.length&&z.css({position:"absolute",top:o-M,width:S-2*R}),c.css({position:"absolute",top:o-M+Q.menuBarHeight,width:S-2*R-(G?0:c.outerWidth()-c.width())}))),(!I||F)&&q+Q.windowHeight<=l+o+Q.bottomHeight+Q.statusBarHeight+R?(I=!0,A.css({position:"fixed",bottom:Q.bottomHeight,width:S-2*R}),y.css({position:"fixed",bottom:0,width:S})):(I||F)&&q+Q.windowHeight>l+o+Q.bottomHeight+Q.statusBarHeight-R&&(I=!1,A.add(y).attr("style",""))):F&&(s.css({position:"absolute",top:0,width:S}),G&&z.length&&z.css({position:"absolute",top:0,width:S-2*R}),c.css({position:"absolute",top:Q.menuBarHeight,width:S-2*R-(G?0:c.outerWidth()-c.width())}),A.add(y).attr("style","")),C.width()<300&&Q.windowWidth>600&&n.height()>B.height()+P+120&&Q.windowHeightQ.windowHeight||J||K?P>=q+N?(B.attr("style",""),J=K=!1):q>L?J?(J=!1,f=B.offset().top-Q.adminBarHeight,g=p.offset().top,gq&&(K?(K=!1,f=B.offset().top-20,g=p.offset().top,g=q+N&&(J=!0,B.css({position:"fixed",top:N,bottom:""}))):(q>=P-N?B.css({position:"fixed",top:N}):B.attr("style",""),J=K=!1),L=q):(B.attr("style",""),J=K=!1),F&&(r.css({paddingTop:Q.toolsHeight}),G?u.css({paddingTop:Q.visualTopHeight+Q.menuBarHeight}):(w.css({marginTop:Q.textTopHeight}),x.width(S-20-2*R)))}}function f(){d(),e()}function g(a){for(var b=1;6>b;b++)setTimeout(a,500*b)}function h(){clearTimeout(l),l=setTimeout(e,100)}function i(){window.pageYOffset&&window.pageYOffset>M&&window.scrollTo(window.pageXOffset,0),q.addClass("wp-editor-expand"),m.on("scroll.editor-expand resize.editor-expand",function(a){e(a.type),h()}),n.on("wp-collapse-menu.editor-expand postboxes-columnchange.editor-expand editor-classchange.editor-expand",e).on("postbox-toggled.editor-expand",function(){!J&&!K&&window.pageYOffset>20&&(K=!0,window.scrollBy(0,-1),e(),window.scrollBy(0,1)),e()}),w.on("focus.editor-expand input.editor-expand propertychange.editor-expand",d),w.on("keyup.editor-expand",c),F(),E&&E.pubsub.subscribe("hidden",f),k&&(k.settings.wp_autoresize_on=!0,k.execCommand("wpAutoResizeOn"),k.isHidden()||k.execCommand("wpAutoResize")),(!k||k.isHidden())&&d(),e()}function j(){var b=window.getUserSetting("ed_size");window.pageYOffset&&window.pageYOffset>M&&window.scrollTo(window.pageXOffset,0),q.removeClass("wp-editor-expand"),m.off(".editor-expand"),n.off(".editor-expand"),w.off(".editor-expand"),G(),E&&E.pubsub.unsubscribe("hidden",f),a.each([t,v,s,z,y,A,r,u,w,B],function(a,b){b&&b.attr("style","")}),H=I=J=K=!1,k&&(k.settings.wp_autoresize_on=!1,k.execCommand("wpAutoResizeOff"),k.isHidden()||(w.hide(),b&&k.theme.resizeTo(null,b))),b&&w.height(b)}var k,l,m=a(window),n=a(document),o=a("#wpadminbar"),p=a("#wpfooter"),q=a("#postdivrich"),r=a("#wp-content-wrap"),s=a("#wp-content-editor-tools"),t=a(),u=a(),v=a("#ed_toolbar"),w=a("#content"),x=a('
'),y=a("#post-status-info"),z=a(),A=a(),B=a("#side-sortables"),C=a("#postbox-container-1"),D=a("#post-body"),E=window.wp.editor&&window.wp.editor.fullscreen,F=function(){},G=function(){},H=!1,I=!1,J=!1,K=!1,L=0,M=130,N=56,O=300,P=window.getUserSetting("editor"),Q={windowHeight:0,windowWidth:0,adminBarHeight:0,toolsHeight:0,menuBarHeight:0,visualTopHeight:0,textTopHeight:0,bottomHeight:0,statusBarHeight:0,sideSortablesHeight:0};x.insertAfter(w),x.css({"font-family":w.css("font-family"),"font-size":w.css("font-size"),"line-height":w.css("line-height"),"white-space":"pre-wrap","word-wrap":"break-word"}),n.on("tinymce-editor-init.editor-expand",function(b,c){function f(){var a,b,d=c.selection.getNode();return b=c.plugins.wpview&&(a=c.plugins.wpview.getView(d))?a.getBoundingClientRect():d.getBoundingClientRect(),b.height?b:!1}function h(a){var b,d,e,g,h=tinymce.util.VK,i=a.keyCode,j=f(),k=10;j&&(b=j.top+c.iframeElement.getBoundingClientRect().top,d=b+j.height,b-=k,d+=k,e=Q.adminBarHeight+Q.toolsHeight+Q.menuBarHeight+Q.visualTopHeight,g=Q.windowHeight-Q.bottomHeight-Q.statusBarHeight,g-eb&&(i===h.UP||i===h.LEFT||i===h.BACKSPACE)?window.scrollTo(window.pageXOffset,b+window.pageYOffset-e):d>g&&window.scrollTo(window.pageXOffset,d+window.pageYOffset-g)))}function i(){setTimeout(function(){c.execCommand("wpAutoResize"),e()},300)}function j(){var b=a("#wpwrap").height();d(),b&&m.scrollTop()>b&&window.scrollTo(window.pageXOffset,b-1),e()}"content"===c.id&&(k=c,c.settings.autoresize_min_height=O,t=r.find(".mce-toolbar-grp"),u=r.find(".mce-edit-area"),A=r.find(".mce-statusbar"),z=r.find(".mce-menubar"),F=function(){c.on("keyup",h),c.on("show",i),c.on("hide",j),c.on("setcontent wp-autoresize wp-toolbar-toggle",e)},G=function(){c.off("keyup",h),c.off("show",i),c.off("hide",j),c.off("setcontent wp-autoresize wp-toolbar-toggle",e)},q.hasClass("wp-editor-expand")&&(F(),g(e)))}),q.hasClass("wp-editor-expand")&&(i(),r.hasClass("html-active")&&g(function(){e(),d()})),a("#adv-settings .editor-expand").show(),a("#editor-expand-toggle").on("change.editor-expand",function(){a(this).prop("checked")?(i(),window.setUserSetting("editor_expand","on")):(j(),window.setUserSetting("editor_expand","off"))}),window.editorExpand={on:i,off:j}}); \ No newline at end of file diff --git a/wp-includes/class-wp-editor.php b/wp-includes/class-wp-editor.php index 9659336fe9..200031bbdc 100644 --- a/wp-includes/class-wp-editor.php +++ b/wp-includes/class-wp-editor.php @@ -112,7 +112,7 @@ final class _WP_Editors { if ( empty( $set['editor_height'] ) ) return $set; - if ( 'content' === $editor_id ) { + if ( 'content' === $editor_id && empty( $set['tinymce']['wp_autoresize_on'] ) ) { // A cookie (set when a user resizes the editor) overrides the height. $cookie = (int) get_user_setting( 'ed_size' ); diff --git a/wp-includes/js/tinymce/plugins/wpautoresize/plugin.js b/wp-includes/js/tinymce/plugins/wpautoresize/plugin.js index 600c12335e..dc1f524437 100644 --- a/wp-includes/js/tinymce/plugins/wpautoresize/plugin.js +++ b/wp-includes/js/tinymce/plugins/wpautoresize/plugin.js @@ -22,7 +22,7 @@ */ tinymce.PluginManager.add( 'wpautoresize', function( editor ) { var settings = editor.settings, - oldSize = 0, + oldSize = 300, isActive = false; function isFullscreen() { diff --git a/wp-includes/js/tinymce/plugins/wpautoresize/plugin.min.js b/wp-includes/js/tinymce/plugins/wpautoresize/plugin.min.js index 68bf7e4822..14296b2afd 100644 --- a/wp-includes/js/tinymce/plugins/wpautoresize/plugin.min.js +++ b/wp-includes/js/tinymce/plugins/wpautoresize/plugin.min.js @@ -1 +1 @@ -tinymce.PluginManager.add("wpautoresize",function(a){function b(){return a.plugins.fullscreen&&a.plugins.fullscreen.isFullscreen()}function c(a){return parseInt(a,10)||0}function d(e){var f,g,k,l,m,n,o,p,q,r,s,t,u=tinymce.DOM;if(j&&(g=a.getDoc())){if(e=e||{},k=g.body,l=g.documentElement,m=h.autoresize_min_height,!k||e&&"setcontent"===e.type&&e.initial||b())return void(k&&l&&(k.style.overflowY="auto",l.style.overflowY="auto"));o=a.dom.getStyle(k,"margin-top",!0),p=a.dom.getStyle(k,"margin-bottom",!0),q=a.dom.getStyle(k,"padding-top",!0),r=a.dom.getStyle(k,"padding-bottom",!0),s=a.dom.getStyle(k,"border-top-width",!0),t=a.dom.getStyle(k,"border-bottom-width",!0),n=k.offsetHeight+c(o)+c(p)+c(q)+c(r)+c(s)+c(t),n&&n=n)&&(n=tinymce.Env.ie?k.scrollHeight:tinymce.Env.webkit&&0===k.clientHeight?0:k.offsetHeight),n>h.autoresize_min_height&&(m=n),h.autoresize_max_height&&n>h.autoresize_max_height?(m=h.autoresize_max_height,k.style.overflowY="auto",l.style.overflowY="auto"):(k.style.overflowY="hidden",l.style.overflowY="hidden",k.scrollTop=0),m!==i&&(f=m-i,u.setStyle(a.iframeElement,"height",m+"px"),i=m,tinymce.isWebKit&&0>f&&d(e),a.fire("wp-autoresize",{height:m}))}}function e(a,b,c){setTimeout(function(){d(),a--?e(a,b,c):c&&c()},b)}function f(){a.dom.hasClass(a.getBody(),"wp-autoresize")||(j=!0,a.dom.addClass(a.getBody(),"wp-autoresize"),a.on("nodechange setcontent keyup FullscreenStateChanged",d),d())}function g(){var b;h.wp_autoresize_on||(j=!1,b=a.getDoc(),a.dom.removeClass(a.getBody(),"wp-autoresize"),a.off("nodechange setcontent keyup FullscreenStateChanged",d),b.body.style.overflowY="auto",b.documentElement.style.overflowY="auto",i=0)}var h=a.settings,i=0,j=!1;a.settings.inline||(h.autoresize_min_height=parseInt(a.getParam("autoresize_min_height",a.getElement().offsetHeight),10),h.autoresize_max_height=parseInt(a.getParam("autoresize_max_height",0),10),h.wp_autoresize_on&&(j=!0,a.on("init",function(){a.dom.addClass(a.getBody(),"wp-autoresize")}),a.on("nodechange keyup FullscreenStateChanged",d),a.on("setcontent",function(){e(3,100)}),a.getParam("autoresize_on_init",!0)&&a.on("init",function(){e(10,200,function(){e(5,1e3)})})),a.on("show",function(){i=0}),a.addCommand("wpAutoResize",d),a.addCommand("wpAutoResizeOn",f),a.addCommand("wpAutoResizeOff",g))}); \ No newline at end of file +tinymce.PluginManager.add("wpautoresize",function(a){function b(){return a.plugins.fullscreen&&a.plugins.fullscreen.isFullscreen()}function c(a){return parseInt(a,10)||0}function d(e){var f,g,k,l,m,n,o,p,q,r,s,t,u=tinymce.DOM;if(j&&(g=a.getDoc())){if(e=e||{},k=g.body,l=g.documentElement,m=h.autoresize_min_height,!k||e&&"setcontent"===e.type&&e.initial||b())return void(k&&l&&(k.style.overflowY="auto",l.style.overflowY="auto"));o=a.dom.getStyle(k,"margin-top",!0),p=a.dom.getStyle(k,"margin-bottom",!0),q=a.dom.getStyle(k,"padding-top",!0),r=a.dom.getStyle(k,"padding-bottom",!0),s=a.dom.getStyle(k,"border-top-width",!0),t=a.dom.getStyle(k,"border-bottom-width",!0),n=k.offsetHeight+c(o)+c(p)+c(q)+c(r)+c(s)+c(t),n&&n=n)&&(n=tinymce.Env.ie?k.scrollHeight:tinymce.Env.webkit&&0===k.clientHeight?0:k.offsetHeight),n>h.autoresize_min_height&&(m=n),h.autoresize_max_height&&n>h.autoresize_max_height?(m=h.autoresize_max_height,k.style.overflowY="auto",l.style.overflowY="auto"):(k.style.overflowY="hidden",l.style.overflowY="hidden",k.scrollTop=0),m!==i&&(f=m-i,u.setStyle(a.iframeElement,"height",m+"px"),i=m,tinymce.isWebKit&&0>f&&d(e),a.fire("wp-autoresize",{height:m}))}}function e(a,b,c){setTimeout(function(){d(),a--?e(a,b,c):c&&c()},b)}function f(){a.dom.hasClass(a.getBody(),"wp-autoresize")||(j=!0,a.dom.addClass(a.getBody(),"wp-autoresize"),a.on("nodechange setcontent keyup FullscreenStateChanged",d),d())}function g(){var b;h.wp_autoresize_on||(j=!1,b=a.getDoc(),a.dom.removeClass(a.getBody(),"wp-autoresize"),a.off("nodechange setcontent keyup FullscreenStateChanged",d),b.body.style.overflowY="auto",b.documentElement.style.overflowY="auto",i=0)}var h=a.settings,i=300,j=!1;a.settings.inline||(h.autoresize_min_height=parseInt(a.getParam("autoresize_min_height",a.getElement().offsetHeight),10),h.autoresize_max_height=parseInt(a.getParam("autoresize_max_height",0),10),h.wp_autoresize_on&&(j=!0,a.on("init",function(){a.dom.addClass(a.getBody(),"wp-autoresize")}),a.on("nodechange keyup FullscreenStateChanged",d),a.on("setcontent",function(){e(3,100)}),a.getParam("autoresize_on_init",!0)&&a.on("init",function(){e(10,200,function(){e(5,1e3)})})),a.on("show",function(){i=0}),a.addCommand("wpAutoResize",d),a.addCommand("wpAutoResizeOn",f),a.addCommand("wpAutoResizeOff",g))}); \ No newline at end of file diff --git a/wp-includes/js/tinymce/wp-tinymce.js.gz b/wp-includes/js/tinymce/wp-tinymce.js.gz index 351509f9c9..3f7c3e4f47 100644 Binary files a/wp-includes/js/tinymce/wp-tinymce.js.gz and b/wp-includes/js/tinymce/wp-tinymce.js.gz differ