event.content = event.content.replace( /<!--more(.*?)-->/g, function( match, moretext ) {
return '<img src="' + tinymce.Env.transparentSrc + '" data-wp-more="more" data-wp-more-text="' + moretext + '" ' +
- 'class="wp-more-tag mce-wp-more" title="' + title + '" data-mce-resize="false" data-mce-placeholder="1" />';
+ 'class="wp-more-tag mce-wp-more" alt="" title="' + title + '" data-mce-resize="false" data-mce-placeholder="1" />';
});
}
event.content = event.content.replace( /<!--nextpage-->/g,
'<img src="' + tinymce.Env.transparentSrc + '" data-wp-more="nextpage" class="wp-more-tag mce-wp-nextpage" ' +
- 'title="' + title + '" data-mce-resize="false" data-mce-placeholder="1" />' );
+ 'alt="" title="' + title + '" data-mce-resize="false" data-mce-placeholder="1" />' );
}
if ( event.load && event.format !== 'raw' && hasWpautop ) {
classname += ' mce-wp-' + tag;
title = tag === 'more' ? 'Read more...' : 'Next page';
title = __( title );
- html = '<img src="' + tinymce.Env.transparentSrc + '" title="' + title + '" class="' + classname + '" ' +
+ html = '<img src="' + tinymce.Env.transparentSrc + '" alt="" title="' + title + '" class="' + classname + '" ' +
'data-wp-more="' + tag + '" data-mce-resize="false" data-mce-placeholder="1" />';
// Most common case
dom.setAttrib( doc.documentElement, 'dir', 'rtl' );
}
+ dom.setAttrib( doc.documentElement, 'lang', editor.getParam( 'wp_lang_attr' ) );
+
if ( env.ie ) {
if ( parseInt( env.ie, 10 ) === 9 ) {
bodyClass.push('ie9');
}
if ( editor.getParam( 'wp_paste_filters', true ) ) {
- if ( ! tinymce.Env.webkit ) {
- // In WebKit handled by removeWebKitStyles()
- editor.on( 'PastePreProcess', function( event ) {
+ editor.on( 'PastePreProcess', function( event ) {
+ // Remove trailing <br> added by WebKit browsers to the clipboard
+ event.content = event.content.replace( /<br class="?Apple-interchange-newline"?>/gi, '' );
+
+ // In WebKit this is handled by removeWebKitStyles()
+ if ( ! tinymce.Env.webkit ) {
// Remove all inline styles
event.content = event.content.replace( /(<[^>]+) style="[^"]*"([^>]*>)/gi, '$1$2' );
// Put back the internal styles
event.content = event.content.replace(/(<[^>]+) data-mce-style=([^>]+>)/gi, '$1 style=$2' );
- });
- }
+ }
+ });
editor.on( 'PastePostProcess', function( event ) {
// Remove empty paragraphs
spaceBottom = windowHeight - iframeRect.top - selection.bottom - blockedBottom,
editorHeight = windowHeight - blockedTop - blockedBottom,
className = '',
+ iosOffsetTop = 0,
+ iosOffsetBottom = 0,
top, left;
if ( spaceTop >= editorHeight || spaceBottom >= editorHeight ) {
return this.hide();
}
+ // Add offset in iOS to move the menu over the image, out of the way of the default iOS menu.
+ if ( tinymce.Env.iOS && currentSelection.nodeName === 'IMG' ) {
+ iosOffsetTop = 54;
+ iosOffsetBottom = 46;
+ }
+
if ( this.bottom ) {
if ( spaceBottom >= spaceNeeded ) {
className = ' mce-arrow-up';
- top = selection.bottom + iframeRect.top + scrollY;
+ top = selection.bottom + iframeRect.top + scrollY - iosOffsetBottom;
} else if ( spaceTop >= spaceNeeded ) {
className = ' mce-arrow-down';
- top = selection.top + iframeRect.top + scrollY - toolbarHeight - margin;
+ top = selection.top + iframeRect.top + scrollY - toolbarHeight - margin + iosOffsetTop;
}
} else {
if ( spaceTop >= spaceNeeded ) {
className = ' mce-arrow-down';
- top = selection.top + iframeRect.top + scrollY - toolbarHeight - margin;
+ top = selection.top + iframeRect.top + scrollY - toolbarHeight - margin + iosOffsetTop;
} else if ( spaceBottom >= spaceNeeded && editorHeight / 2 > selection.bottom + iframeRect.top - blockedTop ) {
className = ' mce-arrow-up';
- top = selection.bottom + iframeRect.top + scrollY;
+ top = selection.bottom + iframeRect.top + scrollY - iosOffsetBottom;
}
}
if ( typeof top === 'undefined' ) {
- top = scrollY + blockedTop + buffer;
+ top = scrollY + blockedTop + buffer + iosOffsetBottom;
}
left = selectionMiddle - toolbarWidth / 2 + iframeRect.left + scrollX;
left = selection.right - toolbarWidth + iframeRect.left + scrollX;
}
+ // No up/down arrows on the menu over images in iOS.
+ if ( tinymce.Env.iOS && currentSelection.nodeName === 'IMG' ) {
+ className = className.replace( / ?mce-arrow-(up|down)/g, '' );
+ }
+
toolbar.className = toolbar.className.replace( / ?mce-arrow-[\w]+/g, '' ) + className;
DOM.setStyles( toolbar, {