This is a placeholder issue for a Drupal 7 port of the module. I have no plans at the moment to initiate the port, but if anyone else starts on it please post feedback and code to this issue. Thanks.

Comments

dgastudio’s picture

subscribe

David Latapie’s picture

subscribe too

Nick Robillard’s picture

subscribe

chriz001’s picture

subscribing

v.zhakov’s picture

subscribe

zarudnyi’s picture

Subscribe

denisanokhin’s picture

Subscribe

endrus’s picture

Subscribe

matt.robinson1’s picture

subscribe

endrus’s picture

Examiner.com runs D7 and it has ajaxified comments, similar to what this module does. Makes me wonder whether the module was already ported but the code was not shared. Or maybe there's some other solution for D7 available?

dgastudio’s picture

i didn't see any ajax in examiner.com

for example:

http://www.examiner.com/beatles-in-national/paul-mccartney-says-he-went-...

Anonymous’s picture

Hi all the best for all

It is an great module

I'm using D7 and i have audio playing... from my www.cameratanovnorte.eu ....

on sametime, and it is in private users, for avaliate each concert, the "submit" "stops" the music.

Subscribe

Best regards
ArchGalileu

www.gasparsantos.eu
www.quartetodouro.eu
www.cameratanovnorte.eu

damienmckenna’s picture

Subscribe.

damienmckenna’s picture

So, anyone have suggestions on how this would be done?

jwilson3’s picture

From just looking at the forms_api_reference.html, it looks like what was #ahah in D6, is now #ajax in D7.

Without looking at this module's D6 code at all, I'd venture to propose a really superficial guess to get things started:

* Implement a hook_form_alter (or the d7 equivalent) that adds in an #ajax attribute to the comment form submit button element.
* Create a custom callback function to handle form submissions from ajax (as opposed to the regular form submit). In D6 this might have been handled by a form_submit handler override), but now looks like you can just create your own callback -- MUCH cleaner -- me likey.
* Then create a couple special lines of js to handle / format what is returned in place. (This might be even possible without any additional coding in the submit button #ajax handler 'wrapper' and 'method' parameters. (See the example linked above in the fapi#ajax documentation).

something like:

// WARNING untested pseudo code...
function ajax_comments_form_comment_form_alter(&$form, ...) {
  $form['comment-form']['submit']['#ajax'] => array(
      'callback' => 'ajax_comments_submit_js',
      'wrapper' => 'comment-form',
      'method' => 'replace',
      'effect' => 'fade',
  );
}

function ajax_comments_submit_js($form, $form_state) {
  // programmatically submit the comment, and obtain the comment id.
  // load/render the comment (or error or whatever it is that happens).
  // return the rendered html.
}

This would be how to get started by /only/ ajaxifying the comment form submission. Not sure what else could be done with this, or what else the d6 module does itself that would need to be replicated using the new ajax d7 system.

acouch’s picture

I started to play with this and got the basic structure for how the new D7 ajax stuff would work. I created a sandbox since there is not a 7.x version here: http://drupal.org/sandbox/acouch/1137212

The goal would be to recreate the functionality in this module and get it committed to this module, though I started from scratch and am trying to work back.

I will probably have enough time next weekend to get this usable for folks as of right now it just does grabs the form submission and pastes it on the page as well as overrides the 'reply' link and offers the comment form under the reply link.

I haven't added the logic for placing the comments in the right place though that wouldn't take too much more work.

webankit’s picture

+1

olofbokedal’s picture

Subscribing

acouch’s picture

I've put some more work into this and have the base functionality working: http://drupal.org/sandbox/acouch/1137212

This is a little more light-weight implementation of the module as the ajax_command framework in D7 makes things easier.

I've included the ability for administrators to decide which content types to include. However this is a performance drain as it has to check for every comment view and use of the reply button. I'm not sure how to alleviate this (to not check _comment_view and comment_form_alter) for every comment especially for node types not selected to use this. It almost seems better to leave this off but would like to hear from users first.

I didn't include the blinking feature. D7 core comments are only oldest to newest (the option to reverse was removed) so the comment always appears where the form was. I've also added a message that shows that the comment was posted successfully.

I haven't gotten a chance to add the row count and reply row counts to the admin but will.

TODOs:

  • better checking for validation and errors
  • check if []threaded is selected before threading
  • make comment without threading or that used the bottom comment setting appear in a slightly better place
  • maybe add options for 'delete' and 'preview' using ajax?

Again my preference is to get this in this module so will contact the maintainer if one of them isn't listening already.

yugongtian’s picture

+++

acouch’s picture

Status: Active » Fixed

neochief was gracious enough to give me commit access to this project.

I've created a 7.x branch and committed my initial work.

Please open issues for this dev branch. It is working but needs more work to get to a stable release. Thanks.

rogical’s picture

+1

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.