This page has archives. Sections older than 40 days may be automatically archived by Lowercase sigmabot III.
Removing magic editintros
The last discussion on remove the "magic editintros" (for BLP/disambig pages) was at MediaWiki talk:Common.js/Archive 22#Replacing magic editintros with editnotices and Lua. That fixated on solving the problem by detecting page categories using lua - which is not really possible until phab:T50175 is resolved. I have a patch for that in the pipeline which is stuck. But never mind, this doesn't actually need T50175:
Module:Disambiguation has seen significant improvements over the last year which make it very accurate in detecting disambiguation pages, without any performance impact. It can be used to check whether to include {{disambig editintro}}.
I'd support this, per what I said in the last discussion. I assumed it'd be too annoying to figure out disambiguation pages without the category, but since it is possible, that was the only blocker to doing what I was trying to do. The only thing is that this needs to be fast since the editnotice is parsed everytime it needs to be displayed. Galobtter (talk) 15:52, 5 February 2024 (UTC)[reply]
Performance should be no more of an issue that the already existing check for {{refideas}} on the talk page is (which I wrote without even thinking about performance and AFAIK hasn't caused any problems of that nature). * Pppery *it has begun...17:19, 5 February 2024 (UTC)[reply]
As part of the {{draft at}} inclusion conditionals, the current editnotice is already checking whether the page is a disambiguation page. In the new module, I'm reusing the same check result for both use-cases. I also tested by not reusing the result and letting it get computed twice - even then no discernible change in lua execution time was seen at a millisecond precision. – SD0001 (talk) 17:52, 5 February 2024 (UTC)[reply]
The hasClass shim looks like low-hanging fruit to be removed since almost nothing still using it is likely to have survived other javascript deprecations in mediawiki. I checked the uses - the search returned 33 results:
All results: (exported here via CD's convert to wikitext feature, and then annotated)
User:GregU/randomlink.js continue; if ((mw.config.get('wgAction') == "history") != hasClass(link, "mw-userlink")) continue; if (link.hostname... 8 KB (847 words) - 12:46, 29 November 2021
94 users, 6 active, but the script is already broken due to undeclared use of getElementsByClassName, see last section of talk page
User:The Editor's Apprentice/randomlink.js continue; if ((mw.config.get('wgAction') == "history") != hasClass(link, "mw-userlink")) continue; if (link.hostname... 9 KB (1,012 words) - 13:45, 27 August 2022
3 users, looks already broken as portletId used further down isn't declared anywhere. cc The Editor's Apprentice
It isn't already broken - that error displays but it still created a link. I edited the script to fix the hasClass issue, since I'm not willing to be the person known for willfully breaking people's stuff. * Pppery *it has begun...01:23, 18 June 2024 (UTC)[reply]
User:Kimdime/monobook.js getElementsByTagName('div'); for(var a=0;a<Divs.length;a++){ if(hasClass(Divs[a],"thumbinner")){ var DivThumb = Divs[a]; ... 15 KB (1,368 words) - 16:40, 7 February 2021
User:Ucucha/collapse.js getElementsByTagName( "tr" ); for ( var i = 0; i < Rows.length; i++ ) { if ( hasClass( Rows[i], "row-collapsebutton" ) ) { /* only add button and... 3 KB (246 words) - 04:41, 4 January 2011
0 users
User:Verdy p/common.js getElementsByTagName("table"); for (var i = 0; i < Tables.length; i++) { if (hasClass(Tables[i], "collapsible")) { /* only add button and increment... 3 KB (326 words) - 20:24, 30 December 2021
Done I was paranoid and edited a few user JS pages to migrate them myself, because it seemed wrong to deliberately break things for a few people when we could avoid doing so. See inline comments above. * Pppery *it has begun...01:23, 18 June 2024 (UTC)[reply]