2 function send_to_editor(h) { |
2 function send_to_editor(h) { |
3 var ed; |
3 var ed; |
4 |
4 |
5 if ( typeof tinyMCE != 'undefined' && ( ed = tinyMCE.activeEditor ) && !ed.isHidden() ) { |
5 if ( typeof tinyMCE != 'undefined' && ( ed = tinyMCE.activeEditor ) && !ed.isHidden() ) { |
6 ed.focus(); |
6 ed.focus(); |
7 if (tinymce.isIE) |
7 if ( tinymce.isIE ) |
8 ed.selection.moveToBookmark(tinymce.EditorManager.activeEditor.windowManager.bookmark); |
8 ed.selection.moveToBookmark(tinymce.EditorManager.activeEditor.windowManager.bookmark); |
9 |
9 |
10 if ( h.indexOf('[caption') === 0 ) { |
10 if ( h.indexOf('[caption') === 0 ) { |
11 if ( ed.plugins.wpeditimage ) |
11 if ( ed.plugins.wpeditimage ) |
12 h = ed.plugins.wpeditimage._do_shcode(h); |
12 h = ed.plugins.wpeditimage._do_shcode(h); |
13 } else if ( h.indexOf('[gallery') === 0 ) { |
13 } else if ( h.indexOf('[gallery') === 0 ) { |
14 if ( ed.plugins.wpgallery ) |
14 if ( ed.plugins.wpgallery ) |
15 h = ed.plugins.wpgallery._do_gallery(h); |
15 h = ed.plugins.wpgallery._do_gallery(h); |
|
16 } else if ( h.indexOf('[embed') === 0 ) { |
|
17 if ( ed.plugins.wordpress ) |
|
18 h = ed.plugins.wordpress._setEmbed(h); |
16 } |
19 } |
17 |
20 |
18 ed.execCommand('mceInsertContent', false, h); |
21 ed.execCommand('mceInsertContent', false, h); |
19 |
22 |
20 } else if ( typeof edInsertContent == 'function' ) { |
23 } else if ( typeof edInsertContent == 'function' ) { |