if (tinymce.isIE)
ed.selection.moveToBookmark(tinymce.EditorManager.activeEditor.windowManager.bookmark);
- if ( h.indexOf('[caption') != -1 )
- h = ed.plugins.wpeditimage._do_shcode(h);
-
+ if ( h.indexOf('[caption') === 0 ) {
+ if ( ed.plugins.wpeditimage )
+ h = ed.plugins.wpeditimage._do_shcode(h);
+ } else if ( h.indexOf('[gallery') === 0 ) {
+ if ( ed.plugins.wpgallery )
+ h = ed.plugins.wpgallery._do_gallery(h);
+ }
+
ed.execCommand('mceInsertContent', false, h);
- } else
+
+ } else if ( typeof edInsertContent == 'function' ) {
edInsertContent(edCanvas, h);
+ } else {
+ jQuery( edCanvas ).val( jQuery( edCanvas ).val() + h );
+ }
tb_remove();
}
$(this).attr( 'href', href + '&width=' + ( W - 80 ) + '&height=' + ( H - 85 ) );
});
};
-
+
jQuery('a.thickbox').click(function(){
if ( typeof tinyMCE != 'undefined' && tinyMCE.activeEditor ) {
tinyMCE.get('content').focus();