The main script object, globally available (the modules use the cd alias).
Namespaces
Members
(static) commentForms :Array.<CommentForm>
- Source:
- See:
Collection of all comment forms on the page in the order of their creation.
Type:
- Array.<CommentForm>
(static) comments :Array.<Comment>
- Source:
- See:
Collection of all comments on the page ordered the same way as in the DOM.
Type:
- Array.<Comment>
(static) config :object
- Source:
Script configuration. The default configuration is in module:defaultConfig.
Type:
- object
(static) debug
- Source:
- See:
Reference to the debug module.
(static) isRunning :boolean
- Source:
Is the script running.
Type:
- boolean
(static) isWorker :boolean
- Source:
Is the code running in the worker context.
Type:
- boolean
(static) page :module:pageRegistry.Page
- Source:
- See:
Current page's object.
Type:
(static) sections :Array.<Section>
- Source:
- See:
Collection of all sections on the page ordered the same way as in the DOM.
Type:
- Array.<Section>
(static) user :module:userRegistry.User
- Source:
- See:
Current user's object.
Type:
Methods
(static) mws(name, …paramsopt) → {string}
- Source:
A foolproof method to access MediaWiki messages intended to be used instead of
mw.msg() to eliminate
any possibility of an XSS injection. By programmer's mistake some mw.msg()
value could be
inserted into a page in a raw HTML form. To prevent this, this function should be used, so if
the message contains an injection (for example, brought from Translatewiki or inserted by a
user who doesn't have the editsitejs
right but does have the editinterface
right), the
function would sanitize the value.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
name |
string | String name. |
|
params |
* |
<optional> <repeatable> |
String parameters (substituted strings, also
User objects for use in {{gender:}}). The last parameter can
be an object that can have a string property |
Returns:
- Type
- string
(static) s(name, …paramsopt) → (nullable) {string}
- Source:
Get a language string.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
name |
string | String name. |
|
params |
* |
<optional> <repeatable> |
String parameters (substituted strings, also
User objects for use in |
Returns:
- Type
- string
(static) sParse(name, …paramsopt) → (nullable) {string}
- Source:
Get a language string in the "parse" format. Wikilinks are replaced with HTML tags, the code is sanitized. Use this for strings that have their raw HTML inserted into the page.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
name |
string | String name. |
|
params |
* |
<optional> <repeatable> |
String parameters (substituted strings, also
User objects for use in |
Returns:
- Type
- string