<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[29049] trunk/src: Enhance the editor on the Add/Edit Post screens, first run.</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://core.trac.wordpress.org/changeset/29049">29049</a></dd>
<dt>Author</dt> <dd>azaozz</dd>
<dt>Date</dt> <dd>2014-07-09 22:05:06 +0000 (Wed, 09 Jul 2014)</dd>
</dl>
<h3>Log Message</h3>
<pre>Enhance the editor on the Add/Edit Post screens, first run. Props avril, see <a href="http://core.trac.wordpress.org/ticket/28328">#28328</a>.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcwpadmincsseditcss">trunk/src/wp-admin/css/edit.css</a></li>
<li><a href="#trunksrcwpadmineditformadvancedphp">trunk/src/wp-admin/edit-form-advanced.php</a></li>
<li><a href="#trunksrcwpadminjscommonjs">trunk/src/wp-admin/js/common.js</a></li>
<li><a href="#trunksrcwpadminjspostjs">trunk/src/wp-admin/js/post.js</a></li>
<li><a href="#trunksrcwpadminjspostboxjs">trunk/src/wp-admin/js/postbox.js</a></li>
<li><a href="#trunksrcwpincludesclasswpeditorphp">trunk/src/wp-includes/class-wp-editor.php</a></li>
<li><a href="#trunksrcwpincludescsseditorcss">trunk/src/wp-includes/css/editor.css</a></li>
<li><a href="#trunksrcwpincludesjstinymcepluginswordpresspluginjs">trunk/src/wp-includes/js/tinymce/plugins/wordpress/plugin.js</a></li>
<li><a href="#trunksrcwpincludesjstinymcepluginswpfullscreenpluginjs">trunk/src/wp-includes/js/tinymce/plugins/wpfullscreen/plugin.js</a></li>
<li><a href="#trunksrcwpincludesjstinymcepluginswpviewpluginjs">trunk/src/wp-includes/js/tinymce/plugins/wpview/plugin.js</a></li>
<li><a href="#trunksrcwpincludesjstinymceskinswordpresswpcontentcss">trunk/src/wp-includes/js/tinymce/skins/wordpress/wp-content.css</a></li>
<li><a href="#trunksrcwpincludesscriptloaderphp">trunk/src/wp-includes/script-loader.php</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunksrcwpadminjseditorexpandjs">trunk/src/wp-admin/js/editor-expand.js</a></li>
<li>trunk/src/wp-includes/js/tinymce/plugins/wpautoresize/</li>
<li><a href="#trunksrcwpincludesjstinymcepluginswpautoresizepluginjs">trunk/src/wp-includes/js/tinymce/plugins/wpautoresize/plugin.js</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcwpadmincsseditcss"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-admin/css/edit.css (29048 => 29049)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-admin/css/edit.css 2014-07-09 20:57:58 UTC (rev 29048)
+++ trunk/src/wp-admin/css/edit.css 2014-07-09 22:05:06 UTC (rev 29049)
</span><span class="lines">@@ -37,7 +37,6 @@
</span><span class="cx">
</span><span class="cx"> #titlediv {
</span><span class="cx"> position: relative;
</span><del>- margin-bottom: 10px;
</del><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> #titlediv label {
</span><span class="lines">@@ -337,7 +336,7 @@
</span><span class="cx"> background-color: #f7f7f7;
</span><span class="cx"> -webkit-box-shadow: 0 1px 1px rgba(0,0,0,0.04);
</span><span class="cx"> box-shadow: 0 1px 1px rgba(0,0,0,0.04);
</span><del>- cursor: row-resize;
</del><ins>+ z-index: 999;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> #post-status-info td {
</span><span class="lines">@@ -345,7 +344,7 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> .autosave-info {
</span><del>- padding: 2px;
</del><ins>+ padding: 2px 10px;
</ins><span class="cx"> text-align: right;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -367,6 +366,18 @@
</span><span class="cx"> padding: 2px 10px;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+#wp-content-editor-container {
+ position: relative;
+}
+
+#content-textarea-clone {
+ z-index: -1;
+ position: absolute;
+ top: 0;
+ visibility: hidden;
+ overflow: hidden;
+}
+
</ins><span class="cx"> #timestampdiv select {
</span><span class="cx"> height: 21px;
</span><span class="cx"> line-height: 14px;
</span><span class="lines">@@ -1348,12 +1359,6 @@
</span><span class="cx"> padding: 10px 20px;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- #wp-content-editor-tools {
- overflow: hidden;
- padding: 20px 15px 1px 0;
- top: 1px;
- }
-
</del><span class="cx"> a.wp-switch-editor {
</span><span class="cx"> font-size: 16px;
</span><span class="cx"> line-height: 1em;
</span></span></pre></div>
<a id="trunksrcwpadmineditformadvancedphp"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-admin/edit-form-advanced.php (29048 => 29049)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-admin/edit-form-advanced.php 2014-07-09 20:57:58 UTC (rev 29048)
+++ trunk/src/wp-admin/edit-form-advanced.php 2014-07-09 22:05:06 UTC (rev 29049)
</span><span class="lines">@@ -11,6 +11,7 @@
</span><span class="cx"> die('-1');
</span><span class="cx">
</span><span class="cx"> wp_enqueue_script('post');
</span><ins>+wp_enqueue_script('editor-expand');
</ins><span class="cx">
</span><span class="cx"> if ( wp_is_mobile() )
</span><span class="cx"> wp_enqueue_script( 'jquery-touch-punch' );
</span><span class="lines">@@ -492,6 +493,7 @@
</span><span class="cx"> 'editor_height' => 360,
</span><span class="cx"> 'tinymce' => array(
</span><span class="cx"> 'resize' => false,
</span><ins>+ 'wp_autoresize_on' => true,
</ins><span class="cx"> 'add_unload_trigger' => false,
</span><span class="cx"> ),
</span><span class="cx"> ) ); ?>
</span></span></pre></div>
<a id="trunksrcwpadminjscommonjs"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-admin/js/common.js (29048 => 29049)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-admin/js/common.js 2014-07-09 20:57:58 UTC (rev 29048)
+++ trunk/src/wp-admin/js/common.js 2014-07-09 22:05:06 UTC (rev 29049)
</span><span class="lines">@@ -179,7 +179,7 @@
</span><span class="cx"> });
</span><span class="cx">
</span><span class="cx"> $('#collapse-menu').on('click.collapse-menu', function() {
</span><del>- var body = $( document.body ), respWidth;
</del><ins>+ var body = $( document.body ), respWidth, state;
</ins><span class="cx">
</span><span class="cx"> // reset any compensation for submenus near the bottom of the screen
</span><span class="cx"> $('#adminmenu div.wp-submenu').css('margin-top', '');
</span><span class="lines">@@ -197,19 +197,25 @@
</span><span class="cx"> body.removeClass('auto-fold').removeClass('folded');
</span><span class="cx"> setUserSetting('unfold', 1);
</span><span class="cx"> setUserSetting('mfold', 'o');
</span><ins>+ state = 'open';
</ins><span class="cx"> } else {
</span><span class="cx"> body.addClass('auto-fold');
</span><span class="cx"> setUserSetting('unfold', 0);
</span><ins>+ state = 'folded';
</ins><span class="cx"> }
</span><span class="cx"> } else {
</span><span class="cx"> if ( body.hasClass('folded') ) {
</span><span class="cx"> body.removeClass('folded');
</span><span class="cx"> setUserSetting('mfold', 'o');
</span><ins>+ state = 'open';
</ins><span class="cx"> } else {
</span><span class="cx"> body.addClass('folded');
</span><span class="cx"> setUserSetting('mfold', 'f');
</span><ins>+ state = 'folded';
</ins><span class="cx"> }
</span><span class="cx"> }
</span><ins>+
+ $( document ).trigger( 'wp-collapse-menu', { state: state } );
</ins><span class="cx"> });
</span><span class="cx">
</span><span class="cx"> if ( 'ontouchstart' in window || /IEMobile\/[1-9]/.test(navigator.userAgent) ) { // touch screen device
</span><span class="lines">@@ -721,7 +727,7 @@
</span><span class="cx"> window.wpResponsive.init();
</span><span class="cx"> });
</span><span class="cx">
</span><del>-// make Windows 8 devices playing along nicely
</del><ins>+// Make Windows 8 devices play along nicely.
</ins><span class="cx"> (function(){
</span><span class="cx"> if ( '-ms-user-select' in document.documentElement.style && navigator.userAgent.match(/IEMobile\/10\.0/) ) {
</span><span class="cx"> var msViewportStyle = document.createElement( 'style' );
</span></span></pre></div>
<a id="trunksrcwpadminjseditorexpandjs"></a>
<div class="addfile"><h4>Added: trunk/src/wp-admin/js/editor-expand.js (0 => 29049)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-admin/js/editor-expand.js (rev 0)
+++ trunk/src/wp-admin/js/editor-expand.js 2014-07-09 22:05:06 UTC (rev 29049)
</span><span class="lines">@@ -0,0 +1,378 @@
</span><ins>+
+window.wp = window.wp || {};
+
+jQuery( document ).ready( function($) {
+ var $window = $( window ),
+ $document = $( document ),
+ $adminBar = $( '#wpadminbar' ),
+ $contentWrap = $( '#wp-content-wrap' ),
+ $tools = $( '#wp-content-editor-tools' ),
+ $visualTop,
+ $visualEditor,
+ $textTop = $( '#ed_toolbar' ),
+ $textEditor = $( '#content' ),
+ $textEditorClone = $( '<div id="content-textarea-clone"></div>' ),
+ $bottom = $( '#post-status-info' ),
+ $statusBar,
+ buffer = 200,
+ adjust,
+ fullscreen = window.wp.editor && window.wp.editor.fullscreen,
+ editorInstance,
+ fixedTop = false,
+ fixedBottom = false;
+
+ $textEditorClone.insertAfter( $textEditor );
+
+ // use to enable/disable
+ $contentWrap.addClass( 'wp-editor-expand' );
+ $( '#content-resize-handle' ).hide();
+
+ $textEditorClone.css( {
+ 'font-family': $textEditor.css( 'font-family' ),
+ 'font-size': $textEditor.css( 'font-size' ),
+ 'line-height': $textEditor.css( 'line-height' ),
+ 'padding': $textEditor.css( 'padding' ),
+ 'padding-top': 37,
+ 'white-space': 'pre-wrap',
+ 'word-wrap': 'break-word'
+ } );
+
+ $textEditor.on( 'focus input propertychange', function() {
+ textEditorResize();
+ } );
+
+ $textEditor.on( 'keyup', function() {
+ var range = document.createRange(),
+ start = $textEditor[0].selectionStart,
+ end = $textEditor[0].selectionEnd,
+ textNode = $textEditorClone[0].firstChild,
+ windowHeight = $window.height(),
+ offset, cursorTop, cursorBottom, editorTop, editorBottom;
+
+ if ( start && end && start !== end ) {
+ return;
+ }
+
+ range.setStart( textNode, start );
+ range.setEnd( textNode, end + 1 );
+
+ offset = range.getBoundingClientRect();
+
+ if ( ! offset.height ) {
+ return;
+ }
+
+ cursorTop = offset.top;
+ cursorBottom = cursorTop + offset.height;
+ editorTop = $adminBar.outerHeight() + $textTop.outerHeight();
+ editorBottom = windowHeight - $bottom.outerHeight();
+
+ if ( cursorTop < editorTop || cursorBottom > editorBottom ) {
+ window.scrollTo( window.pageXOffset, cursorTop + window.pageYOffset - windowHeight / 2 );
+ }
+ } );
+
+ function textEditorResize() {
+ if ( editorInstance && ! editorInstance.isHidden() ) {
+ return;
+ }
+
+ var hiddenHeight = $textEditorClone.width( $textEditor.width() ).text( $textEditor.val() + ' ' ).height(),
+ textEditorHeight = $textEditor.height();
+
+ if ( hiddenHeight < 300 ) {
+ hiddenHeight = 300;
+ }
+
+ if ( hiddenHeight === textEditorHeight ) {
+ return;
+ }
+
+ $textEditor.height( hiddenHeight );
+
+ adjust( 'resize' );
+ }
+
+ // We need to wait for TinyMCE to initialize.
+ $document.on( 'tinymce-editor-init.editor-expand', function( event, editor ) {
+ // Make sure it's the main editor.
+ if ( editor.id !== 'content' ) {
+ return;
+ }
+
+ // Copy the editor instance.
+ editorInstance = editor;
+
+ // Resizing will be handled by the autoresize plugin.
+ editor.theme.resizeTo = function() {};
+
+ // Set the minimum height to the initial viewport height.
+ editor.settings.autoresize_min_height = 300;
+
+ // Get the necessary UI elements.
+ $visualTop = $contentWrap.find( '.mce-toolbar-grp' );
+ $visualEditor = $contentWrap.find( '.mce-edit-area' );
+ $statusBar = $contentWrap.find( '.mce-statusbar' ).filter( ':visible' );
+
+ // Adjust when switching editor modes.
+ editor.on( 'show', function() {
+ setTimeout( function() {
+ editor.execCommand( 'mceAutoResize' );
+ adjust( 'resize' );
+ }, 200 );
+ } );
+
+ editor.on( 'keyup', function() {
+ var offset = getCursorOffset(),
+ windowHeight = $window.height(),
+ cursorTop, cursorBottom, editorTop, editorBottom;
+
+ if ( ! offset ) {
+ return;
+ }
+
+ cursorTop = offset.top + editor.getContentAreaContainer().getElementsByTagName( 'iframe' )[0].getBoundingClientRect().top;
+ cursorBottom = cursorTop + offset.height;
+ editorTop = $adminBar.outerHeight() + $tools.outerHeight() + $visualTop.outerHeight();
+ editorBottom = $window.height() - $bottom.outerHeight();
+
+ if ( cursorTop < editorTop || cursorBottom > editorBottom ) {
+ window.scrollTo( window.pageXOffset, cursorTop + window.pageYOffset - windowHeight / 2 );
+ }
+ } );
+
+ function getCursorOffset() {
+ var selection = editor.selection,
+ node = selection.getNode(),
+ range = selection.getRng(),
+ view, clone, right, offset;
+
+ if ( tinymce.Env.ie && tinymce.Env.ie < 9 ) {
+ return;
+ }
+
+ if ( editor.plugins.wpview && ( view = editor.plugins.wpview.getView( node ) ) ) {
+ offset = view.getBoundingClientRect();
+ } else if ( selection.isCollapsed() ) {
+ clone = range.cloneRange();
+
+ if ( clone.startContainer.length > 1 ) {
+ if ( clone.startContainer.length > clone.endOffset ) {
+ clone.setEnd( clone.startContainer, clone.endOffset + 1 );
+ right = true;
+ } else {
+ clone.setStart( clone.startContainer, clone.endOffset - 1 );
+ }
+
+ selection.setRng( clone );
+ offset = selection.getRng().getBoundingClientRect();
+ selection.setRng( range );
+ } else {
+ offset = node.getBoundingClientRect();
+ }
+ } else {
+ offset = range.getBoundingClientRect();
+ }
+
+ if ( ! offset.height ) {
+ return false;
+ }
+
+ return offset;
+ }
+
+ editor.on( 'hide', function() {
+ textEditorResize();
+ adjust( 'resize' );
+ } );
+
+ // Adjust when the editor resizes.
+ editor.on( 'nodechange setcontent keyup FullscreenStateChanged', function() {
+ adjust( 'resize' );
+ } );
+
+ editor.on( 'wp-toolbar-toggle', function() {
+ $visualEditor.css( {
+ paddingTop: $visualTop.outerHeight()
+ } );
+ } );
+
+ // And adjust "immediately".
+ // Allow some time to load CSS etc.
+ setTimeout( function() {
+ $visualEditor.css( {
+ paddingTop: $visualTop.outerHeight()
+ } );
+
+ adjust( 'resize' );
+ }, 500 );
+ } );
+
+ // Adjust when the window is scrolled or resized.
+ $window.on( 'scroll resize', function( event ) {
+ adjust( event.type );
+ } );
+
+ // Adjust when exiting fullscreen mode.
+ fullscreen && fullscreen.pubsub.subscribe( 'hidden', function() {
+ adjust( 'resize' );
+ } );
+
+ // Adjust when collapsing the menu.
+ $document.on( 'wp-collapse-menu.editor-expand', function() {
+ adjust( 'resize' );
+ } )
+
+ // Adjust when changing the columns.
+ .on( 'postboxes-columnchange.editor-expand', function() {
+ adjust( 'resize' );
+ } )
+
+ // Adjust when changing the body class.
+ .on( 'editor-classchange.editor-expand', function() {
+ adjust( 'resize' );
+ } );
+
+ // Adjust the toolbars based on the active editor mode.
+ function adjust( eventType ) {
+ // Make sure we're not in fullscreen mode.
+ if ( fullscreen && fullscreen.settings.visible ) {
+ return;
+ }
+
+ var bottomHeight = $bottom.outerHeight(),
+ windowPos = $window.scrollTop(),
+ windowHeight = $window.height(),
+ windowWidth = $window.width(),
+ adminBarHeight = windowWidth > 600 ? $adminBar.height() : 0,
+ $top, $editor, visual,
+ toolsHeight, topPos, topHeight, editorPos, editorHeight, editorWidth, statusBarHeight;
+
+ // Visual editor.
+ if ( editorInstance && ! editorInstance.isHidden() ) {
+ $top = $visualTop;
+ $editor = $visualEditor;
+ visual = true;
+
+ // Doesn't hide the panel of 'styleselect'. :(
+ tinymce.each( editorInstance.controlManager.buttons, function( button ) {
+ if ( button._active && ( button.type === 'colorbutton' || button.type === 'panelbutton' || button.type === 'menubutton' ) ) {
+ button.hidePanel();
+ }
+ } );
+ // Text editor.
+ } else {
+ $top = $textTop;
+ $editor = $textEditor;
+ }
+
+ toolsHeight = $tools.outerHeight();
+ topPos = $top.parent().offset().top;
+ topHeight = $top.outerHeight();
+ editorPos = $editor.offset().top;
+ editorHeight = $editor.outerHeight();
+ editorWidth = $editor.outerWidth();
+ statusBarHeight = visual ? $statusBar.outerHeight() : 0;
+
+ // Maybe pin the top.
+ if ( ( ! fixedTop || eventType === 'resize' ) &&
+ // Handle scrolling down.
+ ( windowPos >= ( topPos - toolsHeight - adminBarHeight ) &&
+ // Handle scrolling up.
+ windowPos <= ( topPos - toolsHeight - adminBarHeight + editorHeight - buffer ) ) ) {
+ fixedTop = true;
+
+ $top.css( {
+ position: 'fixed',
+ top: adminBarHeight + toolsHeight,
+ width: editorWidth - ( visual ? 0 : 38 ),
+ borderTop: '1px solid #e5e5e5'
+ } );
+
+ $tools.css( {
+ position: 'fixed',
+ top: adminBarHeight,
+ width: editorWidth + 2
+ } );
+ // Maybe unpin the top.
+ } else if ( fixedTop || eventType === 'resize' ) {
+ // Handle scrolling up.
+ if ( windowPos <= ( topPos - toolsHeight - adminBarHeight ) ) {
+ fixedTop = false;
+
+ $top.css( {
+ position: 'absolute',
+ top: 0,
+ borderTop: 'none',
+ width: $editor.parent().width() - ( $top.outerWidth() - $top.width() )
+ } );
+
+ $tools.css( {
+ position: 'absolute',
+ top: 0,
+ borderTop: 'none',
+ width: $contentWrap.width()
+ } );
+ // Handle scrolling down.
+ } else if ( windowPos >= ( topPos - toolsHeight - adminBarHeight + editorHeight - buffer ) ) {
+ fixedTop = false;
+
+ $top.css( {
+ position: 'absolute',
+ top: window.pageYOffset - $editor.offset().top + adminBarHeight + $tools.outerHeight(),
+ borderTop: 'none'
+ } );
+
+ $tools.css( {
+ position: 'absolute',
+ top: window.pageYOffset - $contentWrap.offset().top + adminBarHeight,
+ borderTop: 'none',
+ width: $contentWrap.width()
+ } );
+ }
+ }
+
+ // Maybe adjust the bottom bar.
+ if ( ( ! fixedBottom || eventType === 'resize' ) &&
+ // + 1 for the border around the .wp-editor-container.
+ ( windowPos + windowHeight ) <= ( editorPos + editorHeight + bottomHeight + statusBarHeight + 1 ) ) {
+ fixedBottom = true;
+
+ $bottom.css( {
+ position: 'fixed',
+ bottom: 0,
+ width: editorWidth + 2,
+ borderTop: '1px solid #dedede'
+ } );
+ } else if ( fixedBottom &&
+ ( windowPos + windowHeight ) > ( editorPos + editorHeight + bottomHeight + statusBarHeight - 1 ) ) {
+ fixedBottom = false;
+
+ $bottom.css( {
+ position: 'relative',
+ bottom: 'auto',
+ width: '100%',
+ borderTop: 'none'
+ } );
+ }
+ }
+
+ textEditorResize();
+
+ $tools.css( {
+ position: 'absolute',
+ top: 0,
+ width: $contentWrap.width()
+ } );
+
+ $contentWrap.css( {
+ paddingTop: $tools.outerHeight()
+ } );
+
+ // This needs to execute after quicktags is ready or a button is added...
+ setTimeout( function() {
+ $textEditor.css( {
+ paddingTop: $textTop.outerHeight() + parseInt( $textEditor.css( 'padding-top' ), 10 )
+ } );
+ }, 500 );
+});
</ins><span class="cx">Property changes on: trunk/src/wp-admin/js/editor-expand.js
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<ins>+native
</ins><span class="cx">\ No newline at end of property
</span><a id="trunksrcwpadminjspostjs"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-admin/js/post.js (29048 => 29049)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-admin/js/post.js 2014-07-09 20:57:58 UTC (rev 29048)
+++ trunk/src/wp-admin/js/post.js 2014-07-09 22:05:06 UTC (rev 29049)
</span><span class="lines">@@ -1004,7 +1004,8 @@
</span><span class="cx"> ( function() {
</span><span class="cx"> var editor, offset, mce,
</span><span class="cx"> $textarea = $('textarea#content'),
</span><del>- $handle = $('#post-status-info');
</del><ins>+ $handle = $('#post-status-info'),
+ $contentWrap = $('#wp-content-wrap');
</ins><span class="cx">
</span><span class="cx"> // No point for touch devices
</span><span class="cx"> if ( ! $textarea.length || 'ontouchstart' in window ) {
</span><span class="lines">@@ -1012,6 +1013,10 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> function dragging( event ) {
</span><ins>+ if ( $contentWrap.hasClass( 'wp-editor-expand' ) ) {
+ return;
+ }
+
</ins><span class="cx"> if ( mce ) {
</span><span class="cx"> editor.theme.resizeTo( null, offset + event.pageY );
</span><span class="cx"> } else {
</span><span class="lines">@@ -1024,6 +1029,10 @@
</span><span class="cx"> function endDrag() {
</span><span class="cx"> var height, toolbarHeight;
</span><span class="cx">
</span><ins>+ if ( $contentWrap.hasClass( 'wp-editor-expand' ) ) {
+ return;
+ }
+
</ins><span class="cx"> if ( mce ) {
</span><span class="cx"> editor.focus();
</span><span class="cx"> toolbarHeight = parseInt( $( '#wp-content-editor-container .mce-toolbar-grp' ).height(), 10 );
</span><span class="lines">@@ -1074,14 +1083,11 @@
</span><span class="cx"> $( '#post-formats-select input.post-format' ).on( 'change.set-editor-class', function() {
</span><span class="cx"> var editor, body, format = this.id;
</span><span class="cx">
</span><del>- if ( format && $( this ).prop('checked') ) {
- editor = tinymce.get( 'content' );
-
- if ( editor ) {
- body = editor.getBody();
- body.className = body.className.replace( /\bpost-format-[^ ]+/, '' );
- editor.dom.addClass( body, format == 'post-format-0' ? 'post-format-standard' : format );
- }
</del><ins>+ if ( format && $( this ).prop( 'checked' ) && ( editor = tinymce.get( 'content' ) ) ) {
+ body = editor.getBody();
+ body.className = body.className.replace( /\bpost-format-[^ ]+/, '' );
+ editor.dom.addClass( body, format == 'post-format-0' ? 'post-format-standard' : format );
+ $( document ).trigger( 'editor-classchange' );
</ins><span class="cx"> }
</span><span class="cx"> });
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunksrcwpadminjspostboxjs"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-admin/js/postbox.js (29048 => 29049)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-admin/js/postbox.js 2014-07-09 20:57:58 UTC (rev 29048)
+++ trunk/src/wp-admin/js/postbox.js 2014-07-09 22:05:06 UTC (rev 29049)
</span><span class="lines">@@ -159,6 +159,8 @@
</span><span class="cx"> if ( el ) {
</span><span class="cx"> el.className = el.className.replace(/columns-\d+/, 'columns-' + n);
</span><span class="cx"> }
</span><ins>+
+ $( document ).trigger( 'postboxes-columnchange' );
</ins><span class="cx"> },
</span><span class="cx">
</span><span class="cx"> _pb_change : function() {
</span></span></pre></div>
<a id="trunksrcwpincludesclasswpeditorphp"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-includes/class-wp-editor.php (29048 => 29049)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/class-wp-editor.php 2014-07-09 20:57:58 UTC (rev 29048)
+++ trunk/src/wp-includes/class-wp-editor.php 2014-07-09 22:05:06 UTC (rev 29049)
</span><span class="lines">@@ -347,6 +347,7 @@
</span><span class="cx"> 'textcolor',
</span><span class="cx"> 'fullscreen',
</span><span class="cx"> 'wordpress',
</span><ins>+ 'wpautoresize',
</ins><span class="cx"> 'wpeditimage',
</span><span class="cx"> 'wpgallery',
</span><span class="cx"> 'wplink',
</span></span></pre></div>
<a id="trunksrcwpincludescsseditorcss"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-includes/css/editor.css (29048 => 29049)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/css/editor.css 2014-07-09 20:57:58 UTC (rev 29048)
+++ trunk/src/wp-includes/css/editor.css 2014-07-09 22:05:06 UTC (rev 29049)
</span><span class="lines">@@ -148,10 +148,15 @@
</span><span class="cx"> div.mce-toolbar-grp {
</span><span class="cx"> border-bottom: 1px solid #dedede;
</span><span class="cx"> background: #f5f5f5;
</span><del>- padding: 3px;
</del><ins>+ padding: 0;
</ins><span class="cx"> position: relative;
</span><ins>+ z-index: 999;
</ins><span class="cx"> }
</span><span class="cx">
</span><ins>+div.mce-toolbar-grp > div {
+ padding: 3px;
+}
+
</ins><span class="cx"> .has-dfw div.mce-toolbar-grp .mce-toolbar.mce-first {
</span><span class="cx"> padding-right: 32px;
</span><span class="cx"> }
</span><span class="lines">@@ -161,14 +166,26 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> div.mce-statusbar {
</span><del>- border-top: 1px solid #eee;
</del><ins>+ border-top: 1px solid #e5e5e5;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> div.mce-path {
</span><del>- padding: 0 8px 2px;
</del><ins>+ padding: 2px 10px;
</ins><span class="cx"> margin: 0;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+.mce-path,
+.mce-path-item,
+.mce-path .mce-divider {
+ font-size: 12px;
+ line-height: 18px;
+}
+
+.mce-path-item:focus {
+ background: none;
+ color: inherit;
+}
+
</ins><span class="cx"> .mce-toolbar .mce-btn,
</span><span class="cx"> .qt-fullscreen {
</span><span class="cx"> border-color: transparent;
</span><span class="lines">@@ -731,7 +748,7 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> .mce-i-wp_code:before {
</span><del>- content: '\e017';
</del><ins>+ content: '\f475';
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> /* Editors */
</span><span class="lines">@@ -740,10 +757,18 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> .wp-editor-tools {
</span><ins>+ background-color: #f1f1f1;
+ padding-top: 20px;
</ins><span class="cx"> position: relative;
</span><del>- z-index: 1;
</del><ins>+ z-index: 1000;
</ins><span class="cx"> }
</span><span class="cx">
</span><ins>+.wp-editor-tools:after {
+ clear: both;
+ content: '';
+ display: table;
+}
+
</ins><span class="cx"> .wp-editor-container {
</span><span class="cx"> clear: both;
</span><span class="cx"> }
</span><span class="lines">@@ -763,10 +788,6 @@
</span><span class="cx"> box-sizing: border-box;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-.wp-editor-tools {
- padding: 0;
-}
-
</del><span class="cx"> .wp-editor-container textarea.wp-editor-area {
</span><span class="cx"> width: 100%;
</span><span class="cx"> margin: 0;
</span></span></pre></div>
<a id="trunksrcwpincludesjstinymcepluginswordpresspluginjs"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-includes/js/tinymce/plugins/wordpress/plugin.js (29048 => 29049)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/js/tinymce/plugins/wordpress/plugin.js 2014-07-09 20:57:58 UTC (rev 29048)
+++ trunk/src/wp-includes/js/tinymce/plugins/wordpress/plugin.js 2014-07-09 22:05:06 UTC (rev 29049)
</span><span class="lines">@@ -52,6 +52,8 @@
</span><span class="cx"> wpAdvButton && wpAdvButton.active( true );
</span><span class="cx"> }
</span><span class="cx"> }
</span><ins>+
+ editor.fire( 'wp-toolbar-toggle' );
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> // Add the kitchen sink button :)
</span></span></pre></div>
<a id="trunksrcwpincludesjstinymcepluginswpautoresizepluginjs"></a>
<div class="addfile"><h4>Added: trunk/src/wp-includes/js/tinymce/plugins/wpautoresize/plugin.js (0 => 29049)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/js/tinymce/plugins/wpautoresize/plugin.js (rev 0)
+++ trunk/src/wp-includes/js/tinymce/plugins/wpautoresize/plugin.js 2014-07-09 22:05:06 UTC (rev 29049)
</span><span class="lines">@@ -0,0 +1,326 @@
</span><ins>+/**
+ * plugin.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+// Forked for WordPress so it can be turned on/off after loading.
+
+/*global tinymce:true */
+/*eslint no-nested-ternary:0 */
+
+/**
+ * Auto Resize
+ *
+ * This plugin automatically resizes the content area to fit its content height.
+ * It will retain a minimum height, which is the height of the content area when
+ * it's initialized.
+ */
+tinymce.PluginManager.add('wpautoresize', function(editor) {
+ var settings = editor.settings, oldSize = 0;
+
+ function isFullscreen() {
+ return editor.plugins.fullscreen && editor.plugins.fullscreen.isFullscreen();
+ }
+
+ if (editor.settings.inline) {
+ return;
+ }
+
+ /**
+ * This method gets executed each time the editor needs to resize.
+ */
+ function resize(e) {
+ var deltaSize, doc, body, docElm, DOM = tinymce.DOM, resizeHeight, myHeight, marginTop, marginBottom;
+
+ doc = editor.getDoc();
+ if (!doc) {
+ return;
+ }
+
+ body = doc.body;
+ docElm = doc.documentElement;
+ resizeHeight = settings.autoresize_min_height;
+
+ if (!body || (e && e.type === "setcontent" && e.initial) || isFullscreen()) {
+ if (body && docElm) {
+ body.style.overflowY = "auto";
+ docElm.style.overflowY = "auto"; // Old IE
+ }
+
+ return;
+ }
+
+ // Calculate outer height of the body element using CSS styles
+ marginTop = editor.dom.getStyle(body, 'margin-top', true);
+ marginBottom = editor.dom.getStyle(body, 'margin-bottom', true);
+ myHeight = body.offsetHeight + parseInt(marginTop, 10) + parseInt(marginBottom, 10);
+
+ // Make sure we have a valid height
+ if (isNaN(myHeight) || myHeight <= 0) {
+ // Get height differently depending on the browser used
+ myHeight = tinymce.Env.ie ? body.scrollHeight : (tinymce.Env.webkit && body.clientHeight === 0 ? 0 : body.offsetHeight);
+ }
+
+ // Don't make it smaller than the minimum height
+ if (myHeight > settings.autoresize_min_height) {
+ resizeHeight = myHeight;
+ }
+
+ // If a maximum height has been defined don't exceed this height
+ if (settings.autoresize_max_height && myHeight > settings.autoresize_max_height) {
+ resizeHeight = settings.autoresize_max_height;
+ body.style.overflowY = "auto";
+ docElm.style.overflowY = "auto"; // Old IE
+ } else {
+ body.style.overflowY = "hidden";
+ docElm.style.overflowY = "hidden"; // Old IE
+ body.scrollTop = 0;
+ }
+
+ // Resize content element
+ if (resizeHeight !== oldSize) {
+ deltaSize = resizeHeight - oldSize;
+ DOM.setStyle(DOM.get(editor.id + '_ifr'), 'height', resizeHeight + 'px');
+ oldSize = resizeHeight;
+
+ // WebKit doesn't decrease the size of the body element until the iframe gets resized
+ // So we need to continue to resize the iframe down until the size gets fixed
+ if (tinymce.isWebKit && deltaSize < 0) {
+ resize(e);
+ }
+ }
+ }
+
+ /**
+ * Calls the resize x times in 100ms intervals. We can't wait for load events since
+ * the CSS files might load async.
+ */
+ function wait( times, interval, callback ) {
+ setTimeout( function() {
+ resize({});
+
+ if ( times-- ) {
+ wait( times, interval, callback );
+ } else if ( callback ) {
+ callback();
+ }
+ }, interval );
+ }
+
+ // Define minimum height
+ settings.autoresize_min_height = parseInt(editor.getParam('autoresize_min_height', editor.getElement().offsetHeight), 10);
+
+ // Define maximum height
+ settings.autoresize_max_height = parseInt(editor.getParam('autoresize_max_height', 0), 10);
+
+ function on() {
+ if ( ! editor.dom.hasClass( editor.getBody(), 'wp-autoresize' ) ) {
+ editor.dom.addClass( editor.getBody(), 'wp-autoresize' );
+ // Add appropriate listeners for resizing the content area
+ editor.on( 'nodechange setcontent keyup FullscreenStateChanged', resize );
+ }
+ }
+
+ function off() {
+ // Don't turn off if the setting is 'on'
+ if ( ! settings.wp_autoresize_on ) {
+ editor.dom.removeClass( editor.getBody(), 'wp-autoresize' );
+ editor.off( 'nodechange setcontent keyup FullscreenStateChanged', resize );
+ oldSize = 0;
+ }
+ }
+
+ if ( settings.wp_autoresize_on ) {
+ // Turn resizing on when the editor loads
+ editor.on( 'init', function() {
+ editor.dom.addClass( editor.getBody(), 'wp-autoresize' );
+ });
+
+ editor.on( 'nodechange setcontent keyup FullscreenStateChanged', resize );
+
+ if ( editor.getParam( 'autoresize_on_init', true ) ) {
+ editor.on( 'init', function() {
+ // Hit it 20 times in 100 ms intervals
+ wait( 10, 200, function() {
+ // Hit it 5 times in 1 sec intervals
+ wait( 5, 1000 );
+ });
+ });
+ }
+ }
+
+ // Register the command
+ editor.addCommand( 'wpAutoResize', resize );
+
+ // On/off
+ editor.addCommand( 'wpAutoResizeOn', on );
+ editor.addCommand( 'wpAutoResizeOff', off );
+});
+/**
+ * plugin.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+// Forked for WordPress so it can be turned on/off after loading.
+
+/*global tinymce:true */
+/*eslint no-nested-ternary:0 */
+
+/**
+ * Auto Resize
+ *
+ * This plugin automatically resizes the content area to fit its content height.
+ * It will retain a minimum height, which is the height of the content area when
+ * it's initialized.
+ */
+tinymce.PluginManager.add('wpautoresize', function(editor) {
+ var settings = editor.settings, oldSize = 0;
+
+ function isFullscreen() {
+ return editor.plugins.fullscreen && editor.plugins.fullscreen.isFullscreen();
+ }
+
+ if (editor.settings.inline) {
+ return;
+ }
+
+ /**
+ * This method gets executed each time the editor needs to resize.
+ */
+ function resize(e) {
+ var deltaSize, doc, body, docElm, DOM = tinymce.DOM, resizeHeight, myHeight, marginTop, marginBottom;
+
+ doc = editor.getDoc();
+ if (!doc) {
+ return;
+ }
+
+ body = doc.body;
+ docElm = doc.documentElement;
+ resizeHeight = settings.autoresize_min_height;
+
+ if (!body || (e && e.type === "setcontent" && e.initial) || isFullscreen()) {
+ if (body && docElm) {
+ body.style.overflowY = "auto";
+ docElm.style.overflowY = "auto"; // Old IE
+ }
+
+ return;
+ }
+
+ // Calculate outer height of the body element using CSS styles
+ marginTop = editor.dom.getStyle(body, 'margin-top', true);
+ marginBottom = editor.dom.getStyle(body, 'margin-bottom', true);
+ myHeight = body.offsetHeight + parseInt(marginTop, 10) + parseInt(marginBottom, 10);
+
+ // Make sure we have a valid height
+ if (isNaN(myHeight) || myHeight <= 0) {
+ // Get height differently depending on the browser used
+ myHeight = tinymce.Env.ie ? body.scrollHeight : (tinymce.Env.webkit && body.clientHeight === 0 ? 0 : body.offsetHeight);
+ }
+
+ // Don't make it smaller than the minimum height
+ if (myHeight > settings.autoresize_min_height) {
+ resizeHeight = myHeight;
+ }
+
+ // If a maximum height has been defined don't exceed this height
+ if (settings.autoresize_max_height && myHeight > settings.autoresize_max_height) {
+ resizeHeight = settings.autoresize_max_height;
+ body.style.overflowY = "auto";
+ docElm.style.overflowY = "auto"; // Old IE
+ } else {
+ body.style.overflowY = "hidden";
+ docElm.style.overflowY = "hidden"; // Old IE
+ body.scrollTop = 0;
+ }
+
+ // Resize content element
+ if (resizeHeight !== oldSize) {
+ deltaSize = resizeHeight - oldSize;
+ DOM.setStyle(DOM.get(editor.id + '_ifr'), 'height', resizeHeight + 'px');
+ oldSize = resizeHeight;
+
+ // WebKit doesn't decrease the size of the body element until the iframe gets resized
+ // So we need to continue to resize the iframe down until the size gets fixed
+ if (tinymce.isWebKit && deltaSize < 0) {
+ resize(e);
+ }
+ }
+ }
+
+ /**
+ * Calls the resize x times in 100ms intervals. We can't wait for load events since
+ * the CSS files might load async.
+ */
+ function wait( times, interval, callback ) {
+ setTimeout( function() {
+ resize({});
+
+ if ( times-- ) {
+ wait( times, interval, callback );
+ } else if ( callback ) {
+ callback();
+ }
+ }, interval );
+ }
+
+ // Define minimum height
+ settings.autoresize_min_height = parseInt(editor.getParam('autoresize_min_height', editor.getElement().offsetHeight), 10);
+
+ // Define maximum height
+ settings.autoresize_max_height = parseInt(editor.getParam('autoresize_max_height', 0), 10);
+
+ function on() {
+ if ( ! editor.dom.hasClass( editor.getBody(), 'wp-autoresize' ) ) {
+ editor.dom.addClass( editor.getBody(), 'wp-autoresize' );
+ // Add appropriate listeners for resizing the content area
+ editor.on( 'nodechange setcontent keyup FullscreenStateChanged', resize );
+ }
+ }
+
+ function off() {
+ // Don't turn off if the setting is 'on'
+ if ( ! settings.wp_autoresize_on ) {
+ editor.dom.removeClass( editor.getBody(), 'wp-autoresize' );
+ editor.off( 'nodechange setcontent keyup FullscreenStateChanged', resize );
+ oldSize = 0;
+ }
+ }
+
+ if ( settings.wp_autoresize_on ) {
+ // Turn resizing on when the editor loads
+ editor.on( 'init', function() {
+ editor.dom.addClass( editor.getBody(), 'wp-autoresize' );
+ });
+
+ editor.on( 'nodechange setcontent keyup FullscreenStateChanged', resize );
+
+ if ( editor.getParam( 'autoresize_on_init', true ) ) {
+ editor.on( 'init', function() {
+ // Hit it 20 times in 100 ms intervals
+ wait( 10, 200, function() {
+ // Hit it 5 times in 1 sec intervals
+ wait( 5, 1000 );
+ });
+ });
+ }
+ }
+
+ // Register the command
+ editor.addCommand( 'wpAutoResize', resize );
+
+ // On/off
+ editor.addCommand( 'wpAutoResizeOn', on );
+ editor.addCommand( 'wpAutoResizeOff', off );
+});
</ins><span class="cx">Property changes on: trunk/src/wp-includes/js/tinymce/plugins/wpautoresize/plugin.js
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<ins>+native
</ins><span class="cx">\ No newline at end of property
</span><a id="trunksrcwpincludesjstinymcepluginswpfullscreenpluginjs"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-includes/js/tinymce/plugins/wpfullscreen/plugin.js (29048 => 29049)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/js/tinymce/plugins/wpfullscreen/plugin.js 2014-07-09 20:57:58 UTC (rev 29048)
+++ trunk/src/wp-includes/js/tinymce/plugins/wpfullscreen/plugin.js 2014-07-09 22:05:06 UTC (rev 29049)
</span><span class="lines">@@ -3,60 +3,20 @@
</span><span class="cx"> * WP Fullscreen (Distraction Free Writing) TinyMCE plugin
</span><span class="cx"> */
</span><span class="cx"> tinymce.PluginManager.add( 'wpfullscreen', function( editor ) {
</span><del>- var settings = editor.settings,
- oldSize = 0;
</del><ins>+ var settings = editor.settings;
</ins><span class="cx">
</span><del>- function resize( e ) {
- var deltaSize, myHeight,
- d = editor.getDoc(),
- body = d.body,
- DOM = tinymce.DOM,
- resizeHeight = 250;
-
- if ( ( e && e.type === 'setcontent' && e.initial ) || editor.settings.inline ) {
- return;
- }
-
- // Get height differently depending on the browser used
- myHeight = tinymce.Env.ie ? body.scrollHeight : ( tinymce.Env.webkit && body.clientHeight === 0 ? 0 : body.offsetHeight );
-
- // Don't make it smaller than 250px
- if ( myHeight > 250 ) {
- resizeHeight = myHeight;
- }
-
- body.scrollTop = 0;
-
- // Resize content element
- if ( resizeHeight !== oldSize ) {
- deltaSize = resizeHeight - oldSize;
- DOM.setStyle( DOM.get( editor.id + '_ifr' ), 'height', resizeHeight + 'px' );
- oldSize = resizeHeight;
-
- // WebKit doesn't decrease the size of the body element until the iframe gets resized
- // So we need to continue to resize the iframe down until the size gets fixed
- if ( tinymce.isWebKit && deltaSize < 0 ) {
- resize( e );
- }
- }
- }
-
- // Register the command
- editor.addCommand( 'wpAutoResize', resize );
-
</del><span class="cx"> function fullscreenOn() {
</span><span class="cx"> settings.wp_fullscreen = true;
</span><span class="cx"> editor.dom.addClass( editor.getDoc().documentElement, 'wp-fullscreen' );
</span><del>- // Add listeners for auto-resizing
- editor.on( 'change setcontent paste keyup', resize );
</del><ins>+ // Start auto-resizing
+ editor.execCommand( 'wpAutoResizeOn' );
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> function fullscreenOff() {
</span><span class="cx"> settings.wp_fullscreen = false;
</span><span class="cx"> editor.dom.removeClass( editor.getDoc().documentElement, 'wp-fullscreen' );
</span><del>- // Remove listeners for auto-resizing
- editor.off( 'change setcontent paste keyup', resize );
- oldSize = 0;
</del><ins>+ // Stop auto-resizing
+ editor.execCommand( 'wpAutoResizeOff' );
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> // For use from outside the editor.
</span></span></pre></div>
<a id="trunksrcwpincludesjstinymcepluginswpviewpluginjs"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-includes/js/tinymce/plugins/wpview/plugin.js (29048 => 29049)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/js/tinymce/plugins/wpview/plugin.js 2014-07-09 20:57:58 UTC (rev 29048)
+++ trunk/src/wp-includes/js/tinymce/plugins/wpview/plugin.js 2014-07-09 22:05:06 UTC (rev 29049)
</span><span class="lines">@@ -646,6 +646,7 @@
</span><span class="cx">
</span><span class="cx"> return {
</span><span class="cx"> getViewText: getViewText,
</span><del>- setViewText: setViewText
</del><ins>+ setViewText: setViewText,
+ getView: getView
</ins><span class="cx"> };
</span><span class="cx"> });
</span></span></pre></div>
<a id="trunksrcwpincludesjstinymceskinswordpresswpcontentcss"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-includes/js/tinymce/skins/wordpress/wp-content.css (29048 => 29049)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/js/tinymce/skins/wordpress/wp-content.css 2014-07-09 20:57:58 UTC (rev 29048)
+++ trunk/src/wp-includes/js/tinymce/skins/wordpress/wp-content.css 2014-07-09 22:05:06 UTC (rev 29049)
</span><span class="lines">@@ -14,9 +14,19 @@
</span><span class="cx"> font-size: 13px;
</span><span class="cx"> line-height: 19px;
</span><span class="cx"> color: #333;
</span><del>- margin: 10px;
</del><ins>+ margin: 9px 10px;
</ins><span class="cx"> }
</span><span class="cx">
</span><ins>+body.wp-autoresize {
+ max-width: 100%;
+ overflow: visible !important;
+ /* The padding ensures margins of the children are contained in the body. */
+ padding-top: 1px !important;
+ padding-bottom: 1px !important;
+ padding-left: 0 !important;
+ padding-right: 0 !important;
+}
+
</ins><span class="cx"> /* When font-weight is different than the default browser style,
</span><span class="cx"> Chrome and Safari replace <strong> and <b> with spans with inline styles on pasting?! */
</span><span class="cx"> body.webkit strong,
</span></span></pre></div>
<a id="trunksrcwpincludesscriptloaderphp"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-includes/script-loader.php (29048 => 29049)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/script-loader.php 2014-07-09 20:57:58 UTC (rev 29048)
+++ trunk/src/wp-includes/script-loader.php 2014-07-09 22:05:06 UTC (rev 29049)
</span><span class="lines">@@ -459,6 +459,8 @@
</span><span class="cx"> 'savingText' => __('Saving Draft…'),
</span><span class="cx"> ) );
</span><span class="cx">
</span><ins>+ $scripts->add( 'editor-expand', "/wp-admin/js/editor-expand$suffix.js", array( 'jquery' ), false, 1 );
+
</ins><span class="cx"> $scripts->add( 'link', "/wp-admin/js/link$suffix.js", array( 'wp-lists', 'postbox' ), false, 1 );
</span><span class="cx">
</span><span class="cx"> $scripts->add( 'comment', "/wp-admin/js/comment$suffix.js", array( 'jquery', 'postbox' ) );
</span></span></pre>
</div>
</div>
</body>
</html>