summaryrefslogtreecommitdiff
path: root/modules/comment/comment.js
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2007-05-17 21:05:38 +0000
committerDries Buytaert <dries@buytaert.net>2007-05-17 21:05:38 +0000
commitda7f952a4576da7bd33348c8cec7439fc32a2114 (patch)
tree176dc079a99ab722bb84dee76f49f4313b32880d /modules/comment/comment.js
parentd1e28d4273e8063d8ce8d420fc398424d637100c (diff)
downloadbrdo-da7f952a4576da7bd33348c8cec7439fc32a2114.tar.gz
brdo-da7f952a4576da7bd33348c8cec7439fc32a2114.tar.bz2
- Patch #141131 by mfer: remember anonyous comment posters.
Diffstat (limited to 'modules/comment/comment.js')
-rw-r--r--modules/comment/comment.js34
1 files changed, 34 insertions, 0 deletions
diff --git a/modules/comment/comment.js b/modules/comment/comment.js
new file mode 100644
index 000000000..f419a6f0d
--- /dev/null
+++ b/modules/comment/comment.js
@@ -0,0 +1,34 @@
+// $Id$
+if (Drupal.jsEnabled) {
+ $(document).ready(function() {
+ 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] + "]").val(cookie);
+ }
+ }
+ });
+};
+
+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 = unescape(document.cookie.substring(offset, end));
+ }
+ }
+
+ return returnValue;
+}