Watch star on Timeless is not AJAX-ified - clicking it sends you to a separate page, instead of watching/unwatching and showing a popup.
Description
Details
Subject | Repo | Branch | Lines +/- | |
---|---|---|---|---|
Support AJAX watch in skins that use a different class structure | mediawiki/core | master | +13 -4 |
Related Objects
Event Timeline
This is actually a core feature that doesn't for with Timeless - see resources/src/mediawiki/page/watch.js.
Specifically this seems to be a problem:
var $links = $( '.mw-watchlink a, a.mw-watchlink' ); // Restrict to core interfaces, ignore user-generated content $links = $links.filter( ':not( #bodyContent *, #content * )' );
The mw-watchlist class is present, but in Timeless almost the entire page is wrapped in a <div id="content">, so the second check ignores the links.
Possibly this selector should be changed to #mw-body-content or something?
If the whole point of that is to ignore user provided content can we set and look for data-mw-watch attributes that are blacklisted from wikitext?
Hmm, yeah... that'll require some extra effort to make sure it works with all the skins, but it seems like a better long-term solution.
Well, we could just move where the content wrapper encompasses, except
that all IS the page content, so perhaps not the best idea. If excluding
user-provided content is the idea, though, shouldn't there be a class
specifically for that? Or is that what mw-body-content is for? What if
you have multiple separated blocks of content?
Change 372076 had a related patch set uploaded (by Legoktm; owner: Legoktm):
[mediawiki/core@master] Support AJAX watch in skins that use a different class structure
We recently introduced the mw-parser-output class (T37247), but currently it is not present around all user-generated content (e.g. not page status indicators). Using it would probably still be a better solution than the current code (it didn't exist when that was written), but I think Legoktm's idea is even better than that.
By the way, the two other features that the patch relies on also didn't exist when the original code was written:
- Disallowing data-mw-* attributes from wikitext was added in 2015: rMWb62f0e91564f: Reserve data-mw and data-parsoid attribute prefix for trusted values
- Support for data-* attributes in the navigation was added in 2016: rMW88f4eca6d8e6: Allow 'data-*' attributes in personal tools links
Change 372076 merged by jenkins-bot:
[mediawiki/core@master] Support AJAX watch in skins that use a different class structure