Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F4058617
LinkTextField.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
LinkTextField.js
View Options
/**
* @class
* @extends OO.ui.FieldLayout
* @constructor
*/
function
LinkTextField
()
{
const
input
=
new
OO
.
ui
.
TextInputWidget
(
{
placeholder
:
mw
.
msg
(
'wikieditor-toolbar-tool-link-int-text-tooltip'
)
}
);
input
.
connect
(
this
,
{
change
:
'onInputChange'
}
);
const
config
=
{
align
:
'top'
,
label
:
mw
.
msg
(
'wikieditor-toolbar-tool-link-int-text'
),
classes
:
[
'mw-wikiEditor-InsertLink-LinkTextField'
]
};
LinkTextField
.
super
.
call
(
this
,
input
,
config
);
// Whether the user has changed the value
// (as opposed to the value being changed automatically
// because the link target field changed).
this
.
touched
=
false
;
}
OO
.
inheritClass
(
LinkTextField
,
OO
.
ui
.
FieldLayout
);
/**
* Set the input's value.
*
* @param {string} val The new value.
*/
LinkTextField
.
prototype
.
setValueIfUntouched
=
function
(
val
)
{
if
(
!
this
.
touched
)
{
this
.
getField
().
setValue
(
val
);
}
};
/**
* @param {boolean} touched
*/
LinkTextField
.
prototype
.
setTouched
=
function
(
touched
)
{
this
.
touched
=
touched
;
};
/**
* If this input is active when it's being changed,
* set it as 'touched' so it won't change again if the title-lookup is changed.
*/
LinkTextField
.
prototype
.
onInputChange
=
function
()
{
if
(
$
.
contains
(
this
.
$element
[
0
],
document
.
activeElement
)
)
{
this
.
touched
=
true
;
}
};
module
.
exports
=
LinkTextField
;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Aug 16 2026, 04:52 (13 w, 4 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
d7/6d/bcdea2f5223fa248caf7a072daa0
Default Alt Text
LinkTextField.js (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment