Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F7423332
ve.ui.ToolContextItem.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.ToolContextItem.js
View Options
/*!
* VisualEditor ToolContextItem class.
*
* @copyright See AUTHORS.txt
*/
/**
* Context item for a tool.
*
* @class
* @extends ve.ui.LinearContextItem
*
* @param {ve.ui.LinearContext} context Context the item is in
* @param {ve.dm.Model} model Model the item is related to
* @param {Function} tool Tool class the item is based on
* @param {Object} [config] Configuration options
*/
ve
.
ui
.
ToolContextItem
=
function
VeUiToolContextItem
(
context
,
model
,
tool
,
config
)
{
// Parent constructor
ve
.
ui
.
ToolContextItem
.
super
.
call
(
this
,
context
,
model
,
config
);
// Properties
this
.
tool
=
tool
;
// Initialization
this
.
setIcon
(
tool
.
static
.
icon
);
this
.
setLabel
(
tool
.
static
.
title
);
this
.
$element
.
addClass
(
've-ui-toolContextItem'
);
};
/* Inheritance */
OO
.
inheritClass
(
ve
.
ui
.
ToolContextItem
,
ve
.
ui
.
LinearContextItem
);
/* Methods */
/**
* @inheritdoc
*/
ve
.
ui
.
ToolContextItem
.
prototype
.
getCommand
=
function
()
{
return
this
.
tool
.
static
.
getCommand
(
this
.
context
.
getSurface
()
);
};
/**
* Get a description of the model.
*
* @return {string} Description of model
*/
ve
.
ui
.
ToolContextItem
.
prototype
.
getDescription
=
function
()
{
let
description
=
''
;
if
(
this
.
model
instanceof
ve
.
dm
.
Annotation
)
{
description
=
ve
.
ce
.
annotationFactory
.
getDescription
(
this
.
model
);
}
else
if
(
this
.
model
instanceof
ve
.
dm
.
Node
)
{
description
=
ve
.
ce
.
nodeFactory
.
getDescription
(
this
.
model
);
}
return
description
;
};
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Nov 22, 06:33 (23 h, 9 m)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
24/23/d2d693ccde429e25bd0708f77ee6
Default Alt Text
ve.ui.ToolContextItem.js (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment