Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F4050810
ve.ui.MWAriaDescribe.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.MWAriaDescribe.js
View Options
/**
* Mixin for adding descriptive ARIA support to elements.
*
* @class
* @abstract
*
* @constructor
* @param {Object} [config] Configuration options
* @param {jQuery} [config.$ariaDescribedBy]
* @param {string} [config.ariaLabel]
* @param {jQuery} [config.$describedElement]
*/
ve
.
ui
.
MWAriaDescribe
=
function
VeUiMWAriaDescribe
(
config
)
{
this
.
$describedElement
=
config
.
$describedElement
||
this
.
$element
;
if
(
config
.
$ariaDescribedBy
)
{
this
.
setAriaDescribedBy
(
config
.
$ariaDescribedBy
);
}
if
(
config
.
ariaLabel
)
{
this
.
setAriaLabel
(
config
.
ariaLabel
);
}
};
/* Setup */
OO
.
initClass
(
ve
.
ui
.
MWAriaDescribe
);
/**
* @param {jQuery} [$description]
* @chainable
* @return {OO.ui.Element} The element, for chaining
*/
ve
.
ui
.
MWAriaDescribe
.
prototype
.
setAriaDescribedBy
=
function
(
$description
)
{
if
(
!
$description
)
{
this
.
$describedElement
.
removeAttr
(
'aria-describedby'
);
return
this
;
}
if
(
!
$description
.
attr
(
'id'
)
)
{
$description
.
attr
(
'id'
,
OO
.
ui
.
generateElementId
()
);
}
this
.
$describedElement
.
attr
(
'aria-describedby'
,
$description
.
attr
(
'id'
)
);
return
this
;
};
/**
* @param {string} label
* @chainable
* @return {OO.ui.Element} The element, for chaining
*/
ve
.
ui
.
MWAriaDescribe
.
prototype
.
setAriaLabel
=
function
(
label
)
{
this
.
$describedElement
.
attr
(
'aria-label'
,
label
);
return
this
;
};
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Aug 15 2026, 17:29 (12 w, 3 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
ce/02/bd7da3c2811d35b8d1a789682ea7
Default Alt Text
ve.ui.MWAriaDescribe.js (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment