Skip to content
Snippets Groups Projects
Commit 4430d463 authored by Dries Buytaert's avatar Dries Buytaert
Browse files

- Patch #440876: missing files.

parent f46e6626
Branches
Tags
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -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);
// $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);
// $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);
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment