Page MenuHomePhabricator

Make block and rollback links hide-able
Closed, DeclinedPublic

Description

Per [http://en.wikipedia.org/wiki/Wikipedia:Administrators%27_noticeboard#Recent_changes_tab_in_Preferences_-_special_choices_for_administrators], it became apparent that administrators wanted the ability to selectively hide either the rollback or the block links in [[Special:Watchlist]], [[Special:Contributions]], [[Special:RecentChanges]], etc.

It appears that this is a relatively simple "add some more CSS ids and make another preference" kind of enhancement, but of course I could be mistaken.


Version: 1.21.x
Severity: enhancement

Details

Reference
bz46412

Event Timeline

bzimport raised the priority of this task from to Low.Nov 22 2014, 1:36 AM
bzimport set Reference to bz46412.
bzimport added a subscriber: Unknown Object (MLST).

Rollback buttons are already hidable, the class is mw-rollback-link.

Personally, I don't find the block button much of a concern since the only thing that happens if you click on it is that you are taken to the block form, at which point you simply hit 'back' in your browser.

As for a preference to do so, it's an almost trivial change to Special:Mypage/common.css. I'd say just make a Gadget if people insist.

Rollback is in span.mw-rollback-link, so that one can easily be done with a little CSS/JavaScript. Block is a little more difficult to modify from user end without using JavaScript/Jquery to look for the <a> element with the innerHTML of "block". I tried editing MediaWiki:Blocklink on my test wiki to wrap "block" with a span.mw-block-link, but the MW parser doesn't allow HTML on that message. Looking at the source a little deeper, that would still leave an extra | that would "look" weird, so the proper workaround would be to use JavaScript/Jquery to find that <a> element, remove the href - title - innerHTML, add a class of "block", then replace " | <a class="block"></a>" with "" in the span.mw-usertoollinks.

(In reply to comment #2)

Rollback is in span.mw-rollback-link, so that one can easily be done with a
little CSS/JavaScript. Block is a little more difficult to modify from user
end
without using JavaScript/Jquery to look for the <a> element with the
innerHTML
of "block". I tried editing MediaWiki:Blocklink on my test wiki to wrap
"block" with a span.mw-block-link, but the MW parser doesn't allow HTML on
that
message. Looking at the source a little deeper, that would still leave an
extra | that would "look" weird, so the proper workaround would be to use
JavaScript/Jquery to find that <a> element, remove the href - title -
innerHTML, add a class of "block", then replace " | <a class="block"></a>"
with
"" in the span.mw-usertoollinks.

On second thought, it would have to be done with JavaScript unless you want those buttons to go away from pages you are reviewing. It would also be nice if it was incorporated into the server-side PHP so that if those options were checked, the parser wouldn't even include them on the page instead of just hiding them.

As a side-note, I've tried on two different wikis to add:
span.mw-rollback-link {

text-decoration: blink; //with and without !important

}
to my common.css because the class wasn't responding to my display: hidden/none and it isn't responding to blinking either. Is it just me not doing it right, or is there a bug somewhere preventing that css from applying to that class?

(In reply to comment #3)

As a side-note, I've tried on two different wikis to add:
span.mw-rollback-link {

text-decoration: blink; //with and without !important

}
to my common.css because the class wasn't responding to my display:
hidden/none
and it isn't responding to blinking either. Is it just me not doing it
right,
or is there a bug somewhere preventing that css from applying to that class?

display:none works fine for me on enwiki. Since I have browser.blink_allowed set to false in my Firefox, I can't test the other. ;)

(In reply to comment #4)

(In reply to comment #3)

As a side-note, I've tried on two different wikis to add:
span.mw-rollback-link {

text-decoration: blink; //with and without !important

}
to my common.css because the class wasn't responding to my display:
hidden/none
and it isn't responding to blinking either. Is it just me not doing it
right,
or is there a bug somewhere preventing that css from applying to that class?

display:none works fine for me on enwiki. Since I have browser.blink_allowed
set to false in my Firefox, I can't test the other. ;)

With css? I still can't get it to work setting the css, but I did get it to work with jquery to .css('display', 'none');

Working on writing a full script to do what the requester wants without needing any core changes. If whomever has the power wants to assign it to me, I'll write the js and close it as wontfix when js is complete.

(In reply to comment #5)

(In reply to comment #4)

(In reply to comment #3)

As a side-note, I've tried on two different wikis to add:
span.mw-rollback-link {

text-decoration: blink; //with and without !important

}
to my common.css because the class wasn't responding to my display:
hidden/none
and it isn't responding to blinking either. Is it just me not doing it
right,
or is there a bug somewhere preventing that css from applying to that class?

display:none works fine for me on enwiki. Since I have browser.blink_allowed
set to false in my Firefox, I can't test the other. ;)

With css? I still can't get it to work setting the css, but I did get it to
work with jquery to .css('display', 'none');

Working on writing a full script to do what the requester wants without
needing
any core changes. If whomever has the power wants to assign it to me, I'll
write the js and close it as wontfix when js is complete.

Or as worksforme maybe?

Okay, the jquery / JavaScript to make those things disappear is:

Remove [rollback]
$('span.mw-rollback-link').remove();
Remove " | block" link
$('span.mw-usertoollinks').each(function () {

var $elem = $(this);
$elem.children('a:last').replaceWith("-");
$elem.html($elem.html().replace(" | -", ""));

});

This script does the trick; no need to keep open.

Marking this as WONTFIX: First of all, this is not possible in the current software (without JS/CSS hacks) so it's not fixed. We also don't want it to be in the software (feature creep, ...), so that this wont be fixed.