Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F4108659
MarkSeenButtonWidget.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
MarkSeenButtonWidget.js
View Options
/**
* Button for marking all changes as seen on the Watchlist.
*
* @class mw.rcfilters.ui.MarkSeenButtonWidget
* @ignore
* @extends OO.ui.ButtonWidget
*
* @param {mw.rcfilters.Controller} controller
* @param {mw.rcfilters.dm.ChangesListViewModel} model Changes list view model
* @param {Object} [config] Configuration object
*/
const
MarkSeenButtonWidget
=
function
MwRcfiltersUiMarkSeenButtonWidget
(
controller
,
model
,
config
)
{
config
=
config
||
{};
// Parent
MarkSeenButtonWidget
.
super
.
call
(
this
,
Object
.
assign
(
{
label
:
mw
.
msg
(
'rcfilters-watchlist-markseen-button'
),
icon
:
'checkAll'
},
config
)
);
this
.
controller
=
controller
;
this
.
model
=
model
;
// Events
this
.
connect
(
this
,
{
click
:
'onClick'
}
);
this
.
model
.
connect
(
this
,
{
update
:
'onModelUpdate'
}
);
this
.
$element
.
addClass
(
'mw-rcfilters-ui-markSeenButtonWidget'
);
this
.
onModelUpdate
();
};
/* Initialization */
OO
.
inheritClass
(
MarkSeenButtonWidget
,
OO
.
ui
.
ButtonWidget
);
/* Methods */
/**
* Respond to the button being clicked
*/
MarkSeenButtonWidget
.
prototype
.
onClick
=
function
()
{
this
.
controller
.
markAllChangesAsSeen
();
// assume there's no more unseen changes until the next model update
this
.
setDisabled
(
true
);
};
/**
* Respond to the model being updated with new changes
*/
MarkSeenButtonWidget
.
prototype
.
onModelUpdate
=
function
()
{
this
.
setDisabled
(
!
this
.
model
.
hasUnseenWatchedChanges
()
);
};
module
.
exports
=
MarkSeenButtonWidget
;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Aug 18, 20:40 (2 w, 2 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
84/2a/2596f6a30ea3e22030a66e2dacc1
Default Alt Text
MarkSeenButtonWidget.js (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment