Jump to content

User talk:Theopolisme/Scripts/ajaxWatchlist.js

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia

Declare dependencies

[edit]

Hi Theopolisme!

Could you replace

		setInterval( updateWatchlist, window.watchlistUpdateFrequency || 20000 );

by

	mw.loader.using( [ 'jquery.spinner', 'mediawiki.notify' ], function(){
		setInterval( updateWatchlist, window.watchlistUpdateFrequency || 20000 );
	} );

to make sure the dependencies are loaded before you script tries to use them? Helder 19:52, 5 March 2014 (UTC)[reply]

@He7d3r: Whoops! Thanks for pointing that out, fixed. Caching is a double edged sword in a development environment... :) Theopolisme (talk) 01:15, 6 March 2014 (UTC)[reply]

Watchlist is reloading while there is user interaction

[edit]

@Theopolisme: I'm using the enhanced recent changes/watchlist, and sometimes this scripts reloads the page right after I clicked in the button to expand the list of changes in a page.

What do you think of reseting the timer each time the user clicks somewhere in the page (or something like that)? That would mean that when the user is interacting with the list, it would not change abruptly. Helder 12:21, 5 June 2014 (UTC)[reply]

@Theopolisme: ^. Helder 15:44, 21 July 2014 (UTC)[reply]
@Theopolisme: I forked you script and implemented the suggestion above. See meta:Special:Diff/12538372. I would like to backport those changes though, so we can keep a single copy of the script (then I'll delete my copy from Meta-wiki). Helder 21:59, 29 June 2015 (UTC)[reply]
@He7d3r: I've updated the script with your copy from meta. Sorry the huge delay & thanks for the ping—I haven't been very active on-wiki in the past year or so, as my contributions might indicate... Again, thanks! Theopolisme (talk) 22:40, 29 June 2015 (UTC)[reply]
Thanks! Helder 19:41, 2 July 2015 (UTC)[reply]

Adapting for other pages

[edit]

Hi Theopolisme! I think it would be interesting to provide a link for users to "Reload periodically" a page they are viewing. When such a button is clicked, the script could fetch the $('#mw-content-text') of the current page each N seconds, and replace the content if there are any changes. This would be useful on recent changes, or other pages which can be frequently updated (logs, user contributions, etc). Helder 13:09, 14 May 2016 (UTC)[reply]

Watchlist UI update appears to have broken this script

[edit]

Hi Theopolisme, I've been using this script for a while now; today the UI got updated for the Watchlist (see WP:VP/T for comments about it breaking other gadgets/scripts), and it appears to have broken this auto-updating script. I'm not sure what part is breaking (it is still injecting the '<div id="ajaxWatchlist">', and no errors are showing in the console), so just letting you know. --PresN 02:28, 20 September 2017 (UTC)[reply]

Note: the problems only occur if the new "New filters for edit review" beta feature is turned on. Leaving it off keeps the watchlist as it is, so this isn't a big deal yet, though presumably at some point in the near future this feature will move out of beta. --PresN 14:38, 21 September 2017 (UTC)[reply]

jQuery

[edit]

Hi Theopolisme!

The script needs to be updated to not use the old ".hover(...)" method. Currently we get this warning in the console:

JQMIGRATE: jQuery.fn.hover() is deprecated

Helder 18:25, 8 October 2017 (UTC)[reply]