User:GeneralNotability/mark-locked

mark-locked is a user script that visually marks links to globally locked accounts on Wikimedia pages.

The script scans links to user pages, user talk pages, contributions pages, and CentralAuth pages, checks whether the corresponding accounts are globally locked, and marks matching links with a visual indicator showing the lock details, including a tooltip where applicable.

Installation

Add the following line to your common.js page (or another personal JavaScript page that you load):

mw.loader.load('//en.wikipedia.org/wiki/User:GeneralNotability/mark-locked.js?action=raw&ctype=text/javascript');

Then bypass your browser cache (often Ctrl+F5 or Ctrl+Shift+R).

Usage

After installation, the script runs automatically whenever a page loads.

The script scans visible content for links pointing to:

  • User:
  • User talk:
  • Special:Contributions/
  • Special:CentralAuth/

If an account is globally locked, matching links are visually modified:

  • reduced opacity,
  • a red dashed underline,
  • a tooltip containing lock information.

Hovering over a marked link displays additional information, when available, such as:

Locked by ExampleSteward: Cross-wiki abuse (12.03d ago)

Appearance

By default, links to globally locked users are visually modified to make them easier to recognize while reading pages.

Locked-user links are displayed with:

  • reduced opacity (40% opaque),
  • a thick dashed red underline,
  • a tooltip containing lock information (when available).

The tooltip may include details such as the locking steward, lock reason, and how long ago the lock occurred.

The appearance is applied automatically and affects only display in your browser; page content is not modified.

This affects only display and does not modify page content.

Example

The following example illustrates how links to globally locked users may appear after the script processes the page. In this example, both comments were written in July 2024, but the second user account was globally locked at a later date.

This looks good to me. I adjusted the wording slightly and added a source for the final paragraph. — Example1 (talk) 14:26, 17 July 2024 (UTC)

Thanks — I agree that the additional source improves readability and makes the conclusion easier to follow. — Lockeroo (talk) 14:41, 17 July 2024 (UTC)

In this example, the second user's signature is shown with the appearance used by the script: reduced opacity, a thick dashed red underline, and a tooltip containing lock details. (Underlying user and talk page links of the fake 'locked user' are not active here due to technical limitations, but will work in the installed script.) Actual tooltip text and appearance may vary depending on browser behavior and available lock-log information.

Performance

The script batches API requests to reduce load.

Two APIs are used:

  • the local wiki API to determine whether accounts are globally locked;
  • the Meta-Wiki API to retrieve lock-log details.

Users with the apihighlimits right may process larger batches.

Notes

  • IP addresses are ignored and are not checked for global locks.
  • Usernames are normalized using MediaWiki title handling to match server-side capitalization behavior.
  • If lock-log details are unavailable, locked accounts are still marked, but the tooltip may be empty.
  • The script updates dynamically when page content changes through MediaWiki hooks.

Compatibility

The script is intended for Wikimedia wikis using MediaWiki JavaScript and ResourceLoader.

It has been tested with standard page views and should work with dynamically loaded content.

Limitations

  • Only globally locked accounts are marked; local blocks are not shown.
  • Links that do not resolve to recognizable user-related URLs are ignored.
  • The tooltip is not visible for users of the native mobile app.
  • Visual appearance depends on browser styling and other gadgets or user scripts.

See also

Content Disclaimer

Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.

  1. The information displayed on this website is sourced in part or in whole from Wikipedia and has been adapted for the purpose of restating it. We strive to provide accurate and relevant information, however:
  2. There is no guarantee of absolute accuracy. Wikipedia is an open, collaborative project that can be edited by anyone, so information is subject to change.
  3. It is not intended to constitute professional advice. The content displayed is for informational and educational purposes only. For important decisions (e.g., medical, legal, or financial), please consult a professional.
  4. Content copyright. Wikipedia is licensed under the Creative Commons Attribution-ShareAlike License (CC BY-SA). This means that content may be reused with appropriate attribution and shared under a similar license.
  5. Responsible use. Any risk arising from the use of information from this website is entirely the responsibility of the user.