Hi
I found the fix myself:
Original code:
jQuery('#insertdownload').click(function(){
var win = window.dialogArguments || opener || parent || top;
var closed = jQuery('#format option:selected').data('closed');
var content = '';
if (closed) {
var title = jQuery(this).data('title');
content = title == '' ? "<?php _e( 'Replace me with your own content', 'wp-download_monitor' ) ?>" : title;
}
closed = closed ? '<span id="caret_pos_holder">' + content + '</span>[/download]' : '';
if (jQuery('#format').val()>0) win.send_to_editor('<?php echo $html; ?> format="' + jQuery('#format').val() + '"]' + closed);
else win.send_to_editor('<?php echo $html; ?>]' + closed);
if (closed != '') {
var ed = win.tinyMCE.activeEditor;
var caret = ed.dom.select('span#caret_pos_holder')[0];
ed.dom.setAttrib(caret, 'id', '')
ed.selection.select(caret);
// ed.dom.remove(caret);
});
}
new code:
jQuery('#insertdownload').click(function(){
var win = window.dialogArguments || opener || parent || top;
var closed = jQuery('#format option:selected').data('closed');
var content = '';
if (closed) {
var title = jQuery(this).data('title');
content = title == '' ? "<?php _e( 'Replace me with your own content', 'wp-download_monitor' ) ?>" : title;
}
closed = closed ? '<span id="caret_pos_holder">' + content + '</span>[/download]' : '';
if (jQuery('#format').val()>0)
win.send_to_editor('<?php echo $html; ?> format="' + jQuery('#format').val() + '"]' + closed);
else
win.send_to_editor('<?php echo $html; ?>]' + closed);
if (closed != '') {
var ed = win.tinyMCE.activeEditor;
//set caret to end of insert
var caret = ed.dom.select('span#caret_pos_holder')[0];
ed.dom.setAttrib(caret, 'id', '');
ed.selection.select(caret);
// ed.dom.remove(caret);
}
});
The last two line have been exchanged.