Forums

[Plugin: @ Reply] Add support for WYSIWYG editors? (9 posts)

  1. Lakjin
    Member
    Posted 2 years ago #

    So recently I decided to add a WYSIWYG comment editor. So far I have found two (http://mk.netgenes.org/my-plugins/mcecomments/ and http://www.deanlee.cn/wordpress/fckeditor-for-wordpress-plugin/). The only problem is @reply doesn't work with them. Would it be possible to add support for WYSIWYG editors? If it helps, I would prefer MCEComments over FCKEditor.

    http://wordpress.org/extend/plugins/reply-to/

  2. Yus
    Member
    Posted 2 years ago #

    MCEComments provides an easy fix on the page you linked. It's for WP Grins but also works with @ Reply.

    Edit the at-reply.php file, search for:
    myField = document.getElementById('comment');
    and replace it with:

    myField = document.getElementById('comment');
    insertHTML('<span>'+inReplyTo+'</span>');
    return;

    And... it works. :)
    You can also remove everything that follows (because it's not needed anymore), up to :

    }
    }
    	//]]>
    </script>

    which you must leave that way.

  3. Lakjin
    Member
    Posted 2 years ago #

    Cool! Thanks!

    (Your plugin is awesome, btw.)

  4. Lakjin
    Member
    Posted 2 years ago #

    This is probably a noob question but, what part of the code do I leave in to make it so your window is focused on the reply box after you click reply? After I did everything you instructed above (including removing the extra code), the reply feature works just fine but the window is no longer automatically focused on the reply box.

  5. Yus
    Member
    Posted 2 years ago #

    Try with myField.focus(); just after insertHTML('<span>'+inReplyTo+'</span>');

  6. Lakjin
    Member
    Posted 2 years ago #

    I tried that already and just retried it again. Doesn't work.

    BTW Do I still need that first If else statement or can I remove it completely and put in the code you posted in your first post?

  7. Lakjin
    Member
    Posted 2 years ago #

    I also tried the plugin with just inserting the code to make it work with MCEComments and not deleting anything. The plugin works but the window is not re-focused.

  8. Yus
    Member
    Posted 2 years ago #

    Yes, you can also remove that if statement.
    I tried using a TinyMCE focus function but I don't know why it also fails. :\

    Anyway, this should do it :

    function yus_replyTo(commentID, author) {
    var inReplyTo = '@<a href="' + commentID + '">' + author + '<\/a>: ';
    insertHTML('<span>'+inReplyTo+'</span>');
    location='#comment_parent';
    }

    It's a bit dirtier than focus() but at least it works.

  9. Lakjin
    Member
    Posted 2 years ago #

    Iyus,

    Thank you! Now if only I can get a hold of the MCEComments author to see why the MCEComments box will only appear for admins on my website, all will be well.

    Again thanks for all your support. I am looking forward to being able to use @Reply and MCEComments together.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags