Page MenuHomePhabricator

"[x]" (CategoryTreeEmptyBullet) should not be displayed when JavaScript is not loaded
Closed, ResolvedPublic

Description

Author: vlakoff

Description:
patch proposal

When JavaScript is disabled, or when the script isn't loaded yet, "[+]" (CategoryTreeBullet) are hidden (inline CSS display:none), but "[x]" (CategoryTreeEmptyBullet) are visible. For consistency, the later shouldn't be displayed too.


Version: unspecified
Severity: enhancement

attachment Hide_CategoryTreeEmptyBullet.diff ignored as obsolete

Details

Reference
bz33863

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 11:59 PM
bzimport set Reference to bz33863.
bzimport added a subscriber: Unknown Object (MLST).

vlakoff wrote:

patch proposal v2

Faster JavaScript in browsers that implement querySelectorAll()

Attached:

I suggest this is fixed by not outputting it from PHP at all (instead of a display:none placeholder).

Inject the element from JavaScript and use an event listener for the activity.

vlakoff wrote:

I don't think it is worth it. The selection of the switch, [+] or [x], to use for each item is accomplished by the PHP; trying to do it with the JS would be harder and less reliable. Also, the JS would be slower (lots of DOM insertions).

sumanah wrote:

vlakoff, thanks for your response.

Sorry for the wait; there's been a bit of a delay in the review of patches here -- as we prepare to get a new version out, we're in a "code slush" during which we concentrate on reviewing code that has already been committed to our source code repository (see http://thread.gmane.org/gmane.science.linguistics.wikipedia.technical/57950 for more details).

Krinkle's also been a bit busy with other commitments. I presume that at some point he'll come back and respond to your reply. But if, in the meantime, you'd like to straighten this issue out and get another opinion on how to proceed, come into our IRC chatroom, MediaWiki-General on Freenode IRC, and ask about this. Thanks for the patch!

A simple .client-nojs or .client-js style rule also works from the css file.
That saves outputting a bunch of inline style rules.

sumanah wrote:

vlakoff, have you had time to consider Krinkle's comment?

Also, if you haven't already, please get a Gerrit account

https://www.mediawiki.org/wiki/Project:Labsconsole_accounts

and submit your change as a merge request into Git. This'll make review a bit faster and help you in the future, as you can just put your patches into the same development workflow as all the other MediaWiki code.

https://www.mediawiki.org/wiki/Git/Workflow

Thanks!

vlakoff, have you had time to consider Krinkle's comment?

Also, if you haven't already, please get a Gerrit account

https://www.mediawiki.org/wiki/Project:Labsconsole_accounts

and submit your change as a merge request into Git. This'll make review a bit
faster and help you in the future, as you can just put your patches into the
same development workflow as all the other MediaWiki code.

https://www.mediawiki.org/wiki/Git/Workflow

Thanks!

Clearing patch keyword, I'll take this trivial bug.

I wrote a Git patch, but the more I think about it, the more this seems unnecessary. At the moment, this is the only useful thing CategoryTree gives to non-JS users, so I don't see why we need to take it away.

I daresay as well that non-JS users will be used to inconsistency, and may even be able to make good use of it in this case (i.e. to quickly see which categories have no subcats).