aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Robert Manea <gotmor@gmail.com>2009-10-20 17:09:05 +0200
committerGravatar Robert Manea <gotmor@gmail.com>2009-10-20 17:09:05 +0200
commit80b551b6717accb9739a60e527ae90784cfc574a (patch)
tree538e607af588a9a34da941616a4246139d646d08
parentbb5efd8d5e44518ecbeb91776dff988a9ff29154 (diff)
added automatic switching to insert mode if a text field has initial focus
-rw-r--r--callbacks.c2
-rw-r--r--examples/config/uzbl/config5
2 files changed, 6 insertions, 1 deletions
diff --git a/callbacks.c b/callbacks.c
index 1cf7221..593fdac 100644
--- a/callbacks.c
+++ b/callbacks.c
@@ -658,7 +658,7 @@ populate_popup_cb(WebKitWebView *v, GtkMenu *m, void *c) {
hit++;
}
- if((mi->context == WEBKIT_HIT_TEST_RESULT_CONTEXT_DOCUMENT) &&
+ if((mi->context == WEBKIT_HIT_TEST_RESULT_CONTEXT_DOCUMENT) &&
(context <= WEBKIT_HIT_TEST_RESULT_CONTEXT_DOCUMENT) &&
!hit) {
if(mi->issep) {
diff --git a/examples/config/uzbl/config b/examples/config/uzbl/config
index c3babe0..8cb4876 100644
--- a/examples/config/uzbl/config
+++ b/examples/config/uzbl/config
@@ -42,6 +42,11 @@ set new_window = sh 'uzbl-browser -u $8' # equivalent to the default beh
@on_event LOAD_FINISH @set_status <span foreground="gold">done</span>
@on_event LOAD_FINISH spawn @scripts_dir/history.sh
+# Generate a FORM_ACTIVE event if a text element on the loaded site
+# has initial focus unfortunatelly this only works for text elements,
+# yet due to webkit limitations
+@on_event LOAD_FINISH js if(document.activeElement.getAttribute('type') == 'text') {Uzbl.run("event FORM_ACTIVE");}
+
# Switch to insert mode if a (editable) html form is clicked
@on_event FORM_ACTIVE @set_mode insert
# Switch to command mode if anything else is clicked