Popups
Displays page/reference previews when hovering over a link to an article/reference.
Loading...
Searching...
No Matches
Popups\PopupsContext Class Reference

Public Member Functions

 __construct (Config $config, ExtensionRegistry $extensionRegistry, PopupsGadgetsIntegration $gadgetsIntegration, SpecialPageFactory $specialPageFactory, UserOptionsLookup $userOptionsLookup)
 
 conflictsWithNavPopupsGadget (User $user)
 
 conflictsWithRefTooltipsGadget (User $user)
 
 showPreviewsOptInOnPreferencesPage ()
 Are Page previews visible on User Preferences Page.
 
 isReferencePreviewsEnabled (User $user)
 
 getConfigBitmaskFromUser (User $user)
 
 shouldSendModuleToUser (User $user)
 
 areDependenciesMet ()
 
 isTitleExcluded ( $title)
 Whether popups code should be shipped to $title.
 

Public Attributes

const EXTENSION_NAME = 'popups'
 
const LOGGER_CHANNEL = 'popups'
 Logger channel name.
 
const PREVIEWS_ENABLED = true
 User preference value for enabled Page Previews.
 
const PREVIEWS_DISABLED = false
 User preference value for disabled Page Previews.
 
const PREVIEWS_OPTIN_PREFERENCE_NAME = 'popups'
 User preference key to enable/disable Page Previews.
 
const REFERENCE_PREVIEWS_PREFERENCE_NAME = 'popups-reference-previews'
 User preference key to enable/disable Reference Previews.
 

Static Protected Attributes

static $instance
 

Constructor & Destructor Documentation

◆ __construct()

Popups\PopupsContext::__construct ( Config $config,
ExtensionRegistry $extensionRegistry,
PopupsGadgetsIntegration $gadgetsIntegration,
SpecialPageFactory $specialPageFactory,
UserOptionsLookup $userOptionsLookup )
Parameters
Config$configMediawiki configuration
ExtensionRegistry$extensionRegistryMediaWiki extension registry
PopupsGadgetsIntegration$gadgetsIntegrationGadgets integration helper
SpecialPageFactory$specialPageFactory
UserOptionsLookup$userOptionsLookup

Member Function Documentation

◆ areDependenciesMet()

Popups\PopupsContext::areDependenciesMet ( )
Returns
bool

◆ conflictsWithNavPopupsGadget()

Popups\PopupsContext::conflictsWithNavPopupsGadget ( User $user)
Parameters
User$userUser whose gadgets settings are being checked
Returns
bool

◆ conflictsWithRefTooltipsGadget()

Popups\PopupsContext::conflictsWithRefTooltipsGadget ( User $user)
Parameters
User$userUser whose gadgets settings are being checked
Returns
bool

◆ getConfigBitmaskFromUser()

Popups\PopupsContext::getConfigBitmaskFromUser ( User $user)
Parameters
User$userUser whose preferences are checked
Returns
int

◆ isReferencePreviewsEnabled()

Popups\PopupsContext::isReferencePreviewsEnabled ( User $user)
Parameters
User$userUser whose preferences are checked
Returns
bool whether or not to show reference previews

◆ isTitleExcluded()

Popups\PopupsContext::isTitleExcluded ( $title)

Whether popups code should be shipped to $title.

For example, if 'Special:UserLogin' is excluded, and the user is on 'Special:UserLogin', then the title is considered excluded.

A title is also considered excluded if its root matches one of the page names from the config variable. For example, if 'User:A' is excluded, and the title is 'User:A/b', then this title is considered excluded.

Language specific excluded titles affect all languages. For example, if "Main_Page" is excluded, "Bosh_Sahifa" (which is "Main_Page" in Uzbek) is considered excluded too.

Parameters
Title$titletitle being tested
Returns
bool

◆ shouldSendModuleToUser()

Popups\PopupsContext::shouldSendModuleToUser ( User $user)
Parameters
User$userUser whose preferences are checked
Returns
bool

◆ showPreviewsOptInOnPreferencesPage()

Popups\PopupsContext::showPreviewsOptInOnPreferencesPage ( )

Are Page previews visible on User Preferences Page.

Returns
bool

Member Data Documentation

◆ REFERENCE_PREVIEWS_PREFERENCE_NAME

const Popups\PopupsContext::REFERENCE_PREVIEWS_PREFERENCE_NAME = 'popups-reference-previews'

User preference key to enable/disable Reference Previews.

Named "mwe-popups-referencePreviews-enabled" in localStorage for anonymous users.


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