MobileFrontend
Mobile optimised frontend for MediaWiki
Loading...
Searching...
No Matches
MobileFrontend\Transforms\MakeSectionsTransform Class Reference

Implements IMobileTransform, that splits the body of the document into sections demarcated by the $headings elements. More...

+ Inheritance diagram for MobileFrontend\Transforms\MakeSectionsTransform:
+ Collaboration diagram for MobileFrontend\Transforms\MakeSectionsTransform:

Public Member Functions

 __construct (array $topHeadingTags, bool $scriptsEnabled)
 
 apply (DOMElement $doc)
 Performs html transformation that splits the body of the document into sections demarcated by the $headings elements.
 

Static Public Member Functions

static interimTogglingSupport ( $nonce)
 Make it possible to open sections while JavaScript is still loading.
 

Public Attributes

const STYLE_COLLAPSIBLE_SECTION_CLASS = 'collapsible-block'
 Class name for collapsible section wrappers.
 

Detailed Description

Implements IMobileTransform, that splits the body of the document into sections demarcated by the $headings elements.

Also moves the first paragraph in the lead section above the infobox.

All member elements of the sections are added to a

so that the section bodies are clearly defined (to be "expandable" for example).

See also
IMobileTransform

Constructor & Destructor Documentation

◆ __construct()

MobileFrontend\Transforms\MakeSectionsTransform::__construct ( array $topHeadingTags,
bool $scriptsEnabled )
Parameters
array$topHeadingTagslist of tags could ne cosidered as sections
bool$scriptsEnabledwheather scripts are enabled

Member Function Documentation

◆ apply()

MobileFrontend\Transforms\MakeSectionsTransform::apply ( DOMElement $doc)

Performs html transformation that splits the body of the document into sections demarcated by the $headings elements.

Also moves the first paragraph in the lead section above the infobox.

Parameters
DOMElement$dochtml document

Implements MobileFrontend\Transforms\IMobileTransform.

◆ interimTogglingSupport()

static MobileFrontend\Transforms\MakeSectionsTransform::interimTogglingSupport ( $nonce)
static

Make it possible to open sections while JavaScript is still loading.

Parameters
string | null$nonceCSP nonce or null if feature is disabled
Returns
string The JavaScript code to add event handlers to the skin

The documentation for this class was generated from the following file: