[gnus git] branch master updated: m0-7-64-g185609a =1= (eww-tag-select): Implement <select>.
Lars Magne Ingebrigtsen <[email protected]>
| Newsgroups | gmane.emacs.gnus.cvs |
|---|---|
| Message-ID | <[email protected]> |
via 185609a679081a071d26e083399cbd83cb3652fd (commit)
from 7c1ea6e40433e6c1ff4273ba58e87e9b5f152cc5 (commit)
- Log -----------------------------------------------------------------
commit 185609a679081a071d26e083399cbd83cb3652fd
Author: Lars Magne Ingebrigtsen <[email protected]>
Date: Tue Jun 11 18:23:57 2013 +0200
(eww-tag-select): Implement <select>.
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index cafd18a..43a7c33 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -2,6 +2,7 @@
* eww.el (eww-convert-widgets): Make widgets from non-tabular layouts
work, too.
+ (eww-tag-select): Implement <select>.
2013-06-10 Albert Krewinkel <[email protected]>
diff --git a/lisp/eww.el b/lisp/eww.el
index 7f48fce..3e79973 100644
--- a/lisp/eww.el
+++ b/lisp/eww.el
@@ -88,7 +88,7 @@
(shr-external-rendering-functions
'((form . eww-tag-form)
(input . eww-tag-input)
- (submit . eww-tag-submit))))
+ (select . eww-tag-select))))
(shr-insert-document document)
(eww-convert-widgets))
(goto-char (point-min))))
@@ -226,6 +226,27 @@
(put-text-property start (point) 'eww-widget widget)
(insert " ")))
+(defun eww-tag-select (cont)
+ (shr-ensure-paragraph)
+ (let ((menu (list 'menu-choice
+ :name (cdr (assq :name cont))
+ :eww-form eww-form))
+ (options nil)
+ (start (point)))
+ (dolist (elem cont)
+ (when (eq (car elem) 'option)
+ (when (cdr (assq :selected (cdr elem)))
+ (nconc menu (list :value
+ (cdr (assq :value (cdr elem))))))
+ (push (list 'item
+ :value (cdr (assq :value (cdr elem)))
+ :tag (cdr (assq 'text (cdr elem))))
+ options)))
+ (nconc menu options)
+ (apply 'widget-create menu)
+ (put-text-property start (point) 'eww-widget menu)
+ (shr-ensure-paragraph)))
+
(defun eww-click-radio (widget &rest ignore)
(let ((form (plist-get (cdr widget) :eww-form))
(name (plist-get (cdr widget) :name)))
-----------------------------------------------------------------------
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we listed those
revisions in full, above.
Summary of changes:
lisp/ChangeLog | 1 +
lisp/eww.el | 23 ++++++++++++++++++++++-
2 files changed, 23 insertions(+), 1 deletions(-)
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Gnus Project".
The branch, master has been updated
hooks/post-receive
--
Gnus Project