Index: /trunk/wp-admin/css/wp-admin.css
===================================================================
--- /trunk/wp-admin/css/wp-admin.css (revision 22006)
+++ /trunk/wp-admin/css/wp-admin.css (revision 22007)
@@ -3108,5 +3108,5 @@
width: 12px;
cursor: se-resize;
- margin: 0 2px;
+ margin: 0 1px;
position: relative;
top: -2px;
@@ -3115,4 +3115,21 @@
#post-body .postarea .wp_themeSkin .mceStatusbar a.mceResize {
top: 20px;
+}
+
+#content-resize-handle {
+ background: transparent url(../images/resize.gif) no-repeat scroll right bottom;
+ width: 12px;
+ cursor: se-resize;
+ position: absolute;
+ right: 2px;
+ height: 19px;
+}
+
+.press-this #content-resize-handle {
+ bottom: 2px;
+}
+
+.tmce-active #content-resize-handle {
+ display: none;
}
@@ -4308,4 +4325,8 @@
-webkit-box-shadow: none;
box-shadow: none;
+}
+
+.comment-php .wp-editor-area {
+ height: 200px;
}
@@ -7321,4 +7342,5 @@
.press-this #poststuff {
margin: 0 10px 10px;
+ padding: 0;
}
@@ -7416,5 +7438,5 @@
.press-this #extra-fields .actions {
- margin: -25px -7px 0 0;
+ margin: -32px -7px 0 0;
}
@@ -7516,5 +7538,5 @@
padding: 0 5px;
border: 0 none;
- height: 357px;
+ height: 345px;
font-family: Consolas, Monaco, monospace;
font-size: 13px;
Index: /trunk/wp-admin/edit-form-advanced.php
===================================================================
--- /trunk/wp-admin/edit-form-advanced.php (revision 22006)
+++ /trunk/wp-admin/edit-form-advanced.php (revision 22007)
@@ -348,5 +348,5 @@
-post_content, 'content', array('dfw' => true, 'tabfocus_elements' => 'sample-permalink,post-preview') ); ?>
+post_content, 'content', array('dfw' => true, 'tabfocus_elements' => 'sample-permalink,post-preview', 'editor_height' => 360) ); ?>
Index: /trunk/wp-admin/js/editor.js
===================================================================
--- /trunk/wp-admin/js/editor.js (revision 22006)
+++ /trunk/wp-admin/js/editor.js (revision 22007)
@@ -50,8 +50,6 @@
return false;
- if ( ed ) {
- txtarea_el.style.height = ed.getContentAreaContainer().offsetHeight + 20 + 'px';
+ if ( ed )
ed.hide();
- }
dom.removeClass(wrap_id, 'tmce-active');
Index: /trunk/wp-admin/js/post.js
===================================================================
--- /trunk/wp-admin/js/post.js (revision 22006)
+++ /trunk/wp-admin/js/post.js (revision 22007)
@@ -668,3 +668,82 @@
wptitlehint();
+
+ // resizable textarea#content
+ (function() {
+ var textarea = $('textarea#content'), offset = null, el;
+
+ function dragging(e) {
+ textarea.height( Math.max(50, offset + e.pageY) + 'px' );
+ return false;
+ }
+
+ function endDrag(e) {
+ var height = $('#wp-content-editor-container').height();
+
+ textarea.focus();
+ $(document).unbind('mousemove', dragging).unbind('mouseup', endDrag);
+
+ if ( height > 83 ) {
+ height -= 33; // compensate for toolbars, padding...
+ setUserSetting( 'ed_size', height );
+ }
+ }
+
+ textarea.css('resize', 'none');
+ el = $('
');
+ $('#wp-content-wrap').append(el);
+ el.on('mousedown', function(e) {
+ offset = textarea.height() - e.pageY;
+ textarea.blur();
+ $(document).mousemove(dragging).mouseup(endDrag);
+ return false;
+ });
+ })();
+
+ tinymce.onAddEditor.add(function(mce, ed){
+ if ( ed.id != 'content' )
+ return;
+
+ // resize TinyMCE to match the textarea height when switching Text -> Visual
+ ed.onLoadContent.add( function(ed, o) {
+ var ifr_height, height = parseInt( $('#content').css('height'), 10 ),
+ tb_height = $('#content_tbl tr.mceFirst').height();
+
+ if ( height && !isNaN(height) && tb_height ) {
+ ifr_height = (height - tb_height) + 12; // compensate for padding in the textarea
+
+ $('#content_tbl').css('height', '' );
+ $('#content_ifr').css('height', ifr_height + 'px' );
+ setUserSetting( 'ed_size', height );
+ }
+ });
+
+ // resize the textarea to match TinyMCE's height when switching Visual -> Text
+ ed.onSaveContent.add( function(ed, o) {
+ var height = $('#content_tbl').height();
+
+ if ( height && height > 83 ) {
+ height -= 33;
+
+ $('#content').css( 'height', height + 'px' );
+ setUserSetting( 'ed_size', height );
+ }
+ });
+
+ // save on resizing TinyMCE
+ ed.onPostRender.add(function() {
+ $('#content_resize').on('mousedown.wp-mce-resize', function(e){
+ $(document).on('mouseup.wp-mce-resize', function(e){
+ var height = $('#wp-content-editor-container').height();
+
+ height -= 33;
+ if ( height > 50 && height != getUserSetting( 'ed_size' ) )
+ setUserSetting( 'ed_size', height );
+
+ $(document).off('mouseup.wp-mce-resize');
+ });
+ });
+ });
+ });
+
});
Index: /trunk/wp-admin/press-this.php
===================================================================
--- /trunk/wp-admin/press-this.php (revision 22006)
+++ /trunk/wp-admin/press-this.php (revision 22007)
@@ -289,5 +289,5 @@
}
- jQuery('#extra-fields').html(' ()
');
+ jQuery('#extra-fields').html('
()
');
jQuery('#img_container').html(strtoappend);
true, // show insert/upload button(s)
'textarea_name' => $editor_id, // set the textarea name to something different, square brackets [] can be used here
- 'textarea_rows' => get_option('default_post_edit_rows', 10), // rows="..."
+ 'textarea_rows' => 20,
'tabindex' => '',
'tabfocus_elements' => ':prev,:next', // the previous and next element ID to move the focus to when pressing the Tab key in TinyMCE
@@ -53,4 +53,24 @@
self::$has_quicktags = true;
+ if ( empty( $set['editor_height'] ) )
+ return $set;
+
+ if ( 'content' === $editor_id ) {
+ // A cookie (set when a user resizes the editor) overrides the height.
+ $cookie = (int) get_user_setting( 'ed_size' );
+
+ // Upgrade an old TinyMCE cookie if it is still around, and the new one isn't.
+ if ( ! $cookie && isset( $_COOKIE['TinyMCE_content_size'] ) ) {
+ parse_str( $_COOKIE['TinyMCE_content_size'], $cookie );
+ $cookie = $cookie['ch'];
+ }
+
+ if ( $cookie )
+ $set['editor_height'] = $cookie;
+ }
+
+ if ( $set['editor_height'] < 50 )
+ $set['editor_height'] = 50;
+
return $set;
}
@@ -68,7 +88,11 @@
$editor_class = ' class="' . trim( $set['editor_class'] . ' wp-editor-area' ) . '"';
$tabindex = $set['tabindex'] ? ' tabindex="' . (int) $set['tabindex'] . '"' : '';
- $rows = ' rows="' . (int) $set['textarea_rows'] . '"';
$switch_class = 'html-active';
$toolbar = $buttons = '';
+
+ if ( ! empty( $set['editor_height'] ) )
+ $height = ' style="height: ' . $set['editor_height'] . 'px"';
+ else
+ $height = ' rows="' . $set['textarea_rows'] . '"';
if ( !current_user_can( 'upload_files' ) )
@@ -117,5 +141,5 @@
}
- $the_editor = apply_filters('the_editor', '
');
+ $the_editor = apply_filters('the_editor', '
');
$content = apply_filters('the_editor_content', $content);
@@ -404,4 +428,7 @@
);
+ // The main editor doesn't use the TinyMCE resizing cookie.
+ $mceInit['theme_advanced_resizing_use_cookie'] = 'content' !== $editor_id || empty( $set['editor_height'] );
+
if ( $first_run )
$mceInit = array_merge(self::$first_init, $mceInit);
@@ -551,13 +578,23 @@
echo "\n";
}
+
+ $mce = ( self::$has_tinymce && wp_default_editor() == 'tinymce' ) || ! self::$has_quicktags;
?>
-
+
+