{"complete", command_complete, {0}, VP_MODE_COMMAND | VP_MODE_COMPLETE},
{"complete-back", command_complete, {1}, VP_MODE_COMMAND | VP_MODE_COMPLETE},
{"inspect", command_inspect, {0}, VP_MODE_NORMAL},
- {"hint-link", command_hints, {HINTS_TYPE_LINK, "."}, VP_MODE_HINTING},
- {"hint-link-new", command_hints, {HINTS_TYPE_LINK | HINTS_TARGET_BLANK, ","}, VP_MODE_HINTING},
+ {"hint-link", command_hints, {HINTS_TYPE_LINK, ". "}, VP_MODE_HINTING},
+ {"hint-link-new", command_hints, {HINTS_TYPE_LINK | HINTS_TARGET_BLANK, ", "}, VP_MODE_HINTING},
{"hint-input-open", command_hints, {HINTS_TYPE_LINK | HINTS_PROCESS | HINTS_PROCESS_INPUT, ";o"}, VP_MODE_HINTING},
{"hint-input-tabopen", command_hints, {HINTS_TYPE_LINK | HINTS_TARGET_BLANK | HINTS_PROCESS | HINTS_PROCESS_INPUT, ";t"}, VP_MODE_HINTING},
{"hint-focus-next", command_hints_focus, {0}, VP_MODE_HINTING},
static void hints_focus(const gulong num)
{
- /* TODO use the document the hinted element belongs to */
- Document* doc = webkit_web_view_get_dom_document(vp.gui.webview);
+ Document* doc = NULL;
+
Hint* hint = hints_get_hint_by_number(currentFocusNum);
if (hint) {
/* reset previous focused element */
dom_element_style_set_property(hint->elem, "background-color", ELEM_BACKGROUND);
+ doc = webkit_dom_node_get_owner_document(WEBKIT_DOM_NODE(hint->elem));
dom_dispatch_mouse_event(doc, hint->elem, "mouseout", 0);
}
/* mark new hint as focused */
dom_element_style_set_property(hint->elem, "background-color", ELEM_BACKGROUND_FOCUS);
+ doc = webkit_dom_node_get_owner_document(WEBKIT_DOM_NODE(hint->elem));
dom_dispatch_mouse_event(doc, hint->elem, "mouseover", 0);
webkit_dom_element_blur(hint->elem);
}
*/
static void hints_click_fired_hint(guint mode, Element* elem)
{
- /* TODO I don't get the mouse click event dispatched here to
- * invoke the gtk events for button press wich might be the better
- * way hanlding to open new windows than setting temporary target
- * attribute here */
gchar* target = webkit_dom_element_get_attribute(elem, "target");
if (mode & HINTS_TARGET_BLANK) { /* open in new window */
webkit_dom_element_set_attribute(elem, "target", "_blank", NULL);
}
/* dispatch click event */
- /* TODO use document of the hint an not the default one, but this is only
- * required if we hint also into frames and iframes */
- Document* doc = webkit_web_view_get_dom_document(vp.gui.webview);
+ Document* doc = webkit_dom_node_get_owner_document(WEBKIT_DOM_NODE(elem));
dom_dispatch_mouse_event(doc, elem, "click", 0);
/* reset previous target attribute */