Common patterns for working with the WEB API.
Bunlar bu scriptin güncellenmiş kod versiyonlarıdır. Bütün versiyonları göster.
eslint: Fully disallow name as a local variable.
name
Closes #238.
␄
Bump version number.
Add a defensive check to focusOnTree().
focusOnTree()
Issue #232.
Introduce a new focusOnTree() function.
This factors out a recent change in Scroller.focus() for reuse by other functions. Specifically, functions about to be migrated across classes.
Scroller.focus()
Issues #232, #252.
Stop shadowing the global name.
Issue #238.
Create a library wide Logger instance.
Logger
Change how focusOnElement() is implemented.
focusOnElement()
Instead of always setting tabindex, instead try to move focus first. Only if that does not work, then set tabindex.
tabindex
Run through ispell.
ispell
Enhance focusOnElement with an removeNonExistent option.
focusOnElement
removeNonExistent
This allows the caller to keep the temporary tabindex attribute.
Issue #273.
Add a base option to waitForSelector, defaulting to document.
base
waitForSelector
document
While implemented to support a new iframe requirement, it looks like this might simplify some existing code as well.
iframe
Issue #267.
Factor roCallback() out of otrot2().
This is to be consistent with otmot() and otrot().
While in here, also added an initial call to the monitoring function and a logging statement, again, simply for consistency.
Issue #221.
Invoke the otmot() monitor function once at the start.
Not unlike the "one last try" a few lines above, there might be situations where the criteria has already been met, but no mutations have been observered and no time out.
Issue #218.
JSDoc: Fix typo in comment.
Factor roCallback() out of otrot().
This is to be consistent with otmot().
While in here, also added an initial and final calls to the monitoring function. Previously the final call was explicitly avoided in otrot(), but upon reflection, seems to cause no harm. Similarly, the initial call was just added to otmot() and seems reasonable here.
Factor moCallback() out of otrot().
The function was getting a bit long, so pulled out the MutationObserver callback.
Also fixed a minor cosmetic issue where, during the "one last try" run of the callback, a "rejecting after timeout" message would still be logged.
Promote SPA.dumpInfoAboutElement() to lib/web.js.
SPA.dumpInfoAboutElement()
Issue #205.
Give the monitor function one last try in otmot().
We already do similar in otrot2(), and the change there just makes the coding look similar.
We also make use of this pattern in a recent change to Scroller.
Scroller
Sometimes otmot() monitor functions do not inspect the records, but instead it is easier to just poll a global state to see if it valid. In those cases, the observeOptions may not be precise enough, and an important mutation missed. This change gives everything a chance to resolve successfully.
A similar change was NOT made to otrot() because the options are set in the function and anything missed is a bug in the library.
Issue #150.
Bump version numbers.
Migrate a number of functions to lib/web.
These include clickElement(), focusOnElement(), and isInput().
I have no idea how I missed these when I added the otmot family.
Issue #167.