I use smileys in a comment form inside a panel. The id of the textarea in my case is edit-comment-2 or edit-comment-3 and not anymore just edit-comment. To allow other textarea id's I introduced a settings field to add more id's. I also changed the javascript var textareaIDs to Drupal.settings.smileys.textarea_ids and set this js setting together with the other js settings in _smileys_add_files().

Even better would be to enable wildcards like edit-comment*, but at the moment this solution is sufficient for my usecases.

For the patch see next comment.

Comments

osopolar’s picture

Status: Active » Needs review
StatusFileSize
new3.8 KB
osopolar’s picture

StatusFileSize
new3.82 KB

Fixed: remove \r and other whitespaces from with "\n"exploded textarea ids.

osopolar’s picture

StatusFileSize
new4.4 KB

There are two little more issues with smileys. In function _smileys_add_files() exists the variable $files_added. I think this was added to add the css/js only once. But fore this need $files_added needs to be set to TRUE;

Another little issue is, that a behavior will be called more than once for a page if there are ajax calls in the page. Therefore the class smileysProcessed needs to be added if the more link was attached in Drupal.behaviors.smileysAutoAttach.

I know that these little issues are not related to this issue. But due the little time I have currently I'm not able to create a patch against a clear version. Anyway I hope this will be useful.