User talk:SD0001/StubSorter.js

Latest comment: 1 month ago by SD0001 in topic "Magic number" usage

Additional line shift

edit

Is it possible to remove the additional line shift when the template is used? Thanks! – 333-blue at 00:43, 4 July 2022 (UTC)Reply

replace other stub at the same time

edit

Is there a way to replace other existing stub template when adding a new stub template, for example adding {{US-film-stub}} and replacing {{Film-stub}} (already added in an article before) at the same time. Kethyga (talk) 06:48, 19 July 2022 (UTC)Reply

Hotkey for saving

edit

@SD0001: I wonder, would it be possible to add a keyboard shortcut (maybe ⇧ Shift+↵ Enter) to save the stub tags? It would save a few seconds of mousing back and forth between the links at Category:Stubs and the top of the screen where the save button is. -- Maddy from Celeste (WAVEDASH) 21:30, 2 December 2023 (UTC)Reply

@Maddy from Celeste S is the hotkey for saving. Depending on your browser/OS settings, Alt+⇧ Shift+S or Alt+S (on Mac Control+⌥ Option+S) should work. – SD0001 (talk) 06:34, 3 December 2023 (UTC)Reply
Ah, thank you! -- Maddy from Celeste (WAVEDASH) 07:16, 3 December 2023 (UTC)Reply

"Magic number" usage

edit

@SD0001, I've ported this script to my home wiki (thanks a lot for developing it!), and there's a small issue I'd like to point out. Here you slice the first 9 characters of the output, and if not for the same operation before that in the script I would've probably never guessed what was the problem. In our case, the prefix is "Шаблон:" instead of "Template:", which is two characters shorter, and thus the code cuts the actual output. Please, either add a comment, or replace "9" with either the same operation or a constant variable defined somewhere in the beginning of the file. -- MonAx (talk) 22:27, 10 November 2025 (UTC)Reply

Done. Thanks for pointing this out. I see how avoiding the magic number makes the code clearer. – SD0001 (talk) 08:55, 11 November 2025 (UTC)Reply