aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoakim Verona2011-11-09 13:46:24 +0100
committerJoakim Verona2011-11-09 13:46:24 +0100
commit32db4845d5c433fd15c6665cbed169e5d8b94f05 (patch)
tree2e23f523c8a33224c4fa929aa8306d8a9d640bb4
parent8520d9c4e50520db79410ec6ef0052df129231dc (diff)
downloademacs-32db4845d5c433fd15c6665cbed169e5d8b94f05.tar.gz
emacs-32db4845d5c433fd15c6665cbed169e5d8b94f05.zip
nav + text edit
-rw-r--r--README.xwidget27
-rw-r--r--lisp/xwidget.el12
2 files changed, 27 insertions, 12 deletions
diff --git a/README.xwidget b/README.xwidget
index 2fdec89deb4..0e1ebbd3e7e 100644
--- a/README.xwidget
+++ b/README.xwidget
@@ -1496,6 +1496,27 @@ hook so anything can filter browser history.
1496** TODO new relative url code sometimes fail 1496** TODO new relative url code sometimes fail
1497http://www.dilbert.com 1497http://www.dilbert.com
1498** TODO input field enhancements 1498** TODO input field enhancements
1499- password field 1499*** password field.
1500- textarea 1500was straightforward
1501 1501
1502*** textarea
1503less straightforward. I would like it to work like emacs-w3m, where a
1504new editing buffer is opened. on c-c, the buffer is closed and the
1505browser field updated. however, it's not immediately obvious how to
1506store the reference to the field reliably.
1507
1508furthermore the current code doesn't seem to propagate linefeed
1509properly to text areas.
1510
1511** DONE bug in current navigation handler
1512 CLOSED: [2011-11-09 Wed 10:04]
1513on www.dn.se
1514Debugger entered--Lisp error: (args-out-of-range "http://platform.twitter.com/widgets/hub.html" 54 357)
1515 match-string(1 "http://platform.twitter.com/widgets/hub.html")
1516 xwidget-webkit-callback(48890368 navigation-policy-decision-requested)
1517 xwidget-event-handler()
1518 call-interactively(xwidget-event-handler nil nil)
1519** TODO how to set the name of a webkit buffer?
1520not obvious because, the buffer isn't created immediately and there is
1521a callback that sets the buffer name automatically
1522** TODO how to find next field in tab order?a
diff --git a/lisp/xwidget.el b/lisp/xwidget.el
index 3f20914f88c..8ed0c72f296 100644
--- a/lisp/xwidget.el
+++ b/lisp/xwidget.el
@@ -166,14 +166,8 @@ defaults to the string looking like a url around the cursor position."
166 ) 166 )
167 167
168 ((eq xwidget-event-type 'navigation-policy-decision-requested) 168 ((eq xwidget-event-type 'navigation-policy-decision-requested)
169 (let ((elmid (progn (string-match ".*#\\(.*\\)" strarg)(match-string 1 strarg)))) 169 (if (string-match ".*#\\(.*\\)" strarg)
170 (message "navigation-policy-decision-requested: '%s' %s" strarg elmid ) 170 (xwidget-webkit-show-id-or-named-element xwidget (match-string 1 strarg))))))))
171
172 (if elmid (xwidget-webkit-show-id-or-named-element xwidget elmid))
173 )
174
175 )
176 ))))
177 171
178(define-derived-mode xwidget-webkit-mode 172(define-derived-mode xwidget-webkit-mode
179 special-mode "xwidget-webkit" "xwidget webkit view mode" 173 special-mode "xwidget-webkit" "xwidget webkit view mode"
@@ -254,7 +248,7 @@ Argument STR string."
254 (list xww 248 (list xww
255 (cond ( (equal "text" field-type) (read-string "text:" field-value)) 249 (cond ( (equal "text" field-type) (read-string "text:" field-value))
256 ( (equal "password" field-type) (read-passwd "password:" nil field-value)) 250 ( (equal "password" field-type) (read-passwd "password:" nil field-value))
257 ( (equal "textarea" field-type) (read-textarea "textarea:" field-value)) 251 ( (equal "textarea" field-type) (read-string "textarea:" field-value))
258 )))) 252 ))))
259 (xwidget-webkit-execute-script xw (format "findactiveelement(document).value='%s'" str))) 253 (xwidget-webkit-execute-script xw (format "findactiveelement(document).value='%s'" str)))
260 254