Ticket #31901: 31901.patch
File 31901.patch, 1.7 KB (added by , 10 years ago) |
---|
-
src/wp-includes/js/tinymce/plugins/wpemoji/plugin.js
1 ( function( tinymce, wp , twemoji) {1 ( function( tinymce, wp ) { 2 2 tinymce.PluginManager.add( 'wpemoji', function( editor ) { 3 3 var typing, 4 4 env = tinymce.Env, … … 39 39 function parseNode( node ) { 40 40 var selection, bookmark; 41 41 42 if ( node && twemoji.test( node.textContent || node.innerText ) ) {42 if ( node && window.twemoji && window.twemoji.test( node.textContent || node.innerText ) ) { 43 43 if ( env.webkit ) { 44 44 selection = editor.selection; 45 45 bookmark = selection.getBookmark(); … … 83 83 var selection = editor.selection, 84 84 node = selection.getNode(); 85 85 86 if ( twemoji.test( node.textContent || node.innerText ) ) {86 if ( window.twemoji && window.twemoji.test( node.textContent || node.innerText ) ) { 87 87 replaceEmoji( node ); 88 88 89 89 // In IE all content in the editor is left selected after wp.emoji.parse()... … … 96 96 97 97 // Convert Twemoji compatible pasted emoji replacement images into our format. 98 98 editor.on( 'PastePostProcess', function( event ) { 99 if ( twemoji ) {99 if ( window.twemoji ) { 100 100 tinymce.each( editor.dom.$( 'img.emoji', event.node ), function( image ) { 101 if ( image.alt && twemoji.test( image.alt ) ) {101 if ( image.alt && window.twemoji.test( image.alt ) ) { 102 102 setImgAttr( image ); 103 103 } 104 104 }); … … 125 125 } 126 126 } ); 127 127 } ); 128 } )( window.tinymce, window.wp , window.twemoji);128 } )( window.tinymce, window.wp );