* eww.el (eww-tag-textarea): Support <textarea>.
authorLars Magne Ingebrigtsen <larsi@gnus.org>
Sun, 16 Jun 2013 15:42:37 +0000 (17:42 +0200)
committerLars Magne Ingebrigtsen <larsi@gnus.org>
Sun, 16 Jun 2013 15:42:37 +0000 (17:42 +0200)
lisp/ChangeLog
lisp/eww.el

index 03c69d0..b08c4ff 100644 (file)
@@ -1,3 +1,7 @@
+2013-06-16  Lars Magne Ingebrigtsen  <larsi@gnus.org>
+
+       * eww.el (eww-tag-textarea): Support <textarea>.
+
 2013-06-16  RĂ¼diger Sonderfeld  <ruediger@c-plusplus.de>
 
        * shr.el (shr-dom-to-xml): Fixed function call.
index 6579d1a..f99e5be 100644 (file)
           '((title . eww-tag-title)
             (form . eww-tag-form)
             (input . eww-tag-input)
+            (textarea . eww-tag-textarea)
             (body . eww-tag-body)
             (select . eww-tag-select))))
       (shr-insert-document document)
       (apply 'widget-create widget)
       (put-text-property start (point) 'eww-widget widget))))
 
+(defun eww-tag-textarea (cont)
+  (let* ((start (point))
+        (widget
+         (list 'editable-field
+               :size (string-to-number
+                      (or (cdr (assq :cols cont))
+                          "40"))
+               :value (or (cdr (assq 'text cont)) "")
+               :action 'eww-submit
+               :name (cdr (assq :name cont))
+               :eww-form eww-form)))
+    (nconc eww-form (list widget))
+    (apply 'widget-create widget)
+    (put-text-property start (point) 'eww-widget widget)))
+
 (defun eww-tag-select (cont)
   (shr-ensure-paragraph)
   (let ((menu (list 'menu-choice