101
101
event.content = event.content.replace( /<!--more(.*?)-->/g, function( match, moretext ) {
102
102
return '<img src="' + tinymce.Env.transparentSrc + '" data-wp-more="more" data-wp-more-text="' + moretext + '" ' +
103
'class="wp-more-tag mce-wp-more" title="' + title + '" data-mce-resize="false" data-mce-placeholder="1" />';
103
'class="wp-more-tag mce-wp-more" alt="" title="' + title + '" data-mce-resize="false" data-mce-placeholder="1" />';
110
110
event.content = event.content.replace( /<!--nextpage-->/g,
111
111
'<img src="' + tinymce.Env.transparentSrc + '" data-wp-more="nextpage" class="wp-more-tag mce-wp-nextpage" ' +
112
'title="' + title + '" data-mce-resize="false" data-mce-placeholder="1" />' );
112
'alt="" title="' + title + '" data-mce-resize="false" data-mce-placeholder="1" />' );
115
115
if ( event.load && event.format !== 'raw' && hasWpautop ) {
162
162
classname += ' mce-wp-' + tag;
163
163
title = tag === 'more' ? 'Read more...' : 'Next page';
164
164
title = __( title );
165
html = '<img src="' + tinymce.Env.transparentSrc + '" title="' + title + '" class="' + classname + '" ' +
165
html = '<img src="' + tinymce.Env.transparentSrc + '" alt="" title="' + title + '" class="' + classname + '" ' +
166
166
'data-wp-more="' + tag + '" data-mce-resize="false" data-mce-placeholder="1" />';
168
168
// Most common case
428
428
dom.setAttrib( doc.documentElement, 'dir', 'rtl' );
431
dom.setAttrib( doc.documentElement, 'lang', editor.getParam( 'wp_lang_attr' ) );
432
434
if ( parseInt( env.ie, 10 ) === 9 ) {
433
435
bodyClass.push('ie9');
472
474
if ( editor.getParam( 'wp_paste_filters', true ) ) {
473
if ( ! tinymce.Env.webkit ) {
474
// In WebKit handled by removeWebKitStyles()
475
editor.on( 'PastePreProcess', function( event ) {
475
editor.on( 'PastePreProcess', function( event ) {
476
// Remove trailing <br> added by WebKit browsers to the clipboard
477
event.content = event.content.replace( /<br class="?Apple-interchange-newline"?>/gi, '' );
479
// In WebKit this is handled by removeWebKitStyles()
480
if ( ! tinymce.Env.webkit ) {
476
481
// Remove all inline styles
477
482
event.content = event.content.replace( /(<[^>]+) style="[^"]*"([^>]*>)/gi, '$1$2' );
479
484
// Put back the internal styles
480
485
event.content = event.content.replace(/(<[^>]+) data-mce-style=([^>]+>)/gi, '$1 style=$2' );
484
489
editor.on( 'PastePostProcess', function( event ) {
485
490
// Remove empty paragraphs
734
739
spaceBottom = windowHeight - iframeRect.top - selection.bottom - blockedBottom,
735
740
editorHeight = windowHeight - blockedTop - blockedBottom,
739
746
if ( spaceTop >= editorHeight || spaceBottom >= editorHeight ) {
740
747
return this.hide();
750
// Add offset in iOS to move the menu over the image, out of the way of the default iOS menu.
751
if ( tinymce.Env.iOS && currentSelection.nodeName === 'IMG' ) {
753
iosOffsetBottom = 46;
743
756
if ( this.bottom ) {
744
757
if ( spaceBottom >= spaceNeeded ) {
745
758
className = ' mce-arrow-up';
746
top = selection.bottom + iframeRect.top + scrollY;
759
top = selection.bottom + iframeRect.top + scrollY - iosOffsetBottom;
747
760
} else if ( spaceTop >= spaceNeeded ) {
748
761
className = ' mce-arrow-down';
749
top = selection.top + iframeRect.top + scrollY - toolbarHeight - margin;
762
top = selection.top + iframeRect.top + scrollY - toolbarHeight - margin + iosOffsetTop;
752
765
if ( spaceTop >= spaceNeeded ) {
753
766
className = ' mce-arrow-down';
754
top = selection.top + iframeRect.top + scrollY - toolbarHeight - margin;
767
top = selection.top + iframeRect.top + scrollY - toolbarHeight - margin + iosOffsetTop;
755
768
} else if ( spaceBottom >= spaceNeeded && editorHeight / 2 > selection.bottom + iframeRect.top - blockedTop ) {
756
769
className = ' mce-arrow-up';
757
top = selection.bottom + iframeRect.top + scrollY;
770
top = selection.bottom + iframeRect.top + scrollY - iosOffsetBottom;
761
774
if ( typeof top === 'undefined' ) {
762
top = scrollY + blockedTop + buffer;
775
top = scrollY + blockedTop + buffer + iosOffsetBottom;
765
778
left = selectionMiddle - toolbarWidth / 2 + iframeRect.left + scrollX;
779
792
left = selection.right - toolbarWidth + iframeRect.left + scrollX;
795
// No up/down arrows on the menu over images in iOS.
796
if ( tinymce.Env.iOS && currentSelection.nodeName === 'IMG' ) {
797
className = className.replace( / ?mce-arrow-(up|down)/g, '' );
782
800
toolbar.className = toolbar.className.replace( / ?mce-arrow-[\w]+/g, '' ) + className;
784
802
DOM.setStyles( toolbar, {