User:Asqueella/JEP 107: Difference between revisions

m
Line 45: Line 45:
==== <code>ScriptMod</code> constructor ====
==== <code>ScriptMod</code> constructor ====
The <code>ScriptMod</code> constructor takes a single <code>options</code> parameter which is an object that may define the following properties:
The <code>ScriptMod</code> constructor takes a single <code>options</code> parameter which is an object that may define the following properties:
* <code>include</code>: an optional parameter, specifying the pages the scripts in this ScriptMod should run on.
* <code>include</code>: an optional parameter specifying the pages the scripts in this script mod should run on.
** Default behavior is to run the mod's scripts on all pages.
** The default behavior is to run the mod's scripts on all pages.
** Providing a string value <code>str</code> is equivalent to providing a single-item array <code>[str]</code>.
** Providing a string value <code>str</code> is equivalent to providing a single-item array <code>[str]</code>.
** The mod's scripts run on pages, matching ''any'' of <code>include</code> rules.
** The mod's scripts run on pages, matching ''any'' of <code>include</code> rules.
Confirmed users
161

edits