From 4430d46334127c69d5ff97ce2e15475c0fae2654 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Fri, 16 Oct 2009 16:37:01 +0000 Subject: - Patch #440876: missing files. --- misc/form.js | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'misc') diff --git a/misc/form.js b/misc/form.js index ca572cf38..4b48d3bb0 100644 --- a/misc/form.js +++ b/misc/form.js @@ -68,7 +68,6 @@ Drupal.behaviors.multiselectSelector = { } }; - /** * Automatically display the guidelines of the selected text format. */ @@ -86,4 +85,22 @@ Drupal.behaviors.filterGuidelines = { } }; +/** + * Prepopulate form fields with information from the visitor cookie. + */ +Drupal.behaviors.fillUserInfoFromCookie = { + attach: function (context, settings) { + $('form.user-info-from-cookie').once('user-info-from-cookie', function () { + var formContext = this; + $.each(['name', 'mail', 'homepage'], function () { + var $element = $('[name=' + this + ']', formContext); + var cookie = $.cookie('Drupal.visitor.' + this); + if ($element.length && cookie) { + $element.val(cookie); + } + }); + }); + } +}; + })(jQuery); -- cgit v1.2.3