Page MenuHomePhabricator

Render redirect wikilinks in a redirect class for customization via user/site CSS.
Closed, DuplicatePublic

Description

Author: Winbots

Description:
Fixes this bug report.

Redirect wikilinks should have a redirect class to allow for customization/highlighting of redirects in user/site CSS.

Obsoletes the highly resource-intensive javascript that does the same thing: http://en.wikipedia.org/wiki/User:Dschwen/highlightredirects.js


Version: 1.12.x
Severity: enhancement

attachment redirect.links.diff ignored as obsolete

Details

Reference
bz12968

Event Timeline

bzimport raised the priority of this task from to Normal.Nov 21 2014, 10:02 PM
bzimport added projects: MediaWiki-Parser, Parser.
bzimport set Reference to bz12968.
bzimport added a subscriber: Unknown Object (MLST).
bzimport created this task.Feb 8 2008, 6:59 AM

Created attachment 4634
Reworked patch

I have optimized the code a bit and renamed the CSS class to 'mw-redirect' to be consistent with the naming conventions for new CSS classes/IDs.

But I wonder if it is intended that this will work only for registered users who have set a threshold > 0 in its preferences?

The function getLinkColour() is called from Linker::makeLinkObj for $threshold > 0 only.

Attached:

On a second thought: applied with r30871. It works for logged in users who have set a threshold > 0 in its preferences. This way no extra database query is necessary.

ayg wrote:

*** Bug 4709 has been marked as a duplicate of this bug. ***

ayg wrote:

*** Bug 6962 has been marked as a duplicate of this bug. ***

ayg wrote:

Improved fix in r30876. It now works for all users, logged in or not and independent of preferences.

ayg wrote:

(In reply to comment #5)

Improved fix in r30876. It now works for all users, logged in or not and
independent of preferences.

Although, note, currently not in all circumstances -- e.g., category links, or anything else using makeLinkObj() (includes lots of special pages). Would be nice to improve LinkCache to fetch and store this info as it does article ID's, so that it could be done efficiently there too. I've left a comment in the code roughly to that effect.

happy.melon.wiki wrote:

Bug 166 requests full implementation of this feature.

*** This bug has been marked as a duplicate of bug 166 ***