diff options
author | Dries Buytaert <dries@buytaert.net> | 2009-10-09 15:39:12 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2009-10-09 15:39:12 +0000 |
commit | a5dba069fb404bc0f2999bf2732154c75d5e4f2c (patch) | |
tree | 64923ba6b02449109cdd592c420c52fde4acef46 /modules/contact/contact.js | |
parent | 0e98ff2018d765fe43bdd3f71e827601709ccd68 (diff) | |
download | brdo-a5dba069fb404bc0f2999bf2732154c75d5e4f2c.tar.gz brdo-a5dba069fb404bc0f2999bf2732154c75d5e4f2c.tar.bz2 |
- #440876 by Dave Reid, sun: reuse comment.module's anonymous cookie information for contact forms.
Diffstat (limited to 'modules/contact/contact.js')
-rw-r--r-- | modules/contact/contact.js | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/modules/contact/contact.js b/modules/contact/contact.js new file mode 100644 index 000000000..effac8145 --- /dev/null +++ b/modules/contact/contact.js @@ -0,0 +1,15 @@ +// $Id$ +(function ($) { + +Drupal.behaviors.contact = { + attach: function(context) { + $.each(['name', 'mail'], function () { + var cookie = $.cookie('Drupal.user.' + this); + if (cookie) { + $('#contact-site-form input[name=' + this + ']', context).once('comment').val(cookie); + } + }); + } +}; + +})(jQuery); |