Needs review
Project:
Smileys
Version:
master
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
16 Nov 2010 at 19:20 UTC
Updated:
25 Nov 2010 at 23:02 UTC
Jump to comment: Most recent file
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.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | smileys-973664-3.patch | 4.4 KB | osopolar |
| #2 | smileys-973664-2.patch | 3.82 KB | osopolar |
| #1 | smileys-973664-1.patch | 3.8 KB | osopolar |
Comments
Comment #1
osopolarComment #2
osopolarFixed: remove \r and other whitespaces from with "\n"exploded textarea ids.
Comment #3
osopolarThere 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.