Module: title

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
Source:
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
Source:
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

Source:
Returns:
Type
mw.Title | null

Fast, native check if we are parsing a self-link, with the only difference beeing the hash.

Parameters:
Name Type Description
el HTMLAnchorElement
Source:
Returns:
Type
boolean