Class: PageGateway

PageGateway(api)

new PageGateway(api)

API for providing Page data

Parameters:
Name Type Description
api mw.Api
Source:

Methods

getPage(title, endpointopt, leadOnlyopt) → {jQuery.Deferred}

Retrieve a page from the api

Parameters:
Name Type Attributes Description
title string

the title of the page to be retrieved

endpoint string <optional>

an alternative api url to retrieve the page from

leadOnly boolean <optional>

When set only the lead section content is returned

Source:
Returns:

with parameter page data that can be passed to a Page view

Type
jQuery.Deferred

getPageLanguages(title, languageopt) → {jQuery.Deferred}

Retrieve available languages for a given title

Parameters:
Name Type Attributes Description
title string

the title of the page languages should be retrieved for

language string <optional>

when provided the names of the languages returned will be translated additionally into this language.

Source:
Returns:

which is called with an object containing langlinks and variant links as defined @ https://en.m.wikipedia.org/w/api.php?action=help&modules=query%2Blanglinks

Type
jQuery.Deferred

getSections(title) → {JQuery.Promise}

Retrieve the sections of a page

Parameters:
Name Type Description
title string

the title of the page to retrieve sections for

Source:
Returns:
Type
JQuery.Promise

getSectionsFromHTML($el) → {Array}

Order sections hierarchically

Parameters:
Name Type Description
$el jQuery.Object

object from which sections are extracted

Source:
Returns:

Ordered array of sections

Type
Array

invalidatePage(title)

Invalidate the internal cache for a given page

Parameters:
Name Type Description
title string

the title of the page who's cache you want to invalidate

Source: