MediaWiki talk:Gadget-find-archived-section.js

Latest comment: 1 month ago by Andrybak in topic Support Wikipedia:Teahouse

Interface-protected edit request on 27 April 2020

edit

On line 101, please change

ajax: { headers: { 'Api-User-Agent': 'w:en:User:SD0001/find-archived-section.js' } }

to

ajax: { headers: { 'Api-User-Agent': 'w:en:MediaWiki:Gadget-find-archived-section.js' } }

Now that the script has moved, to avoid linking to the redirect left behind. Thanks, --DannyS712 (talk) 06:38, 27 April 2020 (UTC)Reply

  Donexaosflux Talk 11:25, 27 April 2020 (UTC)Reply

Interface-protected edit request on 26 July 2020

edit

Please apply this update (diff). This allows the script to find sections with quotation marks in its title such as this one. – Thjarkur (talk) 11:47, 26 July 2020 (UTC)Reply

@SD0001: any comments on this? — xaosflux Talk 14:14, 26 July 2020 (UTC)Reply
  Donexaosflux Talk 15:05, 2 August 2020 (UTC)Reply

Update

edit

Please sync with contents of User:SD0001/find-archived-section2.js (compare). Changes:

  • better i18n setup – define the messages properly and use mw.msg() instead of manual string replaces.
  • don't trigger on anchors used by convenientDiscussions gadget for linking to user comments – since they aren't actually archived sections.

SD0001 (talk) 16:37, 28 March 2021 (UTC)Reply

  Done @SD0001: ping me if you see any problems needing reversion. — xaosflux Talk 13:46, 20 April 2021 (UTC)Reply

Update

edit


An unannounced breaking change occurred in MediaWiki API recently that has essentially broken this gadget. Please apply this fix that resolves the issue. – SD0001 (talk) 14:53, 2 August 2021 (UTC)Reply

Hey, sorry, SD0001, but could you describe a little bit about what's broken, so that I'd know what I'm changing? Testing the gadget out, it seems to work all right for me, but I might jsut be missing what the expected outcome for the script is. Writ Keeper  13:56, 3 August 2021 (UTC)Reply
Hi Writ Keeper. Follow one of the links in user:SD0001/find-archived-section/testcases - the gadget currently fallbacks to the behaviour of simply saying the section is archived and linking the search result. Ideally, it should locate the archived section and link to it directly. – SD0001 (talk) 14:27, 3 August 2021 (UTC)Reply
Ah, got it; looks good, then.   Done, thanks! Writ Keeper  15:03, 3 August 2021 (UTC)Reply

Interface-protected edit request on 22 January 2022

edit

Please sync from User:SD0001/find-archived-section2.js (diff).

This suppresses the script from being triggered on URL hashes used by DiscussionTools and RedWarn. See Wikipedia talk:RedWarn/2020/July#Odd string of text appears when leaving a notice on talk page. for documentation on conflict with RedWarn. – SD0001 (talk) 06:20, 22 January 2022 (UTC)Reply

  Done. Seems weird that Redwarn works that way but...*shrug* Writ Keeper  15:31, 22 January 2022 (UTC)Reply

Support Reference desk

edit

Add

            case "Wikipedia:Reference desk/Science":
				return "Wikipedia:Reference desk/Archives/Science";
			case "Wikipedia:Reference desk/Miscellaneous":
				return "Wikipedia:Reference desk/Archives/Miscellaneous";
			case "Wikipedia:Reference desk/Mathematics":
				return "Wikipedia:Reference desk/Archives/Mathematics";
			case "Wikipedia:Reference desk/Language":
				return "Wikipedia:Reference desk/Archives/Language";
			case "Wikipedia:Reference desk/Humanities":
				return "Wikipedia:Reference desk/Archives/Humanities";
			case "Wikipedia:Reference desk/Entertainment":
				return "Wikipedia:Reference desk/Archives/Entertainment";
			case "Wikipedia:Reference desk/Computing":
				return "Wikipedia:Reference desk/Archives/Computing";
			case "Wikipedia:Reference desk":
				return "Wikipedia:Reference desk/Archives";

after line 35 to support WP:Reference desk. Tested links in User:SD0001/find-archived-section/testcases and all are working except one that seems to stem from a bug in CirrusSearch. Nardog (talk) 09:16, 11 June 2022 (UTC)Reply

  Donexaosflux Talk 20:16, 11 June 2022 (UTC)Reply

Support Wikipedia:Teahouse

edit

Similar to Reference desk above, please add a special case for Wikipedia:Teahouse:

			case "Wikipedia:Teahouse":
				return "Wikipedia:Teahouse/Questions";
			default:
				return prefix;

to find archive subpages of "Wikipedia:Teahouse/Questions". Two new tests were added to the bottom of the testcases page. —⁠andrybak (talk) 00:32, 6 May 2024 (UTC)Reply

  Donexaosflux Talk 10:31, 7 May 2024 (UTC)Reply
I just realized that it won't work, because Teahouse doesn't use __NEWSECTIONLINK__ (big blue custom button is used instead). The script checks presence of the "Add topic" link/button, see var addsection = document.getElementById('ca-addsection');. Would it make sense to add the ID to the Teahouse's custom button to trick the script? —⁠andrybak (talk) 16:57, 7 May 2024 (UTC)Reply
Possibly? Let me know if you want this backed out in the meantime. — xaosflux Talk 18:04, 7 May 2024 (UTC)Reply
It works: Special:Diff/1222763688. Thank you. —⁠andrybak (talk) 19:38, 7 May 2024 (UTC)Reply