@glitchr/flowjs · read at bc6ed6a
API reference
Read from the sources by JSDoc (jsdoc -X src/js): every function, method and property a module puts on its global, in the order of the source, each linked to its line. Uncommented functions show their signature alone; the options are described in the manual.
Core
Navigation
Transparent, the navigation without page loads: links and forms fetched in the background and swapped in place, the history kept, the head and scripts in step, a progress bar that never blinks, neste…
41 options · 75 methods · 4 events · 2 properties
FlowFrame, a website in the website: a frame of the page whose links and forms load their page into the frame alone, with its own history and address.
5 options · 20 methods · 2 events · 1 property
Scrolling
Sticky, the effects of the scroll on a page: a header that steps aside and comes back, an address that follows the section read, magnets, widgets, scroll-percent triggers, swipes, autoscroll.
42 options · 46 methods · 2 events
StickyStops, places a scroll comes to rest on: the scroll settled to the nearest stop once it rests, momentum included, and the keys going from one stop to the next.
18 options · 45 methods · 2 events · 2 properties
StickyScenes, scenes the scroll plays: a section whose stage stays pinned while the page scrolls through it, its progress in CSS and in events - or read sideways, by a horizontal scroll of its track.
10 options · 18 methods · 2 events · 1 property
Lists
StickySortable, sortable lists and trees: drag-and-drop with pointer events (mouse, pen, touch), the arrows on a handle for the keyboard, items moved between the levels of a tree.
32 options · 42 methods · 1 event · 3 properties
Ajaxer
Cookie
Core
Flow
Flow.jquery() function
Flow.now() function
Flow.parseDuration(str) function
"250ms", "1s", "0.3", or several ("1s, 250ms"): the longest, in seconds.
Flow.debounce(func, wait, immediate) function
Flow.remToPixel(rem) function
Flow.emToPixel(em, el) function
Flow.percentToPixel(p, el) function
"15%" of the element's width (the window's without one). Up to 1.5 the number was not divided by 100: 15 times the width.
Flow.toMilliseconds(value) function
A duration in ms: "1s", "250ms", or a plain number of ms ("400", 400). NaN for what is unreadable.
Flow.parseToPixel(str, el) function
"90", "90px", "2rem", "1.5em", "15%", or several ("2rem, 90px"): the largest, in px. undefined for undefined.
Flow.toPixels(value, el, fallback) function
One value to px ("90", "90px", "2rem", "1.5em"); anything unreadable is the fallback.
Flow.scrollPadding(el) function
The scroll-padding of an element (the <html> element by default), in px: {top, left, right, bottom}.
Flow.isScrollableNode(node) function
Whether ONE node scrolls (content larger than its box, and overflow that scrolls (scroll or auto) - or the <html> element, which always may). The cheap layout comparison first: getComputedStyle, the expensive half, is only reached for the few elements that could qualify.
Flow.closestScrollable(el) function
The element itself if it scrolls, else the closest ancestor that does; the <html> element if it scrolls; undefined otherwise - and for an element that is no longer in the page (a node the navigation has just swapped out).
Flow.normalize(scroller) function
The window for the document, <html> or <body> (or nothing); the element otherwise.
Flow.element(scroller) function
The element to read scrollTop from and to scroll: <html> for the window.
Flow.viewport() function
The viewport's size, {width, height}, read once per frame.
Flow.frame(fn) function
Flow.cancelFrame(fn) function
Flow.onScroll(scroller, fn) function
fn(event, scroller) once per frame in which the scroller scrolled. The window for the page.
Flow.offScroll(scroller, fn) function
Flow.onInterrupt(scroller, fn) function
fn(event, scroller) at once when the reader takes over on the scroller.
Flow.offInterrupt(scroller, fn) function
Flow.onResize(fn) function
fn(event) once per frame in which the window was resized.
Flow.offResize(fn) function
Flow.onPage(fn) function
fn(moment) at each of those moments; now too when the document is parsed.
Flow.offPage(fn) function
Flow.scripted(scroller) function
Whether a script is scrolling the scroller, did within the last moment, or left it where it still is and has not been heard since.
Flow.userScroll(el) function
Whether the reader has the scroll of the element's scroller (true unless a script took it).
Flow.jump(scroller, top, left) function
Put the scroller somewhere at once, whatever the page's scroll-behavior. A script's move.
Flow.scrollTo(scroller, dict, callback) function
Scroll an element (the window by default) to {top, left}, at once or over a duration ("250ms"; or "duration-x", "duration-y"), or at a speed (px/s), along a jQuery easing ("swing"), then call back. The scroller's "user-scroll" is false meanwhile, and a wheel, a finger or a press stops the movement where it is and gives the scroll back to the reader - unless {hold: true}, a movement the reader's gesture does not take.
The callback is called once, however the movement ends, with {completed, reason, top, left}: reason "arrived" (completed: true, also when there was no way to go), "interrupted" (the reader took over) or "replaced" (another scroll of the same scroller began).
Flow.release(event, scroller) function
Flow.replaceHash(newHash, triggerHashChange, skipIfEmptyIdentifier) function
Change the address's #hash without a history entry (history.replaceState), keeping the query string. No element with that id: "hashfallback" is dispatched and the hash is left (or emptied). "hashchange" is dispatched unless told not to. True when the address changed.
Transparent
transparent:load event
Told on the window once a page is swapped in (and at the first load): the moment to set up what the new page holds.
transparent:link event
Told on the window when a link or a form is taken over, before its page is fetched.
transparent:beforeunload event
Told on the window before the page in place is left for the next one.
transparent:progress event
Told on the window at each step of the progress bar: detail {state} - "shown", "done", "hidden".
Transparent.isHeadlocked(el) function
Transparent.isRescueMode() function
Transparent.getData(uuid) function
Transparent.setData(uuid, data) function
Transparent.getResponseText(uuid) function
Transparent.getResponsePosition(uuid) function
Transparent.getResponse(uuid) function
Transparent.getLiveResponse(uuid) function
Transparent.setLiveResponse(uuid, htmlEl, scrollableXY) function
Transparent.clearLiveResponse() function
Transparent.getPrefetched(href) function
Transparent.setPrefetched(href, text) function
Transparent.clearPrefetched() function
Transparent.prefetch(href) function
Transparent.claimPrefetch(href, onSettled) function
Transparent.setResponse(uuid, responseText, scrollableXY, exceptionRaised) function
Transparent.setResponseText(uuid, responseText, exceptionRaised) function
Transparent.setResponsePosition(uuid, scrollableXY, exceptionRaised) function
Transparent.hasResponse(uuid) function
Transparent.invalidateResponses() function
Transparent.configure(options) function
Transparent.ready(options) function
Transparent.addLayout() function
Transparent.getLayout(dom) function
Transparent.formInvalidity(form) function
Why the browser refuses a form: each invalid control as "name: message".
"Invalid form submission." on its own said nothing about WHICH field, and the browser's own bubble is easily missed - it appears at the control, which may be off screen, and the next scroll dismisses it. The reasons are the browser's own (validationMessage), so they read in the visitor's language.
Transparent.refuseInvalidForm(form, el) function
Refuse a submission the browser has already refused, and SAY SO.
Returning null here stops the submission for good: the page is never sent, and whatever else would have shown the reason does not run. In a plain form the browser's own interactive validation follows the click and puts its bubble on the first invalid control, but a form submitted by script - a jQuery .submit(), a requestSubmit() - never reaches it, and the visitor is left with a button that does nothing and an error in a console they will never open. reportValidity() is that same bubble, asked for explicitly: it names the control, focuses it and brings it on screen. Guarded, because a control that cannot be focused (hidden, in a closed disclosure) makes the browser refuse to show anything.
Transparent.findNearestForm(el) function
Transparent.findLink(el) function
Transparent.preload(link, callback) function
Transparent.findElementFromParents(el, parents, from) function
Transparent.isPage(dom) function
Transparent.isKnownLayout(dom) function
Transparent.isCompatiblePage(dom, method, data) function
Transparent.callback(fn, delay) function
Transparent.activeTime(el) function
Transparent.activeIn(activeCallback) function
Transparent.activeOut(activeCallback) function
Transparent.replaceCanvases(dom) function
Transparent.adoptNode(node, target) function
Transparent.whenScriptsSettled(callback) function
Transparent.evalScript(el) function
Transparent.rescue(dom) function
Transparent.scrollTo(dict, el, callback) function
Scroll an element (the window by default) through the core's engine, a tick later (the element rendered first).
Transparent.debounce property
Transparent.findImages() function
Transparent.lazyLoad(lazyloadImages) function
Transparent.loadImages() function
Transparent.transferAttributes(dom) function
Transparent.onLoad(uuid, dom, callback, scrollTo, keepScroll) function
Transparent.percentToPixel(p, el) function
Transparent.scrollToHash(hash, options, callback, el) function
Transparent.isElement(obj) function
Transparent.getScrollableElement(el) function
Transparent.getScrollableElementXY() function
Transparent.ttl property
Transparent.save(form) function
Transparent.restore(form) function
Transparent.markSent(form) function
Transparent.settle() function
Transparent.abandon() function
Transparent.clear(form) function
Transparent.restoreAll() function
Transparent.saveAll() function
Transparent.clearExpired() function
Transparent.nestCanReplay(href) function
Transparent.nestReplay(href) function
Transparent.getReloadPosition() function
Transparent.isOpen() function
Transparent.getContainer() function
Transparent.owns(e) function
Transparent.notifyNavigated(href, title, info) function
Transparent.notifyReady() function
Transparent.open(href) function
Transparent.navigate(href) function
Transparent.close(goBack) function
Transparent.inScope(href) function
Transparent.leave(href) function
FlowFrame
flow:frame:load event
Told on the frame (it bubbles) after each page it shows: detail {url, title, frame}.
flow:frame:error event
Told on the frame when no page came: detail {url, status}.
FlowFrame.defaults property
FlowFrame.Frame(root, options) function
FlowFrame.Frame#onClick(event) method
FlowFrame.Frame#onSubmit(event) method
FlowFrame.Frame#titleOf(el) method
FlowFrame.Frame#current() method
FlowFrame.Frame#click(event) method
A link or a button of the frame: its chrome's buttons, a page's links.
FlowFrame.Frame#submit(event) method
A form of a page in the frame, or the address field's.
FlowFrame.Frame#go(url, init, how) method
Show a page in the frame: fetched, its block swapped in, the frame's history moved on.
FlowFrame.Frame#extract(text) method
The block of a page the frame shows, or null for an answer that has none to show.
FlowFrame.Frame#show(html, scroll) method
FlowFrame.Frame#travel(delta) method
Back and forward: from memory, where the page's scroll was left; fetched again when it is not there.
FlowFrame.Frame#back() method
FlowFrame.Frame#forward() method
FlowFrame.Frame#reload() method
FlowFrame.Frame#chrome() method
The chrome: the address field says the frame's page, the buttons what they can do.
FlowFrame.Frame#loading() method
.flow-frame-loading on the progress bar's timing: after delay, at least min. The function ends it.
FlowFrame.Frame#destroy() method
FlowFrame.attach() function
The frame of an element (made if needed).
FlowFrame.get() function
FlowFrame.scan() function
Attach every [data-flow-frame] of the document (or of an element) not attached yet.
Scrolling
Sticky
sticky:ready event
Told on the window once Sticky is set up on the page.
scrollpercent event
Told on a .sticky-scrollpercent-* element when the scroll crosses its percentage: detail {scroll, trigger, dir, percent} (trigger 0 from, 1 once, 2 every).
Sticky.percentToPixel(p, el) function
Sticky.getScrollPadding(el) function
Sticky.epsilon(x1, x0) function
Sticky.reset(el) function
Sticky.ready(options) function
Sticky.get(key) function
Sticky.set(key, value) function
Sticky.add(key, value) function
Sticky.remove(key, value) function
Sticky.configure(options) function
Sticky.compute(event) function
Sticky.overscrollTop(event, el) function
Sticky.overscrollBottom(event, el) function
Sticky.overscrollLeft(event, el) function
Sticky.overscrollRight(event, el) function
Sticky.closestToZero(numbers) function
Sticky.closestTo(x, numbers) function
Sticky.userScroll(el) function
Sticky.scrollTo(dict, callback, el) function
Scroll an element (the window by default) through the core's engine - unless a script has the scroll already. The callback is called once in every case with {completed, reason} (see Flow.scrollTo); reason "refused" when a script had the scroll and nothing was started.
Sticky.scrollToFirstSnap(el, callback) function
Sticky.getFirstSnap(el) function
Sticky.scrollToLastSnap(el, callback) function
Sticky.getLastSnap(el) function
Sticky.scrollToSnap(el, callback) function
Sticky.getSnap(el) function
Sticky.scrollToPreviousSnap(el, callback) function
Sticky.getPreviousSnap(el) function
Sticky.scrollToNextSnap(el, callback) function
Sticky.allowScrolling(el) function
False while the scroller (the window by default) is locked by disableScroll().
Sticky.enableScroll(el) function
Sticky.disableScroll(el) function
Sticky.getNextSnap(el) function
Sticky.onSwipe(el) function
Sticky.onScrollPercent(e) function
Sticky.onScrollSnap(e) function
Sticky.toMagnet(scroller, dict, aim) function
Take a scroller (the window by default) to {top, left}, a magnet's
place, the way the scrollsnap_hold option says. Held (the default):
the page carries .sticky-prevent-scroll and the reader's gesture does
not stop the movement; the page is given back debounce after it
ended. Not held (scrollsnap_hold: false): nothing is set on the
page, and a wheel, a finger, a press or a key stops the movement where
it is - the snap then waits for the scroll to rest before it acts again.
Sticky.getMagnetPositions(scroller, axis) function
Where the magnets of a scroller are along an axis ('y' by default): the scroll positions that meet them, in order, each once. Its own magnets: not those of a scroller inside it.
Sticky.getMagnets(el) function
The magnets (.sticky-magnet) of an element, top to bottom: {element, offsetTop, offsetLeft, visible} - visible, the share of its scroller's box the magnet fills (0 to 1).
Sticky.onScrollDelta(e) function
Sticky.onScrollDebounce(e) function
Sticky.onWheel(e) function
Sticky.onAutoscroll() function
Sticky.onLoad(el) function
Sticky.listen(el, full) function
Hear a scroller (the window by default) scroll: every effect, or the scroll-percent triggers only.
Sticky.unlisten(el) function
Stop hearing a scroller.
Sticky.trigger(target) function
Run the effects now, as if the target's scroller had scrolled.
StickyStops
sticky:stop event
Told on the scroller (it bubbles) at each glide to a stop: detail {scroller, stop, top, axis, key}.
sticky:progress event
Told on the scroller (it bubbles) as the scroll moves between its stops: the same numbers as --sticky-stop, --sticky-progress and --sticky-progress-held.
StickyStops.defaults property
StickyStops.defaults.reach property
StickyStops.Stops(scroller, options) function
StickyStops.Stops#detach() method
StickyStops.Stops#pause() method
Hold the stops off, e.g. while a script scrolls the page itself. Nests.
StickyStops.Stops#resume() method
StickyStops.Stops#top() method
The scroll position along the axis: scrollTop, or scrollLeft for 'x'.
StickyStops.Stops#max() method
The furthest the scroller can scroll.
StickyStops.Stops#viewport() method
The height the scroller shows - its width for 'x'.
StickyStops.Stops#padding() method
The scroller's scroll-padding-top (-left): where a stop should rest from its edge.
StickyStops.Stops#margin(el) method
A stop's own scroll-margin-top (-left): the browser adds it to the scroller's padding for an anchor, and so do the stops.
StickyStops.Stops#edge(el) method
An element's near edge (top, or left) on screen, and its size along the axis.
StickyStops.Stops#size(el) method
StickyStops.Stops#position(el) method
A stop's scroll position: where it is on screen now, not its layout box, less the scroller's scroll-padding and the stop's scroll-margin.
StickyStops.Stops#owns(el) method
Whether a stop is this scroller's, not one of a scroller inside it (a row of data-sticky-axis="x" in the page, or any attached scroller).
StickyStops.Stops#place(rect, frame, margin) method
A stop's place from its box, the scroller's origin, scroll position and padding, and the stop's own margin.
StickyStops.Stops#frameOf() method
What every stop's place is counted from: read once per measure, not once per stop.
StickyStops.Stops#measure(kept) method
The stops, measured: [{element, top, end, bandUp, bandDown}], top to bottom. measure(true) gives the last measure back when the page has kept its shape since (the window's stops, see the constructor).
StickyStops.Stops#still(stop) method
Whether a kept stop is still where it was measured: its box read again (one read; the padding and its margin as measured). A stop that moves with the scroll - pinned, in a pinned block - or that a transition moves changes neither the page's size nor its nodes.
StickyStops.Stops#reach() method
The farthest a glide may go, in px.
StickyStops.Stops#jump(top) method
Put the scroll somewhere at once, whatever the page's scroll-behavior.
StickyStops.Stops#to(position, behavior) method
scrollTo's options for a position along the axis.
StickyStops.Stops#cancel() method
Stop our own animated glide where it is. True when one was running.
StickyStops.Stops#ours(y) method
Whether the scroll is where our glide put it lately - told late, as iOS tells it.
StickyStops.Stops#release() method
StickyStops.Stops#animate(to, duration) method
Glide to a position over a duration, along the easing curve.
StickyStops.Stops#glide(stop) method
StickyStops.Stops#approach(stop) method
Glide to a stop if it is within reach of where the scroll rests.
StickyStops.Stops#toward(stop, way) method
approach(), for a scroll the reader made heading way (1 down, -1 up):
unless the stop does not take a reader going that way (up, down).
StickyStops.Stops#settle() method
StickyStops.Stops#onScroll() method
StickyStops.Stops#scrolls(el) method
Whether an element scrolls by itself along this axis (and so keeps its keys).
StickyStops.Stops#keyed(event) method
Where a key sends the scroll: a stop to glide to ({top, element, key}), or null to leave the key to the browser (and to anyone else).
StickyStops.Stops#screened(stops, y, direction, screen, near, at) method
screens (1.5): an arrow or a page key reads the stop it is in a whole
screen at a time - its top, a screen further, ..., its end (its last
screen), exactly -, then goes on to the next stop's top; up, the same
back to its top, then to the end of the stop above. Down, from less
than shortEnd of a screen before the end the key goes on to the next stop
rather than to that end; up, a step that would rest less than that
under the stop's top goes to the top: never a short step to rest just
before a section. Past a neighbour farther than NEAR screens, the
browser scrolls, as for the other keys.
StickyStops.Stops#onInterrupt() method
StickyStops.Stops#onFocus() method
StickyStops.Stops#onResize() method
StickyStops.Stops#refresh() method
Re-measure the stops and report the progress. For content that moved.
StickyStops.Stops#queue() method
StickyStops.Stops#tick() method
StickyStops.Stops#progress() method
Where the scroll is between its two nearest stops: {index, from, to, top, progress, held}, also written to the custom properties and sent as sticky:progress when it changed. null with fewer than two stops.
StickyStops.attach() function
The stops of a scroller (the window by default); made if needed.
StickyStops.get() function
StickyStops.pause() function
Hold every scroller's stops off, e.g. while a script scrolls the page. Nests.
StickyStops.resume() function
StickyStops.refresh() function
StickyStops.scan() function
Attach every [data-sticky-axis] element of the document (or of an element) that holds stops, and detach the scrollers no longer in it.
StickyScenes
scene:progress event
Told on the scene (it bubbles) at each frame its progress changes: detail {progress, step, stepProgress, state, frame, scene}.
scene:key event
Told on the scene when a key takes it to a step, or out of it: detail {progress, top, scene} (progress 2: the section after, -1: the one before).
StickyScenes.defaults property
StickyScenes.Scene(el, options) function
StickyScenes.Scene#reduced() method
StickyScenes.Scene#sideways() method
StickyScenes.Scene#panelSteps() method
Where the panels begin, as progress (the steps of a sideways scene that names none).
StickyScenes.Scene#marks() method
The scroll positions of the steps, in order: where each begins, then the end.
StickyScenes.Scene#trackKey(e) method
StickyScenes.Scene#pinned() method
StickyScenes.Scene#scrollAt(p) method
The window's scroll position at a progress of the scene.
StickyScenes.Scene#keyed(e) method
Where a key sends the window: a scroll position, or null (the key is not the scene's).
StickyScenes.Scene#measureLength() method
StickyScenes.Scene#progress() method
The progress (0 to 1) of the scene at the scroll position now.
StickyScenes.Scene#update(force) method
StickyScenes.Scene#destroy() method
StickyScenes.attach() function
The scene of an element (made if needed).
StickyScenes.get() function
StickyScenes.scan() function
Attach every scene of the document (or of an element) not attached yet; forget those gone.
StickyScenes.refresh() function
Measure again (content that moved) and update every scene.
StickyScenes.all() function
Lists
StickySortable
sortable:change event
Told on a tree's root (StickySortable.Tree) after each move: detail {item, parent, index, depth, tree}.
StickySortable.defaults property
StickySortable#items() method
StickySortable#onPointerDown(e) method
StickySortable#forgetPress() method
The press waiting for the drag threshold, forgotten: its listeners removed.
StickySortable#beginDrag(item, pointerId, e) method
StickySortable#moveItemTo(clientX, clientY) method
StickySortable#sharesRow(a, b) method
Do these two boxes sit on the same visual row?
Overlap of more than half the shorter box, not "same top": widgets on a row are stretched to the tallest of them but a shorter neighbour that has not stretched still shares the row, and an exact-top test would call that a different one.
StickySortable#orientPlaceholder() method
Which way the drop marker should read, from where it has just landed.
Decided from the NEIGHBOURS rather than the placeholder itself: the placeholder is styled as a thin line, so it has no footprint of its own left to compare against anything.
between two cards sharing a row -> vertical, it goes between them nothing before it -> horizontal, it starts a new row neighbours on different rows -> horizontal, it goes between rows last position, room left on the row -> vertical
A plain vertical list (the sidebar menu uses this same sortable) never has two neighbours sharing a row, so it always reads horizontal, which is the right answer there without a special case.
StickySortable#findDropTarget(siblings, x, y) method
StickySortable#findMergeTarget(siblings, x, y) method
StickySortable#onPointerMove(e) method
StickySortable#topInset(rect) method
StickySortable#updateAutoscroll(clientY) method
StickySortable#runAutoscroll() method
StickySortable#onPointerUp(e) method
StickySortable#onKeyDown(e) method
Keyboard fallback: focus a handle, ArrowUp/ArrowDown moves its item, no pointer needed.
StickySortable.Tree.defaults property
StickySortable.Tree.defaults.maxDepth property
StickySortable.Tree(root, options) function
StickySortable.Tree#all() method
StickySortable.Tree#isItem(el) method
StickySortable.Tree#listOf(item, create) method
StickySortable.Tree#parentOf(item) method
StickySortable.Tree#depthOf(item) method
StickySortable.Tree#siblingsOf(item) method
StickySortable.Tree#heightOf(item) method
How many levels an item's subtree holds below it (0 for an item without children).
StickySortable.Tree#accepts(item) method
StickySortable.Tree#label(item) method
StickySortable.Tree#serialize(list) method
The tree as nested ids: data-id, else id.
StickySortable.Tree#collapse(item, folded) method
An item's children folded (true) or unfolded.
StickySortable.Tree#expand(item) method
StickySortable.Tree#sync(item) method
StickySortable.Tree#say(key, item, extra) method
StickySortable.Tree#changed(item, previousParent) method
StickySortable.Tree#allowed(item, parent, depth) method
Whether an item (its whole subtree) may sit at a depth under a parent.
StickySortable.Tree#onKeyDown(e) method
StickySortable.Tree#onClick(e) method
StickySortable.Tree#onPointerDown(e) method
StickySortable.Tree#begin(item, start, e) method
StickySortable.Tree#place(x, y) method
Where a pointer at (x, y) drops the item: {list, before, parent, depth}.
StickySortable.Tree#ancestorAt(item, depth) method
StickySortable.Tree#firstItemOf(list) method
StickySortable.Tree#onMove(e) method
StickySortable.Tree#onUp(e) method
StickySortable.Tree#destroy() method
Ajaxer
Ajaxer.settings constant
Ajaxer.clear() function
Ajaxer.parseTime(value) function
Ajaxer.ready(list, options) function
Ajaxer.get(key) function
Ajaxer.set(key, value) function
Ajaxer.add(key, value) function
Ajaxer.remove(key, value) function
Ajaxer.configure(options) function
Ajaxer.onLoad() function
Ajaxer.setMethod(name, type) function
Ajaxer.setUrl(name, url) function
Ajaxer.setOutput(name, dataType) function
Ajaxer.getTarget(name) function
Ajaxer.setTarget(name, el) function
Ajaxer.cancelable(name, cancelable) function
Ajaxer.setDebounce(name, debounce) function
Ajaxer.setLoaderDebounce(name, debounce) function
Ajaxer.setThrottle(name, throttle) function
Ajaxer.setLoaderThrottle(name, throttle) function
Ajaxer.setLoaderContainer(name, el) function
Ajaxer.setRetryLimit(name, retryLimit) function
Ajaxer.setQueryLimit(name, queryLimit) function
Ajaxer.debounce(name, func, timeout) function
Ajaxer.throttle(name, func, timeout) function
Ajaxer.abortAll() function
Ajaxer.abort(name, nKill) function
Ajaxer.register(name, xhr) function
Ajaxer.unregister(xhr) function
Ajaxer.isJson(str) function
Ajaxer.isDict(v) function
Ajaxer.xhr(name, data, success, error, complete) function
Cookie
cookie:ready event
Told on the window once Cookie.ready() has configured and started the module.
cookie:consent event
Told on the window at each answer: detail {categories, granted, revoked, source, pending}.
cookie:open event
Told on the window when the banner opens: detail {view} - "banner" or "details".
cookie:close event
Told on the window when the banner closes: detail {view}.
Cookie.seconds(value) function
Cookie.cookies property
The cookies, by their declaration: nothing is read or written under a category that is not granted.
Cookie.cookies.get() function
Cookie.cookies.set() function
Cookie.cookies.remove() function
Cookie.local property
localStorage and sessionStorage, by their declaration.
Cookie.signals() function
The privacy signals of the browser: {gpc, dnt}.
Cookie.use(key, options, onGrant, onRevoke) function
Run onGrant now if the category is granted and each time it becomes so, onRevoke each time it is withdrawn; whether it is granted now. A category not known yet is declared from the options, on demand. (omnibase/consent's Consent.use(name, options, onEnable, onDisable).)
Cookie.unuse(key, onGrant, onRevoke) function
Cookie.scan(rootNode) function
Cookie.ignored(el) function
Whether the element is in one the ignore option names: its clicks are not on the page.
Cookie.reduced() function
Whether the visitor asked for less motion.
Cookie.category(key, definition) function
Declare a category (or add to it), or read one: {key, label, description, default, required, storage, features, state, granted}.
Cookie.categories() function
The categories listed, in the order they were declared.
Cookie.storage(entry) function
Declare what is stored: an entry {type, name, category, duration, purpose, path, domain}, or a list of them.
Cookie.state(key) function
true | false | null (no answer) for a category; null for one that is not declared.
Cookie.granted(key) function
What a script should do now: the answer, else the category's default.
Cookie.pending() function
Whether an answer is wanted: a category without one, a new version, an answer too old.
Cookie.answered() function
Whether an answer that still counts was given.
Cookie.accept() function
Cookie.refuse() function
Cookie.save(map) function
Keep a choice {key: bool}; without one, the switches as the visitor set them (a category without a switch keeps its state).
Cookie.grant(keys) function
Cookie.revoke(keys) function
Cookie.forget() function
Erase the answer: the visitor is asked again.
Cookie.open(view, opener) function
Open the banner ("banner") or the detailed section ("details"); the reopen option's by default.
Cookie.close() function
Cookie.banner() function
The banner's element, once there is one.
Cookie.mount(target) function
Put the banner there (an element or a selector), as it is - several places of a page share the one live banner: another [data-cookie-banner], whose place it takes (that one takes the place it leaves, hidden), or any element, at whose end it goes. Before there is a banner, a [data-cookie-banner] named here is the one that becomes it. Returns the banner, null when there is none.
Cookie.onConsent(fn) function
fn(detail) at each answer.
Cookie.destroy() function
As loaded: no category, no declaration, no feature, no banner. The answer kept stays where it is.
Cookie.reset(el) function
Cookie.ready(options) function
Cookie.hasConsents(groupname) function
Cookie.refresh(defaultConsentDisplayed) function
Cookie.getOption(key) function
Cookie.setOption(key, value) function
Cookie.addOption(key, value) function
Cookie.removeOption(key, value) function
Cookie.configure(options) function
Cookie.onConfirm(onConfirm) function
Cookie.onDeny(onDeny) function
Cookie.onCheck(onCheck) function
Cookie.onLoad(el) function
Cookie.getConsents() function
Cookie.declare(groupname) function
Cookie.checkConsent(groupname) function
true | false | null: a category's answer, else what localStorage "cookie/<GROUP>" holds.