Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F7407076
ve.ui.WindowTool.js
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
ve.ui.WindowTool.js
View Options
/*!
* VisualEditor UserInterface WindowTool class.
*
* @copyright See AUTHORS.txt
*/
/**
* UserInterface dialog tool.
*
* @abstract
* @class
* @extends ve.ui.Tool
* @constructor
* @param {OO.ui.ToolGroup} toolGroup
* @param {Object} [config] Configuration options
*/
ve
.
ui
.
WindowTool
=
function
VeUiWindowTool
()
{
// Parent constructor
ve
.
ui
.
WindowTool
.
super
.
apply
(
this
,
arguments
);
};
/* Inheritance */
OO
.
inheritClass
(
ve
.
ui
.
WindowTool
,
ve
.
ui
.
Tool
);
/* Static Properties */
/**
* Name of the associated windows, if there is more than one possible value, or if it can't be
* deduced from the tool's command.
*
* @static
* @property {string[]}
* @inheritable
*/
ve
.
ui
.
WindowTool
.
static
.
associatedWindows
=
null
;
/* Methods */
/**
* @inheritdoc
*/
ve
.
ui
.
WindowTool
.
prototype
.
onUpdateState
=
function
(
fragment
,
contextDirection
,
activeDialogs
)
{
let
myWindowNames
=
[];
// Parent method
ve
.
ui
.
WindowTool
.
super
.
prototype
.
onUpdateState
.
apply
(
this
,
arguments
);
if
(
this
.
constructor
.
static
.
associatedWindows
!==
null
)
{
myWindowNames
=
this
.
constructor
.
static
.
associatedWindows
;
}
else
{
const
command
=
this
.
getCommand
();
if
(
command
&&
command
.
getAction
()
===
'window'
)
{
myWindowNames
=
[
command
.
getArgs
()[
0
]
];
}
}
// Show the tool as active if any of its associated windows is open
this
.
setActive
(
$
(
activeDialogs
).
filter
(
myWindowNames
).
length
!==
0
);
};
// Deprecated alias
ve
.
ui
.
DialogTool
=
ve
.
ui
.
WindowTool
;
/**
* Command help tool.
*
* @class
* @extends ve.ui.WindowTool
* @constructor
* @param {OO.ui.ToolGroup} toolGroup
* @param {Object} [config] Configuration options
*/
ve
.
ui
.
CommandHelpDialogTool
=
function
VeUiCommandHelpDialogTool
()
{
ve
.
ui
.
CommandHelpDialogTool
.
super
.
apply
(
this
,
arguments
);
};
OO
.
inheritClass
(
ve
.
ui
.
CommandHelpDialogTool
,
ve
.
ui
.
WindowTool
);
ve
.
ui
.
CommandHelpDialogTool
.
static
.
name
=
'commandHelp'
;
ve
.
ui
.
CommandHelpDialogTool
.
static
.
group
=
'help'
;
ve
.
ui
.
CommandHelpDialogTool
.
static
.
icon
=
'keyboard'
;
ve
.
ui
.
CommandHelpDialogTool
.
static
.
title
=
OO
.
ui
.
deferMsg
(
'visualeditor-dialog-command-help-title'
);
ve
.
ui
.
CommandHelpDialogTool
.
static
.
autoAddToCatchall
=
false
;
ve
.
ui
.
CommandHelpDialogTool
.
static
.
commandName
=
'commandHelp'
;
ve
.
ui
.
toolFactory
.
register
(
ve
.
ui
.
CommandHelpDialogTool
);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Nov 21, 20:45 (1 d, 12 h)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
96/28/3ea4de460287cc284684b62a312c
Default Alt Text
ve.ui.WindowTool.js (2 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment