Ticket #31571: 31571.2.patch
File 31571.2.patch, 1.6 KB (added by , 10 years ago) |
---|
-
src/wp-includes/js/tinymce/plugins/wpeditimage/plugin.js
1220 1220 } 1221 1221 }); 1222 1222 1223 editor.on( 'beforeexeccommand', function( event ) { 1224 if ( isPlaceholder( editor.selection.getNode() ) ) { 1225 event.preventDefault(); 1226 } 1227 } ); 1228 1223 1229 return { 1224 1230 _do_shcode: parseShortcode, 1225 1231 _get_shcode: getShortcode -
src/wp-includes/js/tinymce/plugins/wplink/plugin.js
1 1 /* global tinymce */ 2 2 tinymce.PluginManager.add( 'wplink', function( editor ) { 3 3 var linkButton; 4 4 5 5 // Register a command so that it can be invoked by using tinyMCE.activeEditor.execCommand( 'WP_Link' ); 6 6 editor.addCommand( 'WP_Link', function() { 7 7 if ( ( ! linkButton || ! linkButton.disabled() ) && typeof window.wpLink !== 'undefined' ) { … … 60 60 context: 'insert', 61 61 prependToContext: true 62 62 }); 63 64 editor.on( 'pastepreprocess', function( event ) { 65 var content = event.content; 66 67 if ( ! editor.selection.isCollapsed() ) { 68 content = content.replace( /<[^>]+>/g, '' ); 69 content = tinymce.trim( content ); 70 71 if ( /^https?:\/\/\S+$/i.test( content ) ) { 72 editor.execCommand( 'mceInsertLink', false, { 73 href: editor.dom.decode( content ) 74 } ); 75 76 event.preventDefault(); 77 } 78 } 79 } ); 63 80 });