Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F7415268
ve.ce.LanguageAnnotation.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.ce.LanguageAnnotation.js
View Options
/*!
* VisualEditor ContentEditable LanguageAnnotation class.
*
* @copyright See AUTHORS.txt
*/
/**
* ContentEditable language annotation.
*
* @class
* @extends ve.ce.TextStyleAnnotation
* @constructor
* @param {ve.dm.LanguageAnnotation} model Model to observe
* @param {ve.ce.ContentBranchNode} [parentNode] Node rendering this annotation
* @param {Object} [config] Configuration options
*/
ve
.
ce
.
LanguageAnnotation
=
function
VeCeLanguageAnnotation
()
{
// Parent constructor
ve
.
ce
.
LanguageAnnotation
.
super
.
apply
(
this
,
arguments
);
// DOM changes
this
.
$element
.
addClass
(
've-ce-languageAnnotation'
)
.
addClass
(
've-ce-bidi-isolate'
)
.
prop
(
{
lang
:
this
.
model
.
getAttribute
(
'lang'
)
||
undefined
,
dir
:
this
.
model
.
getAttribute
(
'dir'
)
||
undefined
,
title
:
this
.
constructor
.
static
.
getDescription
(
this
.
model
)
}
);
};
/* Inheritance */
OO
.
inheritClass
(
ve
.
ce
.
LanguageAnnotation
,
ve
.
ce
.
TextStyleAnnotation
);
/* Static Properties */
ve
.
ce
.
LanguageAnnotation
.
static
.
name
=
'meta/language'
;
ve
.
ce
.
LanguageAnnotation
.
static
.
tagName
=
'span'
;
/* Static Methods */
/**
* @inheritdoc
*/
ve
.
ce
.
LanguageAnnotation
.
static
.
getDescription
=
function
(
model
)
{
const
lang
=
(
model
.
getAttribute
(
'lang'
)
||
''
).
toLowerCase
(),
name
=
ve
.
init
.
platform
.
getLanguageName
(
lang
),
dir
=
(
model
.
getAttribute
(
'dir'
)
||
''
).
toUpperCase
();
if
(
!
dir
||
dir
===
ve
.
init
.
platform
.
getLanguageDirection
(
lang
).
toUpperCase
()
)
{
return
ve
.
msg
(
'visualeditor-languageannotation-description'
,
name
);
}
return
ve
.
msg
(
'visualeditor-languageannotation-description-with-dir'
,
name
,
dir
);
};
/* Registration */
ve
.
ce
.
annotationFactory
.
register
(
ve
.
ce
.
LanguageAnnotation
);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Nov 22, 02:05 (1 d, 13 h)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
04/3b/f7bf11c5a66beaade32834def292
Default Alt Text
ve.ce.LanguageAnnotation.js (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment