WordPress.org

Ready to get started?Download WordPress

Forums

Download Monitor
[resolved] Upload not working, (Insert Into post) not working (4 posts)

  1. hjgode
    Member
    Posted 1 year ago #

    after selecting a new file in upload dialog nothing is uploaded but Insert dialog appears and then InsertInot post is not working.

    http://wordpress.org/extend/plugins/download-monitor/

  2. hjgode
    Member
    Posted 1 year ago #

    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.

  3. nowton
    Member
    Posted 1 year ago #

    Which file did you adapt?

  4. nowton
    Member
    Posted 1 year ago #

    uploader.php. Thanks, that worked.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic