Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F4072995
ve.ui.CodeMirrorAction.v6.js
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
ve.ui.CodeMirrorAction.v6.js
View Options
/*!
* VisualEditor UserInterface CodeMirrorAction class.
*/
require
(
'./ve.ui.CodeMirrorTool.v6.js'
);
/**
* CodeMirror action
*
* @class
* @extends ve.ui.Action
* @constructor
* @param {ve.ui.Surface} surface Surface to act on
*/
ve
.
ui
.
CodeMirrorAction
=
function
VeUiCodeMirrorAction
()
{
// Parent constructor
ve
.
ui
.
CodeMirrorAction
.
super
.
apply
(
this
,
arguments
);
};
/* Inheritance */
OO
.
inheritClass
(
ve
.
ui
.
CodeMirrorAction
,
ve
.
ui
.
Action
);
/* Static Properties */
ve
.
ui
.
CodeMirrorAction
.
static
.
name
=
'codeMirror'
;
/**
* @inheritdoc
*/
ve
.
ui
.
CodeMirrorAction
.
static
.
methods
=
[
'toggle'
];
/* Methods */
/**
* @method
* @param {boolean} [enable] State to force toggle to, inverts current state if undefined
* @return {boolean} Action was executed
*/
ve
.
ui
.
CodeMirrorAction
.
prototype
.
toggle
=
function
(
enable
)
{
if
(
!
this
.
surface
.
mirror
&&
(
enable
||
enable
===
undefined
)
)
{
mw
.
loader
.
using
(
[
'jquery.client'
,
'ext.CodeMirror.v6.mode.mediawiki'
]
).
then
(
()
=>
{
const
CodeMirrorVisualEditor
=
require
(
'../codemirror.visualEditor.js'
);
const
mediawikiLang
=
require
(
'ext.CodeMirror.v6.mode.mediawiki'
);
this
.
surface
.
mirror
=
new
CodeMirrorVisualEditor
(
this
.
surface
,
mediawikiLang
(
{
bidiIsolation
:
false
,
codeFolding
:
false
,
autocomplete
:
false
,
openLinks
:
false
}
)
);
this
.
surface
.
mirror
.
initialize
();
}
);
}
else
if
(
this
.
surface
.
mirror
)
{
this
.
surface
.
mirror
.
toggle
(
enable
);
}
return
true
;
};
/* Registration */
ve
.
ui
.
actionFactory
.
register
(
ve
.
ui
.
CodeMirrorAction
);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Aug 17 2026, 09:26 (11 w, 2 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
45/f7/ecc83c618df405b5922e749de873
Default Alt Text
ve.ui.CodeMirrorAction.v6.js (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment