Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F1431320
ve.ui.MWLatexContextItem.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.MWLatexContextItem.js
View Options
/*!
* VisualEditor MWLatexContextItem class.
*
* @copyright See AUTHORS.txt
*/
/**
* Abstract context item for a node of a formula provided
* by the Math extension.
*
* @abstract
* @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 {Object} config Configuration options
*/
ve
.
ui
.
MWLatexContextItem
=
function
VeUiMWLatexContextItem
()
{
// Parent constructor
ve
.
ui
.
MWLatexContextItem
.
super
.
apply
(
this
,
arguments
);
this
.
quickEditButton
=
new
OO
.
ui
.
ButtonWidget
(
{
label
:
ve
.
msg
(
'math-visualeditor-mwlatexcontextitem-quickedit'
),
flags
:
[
'progressive'
]
}
);
// Don't show quick edit button in mobile as the primary action will be quick edit
if
(
!
this
.
context
.
isMobile
()
&&
!
this
.
isReadOnly
()
)
{
this
.
actionButtons
.
addItems
(
[
this
.
quickEditButton
],
0
);
}
this
.
quickEditButton
.
connect
(
this
,
{
click
:
'onInlineEditButtonClick'
}
);
// Initialization
this
.
$element
.
addClass
(
've-ui-mwLatexContextItem'
);
};
/* Inheritance */
OO
.
inheritClass
(
ve
.
ui
.
MWLatexContextItem
,
ve
.
ui
.
LinearContextItem
);
/* Static Properties */
ve
.
ui
.
MWLatexContextItem
.
static
.
embeddable
=
false
;
ve
.
ui
.
MWLatexContextItem
.
static
.
inlineEditCommand
=
null
;
/* Methods */
/**
* Handle inline edit button click events.
*/
ve
.
ui
.
MWLatexContextItem
.
prototype
.
onInlineEditButtonClick
=
function
()
{
this
.
context
.
getSurface
().
executeCommand
(
this
.
constructor
.
static
.
inlineEditCommand
);
};
/**
* @inheritdoc
*/
ve
.
ui
.
MWLatexContextItem
.
prototype
.
getCommand
=
function
()
{
return
this
.
context
.
getSurface
().
commandRegistry
.
lookup
(
this
.
context
.
isMobile
()
?
this
.
constructor
.
static
.
inlineEditCommand
:
this
.
constructor
.
static
.
commandName
);
};
/**
* @inheritdoc
*/
ve
.
ui
.
MWLatexContextItem
.
prototype
.
getDescription
=
function
()
{
return
ve
.
ce
.
nodeFactory
.
getDescription
(
this
.
model
);
};
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, May 16, 20:19 (1 d, 2 h)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
bf/98/0c919aa1873ce09d4a4fd776b101
Default Alt Text
ve.ui.MWLatexContextItem.js (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment