summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2009-10-16 16:37:01 +0000
committerDries Buytaert <dries@buytaert.net>2009-10-16 16:37:01 +0000
commit4430d46334127c69d5ff97ce2e15475c0fae2654 (patch)
tree0f4d0fd0bb845f0ed14652924fd6921579fcfd98
parentf46e6626cd5274f1783fb2f6e0e776b8b43b1a5c (diff)
downloadbrdo-4430d46334127c69d5ff97ce2e15475c0fae2654.tar.gz
brdo-4430d46334127c69d5ff97ce2e15475c0fae2654.tar.bz2
- Patch #440876: missing files.
-rw-r--r--misc/form.js19
-rw-r--r--modules/comment/comment.js15
-rw-r--r--modules/contact/contact.js16
3 files changed, 18 insertions, 32 deletions
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);
diff --git a/modules/comment/comment.js b/modules/comment/comment.js
deleted file mode 100644
index 753e99252..000000000
--- a/modules/comment/comment.js
+++ /dev/null
@@ -1,15 +0,0 @@
-// $Id$
-(function ($) {
-
-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);
- }
- });
- }
-};
-
-})(jQuery);
diff --git a/modules/contact/contact.js b/modules/contact/contact.js
deleted file mode 100644
index 41ddc711d..000000000
--- a/modules/contact/contact.js
+++ /dev/null
@@ -1,16 +0,0 @@
-// $Id$
-(function ($) {
-
-Drupal.behaviors.contact = {
- attach: function(context) {
- $.each(['name', 'mail'], function () {
- var cookie = $.cookie('Drupal.visitor.' + this);
- if (cookie) {
- $('#contact-site-form input[name=' + this + ']', context).once('comment').val(cookie);
- $('#contact-personal-form input[name=' + this + ']', context).once('comment').val(cookie);
- }
- });
- }
-};
-
-})(jQuery);