Age | Commit message (Collapse) | Author |
|
|
|
fanglingsu/vimb#237
|
|
|
|
|
|
The function dom_auto_insert_unless_strict_focus was only used internal and
was really small, so the content was moved to the only placed where it was
called.
Also added a missed comment that might still be interesting.
|
|
|
|
This allows to use gi normal mode command to focus also editable element
within iframes in case the current document contains no editable element.
|
|
|
|
This allows us to track also focus changes within frames and iframes also if
they are loaded dynamically. The previous logic added the event listeners to
the document on WEBKIT_LOAD_FINISHED, but if there where later created iframes
in the dom, these where not observers for focus events.
This is only a first attempt to fix the focus issue and does break the logic
behind `set strict-focus=on`.
|
|
Allow new HTML input type to be found by dom_focus_input as editable
field.
Reformat a little the xpath expression in order to have a lisible
string.
Close: #204
|
|
|
|
mark new input types as editable, according to the way of webkit handle
these.
|
|
Allow to focus input type search on running normal mode command 'gi'.
|
|
HTML5 define a new input type="search":
http://www.w3.org/TR/html-markup/input.search.html
declare this element to be editable, in order to switch in input-mode
when use it.
|
|
|
|
The previous logic of switching back to normal mode in
webview_load_status_cb() does only work for google search or if the place
where we switch back to normal mode is change for translate.google.com. But
this would have never been working for both sites.
This patch tries another approach and doe the switching back to normal mode
also by observing dom events. In case the strict-focus is enabled the focus
event callback blur the active element to keep vimb in it's current mode. If
vimb is in input mode the focus is not removed from the element, which allows
to to keep in input mode if this was started by user interaction like 'gi'
normal mode command, hinting or click to editable element.
There are two way's to obtain the input mode.
1. By user interaction: where vimb is set to input mode and after that the
form element is focused, or where the input mode is set right after the dom
event observer took their decision.
2. By the page: Only the focus/blur state of the editable active element
changes and vimb pick this state changes up and follows this, or remove the
focus in case of enabled strict-focus.
|
|
|
|
|
|
|
|
If strict-focus is enabled and the user started typing into form field right
before the page way fully loaded, the focus was cleared, so that vimb switched
back to normal mode and executed the pressed keys as normal mode commands.
No the focus is only cleared if strict-focus is enabled and vimb is not in
input mode.
|
|
|
|
Now the strict-focus=on prevents vimb only from switching to input mode if
focus is on editable element on page load (for example set by a body onload
script). Vimb follow all further focus events.
|
|
If a radio button was clicked vimb switched to input mode. Now the logic what
element is editable is consistent within dom.c. Editable are textarea, and
input elements without any type a and type text or password.
|
|
Don't switch from pass through by click into input field nor by a reload of the
page with a focused input field.
|
|
|
|
This enables to focus the search box of google, that has not type attribute.
|
|
This allows to ignore possible focused form fields on pages that forces vimb
into input mode. If 'strict-focus' is on, vimb removes the focus from form
fields event if the page say that say should be focussed,
|
|
Until today vimb mapped two-part keybindings to commands. This patch changed
this paradigm into a more vi like way. The commands are separated into normal
mode commands that mainly consists of a single char and ex commands that can
by typed into the inputbox like ':open'. This change allows us to adapt also
the way keypresses and mapping are handled. Now every keypress is converted
into a unsigned char and collected into a typeahead queue. The mappings are
applied on the queue. So now we can use also long keymaps and run multiple
commands for different modes with them like ':nmap abcdef :set
scripts!<CR>:open search query<CR>50G'.
|
|
This reflects better what we are doing and we used both terms in the manual
page which was confusing. So now the mode is called 'Input Mode'.
|
|
|
|
The new command and keybinding are use to focus the first editable element on
the page and to switch vimb into insert mode.
|
|
|
|
|
|
|
|
Change api of dom function to take the webview as parameter.
|
|
|
|
|
|
|
|
If they are lower case, vim can highlight them correct.
|
|
|
|
|
|
|
|
If a editable form element was focussed, vimb browser switched to insert mode.
But if the insert mode was left by hitting <esc> the element kept focused, so
that key-presses went still into the focused element.
|
|
|
|
|
|
There is already a software calles vimp so I think it will be better to rename
this little project.
|
|
|
|
|
|
The previous approach to use the dom api to generate the hints was much slower
than the javascript solution. I think the javascript way is also a little bit
more flexible and easier to implement. But now we have to concern about data
sharing between c-layer an the javascript.
|
|
We considered every html form input element as editable. This brakes the next
submit element on duckduckgo's search result page.
Now we exclude the input type submit, reset and image from the editable input
elements.
|