Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F4125586
LinkTypeField.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
LinkTypeField.js
View Options
/**
* @class
* @extends OO.ui.FieldLayout
* @mixes OO.EventEmitter
* @constructor
*/
function
LinkTypeField
()
{
// Mixin constructor
OO
.
EventEmitter
.
call
(
this
);
this
.
radioInt
=
new
OO
.
ui
.
RadioOptionWidget
(
{
label
:
mw
.
msg
(
'wikieditor-toolbar-tool-link-int'
)
}
);
this
.
radioExt
=
new
OO
.
ui
.
RadioOptionWidget
(
{
label
:
mw
.
msg
(
'wikieditor-toolbar-tool-link-ext'
)
}
);
var
radioSelect
=
new
OO
.
ui
.
RadioSelectWidget
(
{
items
:
[
this
.
radioInt
,
this
.
radioExt
]
}
);
radioSelect
.
connect
(
this
,
{
choose
:
this
.
onRadioChoose
}
);
var
config
=
{
align
:
'top'
,
classes
:
[
'mw-wikiEditor-InsertLink-LinkTypeField'
]
};
LinkTypeField
.
super
.
call
(
this
,
radioSelect
,
config
);
}
OO
.
inheritClass
(
LinkTypeField
,
OO
.
ui
.
FieldLayout
);
OO
.
mixinClass
(
LinkTypeField
,
OO
.
EventEmitter
);
LinkTypeField
.
static
.
LINK_MODE_INTERNAL
=
'internal'
;
LinkTypeField
.
static
.
LINK_MODE_EXTERNAL
=
'external'
;
/**
* Select the 'external link' radio.
*
* @param {boolean} isExternal
*/
LinkTypeField
.
prototype
.
setIsExternal
=
function
(
isExternal
)
{
this
.
getField
().
selectItem
(
isExternal
?
this
.
radioExt
:
this
.
radioInt
);
};
/**
* Is the 'internal link' radio currently selected?
*
* @return {boolean}
*/
LinkTypeField
.
prototype
.
isInternal
=
function
()
{
return
this
.
radioInt
.
isSelected
();
};
/**
* Emit a 'change' event when the radio selection changes.
*
* @private
*/
LinkTypeField
.
prototype
.
onRadioChoose
=
function
()
{
this
.
emit
(
'change'
,
this
.
radioExt
.
isSelected
()
);
};
module
.
exports
=
LinkTypeField
;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Aug 19, 07:32 (2 w, 2 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
04/51/e4e4b3fda7dcbc0d85b07e0d769f
Default Alt Text
LinkTypeField.js (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment