Support AJAX watch in skins that use a different class structure
authorKunal Mehta <legoktm@member.fsf.org>
Tue, 15 Aug 2017 20:34:55 +0000 (13:34 -0700)
committerKunal Mehta <legoktm@member.fsf.org>
Wed, 16 Aug 2017 02:12:53 +0000 (19:12 -0700)
commit30cfcd39a574fe82842e002be93fdf6f8cdd81c2
tree14a1ec08b91f21c69240c5a8fcd4849a66ad6173
parenta70c4a4c466db5663b845889cacdef00d7200760
Support AJAX watch in skins that use a different class structure

Skipping links that are in #bodyContent or #content doesn't work for
skins like Timeless. Instead of trying to filter based on those classes,
have SkinTemplate set a data-mw=interface attribute on the <a> element,
and filter based on that. The Sanitizer prevents any data-mw attributes
being set by users, so it must have been created by MediaWiki, and
therefore safe to use.

If no link meets that criteria, then it will fallback to trying to find
a link using the old criteria of not being in #bodyContent or #content.

Bug: T173279
Change-Id: I1688a499dda40428dd514230b78ccded0d228ca3
includes/skins/SkinTemplate.php
resources/src/mediawiki/page/watch.js