Methods
(static) fromElement(el, config) → {mw.Title|null}
Return an mw.Title from an HTMLAnchorElement if valid for page previews. Convenience method
Parameters:
Name | Type | Description |
---|---|---|
el |
HTMLAnchorElement | |
config |
mw.Map |
Returns:
- Type
- mw.Title | null
(static) getTitle(href, config) → {string|undefined}
Gets the title of a local page from an href given some configuration.
Parameters:
Name | Type | Description |
---|---|---|
href |
string | |
config |
mw.Map |
Returns:
- Type
- string | undefined
(static) isValid(title, contentNamespaces) → {mw.Title|null}
Given a page title it will return the mediawiki.Title if it is an eligible link for showing page previews, null otherwise
Parameters:
Name | Type | Description |
---|---|---|
title |
string | undefined | page title to check if it should show preview |
contentNamespaces |
Array.<number> | contentNamespaces as specified in wgContentNamespaces |
Returns:
- Type
- mw.Title | null
(inner) isOwnPageAnchorLink(el) → {boolean}
Fast, native check if we are parsing a self-link, with the only difference beeing the hash.
Parameters:
Name | Type | Description |
---|---|---|
el |
HTMLAnchorElement |
Returns:
- Type
- boolean