What i would like to see is a small piece of javascript in this module. When were on a topic, press the quick reply link, get send to the bottom of the page to the comment form. The form should be focused so we can directly start typing. This should only get focused when the user presses the quick reply link.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Michelle’s picture

I don't know javascript but I'd be happy to add this if someone can do a patch.

Michelle

Michsk’s picture

will do.

Michelle’s picture

Status: Active » Postponed (maintainer needs more info)

Are you still planning on doing this?

Michelle

Michsk’s picture

Yes, this week.

Michsk’s picture

will do this today.

Michsk’s picture

Here's the js

Drupal.behaviors.advForumFocus = function(context) {
  $('.topic-reply-allowed a:not(.checked)', context).addClass('checked').click(function(e){
    $('#edit-comment').focus();
	e.preventDefault();
    return false;
  });
};
Michelle’s picture

Status: Postponed (maintainer needs more info) » Needs review

Thanks, will have a look soon as i can.

Will changing advForumFocus to AdvancedForumFocus hurt anything? Pet peeve but I don't like that abbreviation and have removed it from the rest of the code.

Michelle

Michsk’s picture

that's no problem.

Michelle’s picture

I'm going to add this after alpha 4. Sorry for that but alpha 4 has been delayed for so long that I have to be strict at this point. Nothing that isn't a bug fix is going in until I get that release out, even if it's a ready to go patch. I can't risk introducing new bugs while I'm trying to clean up the remaining ones.

Michelle

mcdruid’s picture

I thought this was going to be a quick one, but it's not turned out to be...

AFAICS the existing js/advanced_forum.js file is entirely concerned with the collapsible containers functionality. It only gets added by the preprocess function for topic_lists and it's not obvious (to me at least) how behaviours for totally unrelated functionality like this could be added to it cleanly.

So, I've added a new file js/advanced_forum_node.js which gets added by the preprocess function for nodes (it would be too messy to start messing with the existing file / code to make the namespaces consistent, IMHO so I'm leaving all that as is).

I've added lasac's new Drupal behavior in this file. I had to modify it a little though in order to accommodate some of the different configurations that could be in place. i.e.

* don't do anything if the comment form is on a separate page (otherwise breaks the reply links)
* if comment subjects are enabled, focus the subject textfield rather than the comment textarea

I'm attaching this as a patch for further review rather than committing it straight away - feedback welcomed.

mcdruid’s picture

Status: Needs review » Fixed

I reviewed this again, and realised it needed to be adapted for nodecomment, where the ids in the form will be different.

It should now work with and without nodecomment.

Committed to 6.x-2.x branch.

Thanks for the original work lasac, and sorry it took so long to get in.

Michsk’s picture

No problem. Thanks for commiting.

I had more work with the theme for advanced forum, for which there is zero info about commiting or not. Maybe you could shine some light on that? Would be great to have it come standard with AF

Status: Fixed » Closed (fixed)

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