User:Asqueella/JEP 107: Difference between revisions

→‎ScriptMod constructor: Make 'include' required [7:ff25bb83ffdb in my repo]
m (fix the heading level)
(→‎ScriptMod constructor: Make 'include' required [7:ff25bb83ffdb in my repo])
Line 59: Line 59:
==== <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 script mod should run on.
* <code>include</code>: a required parameter specifying the pages the scripts in this script mod should run on.
** 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