Changeset 31691
- Timestamp:
- 03/09/2015 07:59:14 PM (10 years ago)
- Location:
- trunk/src/wp-includes/js/tinymce/plugins
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/js/tinymce/plugins/wpeditimage/plugin.js
r31362 r31691 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, -
trunk/src/wp-includes/js/tinymce/plugins/wplink/plugin.js
r29183 r31691 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() { … … 61 61 prependToContext: true 62 62 }); 63 64 editor.on( 'pastepreprocess', function( event ) { 65 var pastedStr = event.content; 66 67 if ( ! editor.selection.isCollapsed() ) { 68 pastedStr = pastedStr.replace( /<[^>]+>/g, '' ); 69 pastedStr = tinymce.trim( pastedStr ); 70 71 if ( /^(?:https?:)?\/\/\S+$/i.test( pastedStr ) ) { 72 editor.execCommand( 'mceInsertLink', false, { 73 href: editor.dom.decode( pastedStr ) 74 } ); 75 76 event.preventDefault(); 77 } 78 } 79 } ); 63 80 });
Note: See TracChangeset
for help on using the changeset viewer.