Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F4126656
RclTargetPageWidget.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
RclTargetPageWidget.js
View Options
/**
* Widget to select and display target page on Special:RecentChangesLinked (AKA Related Changes).
*
* @class mw.rcfilters.ui.RclTargetPageWidget
* @ignore
* @extends OO.ui.Widget
*
* @param {mw.rcfilters.Controller} controller
* @param {mw.rcfilters.dm.FilterItem} targetPageModel
* @param {Object} [config] Configuration object
*/
const
RclTargetPageWidget
=
function
MwRcfiltersUiRclTargetPageWidget
(
controller
,
targetPageModel
,
config
)
{
config
=
config
||
{};
// Parent
RclTargetPageWidget
.
super
.
call
(
this
,
config
);
this
.
controller
=
controller
;
this
.
model
=
targetPageModel
;
this
.
titleSearch
=
new
mw
.
widgets
.
TitleInputWidget
(
{
validate
:
false
,
placeholder
:
mw
.
msg
(
'rcfilters-target-page-placeholder'
),
showImages
:
true
,
showDescriptions
:
true
,
addQueryInput
:
false
}
);
// Events
this
.
model
.
connect
(
this
,
{
update
:
'updateUiBasedOnModel'
}
);
this
.
titleSearch
.
$input
.
on
(
{
blur
:
this
.
onLookupInputBlur
.
bind
(
this
)
}
);
this
.
titleSearch
.
lookupMenu
.
connect
(
this
,
{
choose
:
'onLookupMenuChoose'
}
);
// Initialize
this
.
$element
.
addClass
(
'mw-rcfilters-ui-rclTargetPageWidget'
)
.
append
(
this
.
titleSearch
.
$element
);
this
.
updateUiBasedOnModel
();
};
/* Initialization */
OO
.
inheritClass
(
RclTargetPageWidget
,
OO
.
ui
.
Widget
);
/* Methods */
/**
* Respond to the user choosing a title
*/
RclTargetPageWidget
.
prototype
.
onLookupMenuChoose
=
function
()
{
this
.
titleSearch
.
$input
.
trigger
(
'blur'
);
};
/**
* Respond to titleSearch $input blur
*/
RclTargetPageWidget
.
prototype
.
onLookupInputBlur
=
function
()
{
this
.
controller
.
setTargetPage
(
this
.
titleSearch
.
getQueryValue
()
);
};
/**
* Respond to the model being updated
*/
RclTargetPageWidget
.
prototype
.
updateUiBasedOnModel
=
function
()
{
const
title
=
mw
.
Title
.
newFromText
(
this
.
model
.
getValue
()
),
text
=
title
?
title
.
toText
()
:
this
.
model
.
getValue
();
this
.
titleSearch
.
setValue
(
text
);
this
.
titleSearch
.
setTitle
(
text
);
};
module
.
exports
=
RclTargetPageWidget
;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Aug 19, 08:12 (2 w, 3 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
2f/3a/6f5188003673c6c8c7a96f3193bd
Default Alt Text
RclTargetPageWidget.js (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment