Properties
compartmentRegistry :Object.<Compartment>
#
Registry of CodeMirror Compartments that are made available for reconfiguration in CodeMirrorPreferences.
Type:
- Source:
Registry of CodeMirror Compartments that are made available for reconfiguration in CodeMirrorPreferences.
defaultPreferences :Object
#
The default CodeMirror preferences, as defined by $wgCodeMirrorPreferences
.
Type:
- Source:
$wgCodeMirrorPreferences
.
extension
#
- Source:
extensionRegistry :Object.<Extension>
#
Registry of CodeMirror Extensions that are made available to CodeMirrorPreferences.
Type:
- Source:
isVisualEditor :boolean
#
optionName :string
#
panel
#
- Source:
panelStateField :StateField
#
prefsToggleEffect :StateEffectType
#
Methods
fetchPreferences() → {Object}
#
Fetch the user's CodeMirror preferences from the user options API, or clientside storage for unnamed users.
- Source:
Returns:
- Type
- Object
Fetch the user's CodeMirror preferences from the user options API, or clientside storage for unnamed users.
getCheckbox()
#
- Source:
getPreference(prefName) → {boolean}
#
Get the value of the given CodeMirror preference.
Parameters:
Name | Type | Description |
---|---|---|
prefName |
string |
- Source:
Returns:
- Type
- boolean
onKeydown(event)
#
Handle keydown events on the preferences panel.
Parameters:
Name | Type | Description |
---|---|---|
event |
KeyboardEvent |
- Source:
registerExtension(name, extension, view)
#
Register an Extension
with CodeMirrorPreferences, along with a
corresponding Compartment
so that the Extension can be reconfigured.
Parameters:
Name | Type | Description |
---|---|---|
name |
string | |
extension |
Extension | |
view |
EditorView |
- Source:
Register an Extension
with CodeMirrorPreferences, along with a
corresponding Compartment
so that the Extension can be reconfigured.
setPreference(key, value)
#
Set the given CodeMirror preference and update the user option in the database, or clientside storage for unnamed users.
Parameters:
Name | Type | Description |
---|---|---|
key |
string | |
value |
Mixed |
- Source:
Set the given CodeMirror preference and update the user option in the database, or clientside storage for unnamed users.
toggle(view, [force]) → {boolean}
#
Toggle display of the preferences panel.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
view |
EditorView | ||
force |
boolean |
optional |
Force the panel to open or close. |
- Source:
Returns:
- Type
- boolean