Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F7424342
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 {Promise} Action was executed
*/
ve
.
ui
.
CodeMirrorAction
.
prototype
.
toggle
=
async
function
(
enable
)
{
if
(
!
this
.
surface
.
mirror
&&
(
enable
||
enable
===
undefined
)
)
{
await
mw
.
loader
.
using
(
[
'ext.CodeMirror.v6.mode.mediawiki'
]
);
const
CodeMirrorVisualEditor
=
require
(
'../codemirror.visualEditor.js'
);
const
{
mediawiki
}
=
require
(
'ext.CodeMirror.v6.mode.mediawiki'
);
this
.
surface
.
mirror
=
new
CodeMirrorVisualEditor
(
this
.
surface
,
mediawiki
(
{
bidiIsolation
:
false
,
codeFolding
:
false
,
autocomplete
:
false
,
openLinks
:
false
}
)
);
this
.
surface
.
mirror
.
initialize
();
}
else
if
(
this
.
surface
.
mirror
)
{
this
.
surface
.
mirror
.
toggle
(
enable
);
}
};
/* Registration */
ve
.
ui
.
actionFactory
.
register
(
ve
.
ui
.
CodeMirrorAction
);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Nov 22, 07:19 (21 h, 25 m)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
ff/51/6a64b238142a6b1a324f0a953824
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