Jump to content

MediaWiki talk:Gadget-markblocked.js

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia

This is an old revision of this page, as edited by Cabayi (talk | contribs) at 09:38, 29 January 2019 (→‎Globally locked and blocked users: oh dear!). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Underline links

If u want, you may check the Underline links option. If this option has value = 'never' then blocked users will not have 'line-through' style, in standard way. ru:Special:Diff/83641579. Iniquity (talk) 12:01, 13 February 2017 (UTC) Just use selectors: ru:Special:Diff/83643224. Iniquity (talk) 13:12, 13 February 2017 (UTC)[reply]

Sorry, no idea what you are talking about. Can you be more specific? Code in a sandbox? — Martin (MSGJ · talk) 13:46, 13 February 2017 (UTC)[reply]
@MSGJ: Wow, sorry, my fault. You are having selectors' rule. Iniquity (talk) 16:42, 13 February 2017 (UTC)[reply]

External links

Can we fix the support for external links? I've proven in principle that it can be done. (The only minor problem I see on testing this is that the tooltip, e.g. on Fruit of the land, starts with "undefined". I'm sure that can be fixed in due course.)

Fixing this might resolve the dispute at WT:Notifications#Checkuser and admin questions. Burninthruthesky (talk) 10:46, 12 April 2017 (UTC) Burninthruthesky (talk) 11:42, 12 April 2017 (UTC)[reply]

@Burninthruthesky: I've made the requested change. The only downside is that it will make the script slightly slower, but hopefully not enough that it is noticeable. Kaldari (talk) 17:55, 12 April 2017 (UTC)[reply]
Many thanks for your prompt response. Burninthruthesky (talk) 20:50, 12 April 2017 (UTC)[reply]

Redlinks for noping

I have incorporated some somewhat-overlapping functionality, to fix redlinked user pages even when using {{noping}}. As Vanjagenije suggests at WT:Notifications#Checkuser and admin questions, can we add this to the gadget please? Burninthruthesky (talk) 19:33, 26 April 2017 (UTC); diff updated 08:05, 27 April 2017 (UTC)[reply]

@Kaldari: would you mind looking over this? — xaosflux Talk 17:24, 13 May 2017 (UTC)[reply]
Hmm, I'm a little worried about adding another API request into the script. This will probably double the execution time. Kaldari (talk) 23:04, 13 May 2017 (UTC)[reply]
How about enabling it only if a user preference is set? Burninthruthesky (talk) 07:45, 16 May 2017 (UTC)[reply]

Request disabled as stale. Please reactivate if you get consensus for this change — Martin (MSGJ · talk) 11:17, 24 May 2017 (UTC)[reply]

Color changes

I have placed the markthrough script to the bottom of my common .js page in an attempt to customize the actual strike colors.

mw.util.addCSS('\
	a.user-blocked-temp {'   + ( window.mbTempStyle || 'opacity: 0.7; text-decoration: line-through' ) + '}\
	a.user-blocked-indef {'  + ( window.mbIndefStyle || 'opacity: 0.4; font-style: italic; text-decoration: line-through' ) + '}\
	.user-blocked-tipbox {' + ( window.mbTipBoxStyle || 'font-size:smaller; background:#FFFFF0; border:1px solid #FEA; padding:0 0.3em; color:#FF0000' ) + '}\
	');

I've been adjusting the color values here, but nothing changes, what am I doing wrong ? Thanks for any help. - FlightTime (open channel) 22:38, 29 July 2017 (UTC)[reply]

Protected edit request on 11 October 2017

user = user[2];

change to

user = user[2];
if( /[a-f0-9]{1,4}(:[a-f0-9]{1,4}){7}/.test(user) ) user = user.toUpperCase();

A query for the blocks on 2001:8003:407c:ba00:de0:bcb6:8f7a:120d returns the IPv6 in the form of 2001:8003:407C:BA00:DE0:BCB6:8F7A:120D meaning that blk.user later down in the script does not have the same value as the one stored in userLinks. This causes the script to fail when there is a link to an IPv6 with the letter characters lowercase. (An example would be the current version of ANI) (An example would be Special:Contributions/2602:306:cc2b:7000:41d3:b92d:731c:959d). -- The Voidwalker Whispers 19:32, 11 October 2017 (UTC)[reply]

Done @The Voidwalker: please confirm I have done that correctly — Martin (MSGJ · talk) 06:14, 14 October 2017 (UTC)[reply]
The example works correctly; everything appears to be in order. Thanks! -- The Voidwalker Whispers 16:42, 14 October 2017 (UTC)[reply]

Would be nice to have range blocks marked too

Could it be that range blocks (such as this for 168.99.198.48 (talk · contribs · deleted contribs · logs · filter log · block user · block log) and this for 2001:8003:54C9:8100:982B:CE3D:8B5A:9A64 (talk · contribs · deleted contribs · logs · filter log · block user · block log)) don't get marked as blocked? More examples can be found here. It would be nice to see them marked as such. Cheers - DVdm (talk) 07:04, 26 October 2017 (UTC)[reply]

Support.   — Jeff G. ツ 15:09, 13 April 2018 (UTC)[reply]
 Not done: I don't see any problem. The first one is correctry shown as blocked. The second IP is not blocked. And the third link is to the history of ANI. In any case, an edit cannot be made unless the exact change is specified. — Martin (MSGJ · talk) 06:39, 16 April 2018 (UTC)[reply]

Globally locked and blocked users

Hi. Can this script be made to show globally locked and blocked users, as well as locally blocked users?   — Jeff G. ツ 15:09, 13 April 2018 (UTC)[reply]

 Not done: it's not clear what changes you want to be made. Please mention the specific changes in a "change X to Y" format and provide a reliable source if appropriate. — Martin (MSGJ · talk) 06:39, 16 April 2018 (UTC)[reply]
MSGJ this gadget strikes through the names of locally blocked users, but does nothing if the user is globally locked but not locally blocked.
MediaWiki:Gadget-popups.js detects both and hovering over a name like User:Chyah will show BLOCKED, LOCKED
The ability to strike through the named of locked users (since in practice the effect of blocking and locking is equivalent) should be provided. The javascript required is out of my league I'm afraid. Cabayi (talk) 15:58, 31 December 2018 (UTC)[reply]
Me too. Good luck finding someone to help. Feel free to reactivate the request when the code is ready to deploy. — Martin (MSGJ · talk) 08:51, 2 January 2019 (UTC)[reply]
Per mw:Extension:CentralAuth/API there unfortunately doesn't appear to be an way to query which of a list of users are locked - only whether an individual user is locked (and doing one query for every user on a page would make the script extremely slow). Galobtter (pingó mió) 08:39, 29 January 2019 (UTC)[reply]
Thanks for the research Galobtter. -- Cabayi (talk) 09:38, 29 January 2019 (UTC)[reply]