' + __( 'To move focus to other buttons use Tab or the arrow keys. To return focus to the editor press Escape or use one of the buttons.' ) + '
\s*<(p|div|ul|ol|dl|table|blockquote|h[1-6]|fieldset|pre)( [^>]*)?>/gi, '<$1$2>' ) .replace( /<\/(p|div|ul|ol|dl|table|blockquote|h[1-6]|fieldset|pre)>\s*<\/p>/gi, '$1>' ); } }); if ( $ ) { // Run on DOM ready. Otherwise TinyMCE may initialize earlier and handlers attached // on DOM ready of after the `tinymce.init()` call may not get triggered. $( function() { $( document ).triggerHandler( 'tinymce-editor-init', [editor] ); }); } if ( window.tinyMCEPreInit && window.tinyMCEPreInit.dragDropUpload ) { dom.bind( doc, 'dragstart dragend dragover drop', function( event ) { if ( $ ) { // Trigger the jQuery handlers. $( document ).trigger( new $.Event( event ) ); } }); } if ( editor.getParam( 'wp_paste_filters', true ) ) { editor.on( 'PastePreProcess', function( event ) { // Remove trailing added by WebKit browsers to the clipboard. event.content = event.content.replace( //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. editor.$( 'p', event.node ).each( function( i, node ) { if ( dom.isEmpty( node ) ) { dom.remove( node ); } }); if ( tinymce.isIE ) { editor.$( 'a', event.node ).find( 'font, u' ).each( function( i, node ) { dom.remove( node, true ); }); } }); } }); editor.on( 'SaveContent', function( event ) { // If editor is hidden, we just want the textarea's value to be saved. if ( ! editor.inline && editor.isHidden() ) { event.content = event.element.value; return; } // Keep empty paragraphs :( event.content = event.content.replace( /
(?:|\u00a0|\uFEFF| )*<\/p>/g, '