Index: modules/comment/comment.js =================================================================== RCS file: /cvs/drupal/drupal/modules/comment/comment.js,v retrieving revision 1.13 diff -u -p -r1.13 comment.js --- modules/comment/comment.js 9 Oct 2009 15:39:12 -0000 1.13 +++ modules/comment/comment.js 9 Oct 2009 17:13:48 -0000 @@ -3,12 +3,14 @@ Drupal.behaviors.comment = { attach: function (context, settings) { - $.each(['name', 'homepage', 'mail'], function () { - var cookie = $.cookie('Drupal.visitor.' + this); - if (cookie) { - $('#comment-form input[name=' + this + ']', context).once('comment').val(cookie); - } - }); + $('form#comment-form', context).once('comment', function () { + $.each(['name', 'mail'], function () { + var cookie = $.cookie('Drupal.visitor.' + this); + if (cookie) { + $('form#comment-form input[name=' + this + ']', context).val(cookie); + } + }); + }) } }; Index: modules/contact/contact.js =================================================================== RCS file: /cvs/drupal/drupal/modules/contact/contact.js,v retrieving revision 1.1 diff -u -p -r1.1 contact.js --- modules/contact/contact.js 9 Oct 2009 15:39:12 -0000 1.1 +++ modules/contact/contact.js 9 Oct 2009 17:13:49 -0000 @@ -2,13 +2,15 @@ (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); - } - }); + attach: function (context, settings) { + $('form#contact-site-form', context).once('contact', function () { + $.each(['name', 'mail'], function () { + var cookie = $.cookie('Drupal.visitor.' + this); + if (cookie) { + $('form#contact-site-form input[name=' + this + ']', context).val(cookie); + } + }); + }) } }; Index: modules/user/user.js =================================================================== RCS file: /cvs/drupal/drupal/modules/user/user.js,v retrieving revision 1.18 diff -u -p -r1.18 user.js --- modules/user/user.js 21 Sep 2009 08:52:41 -0000 1.18 +++ modules/user/user.js 9 Oct 2009 17:13:49 -0000 @@ -188,4 +188,17 @@ Drupal.behaviors.userSettings = { } }; +Drupal.behaviors.userRegistration = { + attach: function (context, settings) { + $('form#user-register', context).once('userRegistration', function () { + $.each(['name', 'mail'], function () { + var cookie = $.cookie('Drupal.visitor.' + this); + if (cookie) { + $('form#user-register input[name=' + this + ']', context).val(cookie); + } + }); + }) + } +}; + })(jQuery); Index: modules/user/user.module =================================================================== RCS file: /cvs/drupal/drupal/modules/user/user.module,v retrieving revision 1.1060 diff -u -p -r1.1060 user.module --- modules/user/user.module 10 Oct 2009 16:48:39 -0000 1.1060 +++ modules/user/user.module 10 Oct 2009 19:36:17 -0000 @@ -3080,6 +3080,9 @@ function user_register_form($form, &$for $form['account']['#type'] = 'markup'; } + $form['#attached']['library'][] = array('system', 'cookie'); + $form['#attached']['js'][] = drupal_get_path('module', 'user') . '/user.js'; + $form['submit'] = array( '#type' => 'submit', '#value' => t('Create new account'),