Last modified: 2013-06-30 16:30:40 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T46252, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 44252 - InfoAction should have unique CSS hooks for each field
InfoAction should have unique CSS hooks for each field
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Interface (Other open bugs)
1.22.0
All All
: Lowest enhancement (vote)
: ---
Assigned To: Alex Monk
: easy
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-01-22 19:13 UTC by MZMcBride
Modified: 2013-06-30 16:30 UTC (History)
4 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description MZMcBride 2013-01-22 19:13:50 UTC
Somewhat related to bug 42629, the table rows at action=info should have unique CSS IDs so that they can be targeted with the CSS target pseudo-selector. In particular, I'd like to be able to highlight the "Number of watchers" row, though having IDs for all of the rows would probably be nice.
Comment 1 Krinkle 2013-02-14 09:10:17 UTC
(In reply to comment #0)
> Somewhat related to bug 42629, the table rows at action=info should have
> unique
> CSS IDs so that they can be targeted with the CSS target pseudo-selector. In
> particular, I'd like to be able to highlight the "Number of watchers" row,
> though having IDs for all of the rows would probably be nice.

Highlight for what reason?

We're not going to add random IDs everywhere just to enable users to hang up more circus decoration.

If you're looking for alternate styling, the table could have a distinguishing class (e.g. ".mw-infoaction-table") and use something like .mw-infoaction-table tr to give the rows special styling (e.g. alternating row highlighting or whatever).

But individual IDs seems very selective and overkill, at least without a proper use case.
Comment 2 MZMcBride 2013-02-14 09:22:16 UTC
(In reply to comment #1)
> Highlight for what reason?

There's a link to the number of watchers from &action=history on many wikis. This goes to a page such as <https://toolserver.org/~mzmcbride/watcher/?db=enwiki_p&titles=Apple+Inc.> currently, where there's a lot of signal and little noise and it's easy to see the value that the user is interested in (because it's nearly the only information on the page).

Compare to <https://en.wikipedia.org/w/index.php?title=Apple_Inc.&action=info##Basic_information>, which is the most targeted a link can be currently from &action=history (yes, two ##...). With this link, the target (the number of page watchers) gets lost after the user visits the info page. Highlighting that specific table row when there's an ID of #mw-info-page-watchers or similar would be a nice improvement, I think. This could be done with local CSS on wikis such as the English Wikipedia and Meta-Wiki. However, no highlighting or more specific targeting can take place with the current HTML structure, as far as I'm aware.

> We're not going to add random IDs everywhere just to enable users to hang up
> more circus decoration.

I'm only interested in highlighting the watchers row.
Comment 3 MZMcBride 2013-03-25 23:18:16 UTC
https://en.wikipedia.org/wiki/Barack_obama?action=info

Is there a good way to select only the "Number of page watchers" table row in CSS or JavaScript? I want to highlight it from a particular hyperlink using an anchor (similar to how <ref></ref>s have a light blue background on some wikis). This requires being able to select only that table row. Is this possible currently?
Comment 4 Bartosz Dziewoński 2013-03-27 20:45:52 UTC
(In reply to comment #3)
> https://en.wikipedia.org/wiki/Barack_obama?action=info
> 
> Is there a good way to select only the "Number of page watchers" table row in
> CSS or JavaScript?

Not right now. If you're looking for a quick solution, '#mw-content-text .mw-page-info:first-of-type tr:nth-of-type(8)' will do the job for now, but it'll break if any rows are removed or added or if the order changes.

You could probably cook up some XPath selector to find a table cell with 'Number of page watchers' inside and return the next one (there is some way of using it in JS I'd have to look up), but I don't know it enough to be helpful here.


> I want to highlight it from a particular hyperlink using
> an
> anchor (similar to how <ref></ref>s have a light blue background on some
> wikis). This requires being able to select only that table row. Is this
> possible currently?

If you want to use the :target pseudoclass (which would be the right way, and it's how the <ref> highlighting is done), the table row would have to have an ID. If in JavaScript, see above.
Comment 5 MZMcBride 2013-03-28 06:07:51 UTC
(In reply to comment #4)
> If you want to use the :target pseudoclass (which would be the right way, and
> it's how the <ref> highlighting is done), the table row would have to have an
> ID. If in JavaScript, see above.

An ID also helps with jQuery. I think Krinkle was worried there wasn't a reasonable use-case here. I believe there is, so I'm adding the "easy" keyword accordingly. This is a trivial change.
Comment 6 MZMcBride 2013-06-22 22:42:16 UTC
Implementing this change would allow me to begin the deprecation process for the watcher tool.
Comment 7 Gerrit Notification Bot 2013-06-22 23:07:14 UTC
Related URL: https://gerrit.wikimedia.org/r/70028 (Gerrit Change Id4fd17e748c0fe3a9f4c51846abcaa8942fa5c50)
Comment 8 Gerrit Notification Bot 2013-06-30 16:30:40 UTC
Change 70028 merged by jenkins-bot:
Add ID to action=info table rows

https://gerrit.wikimedia.org/r/70028

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links