Methods
abandon() → {Redux.Thunk}static
#
Represents the user abandoning a link, either by moving their mouse away from it or by shifting focus to another UI element using their keyboard or an assistive device, or abandoning a preview by moving their mouse away from it.
- Source:
Returns:
- Type
- Redux.Thunk
boot(initiallyEnabled, user, userSettings, config, url) → {Object}static
#
Represents Page Previews booting.
When a Redux store is created, the @@INIT
action is immediately
dispatched to it. To avoid overriding the term, we refer to booting rather
than initializing.
Page Previews persists critical pieces of information to local storage.
Since reading from and writing to local storage are synchronous, Page
Previews is booted when the browser is idle (using
mw.requestIdleCallback
)
so as not to impact latency-critical events.
Parameters:
Name | Type | Description |
---|---|---|
initiallyEnabled |
Object | Allows to disable individual popup types while still showing the footer link |
user |
mw.User | |
userSettings |
||
config |
mw.Map | The config of the MediaWiki client-side application,
i.e. |
url |
string |
- Source:
Returns:
- Type
- Object
fetch(gateway, title, el, token, type) → {Redux.Thunk}static
#
Represents Page Previews fetching data via the gateway.
Parameters:
Name | Type | Description |
---|---|---|
gateway |
Gateway | |
title |
mw.Title | |
el |
HTMLAnchorElement | |
token |
string | The unique token representing the link interaction that triggered the fetch |
type |
string | One of the previewTypes.TYPE_… constants |
- Source:
Returns:
- Type
- Redux.Thunk
hideSettings() → {Object}static
#
Represents the user closing the settings dialog and saving their settings.
- Source:
Returns:
- Type
- Object
linkClick(el) → {Object}static
#
Represents the user clicking on a link with their mouse, keyboard, or an assistive device.
Parameters:
Name | Type | Description |
---|---|---|
el |
HTMLAnchorElement |
- Source:
Returns:
- Type
- Object
linkDwell(title, el, measures, gateway, generateToken, type) → {Redux.Thunk}static
#
Represents the user dwelling on a link, either by hovering over it with their mouse or by focussing it using their keyboard or an assistive device.
Parameters:
Name | Type | Description |
---|---|---|
title |
mw.Title | |
el |
HTMLAnchorElement | |
measures |
ext.popups.Measures | |
gateway |
Gateway | |
generateToken |
function | |
type |
string | One of the previewTypes.TYPE_… constants |
- Source:
Returns:
- Type
- Redux.Thunk
pageviewLogged() → {Object}static
#
Represents the situation when a pageview has been logged (see previewShow and PREVIEW_SEEN action type)
- Source:
Returns:
- Type
- Object
previewDwell() → {Object}static
#
Represents the user dwelling on a preview with their mouse.
- Source:
Returns:
- Type
- Object
previewShow(token) → {Object}static
#
Represents a preview being shown to the user.
This action is dispatched by the ./changeListeners/render.js
change
listener.
Parameters:
Name | Type | Description |
---|---|---|
token |
string |
- Source:
Returns:
- Type
- Object
registerSetting(name, enabled) → {Object}static
#
Registers a page preview setting for anonymous users.
Parameters:
Name | Type | Description |
---|---|---|
name |
string | setting name which is used for storage and deriving associated messages. |
enabled |
boolean | is the feature enabled by default? |
- Source:
Returns:
- Type
- Object
saveSettings(enabled) → {Redux.Thunk}static
#
Represents the user saving their settings.
N.B. This action returns a Redux.Thunk not because it needs to perform
asynchronous work, but because it needs to query the global state for the
current enabled state. In order to keep the enabled state in a single
place (the preview reducer), we query it and dispatch it as oldValue
so that other reducers (like settings) can act on it without having to
duplicate the enabled
state locally.
See docs/adr/0003-keep-enabled-state-only-in-preview-reducer.md for more
details.
Parameters:
Name | Type | Description |
---|---|---|
enabled |
Object | Mapping preview type identifiers to boolean flags |
- Source:
Returns:
- Type
- Redux.Thunk
showSettings() → {Object}static
#
Represents the user clicking either the "Enable previews" footer menu link, or the "cog" icon that's present on each preview.
- Source:
Returns:
- Type
- Object
statsvLogged() → {Object}static
#
Represents the queued statsv event being logged.
See mw.popups.changeListeners.statsv
change listener.
- Source:
Returns:
- Type
- Object
timedAction(baseAction) → {Object}inner
#
Mixes in timing information to an action.
Warning: the baseAction
parameter is modified and returned.
Parameters:
Name | Type | Description |
---|---|---|
baseAction |
Object |
- Source:
Returns:
- Type
- Object