Making Ajax Edit Comments Compatible With Other Ajax Plugins

  

One of the many feature requests I have gotten for Ajax Edit Comments was to allow different Ajax-type plugins to be compatible. It works both ways to make a plugin compatible, so I coded in a hook that would allow other plugin authors to initialize the JavaScript code.

Within this post I will explain the hook, and give two examples of plugins that can be made compatible rather easily.

The Plugin Hook

With version 1.1, Ajax Edit Comments now has a JavaScript hook for other plugin authors to tap into. The JavaScript code to call the plugin is simple:


if (window.AjaxEditComments) {
   AjaxEditComments.init();
}

This code should allow the plugin to work with other AJAX-type comment plugins. All you are doing is initializing the plugin.

Ajax Comments

Find in the file “ajax-comments.php” line 97 where it reads:


new Insertion.Bottom(ol, request.responseText);

Add in this code right after that line:


if (window.AjaxEditComments) {
   AjaxEditComments.init();
}

Better Comments Manager

The Better Comments Manager (version 1.3) now has its own edit feature, so it isn’t necessary to make Ajax Edit Comments compatible for the time being.

jQuery Ajax Comments

A developmental version of this plugin and a spin-off of jQuery Ajax Comments have been made compatible. Please visit this jQuery Ajax Comments site for more details.

Conclusion

If any of you plugin authors out there have a fix for making your plugin compatible, please leave a comment and I’ll e-mail you and get the code and post it here. Thank you.


Other RA Project Articles



If you like this article, please consider signing up for RA Project Daily Updates via email or directly to the RA Project RSS Feed http://feeds.feedburner.com/RAproject. Thank you!






17 Comments on “Making Ajax Edit Comments Compatible With Other Ajax Plugins” - Add yours!

  1. Sorry, but where is the hook in plugin code?
    I don’t see it :(

  2. Iktomi,

    All you need to do is call the init function as described in the first part of the post. The actual ‘init’ function is in the ‘js-includes’ folder in ‘wp-ajax-edit-comments.js.php’.

  3. I made some changes to the original jQueryAJAX Comments so it ALWAYS works. There was just a small bug in the routine to find the proper url of a php file. If you like I could send you my changed Plugin and you could help to make it compatible with your plugin.
    I don’t use the plugin itself but used the code in my theme for my comments. I am not experienced enough to get it to work with your plugin either.

    Send me a mail and I will send you my chnaged Plugin in return.

  4. kretzschmar,

    Sent you an email. Let me know if you got it please.

  5. I already answered. Hope you can help. And AGAIN. You do a fantastic job and it is nice that you answered so quickly because I think there are plenty of users out there who like John Wranas Plugin a lot (like me).

  6. Oopse, I forgot to give the link to the Text Control plugin, which again is incompatible with Ajax Edit Comment: http://dev.wp-plugins.org/wiki/TextControl. My apology for the reiteration: I just want to know if it is ‘possible’ to make these two plugins compatible =?

    –Mint-Tree–

    Edit: arg…my first comment got flagged as potential spam =(

  7. Hi Ronald, thank you very much for your helpful hooks. I am running into a bit of an issue however. I am using the AJAX comment plugin located here: http://www.smullindesign.com/ (the site seems to be having issues now but maybe it’s just me).

    I did locate an ajax-comments.php file but could not find the line that you mentioned anywhere in the file. I tried putting your hook in a couple of places that I thought looked right but apparently they weren’t because every time I uploaded the file I would get error messages.

    Thanks again for all your help, hopefully we can figure out a fix for this comment plugin as well as I would really like to use your edit comment plugin.

    Thanks

  8. thanks. I searched this issues.

  9. i create a ajax script that brings the data from mysql table, but there is a problem that it disappear onmouseout.
    i want a tool which can hold it, and i want a close button to close the ajax result.

    PLZ………….help me, but remember i want complete solution,that will work on just a little bit editing.

  10. Interesting and communicative, but would make something more on this topic?

  11. Your web page does not correctly work in safari browser

  12. is it now work with all browser ? Any Update ?

Trackbacks/Pingbacks

  1. 让Ajax Comments与Ajax Edit Comments一起工作 at fireyy blog - 15. Jun, 2007

    [...] Edit Comments的作者Ronald Huereca今天发布了一个Plugin Hook,可以让Ajax Edit Comments 与 其他 Ajax Plugins 融洽工作。 [...]

  2. Digg Like Comment Editor For WordPress » Jeffro2pt0.com - 11. Jul, 2007

    [...] hook for other plugin authors to tap [...]

  3. AJAX Edit Comments (2. Fortsetzung) » Cowboy's Weblog - 19. Nov, 2007

    [...] behindert laut Ronald das Editieren nicht, und für “AJAX Comments” hat er eine Anleitung zum Patchen, damit es mit AJAX Edit Comments zusammen arbeitet. Aber zumindest bei mir klappt das nicht. Diese [...]

  4. Fix: Ajax Edit Comments und Unnamed Live Comments | marcO's_br4inh4ck - 17. Jan, 2008

    [...] von Ajax Edit Comments hat der Entwickler einen Hook bereitgestellt um dieses Problem (zwar etwas unelegant – aber egal) zu [...]

  5. 让Ajax Comments与Ajax Edit Comments一起工作 - ifireyy - 22. May, 2008

    [...] Edit Comments的作者Ronald Huereca今天发布了一个Plugin Hook,可以让Ajax Edit Comments 与 其他 Ajax Plugins [...]

Leave a comment

Please include your real name or nickname, along with your business name if you wish, in the "Name" box above. If you use only keywords in your name, a random name will be assigned to your comment.