TinyMCE in iOS:

- Fix placing the caret at the bottom of longer posts when the keyboard is open.
- Disable resizing on switching editors and on show/hide the kitchen sink row.
See #28242
Built from https://develop.svn.wordpress.org/trunk@28626


git-svn-id: http://core.svn.wordpress.org/trunk@28446 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Ozz 2014-05-30 02:38:16 +00:00
parent 1e8b5ef008
commit 15a1f80885
7 changed files with 39 additions and 15 deletions

View File

@ -60,7 +60,8 @@ window.switchEditors = {
if ( ed ) {
ed.show();
if ( editorHeight ) {
// No point resizing the iframe in iOS
if ( ! tinymce.Env.iOS && editorHeight ) {
toolbarHeight = getToolbarHeight();
editorHeight = editorHeight - toolbarHeight + 14;
@ -84,16 +85,18 @@ window.switchEditors = {
}
if ( ed ) {
iframe = DOM.get( id + '_ifr' );
editorHeight = iframe ? parseInt( iframe.style.height, 10 ) : 0;
if ( ! tinymce.Env.iOS ) {
iframe = DOM.get( id + '_ifr' );
editorHeight = iframe ? parseInt( iframe.style.height, 10 ) : 0;
if ( editorHeight ) {
toolbarHeight = getToolbarHeight();
editorHeight = editorHeight + toolbarHeight - 14;
if ( editorHeight ) {
toolbarHeight = getToolbarHeight();
editorHeight = editorHeight + toolbarHeight - 14;
// height cannot be under 50 or over 5000
if ( editorHeight > 50 && editorHeight < 5000 ) {
txtarea_el.style.height = editorHeight + 'px';
// height cannot be under 50 or over 5000
if ( editorHeight > 50 && editorHeight < 5000 ) {
txtarea_el.style.height = editorHeight + 'px';
}
}
}

File diff suppressed because one or more lines are too long

View File

@ -37,9 +37,12 @@ tinymce.PluginManager.add( 'wordpress', function( editor ) {
}
});
if ( pixels && ! initial ) {
iframe = editor.getContentAreaContainer().firstChild;
DOM.setStyle( iframe, 'height', iframe.clientHeight + pixels ); // Resize iframe
if ( pixels && ! initial ) {
// Resize iframe, not needed in iOS
if ( ! tinymce.Env.iOS ) {
iframe = editor.getContentAreaContainer().firstChild;
DOM.setStyle( iframe, 'height', iframe.clientHeight + pixels );
}
if ( state === 'hide' ) {
setUserSetting('hidetb', '0');
@ -277,6 +280,10 @@ tinymce.PluginManager.add( 'wordpress', function( editor ) {
doc = editor.getDoc(),
dom = editor.dom;
if ( tinymce.Env.iOS ) {
dom.addClass( doc.documentElement, 'ios' );
}
if ( editor.getParam( 'directionality' ) === 'rtl' ) {
bodyClass.push('rtl');
dom.setAttrib( doc.documentElement, 'dir', 'rtl' );
@ -358,6 +365,10 @@ tinymce.PluginManager.add( 'wordpress', function( editor ) {
editor.on( 'preInit', function() {
// Don't replace <i> with <em> and <b> with <strong> and don't remove them when empty
editor.schema.addValidElements( '@[id|accesskey|class|dir|lang|style|tabindex|title|contenteditable|draggable|dropzone|hidden|spellcheck|translate],i,b' );
if ( tinymce.Env.iOS ) {
editor.settings.height = 300;
}
});
// Add custom shortcuts

File diff suppressed because one or more lines are too long

View File

@ -1,4 +1,14 @@
/* Additional default styles for the editor */
html.ios {
height: 100%;
}
.ios body#tinymce {
height: 200%;
max-width: none;
}
body {
font-family: Georgia, "Times New Roman", "Bitstream Charter", Times, serif;
font-size: 13px;

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.0-alpha-20140529';
$wp_version = '4.0-alpha-20140530';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.