ResourceLoader/Vocabulary

From MediaWiki.org
Jump to: navigation, search

Programming Interfaces[edit]

ResourceLoader
A PHP class that handles generating request strings and serving modules.
ResourceLoaderModule

Context[edit]

Web requests to load.php can specify values for these; ResourceLoader does so when it inserts load.php URLs in the HTML and JavaScript that it generates. PHP server code can retrieve their values through getDebug/Skin/Language() methods of ResourceLoaderContext. In the browser these usually map to debug, skin, and wgUserLanguage configuration values in mw.config.

debug
Also known as Development mode. See Debug mode for more information.
skin
The ID of the skin that the requesting page uses.
lang
The language code of the interface that the requesting page is displayed in.

Resources[edit]

Resource
Any component in a module (messages, scripts, and styles).
Loader
A JavaScript object (mw.loader) that handles dependencies and loading procedures for modules.
Localization
A PHP file that provides localized messages in multiple languages for a module.
Message blob
A JSON string containing messages used in a module in a specific language.
Module
A combination of one or more scripts and/or styles identified by a unique name.
Dependencies
One or more modules which must be loaded for the module to function.
Script
A JavaScript file that provides the body of the module’s code.
Style
A CSS file that provides style rules for a module.
Origin
The type of place a module originates from. Used to determine whether a module is safe for certain uses. Eg. a user- or site-generated module is never ran on Special:UserLogin or Special:Preferences. See also ResourceLoader/Origins.

Module loader states[edit]

» See also mediaWiki.loader and RL client-side errors.
registered
A module has been identified to exist by a call to mw.loader.register (this is the default state for a module before it is used).
loading
A module is being received by the client.
loaded
A module has been received by the client.
ready
A module has been received by the client, and executed with no errors
error
TODO
null
TODO


ResourceLoaderResourceLoader
Documentation FeaturesResourceLoader/Features · VocabularyResourceLoader/Vocabulary · Migration guide (users)ResourceLoader/Migration guide (users) · Migration guide (developers)ResourceLoader/Migration guide for extension developers · Developing with ResourceLoaderResourceLoader/Developing with ResourceLoader · Core modulesResourceLoader/Modules · Mobile supportResourceLoader/Writing a MobileFrontend friendly ResourceLoader module
Project information Status updatesResourceLoader/status · Version 1 Design SpecificationResourceLoader/Version 1 Design Specification · Version 2 Design SpecificationResourceLoader/Version 2 Design Specification · RequirementsResourceLoader/Requirements
Other JavaScript DeprecationsResourceLoader/Legacy JavaScript