1 /* global getUserSetting, setUserSetting */
2 ( function( tinymce ) {
3 // Set the minimum value for the modals z-index higher than #wpadminbar (100000)
4 tinymce.ui.FloatPanel.zIndex = 100100;
6 tinymce.PluginManager.add( 'wordpress', function( editor ) {
7 var wpAdvButton, style,
10 __ = editor.editorManager.i18n.translate,
13 hasWpautop = ( wp && wp.editor && wp.editor.autop && editor.getParam( 'wpautop', true ) );
16 $( document ).triggerHandler( 'tinymce-editor-setup', [ editor ] );
19 function toggleToolbars( state ) {
20 var iframe, initial, toolbars,
23 initial = ( state === 'hide' );
25 if ( editor.theme.panel ) {
26 toolbars = editor.theme.panel.find('.toolbar:not(.menubar)');
29 if ( ! toolbars || toolbars.length < 2 || ( state === 'hide' && ! toolbars[1].visible() ) ) {
33 if ( ! state && toolbars[1].visible() ) {
37 each( toolbars, function( toolbar, i ) {
39 if ( state === 'hide' ) {
49 if ( pixels && ! initial ) {
50 // Resize iframe, not needed in iOS
51 if ( ! tinymce.Env.iOS ) {
52 iframe = editor.getContentAreaContainer().firstChild;
53 DOM.setStyle( iframe, 'height', iframe.clientHeight + pixels );
56 if ( state === 'hide' ) {
57 setUserSetting('hidetb', '0');
58 wpAdvButton && wpAdvButton.active( false );
60 setUserSetting('hidetb', '1');
61 wpAdvButton && wpAdvButton.active( true );
65 editor.fire( 'wp-toolbar-toggle' );
68 // Add the kitchen sink button :)
69 editor.addButton( 'wp_adv', {
70 tooltip: 'Toolbar Toggle',
72 onPostRender: function() {
74 wpAdvButton.active( getUserSetting( 'hidetb' ) === '1' ? true : false );
78 // Hide the toolbars after loading
79 editor.on( 'PostRender', function() {
80 if ( editor.getParam( 'wordpress_adv_hidden', true ) && getUserSetting( 'hidetb', '0' ) === '0' ) {
81 toggleToolbars( 'hide' );
85 editor.addCommand( 'WP_Adv', function() {
89 editor.on( 'focus', function() {
90 window.wpActiveEditor = editor.id;
93 // Replace Read More/Next Page tags with images
94 editor.on( 'BeforeSetContent', function( event ) {
97 if ( event.content ) {
98 if ( event.content.indexOf( '<!--more' ) !== -1 ) {
99 title = __( 'Read more...' );
101 event.content = event.content.replace( /<!--more(.*?)-->/g, function( match, moretext ) {
102 return '<img src="' + tinymce.Env.transparentSrc + '" data-wp-more="more" data-wp-more-text="' + moretext + '" ' +
103 'class="wp-more-tag mce-wp-more" alt="" title="' + title + '" data-mce-resize="false" data-mce-placeholder="1" />';
107 if ( event.content.indexOf( '<!--nextpage-->' ) !== -1 ) {
108 title = __( 'Page break' );
110 event.content = event.content.replace( /<!--nextpage-->/g,
111 '<img src="' + tinymce.Env.transparentSrc + '" data-wp-more="nextpage" class="wp-more-tag mce-wp-nextpage" ' +
112 'alt="" title="' + title + '" data-mce-resize="false" data-mce-placeholder="1" />' );
115 if ( event.load && event.format !== 'raw' && hasWpautop ) {
116 event.content = wp.editor.autop( event.content );
119 // Remove spaces from empty paragraphs.
120 event.content = event.content.replace( /<p>(?: |\u00a0|\uFEFF|\s)+<\/p>/gi, '<p><br /></p>' );
124 // Replace images with tags
125 editor.on( 'PostProcess', function( e ) {
127 e.content = e.content.replace(/<img[^>]+>/g, function( image ) {
128 var match, moretext = '';
130 if ( image.indexOf( 'data-wp-more="more"' ) !== -1 ) {
131 if ( match = image.match( /data-wp-more-text="([^"]+)"/ ) ) {
135 image = '<!--more' + moretext + '-->';
136 } else if ( image.indexOf( 'data-wp-more="nextpage"' ) !== -1 ) {
137 image = '<!--nextpage-->';
145 // Display the tag name instead of img in element path
146 editor.on( 'ResolveName', function( event ) {
149 if ( event.target.nodeName === 'IMG' && ( attr = editor.dom.getAttrib( event.target, 'data-wp-more' ) ) ) {
155 editor.addCommand( 'WP_More', function( tag ) {
156 var parent, html, title,
157 classname = 'wp-more-tag',
159 node = editor.selection.getNode();
162 classname += ' mce-wp-' + tag;
163 title = tag === 'more' ? 'Read more...' : 'Next page';
165 html = '<img src="' + tinymce.Env.transparentSrc + '" alt="" title="' + title + '" class="' + classname + '" ' +
166 'data-wp-more="' + tag + '" data-mce-resize="false" data-mce-placeholder="1" />';
169 if ( node.nodeName === 'BODY' || ( node.nodeName === 'P' && node.parentNode.nodeName === 'BODY' ) ) {
170 editor.insertContent( html );
174 // Get the top level parent node
175 parent = dom.getParent( node, function( found ) {
176 if ( found.parentNode && found.parentNode.nodeName === 'BODY' ) {
181 }, editor.getBody() );
184 if ( parent.nodeName === 'P' ) {
185 parent.appendChild( dom.create( 'p', null, html ).firstChild );
187 dom.insertAfter( dom.create( 'p', null, html ), parent );
190 editor.nodeChanged();
194 editor.addCommand( 'WP_Code', function() {
195 editor.formatter.toggle('code');
198 editor.addCommand( 'WP_Page', function() {
199 editor.execCommand( 'WP_More', 'nextpage' );
202 editor.addCommand( 'WP_Help', function() {
203 var access = tinymce.Env.mac ? __( 'Ctrl + Alt + letter:' ) : __( 'Shift + Alt + letter:' ),
204 meta = tinymce.Env.mac ? __( 'Cmd + letter:' ) : __( 'Ctrl + letter:' ),
207 header, html, dialog, $wrap;
210 { c: 'Copy', x: 'Cut' },
211 { v: 'Paste', a: 'Select all' },
212 { z: 'Undo', y: 'Redo' },
213 { b: 'Bold', i: 'Italic' },
214 { u: 'Underline', k: 'Insert/edit link' }
216 table1.push( tr( row ) );
220 { 1: 'Heading 1', 2: 'Heading 2' },
221 { 3: 'Heading 3', 4: 'Heading 4' },
222 { 5: 'Heading 5', 6: 'Heading 6' },
223 { l: 'Align left', c: 'Align center' },
224 { r: 'Align right', j: 'Justify' },
225 { d: 'Strikethrough', q: 'Blockquote' },
226 { u: 'Bullet list', o: 'Numbered list' },
227 { a: 'Insert/edit link', s: 'Remove link' },
228 { m: 'Insert/edit image', t: 'Insert Read More tag' },
229 { h: 'Keyboard Shortcuts', x: 'Code' },
230 { p: 'Insert Page Break tag', w: 'Distraction-free writing mode' }
232 table2.push( tr( row ) );
238 each( row, function( text, key ) {
240 out += '<td></td><td></td>';
242 out += '<td><kbd>' + key + '</kbd></td><td>' + __( text ) + '</td>';
246 return out + '</tr>';
249 header = [ __( 'Letter' ), __( 'Action' ), __( 'Letter' ), __( 'Action' ) ];
250 header = '<tr><th>' + header.join( '</th><th>' ) + '</th></tr>';
252 html = '<div class="wp-editor-help">';
254 // Main section, default and additional shortcuts
256 '<h2>' + __( 'Default shortcuts,' ) + ' ' + meta + '</h2>' +
257 '<table class="wp-help-th-center">' +
261 '<h2>' + __( 'Additional shortcuts,' ) + ' ' + access + '</h2>' +
262 '<table class="wp-help-th-center">' +
267 if ( editor.plugins.wptextpattern ) {
268 // Text pattern section
270 '<h2>' + __( 'When starting a new paragraph with one of these formatting shortcuts followed by a space, the formatting will be applied automatically. Press Backspace or Escape to undo.' ) + '</h2>' +
272 tr({ '*': 'Bullet list' }) +
273 tr({ '-': 'Bullet list' }) +
274 tr({ '1.': 'Numbered list' }) +
275 tr({ '1)': 'Numbered list' }) +
279 '<h2>' + __( 'The following formatting shortcuts are replaced when pressing Enter. Press Escape or the Undo button to undo.' ) + '</h2>' +
281 tr({ '>': 'Blockquote' }) +
282 tr({ '##': 'Heading 2' }) +
283 tr({ '###': 'Heading 3' }) +
284 tr({ '####': 'Heading 4' }) +
285 tr({ '#####': 'Heading 5' }) +
286 tr({ '######': 'Heading 6' }) +
290 // Focus management section
292 '<h2>' + __( 'Focus shortcuts:' ) + '</h2>' +
294 tr({ 'Alt + F8': 'Inline toolbar (when an image, link or preview is selected)' }) +
295 tr({ 'Alt + F9': 'Editor menu (when enabled)' }) +
296 tr({ 'Alt + F10': 'Editor toolbar' }) +
297 tr({ 'Alt + F11': 'Elements path' }) +
299 '<p>' + __( '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.' ) + '</p>';
303 dialog = editor.windowManager.open( {
304 title: 'Keyboard Shortcuts',
317 dialog.$el.find( 'div[role="application"]' ).attr( 'role', 'document' );
318 $wrap = dialog.$el.find( '.mce-wp-help' );
321 $wrap.attr( 'tabindex', '0' );
323 $wrap.on( 'keydown', function( event ) {
324 // Prevent use of: page up, page down, end, home, left arrow, up arrow, right arrow, down arrow
325 // in the dialog keydown handler.
326 if ( event.keyCode >= 33 && event.keyCode <= 40 ) {
327 event.stopPropagation();
334 editor.addCommand( 'WP_Medialib', function() {
335 if ( wp && wp.media && wp.media.editor ) {
336 wp.media.editor.open( editor.id );
341 editor.addButton( 'wp_more', {
342 tooltip: 'Insert Read More tag',
343 onclick: function() {
344 editor.execCommand( 'WP_More', 'more' );
348 editor.addButton( 'wp_page', {
349 tooltip: 'Page break',
350 onclick: function() {
351 editor.execCommand( 'WP_More', 'nextpage' );
355 editor.addButton( 'wp_help', {
356 tooltip: 'Keyboard Shortcuts',
360 editor.addButton( 'wp_code', {
363 stateSelector: 'code'
368 if ( wp && wp.media && wp.media.editor ) {
369 editor.addMenuItem( 'add_media', {
371 icon: 'wp-media-library',
377 // Insert "Read More..."
378 editor.addMenuItem( 'wp_more', {
379 text: 'Insert Read More tag',
382 onclick: function() {
383 editor.execCommand( 'WP_More', 'more' );
387 // Insert "Next Page"
388 editor.addMenuItem( 'wp_page', {
392 onclick: function() {
393 editor.execCommand( 'WP_More', 'nextpage' );
397 editor.on( 'BeforeExecCommand', function(e) {
398 if ( tinymce.Env.webkit && ( e.command === 'InsertUnorderedList' || e.command === 'InsertOrderedList' ) ) {
400 style = editor.dom.create( 'style', {'type': 'text/css'},
401 '#tinymce,#tinymce span,#tinymce li,#tinymce li>span,#tinymce p,#tinymce p>span{font:medium sans-serif;color:#000;line-height:normal;}');
404 editor.getDoc().head.appendChild( style );
408 editor.on( 'ExecCommand', function( e ) {
409 if ( tinymce.Env.webkit && style &&
410 ( 'InsertUnorderedList' === e.command || 'InsertOrderedList' === e.command ) ) {
412 editor.dom.remove( style );
416 editor.on( 'init', function() {
417 var env = tinymce.Env,
418 bodyClass = ['mceContentBody'], // back-compat for themes that use this in editor-style.css...
419 doc = editor.getDoc(),
423 dom.addClass( doc.documentElement, 'ios' );
426 if ( editor.getParam( 'directionality' ) === 'rtl' ) {
427 bodyClass.push('rtl');
428 dom.setAttrib( doc.documentElement, 'dir', 'rtl' );
431 dom.setAttrib( doc.documentElement, 'lang', editor.getParam( 'wp_lang_attr' ) );
434 if ( parseInt( env.ie, 10 ) === 9 ) {
435 bodyClass.push('ie9');
436 } else if ( parseInt( env.ie, 10 ) === 8 ) {
437 bodyClass.push('ie8');
438 } else if ( env.ie < 8 ) {
439 bodyClass.push('ie7');
441 } else if ( env.webkit ) {
442 bodyClass.push('webkit');
445 bodyClass.push('wp-editor');
447 each( bodyClass, function( cls ) {
449 dom.addClass( doc.body, cls );
453 // Remove invalid parent paragraphs when inserting HTML
454 editor.on( 'BeforeSetContent', function( event ) {
455 if ( event.content ) {
456 event.content = event.content.replace( /<p>\s*<(p|div|ul|ol|dl|table|blockquote|h[1-6]|fieldset|pre)( [^>]*)?>/gi, '<$1$2>' )
457 .replace( /<\/(p|div|ul|ol|dl|table|blockquote|h[1-6]|fieldset|pre)>\s*<\/p>/gi, '</$1>' );
462 $( document ).triggerHandler( 'tinymce-editor-init', [editor] );
465 if ( window.tinyMCEPreInit && window.tinyMCEPreInit.dragDropUpload ) {
466 dom.bind( doc, 'dragstart dragend dragover drop', function( event ) {
468 // Trigger the jQuery handlers.
469 $( document ).trigger( new $.Event( event ) );
474 if ( editor.getParam( 'wp_paste_filters', true ) ) {
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 ) {
481 // Remove all inline styles
482 event.content = event.content.replace( /(<[^>]+) style="[^"]*"([^>]*>)/gi, '$1$2' );
484 // Put back the internal styles
485 event.content = event.content.replace(/(<[^>]+) data-mce-style=([^>]+>)/gi, '$1 style=$2' );
489 editor.on( 'PastePostProcess', function( event ) {
490 // Remove empty paragraphs
491 each( dom.select( 'p', event.node ), function( node ) {
492 if ( dom.isEmpty( node ) ) {
500 editor.on( 'SaveContent', function( event ) {
501 // If editor is hidden, we just want the textarea's value to be saved
502 if ( ! editor.inline && editor.isHidden() ) {
503 event.content = event.element.value;
507 // Keep empty paragraphs :(
508 event.content = event.content.replace( /<p>(?:<br ?\/?>|\u00a0|\uFEFF| )*<\/p>/g, '<p> </p>' );
511 event.content = wp.editor.removep( event.content );
515 editor.on( 'preInit', function() {
516 var validElementsSetting = '@[id|accesskey|class|dir|lang|style|tabindex|' +
517 'title|contenteditable|draggable|dropzone|hidden|spellcheck|translate],' + // Global attributes.
518 'i,' + // Don't replace <i> with <em> and <b> with <strong> and don't remove them when empty.
520 'script[src|async|defer|type|charset|crossorigin|integrity]'; // Add support for <script>.
522 editor.schema.addValidElements( validElementsSetting );
524 if ( tinymce.Env.iOS ) {
525 editor.settings.height = 300;
534 u: 'InsertUnorderedList',
535 o: 'InsertOrderedList',
544 }, function( command, key ) {
545 editor.shortcuts.add( 'access+' + key, '', command );
548 editor.addShortcut( 'meta+s', '', function() {
549 if ( wp && wp.autosave ) {
550 wp.autosave.server.triggerSave();
556 * Experimental: create a floating toolbar.
557 * This functionality will change in the next releases. Not recommended for use by plugins.
559 editor.on( 'preinit', function() {
560 var Factory = tinymce.ui.Factory,
561 settings = editor.settings,
565 container = editor.getContainer(),
566 wpAdminbar = document.getElementById( 'wpadminbar' ),
567 mceIframe = document.getElementById( editor.id + '_ifr' ),
573 mceToolbar = tinymce.$( '.mce-toolbar-grp', container )[0];
574 mceStatusbar = tinymce.$( '.mce-statusbar', container )[0];
577 if ( editor.id === 'content' ) {
578 wpStatusbar = document.getElementById( 'post-status-info' );
581 function create( buttons, bottom ) {
586 each( buttons, function( item ) {
589 function bindSelectorChanged() {
590 var selection = editor.selection;
592 if ( itemName === 'bullist' ) {
593 selection.selectorChanged( 'ul > li', function( state, args ) {
594 var i = args.parents.length,
598 nodeName = args.parents[ i ].nodeName;
600 if ( nodeName === 'OL' || nodeName == 'UL' ) {
605 item.active( state && nodeName === 'UL' );
609 if ( itemName === 'numlist' ) {
610 selection.selectorChanged( 'ol > li', function( state, args ) {
611 var i = args.parents.length,
615 nodeName = args.parents[ i ].nodeName;
617 if ( nodeName === 'OL' || nodeName === 'UL' ) {
622 item.active( state && nodeName === 'OL' );
626 if ( item.settings.stateSelector ) {
627 selection.selectorChanged( item.settings.stateSelector, function( state ) {
628 item.active( state );
632 if ( item.settings.disabledStateSelector ) {
633 selection.selectorChanged( item.settings.disabledStateSelector, function( state ) {
634 item.disabled( state );
639 if ( item === '|' ) {
642 if ( Factory.has( item ) ) {
647 if ( settings.toolbar_items_size ) {
648 item.size = settings.toolbar_items_size;
651 toolbarItems.push( item );
655 if ( ! buttonGroup ) {
661 toolbarItems.push( buttonGroup );
664 if ( editor.buttons[ item ] ) {
666 item = editor.buttons[ itemName ];
668 if ( typeof item === 'function' ) {
672 item.type = item.type || 'button';
674 if ( settings.toolbar_items_size ) {
675 item.size = settings.toolbar_items_size;
678 item = Factory.create( item );
680 buttonGroup.items.push( item );
682 if ( editor.initialized ) {
683 bindSelectorChanged();
685 editor.on( 'init', bindSelectorChanged );
692 toolbar = Factory.create( {
695 classes: 'toolbar-grp inline-toolbar-grp',
705 toolbar.bottom = bottom;
707 function reposition() {
708 if ( ! currentSelection ) {
712 var scrollX = window.pageXOffset || document.documentElement.scrollLeft,
713 scrollY = window.pageYOffset || document.documentElement.scrollTop,
714 windowWidth = window.innerWidth,
715 windowHeight = window.innerHeight,
716 iframeRect = mceIframe ? mceIframe.getBoundingClientRect() : {
719 bottom: windowHeight,
724 toolbar = this.getEl(),
725 toolbarWidth = toolbar.offsetWidth,
726 toolbarHeight = toolbar.offsetHeight,
727 selection = currentSelection.getBoundingClientRect(),
728 selectionMiddle = ( selection.left + selection.right ) / 2,
731 spaceNeeded = toolbarHeight + margin + buffer,
732 wpAdminbarBottom = wpAdminbar ? wpAdminbar.getBoundingClientRect().bottom : 0,
733 mceToolbarBottom = mceToolbar ? mceToolbar.getBoundingClientRect().bottom : 0,
734 mceStatusbarTop = mceStatusbar ? windowHeight - mceStatusbar.getBoundingClientRect().top : 0,
735 wpStatusbarTop = wpStatusbar ? windowHeight - wpStatusbar.getBoundingClientRect().top : 0,
736 blockedTop = Math.max( 0, wpAdminbarBottom, mceToolbarBottom, iframeRect.top ),
737 blockedBottom = Math.max( 0, mceStatusbarTop, wpStatusbarTop, windowHeight - iframeRect.bottom ),
738 spaceTop = selection.top + iframeRect.top - blockedTop,
739 spaceBottom = windowHeight - iframeRect.top - selection.bottom - blockedBottom,
740 editorHeight = windowHeight - blockedTop - blockedBottom,
746 if ( spaceTop >= editorHeight || spaceBottom >= editorHeight ) {
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;
757 if ( spaceBottom >= spaceNeeded ) {
758 className = ' mce-arrow-up';
759 top = selection.bottom + iframeRect.top + scrollY - iosOffsetBottom;
760 } else if ( spaceTop >= spaceNeeded ) {
761 className = ' mce-arrow-down';
762 top = selection.top + iframeRect.top + scrollY - toolbarHeight - margin + iosOffsetTop;
765 if ( spaceTop >= spaceNeeded ) {
766 className = ' mce-arrow-down';
767 top = selection.top + iframeRect.top + scrollY - toolbarHeight - margin + iosOffsetTop;
768 } else if ( spaceBottom >= spaceNeeded && editorHeight / 2 > selection.bottom + iframeRect.top - blockedTop ) {
769 className = ' mce-arrow-up';
770 top = selection.bottom + iframeRect.top + scrollY - iosOffsetBottom;
774 if ( typeof top === 'undefined' ) {
775 top = scrollY + blockedTop + buffer + iosOffsetBottom;
778 left = selectionMiddle - toolbarWidth / 2 + iframeRect.left + scrollX;
780 if ( selection.left < 0 || selection.right > iframeRect.width ) {
781 left = iframeRect.left + scrollX + ( iframeRect.width - toolbarWidth ) / 2;
782 } else if ( toolbarWidth >= windowWidth ) {
783 className += ' mce-arrow-full';
785 } else if ( ( left < 0 && selection.left + toolbarWidth > windowWidth ) || ( left + toolbarWidth > windowWidth && selection.right - toolbarWidth < 0 ) ) {
786 left = ( windowWidth - toolbarWidth ) / 2;
787 } else if ( left < iframeRect.left + scrollX ) {
788 className += ' mce-arrow-left';
789 left = selection.left + iframeRect.left + scrollX;
790 } else if ( left + toolbarWidth > iframeRect.width + iframeRect.left + scrollX ) {
791 className += ' mce-arrow-right';
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, '' );
800 toolbar.className = toolbar.className.replace( / ?mce-arrow-[\w]+/g, '' ) + className;
802 DOM.setStyles( toolbar, {
810 toolbar.on( 'show', function() {
814 toolbar.on( 'keydown', function( event ) {
815 if ( event.keyCode === 27 ) {
821 editor.on( 'remove', function() {
825 toolbar.reposition = reposition;
826 toolbar.hide().renderTo( document.body );
831 editor.shortcuts.add( 'alt+119', '', function() {
834 if ( activeToolbar ) {
835 node = activeToolbar.find( 'toolbar' )[0];
836 node && node.focus( true );
840 editor.on( 'nodechange', function( event ) {
841 var collapsed = editor.selection.isCollapsed();
844 element: event.element,
845 parents: event.parents,
849 editor.fire( 'wptoolbar', args );
851 currentSelection = args.selection || args.element;
853 if ( activeToolbar ) {
854 activeToolbar.hide();
857 if ( args.toolbar ) {
858 activeToolbar = args.toolbar;
859 activeToolbar.show();
861 activeToolbar = false;
865 editor.on( 'focus', function() {
866 if ( activeToolbar ) {
867 activeToolbar.show();
871 function hide( event ) {
872 if ( activeToolbar ) {
873 activeToolbar.hide();
875 if ( event.type === 'hide' ) {
876 activeToolbar = false;
877 } else if ( event.type === 'resize' || event.type === 'scroll' ) {
878 clearTimeout( timeout );
880 timeout = setTimeout( function() {
881 if ( activeToolbar && typeof activeToolbar.show === 'function' ) {
882 activeToolbar.show();
889 DOM.bind( window, 'resize scroll', hide );
890 editor.dom.bind( editor.getWin(), 'resize scroll', hide );
892 editor.on( 'remove', function() {
893 DOM.unbind( window, 'resize scroll', hide );
894 editor.dom.unbind( editor.getWin(), 'resize scroll', hide );
897 editor.on( 'blur hide', hide );
899 editor.wp = editor.wp || {};
900 editor.wp._createToolbar = create;
905 // Expose some functions (back-compat)
914 }( window.tinymce ));