I'm interessed to have Quotes working with ajax_comments, I'm too busy so if someone want to do this little job I can sponsor for it :)

Comments

Asome’s picture

ok I have now ajax_comments with quote support, I can quote with ajax and also quote "selected text"

Just need to finish it and found the time to commit :)

playfulwolf’s picture

ready to be betatester :)

p.s. cannot use git, so when zip file is ready?

Asome’s picture

almost ready, tonite or tomorrow I will commit it

mermemladeK’s picture

Hello
Any news in this regard?
Thank you for the great module.

playfulwolf’s picture

Asome, still no news?

muschpusch’s picture

Priority: Major » Normal

i'm setting this to normal. Asome could you provide a patch?

muschpusch’s picture

Status: Active » Closed (won't fix)

no feedback... closing this!

luco’s picture

Issue summary: View changes
Status: Closed (won't fix) » Patch (to be ported)
StatusFileSize
new1.01 KB

reopening because... here's a patch!

it's basic functionality: once applied, this patch will cause all replies to include the original comment surrounded by <blockquote> tags.

please test.

if you like this patch, I'll add the needed granularity: checkboxes in the settings form to control quote support on a per- content type basis.

cheers,
Luciano

formatC&#039;vt’s picture

Status: Patch (to be ported) » Needs review

What about Markdown and other text markups?

nickonom’s picture

Status: Needs review » Needs work

Patch in #8 does nothing with regard to making Ajax Comment compatible with Quote. It just adds unnecessary tags.

happyblitz’s picture

StatusFileSize
new8.55 KB

I wanted to use both modules on my site, so i add changes in ajax_comment module.
It works for me.

If anyone want to apply patch and test it, tern off and then tern on ajax_comment module because i add a path in hook_menu.

nickonom’s picture

happyblitz, thanks. works nice!

nickonom’s picture

happyblitz, after some testing I found out it works only for comments. With the "Display the quote link for nodes" setting on /admin/config/content/quote checked on and using the following command in node.tpl.php file:

print render($content['links']);

it outputs something like:

<ul class="links inline"><li class="quote quote first last"><a href="/comment/reply/23?quote=1#comment-form" title="Quote this post in your reply.">Quote</a></li>
</ul>

and this doesn't work with ajax, while for comments it outputs:

<ul class="links inline"><li class="quote quote first last"><a href="/comment/reply/23/64?quote=1#comment-form" title="Quote this post in your reply." class="use-ajax-comments ajax-comments-quote ajax-comments-quote-23-64 ajax-processed">quote</a></li>
</ul>

and this works very well for comments.

sgdev’s picture

Status: Needs work » Needs review
StatusFileSize
new9.65 KB

Have reworked this patch since it no longer cleanly applies to 7.x-1.x-dev.

Also found an issue where if a user replies to a comment and then immediately replies to another, the comment_body is populated with the content entered in the first comment. There is now some extra logic to clear the #default_value each time.

@nickonom, I understand your feedback, but I don't know how this module would be able to accomplish what you're seeking. All of the Ajax interactions that occur are done within the framework of comments. There are no Ajax wrappers connected to nodes. It is always going to redirect the node quote to a separate page.

If you wanted to accomplish something like that, it would need to be its own sub-module, or this module would need to be reworked to no longer be "Ajax Comments", but rather something like "Ajax Links" (fire Ajax functionality for any link attached to an entity, whether node, comment, etc.).

sgdev’s picture

StatusFileSize
new9.65 KB

Sorry, just noticed there was one format problem from the previous patch that got carried over. The attached version fixes it so the code follows Drupal standards. Thanks.

sgdev’s picture

Title: quote support » Quote module support
StatusFileSize
new11.16 KB

One additional update to the previous patch.

After further testing, I noticed a problem. If a reply comment is submitted, and then I immediately attempt to reply to another comment, the comment body has a default value of the previously submitted comment.

The reason for this problem is connected to how the Drupal Ajax framework functions. If an entire form is rebuilt after one has been closed, and drupal_html_id is being used to generate the form ID, it will have the same ID as the previous form. This causes the next instance of the form to pull the textarea value from cache rather than build cleanly.

There are only two ways to avoid this problem:

1) Selectively rebuild form fields when they need to be updated, rather than build the entire form.
2) Clear the textarea value after the new form is built.

The approach I've taken to fix this is #2. This should really be its own patch, but I've included it here because we don't want textarea cleared if it is a quote. There needs to be extra conditional logic to handle this case.

I'll also post this as a separate patch with the hope that it can get reviewed and committed, and if I need to re-create the Quote support patch with the extra logic, I can do that later.

Please review, thanks.

sgdev’s picture

Here is the separate patch that includes only the code to fix the textarea problem:
https://www.drupal.org/project/ajax_comments/issues/3020827

sgdev’s picture

StatusFileSize
new11.13 KB

As I mentioned here (https://www.drupal.org/project/ajax_comments/issues/3020827#comment-1289...), I forgot to remove one console.log I put in the JavaScript file during testing.

This new version removes that one extra line I had left in the code by accident.