Wikibooks:Reading room/Technical Assistance

(Redirected from Wikibooks:TECH)
Latest comment: 2 hours ago by Xeverything11 in topic Recent changes improvements
ArchivesWikibooks Discussion Rooms
Discussions Assistance Requests Announcements
General | Proposals | Projects | Featured books General | Technical | Administrative Deletion | Undeletion | Import | Permissions Bulletin Board

Welcome to the Technical Assistance reading room. Get assistance on questions related to MediaWiki markup, CSS, JavaScript, and such as they relate to Wikibooks. This is not a general-purpose technical support room.

To submit a bug notice or feature request for the MediaWiki software, visit Phabricator.

To get more information about the MediaWiki software, or to download your own copy, visit MediaWiki

There are also two IRC channels for technical help: #mediawikiconnect for issues about the software, and #mediawiki-coreconnect for WMF server or configuration issues.

move request

edit

hi can someone move the page MacOS Sequoia to draft space - if such a thing exists here- please? it seems to have been flagged for deletion and i would rather it be moved to draft. SillySarah321 (discusscontribs) 08:59, 22 November 2024 (UTC)Reply

Hi @SillySarah321! It looks like someone else queried it, which does not necessarily mean it's flagged for deletion. I took a look at it, and it seems like you have an outline you're working on, which makes it a book under construction. If you don't end up building it out, it may be considered abandoned and then deleted, but it's fine for now. If you would like it to be moved to your sandbox so you can take your time fleshing it out, we can do that as well. Cheers! —Kittycataclysm (discusscontribs) 13:17, 22 November 2024 (UTC)Reply
moving it to my sandbox does seem like a good idea. i think that would be a good course to follow. thanks! SillySarah321 (discusscontribs) 09:28, 25 November 2024 (UTC)Reply
  Done @SillySarah321 see User:sillySarah321/MacOS Sequoia. Cheers! —Kittycataclysm (discusscontribs) 13:14, 25 November 2024 (UTC)Reply

Trouble with printable book

edit

I have decided to adopt Wikijunior:Philosophy, but I'm having some difficulty with getting the print version working. Can anyone here explain the problem to me? — JJPMaster (discusscontribs) 21:09, 1 December 2024 (UTC)Reply

I was able to fix it for you! It looks like the template was auto-referencing Philosophy, probably due to some parsing error I didn't look at in detail. I forced it to use Wikijunior:Philosophy as the contents page, which fixed it. Cheers —Kittycataclysm (discusscontribs) 21:47, 1 December 2024 (UTC)Reply
@Kittycataclysm: Note: I fixed the problem with {{printable}}. It now works without the parameter. JJPMaster (she/they) 01:00, 8 December 2024 (UTC)Reply
Great! —Kittycataclysm (discusscontribs) 19:45, 8 December 2024 (UTC)Reply

CollectionParser gadget doesn't work

edit

And I think I fixed it here. If I succeeded, please replace the text of the gadget page with mine. JJPMaster (she/they) 03:56, 8 December 2024 (UTC)Reply

Also, make sure to remove it from the "broken gadgets" section of MediaWiki:Gadgets-definition. JJPMaster (she/they) 04:33, 8 December 2024 (UTC)Reply
Courtesy ping: @Leaderboard. JJPMaster (she/they) 04:02, 17 December 2024 (UTC)Reply
@JJPMaster   Done Leaderboard (discusscontribs) 16:12, 17 December 2024 (UTC)Reply

┌─────────┘
@Leaderboard: Edit request: Please replace all content below and including the current addPediapressLinks function with the following:

function addPediapressLinks($content) {
	if ( mw.config.get('wgArticleId') && (mw.config.get('wgNamespaceNumber') == 0 || mw.config.get('wgNamespaceNumber') == 102 || mw.config.get('wgNamespaceNumber') == 110) ) {
		$(mw.util.addPortletLink ('p-personal', '#', 'Get collection')).click(function() {
			getCollection($content);
		});
	}
}

$(function() { addPediapressLinks() });

This fixes two bugs: (a) a bug where whenever the DOM was reloaded (e.g. when you press the "Reload" button in the live preview), the link would be duplicated, and (b) the link appears on nonexistent pages, causing an error. JJPMaster (she/they) 21:45, 20 December 2024 (UTC)Reply

  Done Leaderboard (discusscontribs) 03:16, 21 December 2024 (UTC)Reply
@Leaderboard: Oh, I think you missed the removal of the "mw.hook..." part. JJPMaster (she/they) 03:22, 21 December 2024 (UTC)Reply
@JJPMaster Apologies, that's done. Leaderboard (discusscontribs) 03:27, 21 December 2024 (UTC)Reply
@Leaderboard: While trying to use the updated version, I noticed another problem (an outdated CSS class name was being used), so I made a series of changes here to resolve it (and I also partially reversed the above change due to a problem involving what happens if the content of the page changes). I would like to request that that be made the content of MediaWiki:Gadget-collectionparser.js. JJPMaster (she/they) 04:35, 21 December 2024 (UTC)Reply
  Done Leaderboard (discusscontribs) 05:13, 21 December 2024 (UTC)Reply

Proposal: Adopt OneClickWelcomer as a gadget

edit

There is currently a gadget that is supposed to provide a link on user talk pages to instantly welcome any user, or warn them with {{Test1}}. However, this gadget does not work. So, I made a replacement: OneClickWelcomer. This allows you to welcome any user with one click (hence the name), and also warn anyone, and it differs from the gadget because you can warn them with {{Test1}}, {{Test2}}, or {{Test3}}, and because the links also appear on user pages, user contribution pages, Special:RecentChanges, Special:NewPages, and page histories. I propose that the nonfunctional gadget be removed and replaced with my replacement. JJPMaster (she/they) 18:22, 8 December 2024 (UTC)Reply

@Leaderboard what do you think? I'm not really familiar with this area. —Kittycataclysm (discusscontribs) 19:44, 8 December 2024 (UTC)Reply
@JJPMaster   Done. As you are not an interface admin, ping me whenever you want the wiki version to be updated. Leaderboard (discusscontribs) 11:34, 10 December 2024 (UTC)Reply
@Leaderboard: Thank you! Although, I would like to make three requests already. Firstly, on MediaWiki:Gadgets-definition, please move it from "broken-gadgets" to "edit-gadgets". Secondly, change the description to this:

This allows you to welcome any user with one click (hence the name), and warn them with {{Test1}}, {{Test2}}, or {{Test3}}. The links appear on user pages, Special:Contributions pages, Special:RecentChanges, Special:NewPages, and page histories.

Thirdly, please go into MediaWiki:Gadget-OneClickWelcomer.js and replace "OneClickWelcomer.js" in the summary fields with "OneClickWelcomer." JJPMaster (she/they) 15:11, 10 December 2024 (UTC)Reply
@JJPMaster First two   Done; isn't the third one already done? Leaderboard (discusscontribs) 06:20, 14 December 2024 (UTC)Reply
Firstly, thank you! Secondly, I was referring to the fields like this:
"Welcomed new anonymous user with [[User:JJPMaster/OneClickWelcomer.js|OneClickWelcomer]]"
I was asking for that link to be replaced with:
"[[User:JJPMaster/OneClickWelcomer|OneClickWelcomer]]" JJPMaster (she/they) 06:21, 14 December 2024 (UTC)Reply
Leaderboard. JJPMaster (she/they) 06:25, 14 December 2024 (UTC)Reply
@JJPMaster But User:JJPMaster/OneClickWelcomer is not a valid link? Leaderboard (discusscontribs) 06:27, 14 December 2024 (UTC)Reply
@Leaderboard: Oh, sorry about that, I thought that I had already created a documentation page for that script. I will redirect it to the JavaScript file until I am done with having done that. JJPMaster (she/they) 06:32, 14 December 2024 (UTC)Reply
  Done. Leaderboard (discusscontribs) 06:34, 14 December 2024 (UTC)Reply
@Leaderboard: Oh, I think you forgot to do the "warned anonymous user" ones as well. JJPMaster (she/they) 07:08, 14 December 2024 (UTC)Reply
  Done Leaderboard (discusscontribs) 07:24, 14 December 2024 (UTC)Reply

Title blacklist request

edit

Please add the following to MediaWiki:Titleblacklist:

.*[^\0-\x{FFFF}].* <casesensitive> # Very few characters outside the [[Basic Multilingual Plane]] are useful in titles

This should prevent the creation of titles with unusual Unicode characters (e.g. the recently deleted Pushpa 2 The Rule (𝟸𝟶𝟸𝟺) Full M𝚘𝚟𝚒𝚎 D𝚘𝚠𝚗𝚕𝚘a𝚍 in H𝚒𝚗𝚍𝚒 𝚅𝚎𝚐𝚊𝚖𝚘𝚟𝚒𝚎𝚜 𝙵𝚛e𝚎 8k). JJPMaster (she/they) 11:09, 10 December 2024 (UTC)Reply

I think an abuse filter is better for this, and there might even be something similar on Meta-Wiki (global filters apply to here too). Leaderboard (discusscontribs) 14:47, 10 December 2024 (UTC)Reply
@Leaderboard: I suggested to add it to the TB because it seems like that's why that title isn't allowed on enwiki. However, a filter may be better if you want to allow certain groups of users to create pages with those kinds of titles anyway. JJPMaster (she/they) 15:13, 10 December 2024 (UTC)Reply
  Done. Leaderboard (discusscontribs) 06:29, 14 December 2024 (UTC)Reply
@Leaderboard The link [[Basic Multilingual Plane]] is a red link, because there isn't a page on Wikibooks with that title. There is a page on Wikipedia with that title, which explains what the Basic Multilingual Plane is, so let's replace that link with [[w:Basic Multilingual Plane]]. TTWIDEE (discusscontribs) 18:54, 17 December 2024 (UTC)Reply
@TTWIDEE I don't get your question? Leaderboard (discusscontribs) 02:52, 18 December 2024 (UTC)Reply
@Leaderboard: They're just asking for
.*[^\0-\x{FFFF}].* <casesensitive> # Very few characters outside the [[Basic Multilingual Plane]] are useful in titles
To become
.*[^\0-\x{FFFF}].* <casesensitive> # Very few characters outside the [[w:Basic Multilingual Plane]] are useful in titles
JJPMaster (she/they) 03:01, 18 December 2024 (UTC)Reply
  Done Leaderboard (discusscontribs) 03:05, 18 December 2024 (UTC)Reply

Low contrast with Template:hidden begin in dark mode

edit

Dark mode is coming and we need to prepare for it. Text wrapped in {{hidden begin}} {{hidden end}} looks like this:

Expand me!

Lorum ipsum

Notice that you can barely distinguish the text from the background if you enabled dark mode in Special:Preferences#mw-prefsection-rendering. To fix this, an administrator should replace background:{{{bg1|transparent}}} with {{#if:{{{bg1|}}}|background:{{{bg1}}};}} (analogous for bg2) in Template:hidden begin to comply with the recommendations for night mode.

Also, the text "Expand me!" in the example above has CSS class "title", which makes the text appear in dark gray on a dark background due to the rule .collapsible .title { color:#4D4D4D; } in MediaWiki:Common.css/Nav.css. This rule should probably be replaced by something like .collapsible .title { color:var(--color-subtle,#4D4D4D); } (inspired by this recommendation). Dexxor (discusscontribs) 15:53, 11 December 2024 (UTC)Reply

@Dexxor   Done Leaderboard (discusscontribs) 06:22, 14 December 2024 (UTC)Reply
Thanks for editing Template:hidden begin! The other issue with MediaWiki:Common.css/Nav.css is still open. Dexxor (discusscontribs) 08:44, 14 December 2024 (UTC)Reply
@Dexxor I'm not seeing that exact string on the file - am I missing something? Leaderboard (discusscontribs) 02:19, 18 December 2024 (UTC)Reply
@Leaderboard: I believe they accidentally omitted most of line 4, which has the following:
.collapsible .title, .collapsible tr:first-child th, .collapsible tr:first-child td { cursor:pointer; padding-right:16px; color:#4D4D4D; }
They want it to be changed to
.collapsible .title, .collapsible tr:first-child th, .collapsible tr:first-child td { cursor:pointer; padding-right:16px; color:var(--color-subtle,#4D4D4D); }
JJPMaster (she/they) 02:36, 18 December 2024 (UTC)Reply
@JJPMaster That's line 3 though - is this supposed to be on both lines? Leaderboard (discusscontribs) 02:51, 18 December 2024 (UTC)Reply
@Leaderboard: Sorry, I just said the wrong number. It is line 3. JJPMaster (she/they) 03:00, 18 December 2024 (UTC)Reply
@JJPMaster Correct, and am I supposed to do this on line 4 as well? Just want to have this explicitly clarified as the purpose of both lines seem to be similar. Leaderboard (discusscontribs) 03:07, 18 December 2024 (UTC)Reply
@Leaderboard: No, because only line 3 has the color set to be 4D4D4D. JJPMaster (she/they) 03:08, 18 December 2024 (UTC)Reply
@JJPMaster I get a warning: Warning: Expected (<color>) but found 'var(--color-subtle , #4D4D4D)'. - is this expected? Leaderboard (discusscontribs) 03:10, 18 December 2024 (UTC)Reply
@Leaderboard: I decided to investigate a little bit and found mw:Recommendations for night mode compatibility on Wikimedia wikis#Use CSS variables or CSS design tokens with fallback for background and text where possible, which has nearly identical code, so I would assume that this is expected. JJPMaster (she/they) 03:17, 18 December 2024 (UTC)Reply
  Done Leaderboard (discusscontribs) 03:30, 21 December 2024 (UTC)Reply

Some changes to MediaWiki:Gadget-markAdmins

edit

The markAdmins gadget has had some problems. I have forked the markAdmins gadget and added some more groups, but that doesn't completely solve the problem; the problem is that the information here is incredibly out-of-date. To solve this, I have adapted MDanielsBot's source code for User:JJPMaster (bot), which will automatically update User:JJPMaster (bot)/markAdmins-Data.js. The source code for my bot can be found here, and it's on Toolforge here. JJPMaster (she/they) 04:43, 14 December 2024 (UTC)Reply

Courtesy ping: @Leaderboard. JJPMaster (she/they) 04:47, 14 December 2024 (UTC)Reply
@JJPMaster A bot available for Gadgets should not be pulling data from userspace in my opinion; do you think it could be placed somewhere else? Leaderboard (discusscontribs) 06:25, 14 December 2024 (UTC)Reply
@Leaderboard: I think there are three possible alternatives here:
  1. Store the data on an external site - I believe this would be very inefficient, and probably also insecure
  2. Store the data in another non-MediaWiki namespace - There would need to be some measure taken to prevent anyone other than my bot from editing the page, otherwise it would be insecure
  3. Store the data alongside the gadget in the MediaWiki namespace - This would probably be the most secure, but would require my bot, and thus me, to have interface admin privileges, unless you or JackPotte maintained it instead.
JJPMaster (she/they) 06:30, 14 December 2024 (UTC)Reply
@JJPMaster Can you do this on Meta-Wiki (eg have a page like metawiki:MarkAdmins/enwikibooks)? This can be useful if you plan to run this on many wikis. Leaderboard (discusscontribs) 06:32, 14 December 2024 (UTC)Reply
@Leaderboard: I feel like that might have the same problem as option 2 here, on top of the fact that we would need a Meta administrator to change the content model of that page to JavaScript (since it doesn't have the .js extension). Also, I will courtesy ping the maintainer of the Wikipedia bot here. JJPMaster (she/they) 06:37, 14 December 2024 (UTC)Reply
I'll wait for some comments then - ping me in a week if you don't get any. Leaderboard (discusscontribs) 06:40, 14 December 2024 (UTC)Reply
@Leaderboard: I have not received a reply. JJPMaster (she/they) 02:23, 21 December 2024 (UTC)Reply
@JJPMaster Plus make markAdmins-Data a JSON file, not a JS file - the former is significantly safer. Leaderboard (discusscontribs) 05:28, 21 December 2024 (UTC)Reply
@Leaderboard:   Done. My bot actually already produced a JSON file (User:JJPMaster (bot)/markAdmins-Data.json), but the script does not fetch from it—it fetches from User:JJPMaster (bot)/markAdmins-Data.js. What I've done is disabled the part of my bot that automatically updates that page, and replaced its content with a short script that just fetches the JSON data directly rather than reimplementing it. JJPMaster (she/they) 05:54, 21 December 2024 (UTC)Reply
@JJPMaster So replacing the code of the gadget with User:JJPMaster/markAdmins-core.js is enough? Leaderboard (discusscontribs) 06:21, 21 December 2024 (UTC)Reply
@Leaderboard: Yes, that will be good, as well as the deletion of the outdated MediaWiki:Gadget-markAdmins-data.js. Also, I should ask, should I request the bot flag for User:JJPMaster (bot)? JJPMaster (she/they) 06:27, 21 December 2024 (UTC)Reply
@JJPMaster   Done; regarding your other question, this is up to you. While a good idea to request bot status, this is not required in most cases. Leaderboard (discusscontribs) 06:38, 21 December 2024 (UTC)Reply
@Leaderboard: And please also remove the deleted page from MediaWiki:Gadgets-definition (and for the bot flag request, should I go to WB:PERM for that, or m:SRBS since we have no bureaucrats)? JJPMaster (she/they) 06:48, 21 December 2024 (UTC)Reply
@JJPMaster What do you mean by "deleted page"? Regarding your second question, it would be WB:PERM; the fact that we don't have bureaucrats means that after getting approval on PERM, someone goes to m:SRBS and ask the stewards to grant bot status. Leaderboard (discusscontribs) 10:18, 21 December 2024 (UTC)Reply

Interface page edit request

edit

Since English Wikibooks has no bureaucrats, many user rights logs are incomplete (since grants and removals of adminship can only be done by stewards at Meta). Thus, I ask that a link to the global rights log be added to MediaWiki:Viewinguserrights, as I have done at User:JJPMaster/MediaWiki:Viewinguserrights. Courtesy ping: Leaderboard. JJPMaster (she/they) 02:02, 17 December 2024 (UTC)Reply

@JJPMaster   Done Leaderboard (discusscontribs) 02:12, 17 December 2024 (UTC)Reply

Reclassifying markblocked

edit

Please remove "|rights=block" from the markblocked gadget on MediaWiki:Gadgets-definition, as its use does not require the ability to block. Courtesy ping: Leaderboard. JJPMaster (she/they) 23:09, 17 December 2024 (UTC)Reply

@JJPMaster "its use does not require the ability to block" - how so? Leaderboard (discusscontribs) 02:17, 18 December 2024 (UTC)Reply
@Leaderboard: This gadget just strikes through the usernames of blocked users. It does not actually block anybody. I have extensively used this gadget despite not being an administrator on enwiki. JJPMaster (she/they) 02:33, 18 December 2024 (UTC)Reply
@JJPMaster   Done - I mixed it up with "massblock". Leaderboard (discusscontribs) 02:51, 18 December 2024 (UTC)Reply

Recent changes improvements

edit

I would like to propose the following changes on recent changes in dark mode:

  • Tag has too low contrast in dark mode, so a change of background to rgba(255,51,51,0.25) would improve contrast.
  • Revision size colors (+0-500 bytes, -0-500 bytes, lower than -500 bytes) are too dark in DM. Remove CSS that causes this problem, to revert to default CSS.

Thanks Xeverything11 (discusscontribs) 20:22, 20 December 2024 (UTC)Reply

See MediaWiki:Common.css/Recentchanges.css. Xeverything11 (discusscontribs) 20:38, 20 December 2024 (UTC)Reply
@Xeverything11 Can you share the code that would fix both issues? Leaderboard (discusscontribs) 06:39, 21 December 2024 (UTC)Reply
Replace with:
/* Hide [unchecked page] from Flagged Rev */
span.flaggedrevs-unreviewed {
    display: none;
}

/* Highlight review link */
span.flaggedrevs-pending {background-color: yellow;}

/* Highlight edit filter tags */
span.mw-tag-markers {background-color: rgba(255,51,51,0.25);}
Thanks. Xeverything11 (discusscontribs) 07:12, 21 December 2024 (UTC)Reply
@Xeverything11   Done Leaderboard (discusscontribs) 10:41, 21 December 2024 (UTC)Reply
Thank you! Xeverything11 (discusscontribs) 10:45, 21 December 2024 (UTC)Reply

OneClickWelcomer edit requests

edit

Please replace the content of MediaWiki:Gadget-OneClickWelcomer.js with User:JJPMaster/OneClickWelcomer/unstable.js, which allows the "welcome" and "warn" links to persist after reloading recent changes. Also, please add Special:Watchlist to the list of pages the links display on in MediaWiki:Gadget-OneClickWelcomer. JJPMaster (she/they) 02:26, 21 December 2024 (UTC)Reply

  Courtesy ping: Leaderboard. JJPMaster (she/they) 02:26, 21 December 2024 (UTC)Reply
  Done Leaderboard (discusscontribs) 03:14, 21 December 2024 (UTC)Reply