(require("MediaWiki-Popups Integration"))(store, registerModel, registerPreviewUI, registerGatewayForPreviewType) → {Object}
This function provides a mw.popups object which can be used by 3rd party to interact with Popups.
Parameters:
Name | Type | Description |
---|---|---|
store |
Redux.Store | Popups store |
registerModel |
function | allows extensions to register custom preview handlers. |
registerPreviewUI |
function | allows extensions to register custom preview renderers. |
registerGatewayForPreviewType |
function | allows extensions to register gateways for preview types. |
- Source:
Returns:
external Popups interface
- Type
- Object
Methods
(inner) isEnabled() → {boolean}
- Source:
Returns:
If Page Previews are currently active
- Type
- boolean
(inner) register(module)
Register a custom preview type.
Parameters:
Name | Type | Description |
---|---|---|
module |
PopupModule |
- Source:
Type Definitions
PopupModule
Type:
- Object
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
type |
string | A unique string for identifying the subtype of a page preview |
|
renderFn |
function |
<optional> |
How the custom preview type will render the preview. If not provided default renderer is used. |
type |
string | A unique string for identifying the type of page preview |
|
selector |
string | A CSS selector which identifies elements that will display this type of page preview |
|
gateway |
Gateway | A Gateway for obtaining the preview data. |
|
renderFn |
function |
<optional> |
How the custom preview type will render the preview. If not provided default renderer is used. |
subTypes |
Array.<PopupSubtype> | this is for registering types that are subsets of the current type e.g. share the same selector. |
|
delay |
number |
<optional> |
optional delay between hovering and displaying preview. If not defined, delay will be zero. |
- Source: