if using other editors like tinymce or similar, it would be nice to have the option to add quicktags only to comments.

it's an easy fix, a appended the patch.

CommentFileSizeAuthor
quicktags_3.patch856 bytessuit4

Comments

ursus@drupal.ru’s picture

I've patched quicktags.module and after I've selected Comments only option, quicktags buttons neither shows in node/add/* no above commets textarea :(

suit4’s picture

hmm, did you use the latest release of quicktags?

I only testet this on Drupal 5.2 and it works nice for me.

ursus@drupal.ru’s picture

hmm...
can you share your patched quicktags.module file? :)

ursus@drupal.ru’s picture

sorry, patch is really working.
but I see quicktags buttons only when address is like comment/reply/*

suit4’s picture

do you use quicktags on custom nodes, like cck nodes?
It might be possible, that quicktags is not working currently qith custom nodes...

suit4’s picture

... the check works like this in the pathced quicktags.module

function quicktags_show_quicktags() {
  if (user_access('use quicktags')) {
    switch (variable_get('quicktags_show', 0)) {
      case 0:
        return TRUE;
        break;
      case 1:
        if (arg(0) == 'node' && (arg(1) == 'add' || arg(2) == 'edit')) {
          return TRUE;
        }
        break;
      case 2:
        if (arg(0) == 'node' || arg(0) == 'comment') {
          return TRUE;
        }
        break;
      case 3:
        if (arg(0) == 'comment') {
          return TRUE;
        }
        break;        
      default:
        return FALSE;
    }
  }
  else {
    return FALSE;
  }
}

case 3 is your check: if the first argument is not comment, it will return false.

How is the name of your url? http://yourdomain.org/yourcustomnode/comment ?
Than this check WILL fail, because arg(0) is not comment, but yourcustomnode.

Try to chankge that check to

...
      case 3:
        if (arg(0) == 'comment' || arg(1) == 'comment' || arg(2) == 'comment') { // adjust for your needs
          return TRUE;
        }
        break; 
...

maybe that helps.