Topic on Talk:Edit Review Improvements/New filters for edit review

A hook on refresh

10
Summary by Stephanecbisson
 mw.hook( 'wikipage.content' ).add( function () { 
   /* gadgets init here */
 } );
IKhitron (talkcontribs)

Hello. I'd like to add new filters support for a gadget in our wiki. All the gadget improvements disappear on live update refresh. Is there a way to add a hook on this refresh? Thank you.

Stephanecbisson (talkcontribs)

The 'wikipage.content' hook is fired every time the changes list gets updated (because of filter changes or live update).

 mw.hook( 'wikipage.content' ).add( function () {
   /* gadgets init here */
 } );
IKhitron (talkcontribs)

Thanks a lot, it works very well.

IKhitron (talkcontribs)

Hello again. I see that this hook is fired only on a part of liveupdate changes. When the link "update now" becomes visible, it isn't. @Stephanecbisson:

Stephanecbisson (talkcontribs)

The hook is fired every time new changes are shown regardless of why they are shown (live update, view newest, filter change).

When the "View newest changes" link becomes visible, no RC lines are added and therefore the hook isn't fired.

IKhitron (talkcontribs)

I see, Stephanecbisson, thank you for the explanation. But maybe there is some another way to catch this event?

Stephanecbisson (talkcontribs)

I don't know of any way to be notified when the "View newest" link becomes visible.

What are you trying to accomplish?

IKhitron (talkcontribs)

I'm trying to add to our WatchList Manager a support for new filters. Actually, what should be done here, is that the link div will be allways in different place in the screen, using insertAfter. I tried also to convert it to span, so it will be in the same line with my buttons, but looks like mediawiki can't locate it and update to be visible this way, so I gave up. But Stephanecbisson, I thought there is a way to set a trigger on "span.oo-ui-element-hidden". Am i wrong? Thank you.

IKhitron (talkcontribs)

Well, it still will be very nice if there will be a way to do this, but I solved the problem I has.

Trizek (WMF) (talkcontribs)

Can we imagine to have a browser notification? That would be a nice hackathon project.

Reply to "A hook on refresh"