2007-05-17 21:05:38 +00:00
|
|
|
// $Id$
|
2009-02-18 13:46:55 +00:00
|
|
|
(function($) {
|
2007-07-01 15:37:10 +00:00
|
|
|
|
2008-10-29 10:01:28 +00:00
|
|
|
Drupal.behaviors.comment = {
|
2009-03-13 23:15:09 +00:00
|
|
|
attach: function(context, settings) {
|
2008-10-29 10:01:28 +00:00
|
|
|
var parts = new Array("name", "homepage", "mail");
|
|
|
|
var cookie = '';
|
|
|
|
for (i=0;i<3;i++) {
|
|
|
|
cookie = Drupal.comment.getCookie('comment_info_' + parts[i]);
|
|
|
|
if (cookie != '') {
|
|
|
|
$("#comment-form input[name=" + parts[i] + "]:not(.comment-processed)", context)
|
|
|
|
.val(cookie)
|
|
|
|
.addClass('comment-processed');
|
|
|
|
}
|
2007-05-17 21:05:38 +00:00
|
|
|
}
|
2007-07-01 15:37:10 +00:00
|
|
|
}
|
2007-05-17 21:05:38 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
Drupal.comment = {};
|
|
|
|
|
|
|
|
Drupal.comment.getCookie = function(name) {
|
|
|
|
var search = name + '=';
|
|
|
|
var returnValue = '';
|
|
|
|
|
|
|
|
if (document.cookie.length > 0) {
|
|
|
|
offset = document.cookie.indexOf(search);
|
|
|
|
if (offset != -1) {
|
|
|
|
offset += search.length;
|
|
|
|
var end = document.cookie.indexOf(';', offset);
|
|
|
|
if (end == -1) {
|
|
|
|
end = document.cookie.length;
|
|
|
|
}
|
2007-05-20 12:34:48 +00:00
|
|
|
returnValue = decodeURIComponent(document.cookie.substring(offset, end).replace(/\+/g, '%20'));
|
2007-05-17 21:05:38 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return returnValue;
|
2007-09-01 07:08:11 +00:00
|
|
|
};
|
2009-02-18 13:46:55 +00:00
|
|
|
|
|
|
|
})(jQuery);
|