WordPress.org

Support

Support » Plugins and Hacks » Download Monitor » [Resolved] Upload not working, (Insert Into post) not working

[Resolved] Upload not working, (Insert Into post) not working

Viewing 3 replies - 1 through 3 (of 3 total)
  • 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.

    Which file did you adapt?

    uploader.php. Thanks, that worked.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Resolved] Upload not working, (Insert Into post) not working’ is closed to new replies.
Skip to toolbar