Drupal 6 provides Drupal.behaviors to attach handlers to DOM.

It's not good idea to attach js at hook_init() suppose it's better to put this into hook_nodeapi where it's really should happen now

Comments

chia’s picture

hi,
thanks, i will edit it next update.

zyxware’s picture

Here is a patch that changes the way buzzthis hooks into the document.load using Drupal.behaviors

andypost’s picture

Status: Active » Reviewed & tested by the community

Yes, it works

chia’s picture

Status: Reviewed & tested by the community » Fixed
andypost’s picture

Status: Fixed » Needs review
StatusFileSize
new597 bytes

js strings should be translatable. So "Google Buzz" should be Drupal.t("Google Buzz")

chia’s picture

Status: Needs review » Fixed

I am marking this as fixed.
Language can be selected from 'admin/settings/buzzthis'.

andypost’s picture

Oh I see, but for list of languages better use http://api.drupal.org/api/function/_locale_get_predefined_list/6

chia’s picture

Yes, I used this as a reference
http://www.google.com/buzz/api/admin/configPostWidget
New Buzz script has a default input as a language now.

andypost’s picture

I know but language names also should be translated

chia’s picture

Status: Fixed » Needs work

Ok right :)