Initial code using Drupal 6.38
This commit is contained in:
commit
4824608a33
467 changed files with 90887 additions and 0 deletions
34
modules/comment/comment.js
Normal file
34
modules/comment/comment.js
Normal file
|
@ -0,0 +1,34 @@
|
|||
|
||||
Drupal.behaviors.comment = function (context) {
|
||||
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');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
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;
|
||||
}
|
||||
returnValue = decodeURIComponent(document.cookie.substring(offset, end).replace(/\+/g, '%20'));
|
||||
}
|
||||
}
|
||||
|
||||
return returnValue;
|
||||
};
|
Reference in a new issue