Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F4102165
ve.ui.MWReferencesListCommand.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.MWReferencesListCommand.js
View Options
'use strict'
;
/*!
* VisualEditor UserInterface MediaWiki ReferencesListCommand class.
*
* @copyright 2011-2018 VisualEditor Team's Cite sub-team and others; see AUTHORS.txt
* @license MIT
*/
/**
* References list command.
*
* If a references list node is selected, opens the dialog to edit it.
* Otherwise inserts the references list for the default group.
*
* @constructor
* @extends ve.ui.Command
*/
ve
.
ui
.
MWReferencesListCommand
=
function
VeUiMWReferencesListCommand
()
{
// Parent constructor
ve
.
ui
.
MWReferencesListCommand
.
super
.
call
(
this
,
'referencesList'
,
null
,
null
,
{
supportedSelections
:
[
'linear'
]
}
);
};
/* Inheritance */
OO
.
inheritClass
(
ve
.
ui
.
MWReferencesListCommand
,
ve
.
ui
.
Command
);
/* Methods */
/**
* @override
*/
ve
.
ui
.
MWReferencesListCommand
.
prototype
.
execute
=
function
(
surface
)
{
const
fragment
=
surface
.
getModel
().
getFragment
();
const
selectedNode
=
fragment
.
getSelectedNode
();
const
isReflistNodeSelected
=
selectedNode
&&
selectedNode
instanceof
ve
.
dm
.
MWReferencesListNode
;
if
(
isReflistNodeSelected
)
{
return
surface
.
execute
(
'window'
,
'open'
,
'referencesList'
);
}
else
{
fragment
.
collapseToEnd
().
insertContent
(
[
{
type
:
'mwReferencesList'
,
attributes
:
{
listGroup
:
'mwReference/'
,
refGroup
:
''
,
isResponsive
:
mw
.
config
.
get
(
'wgCiteResponsiveReferences'
)
}
},
{
type
:
'/mwReferencesList'
}
]
);
return
true
;
}
};
/* Registration */
ve
.
ui
.
commandRegistry
.
register
(
new
ve
.
ui
.
MWReferencesListCommand
()
);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Aug 18, 17:18 (3 w, 3 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
a1/1b/d5916a4c17c92ae8283b8be6095f
Default Alt Text
ve.ui.MWReferencesListCommand.js (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment