Last modified: 2014-09-24 01:26:07 UTC
Please add a CSS class that targets IP user pages. This would be useful for applying custom CSS rules to IP user pages. For example, a user could choose to set "visibility:hidden" on all IP user page links, because IP addresses generally do not use user pages. The CSS to do that could be: .ns-3.ip-userpage #ca-nstab-user a { visibility: hidden; } Or the following could be used to make gray, but not remove, links to nonexistant user pages: .ns-3.ip-userpage #ca-nstab-user.new a { color: #7D7D7D; } I've created a patch, based on MediaWiki 1.11.0, that provides this behavior. It adds "ip-userpage" to <body>'s class attribute. Since this isn't a major change, hopefully you developers will be more willing to implement it ;-)
Created attachment 4507 [details] SkinTemplate patch
Created attachment 4508 [details] MonoBook.php patch
Created attachment 4509 [details] SkinTemplate.php patch Fixed patch to prevent ip-userpage class from appearing outside the User and User_talk namespaces
That would hide or gray out links that are *on* an IP user page, not links *to an IP user page.
Look again. It does nothing of the kind.
It could be used to gray out all links on an IP user page, but I doubt anyone will want to do that, and that's not what I intended this code to be used for. I intend to use it to gray out the "user page" tab for IP editors, rather than having it appear in glaring red.
*Bulk BZ Change: +Patch to open bugs with patches attached that are missing the keyword*
Adding the "design" keyword since this is partly a visual design change.
These patches don't apply at all, marking them as obsolete. pageclass et al seem to have disappeared in one of the recent skin system refactorings, so I don't really know how to apply this to trunk. Removing design keyword, it's not really needed IMO because the default design isn't changed at all, this'll just enable people to do certain things in their own CSS more conveniently.
rememberthedot, are you interested in revising this patch to work with current trunk? Thanks!
The proper way to do this now in current code: - Use userpage-anon and userpage-user for classes, they fit in better with the ns-* page-* pattern that we already have going with classes. ip-userpage is an odd break from that. (note don't use something like page-anonuser since that would conflict with a page titled [[Anonuser]]) - Code would go in OutputPage::headElement, likely right after the `$bodyAttrs['class'] .= ' ' . $sk->getPageClasses( $this->getTitle() );` line. - You'd probably move the $this->getTitle() from that to a $title variable and use it in getPageClasses as well. if ( $title->getNamespace() == NS_USER || $title->getNamespace() == NS_USER_TALK ) { // Don't show the class on subpages if ( !$title->isSubpage() ) { $bodyAttrs['class'] .= ' ' . ( User::isIP( $this->getTitle() ) ? 'userpage-anon' : 'userpage-user' ); } }