Jump to content

User talk:Pathoschild

Page contents not supported in other languages.
This user is a Wikimedia steward.
This user has administrator privileges on the English Wikipedia.
From Wikipedia, the free encyclopedia
(Redirected from User talk:Pathoschild/s)

m:User talk:Pathoschild

"Script" header in sidebar

[edit]

Can you help me solve the perennial issue with the repeated "Script" header in sidebar? Would it be related to how I use your script? It's obviously not urgent, but it's annoying. Thanks for ay suggestions you can give me. -- Ohc revolution of our times 11:21, 8 June 2022 (UTC)[reply]

@Ohconfucius: Hi! That's from Regex Menu Framework, which has been obsolete and unmaintained for just over a decade. I suggest switching any scripts that use it to the newer TemplateScript (which you already use elsewhere), which should fix that. —Pathoschild (talk) 19:09, 8 June 2022 (UTC)[reply]
There's been a minor cataclysm since I tried to copy over TemplateScript. Some of my test scripts have failed (I think principally the MOSFORMAT script, where the restoration of protected strings stalls), and the there have been complaints notably about my (production) MOSNUM script and my COMMONTERMS script. Could you possibly advise where I have gone wrong? I also noticed that you had modified my MOSUTIL script, so I have just copied it over to the production version. Regards, -- Ohc revolution of our times 07:43, 10 June 2022 (UTC)[reply]
@Ohconfucius: I suggest migrating incrementally instead, so we can isolate what might cause issues. I just added some compatibility wrappers to test/MOSNUM utils, which in theory will let you update that script by itself without changing anything else. If that works fine, we can migrate the next script and retest, and so forth. —Pathoschild (talk) 18:32, 11 June 2022 (UTC)[reply]

Migrate MOSNUM utils

[edit]

It seems that your version of MOSUTIL script does not function; the MOSNUM script buttons disappear upon installation with both test and production scripts. In fact, I suspect it might never have worked.

Secondly, I don't quite understand why there were two calls for Regex menu framework in my Sources script. The script continues to work after I substituted the first instance for TemplateScript, but fails to work thereafter if either one of those calls is removed. -- Ohc revolution of our times 11:04, 15 June 2022 (UTC)[reply]

I replaced regex menu framework as the basis of my Common terms script. And while there are now no longer any script buttons in the side bar, the underlying functions can still be called up from within my vector script. -- Ohc revolution of our times 13:52, 15 June 2022 (UTC)[reply]

TemplateScript and Regex Menu Framework are different frameworks; they have equivalent features, but their code isn't interchangeable. For example, your scripts depend on a global regex function which doesn't exist in TemplateScript. So you can't just swap the imports, you also need to migrate the code to the new format (and keep the Regex Menu Framework imports too until any code using it is fully updated). That's why I suggest starting with a single script (like MOSUTIL), migrating it, and making sure it fully works before moving on to the next script.
It's been a long time since I updated MOSUTIL, so I'm not familiar with the usage anymore. I loaded the updated scripts on an edit page and I did see a list of links added to the sidebar under 'Tools' (DATES to dmy, DATES to mdy, US-slash dates, and UK-slash dates). Are those the script buttons you mean? Do you have a sandbox page with a list of test cases and expected output, so I can do a full end-to-end test? —Pathoschild (talk) 15:10, 15 June 2022 (UTC)[reply]
Thanks for the explanation. Those items in the sidebar under 'Tools' (DATES to dmy, DATES to mdy, US-slash dates, and UK-slash dates) are the ones I mean by script buttons. I have a test page for each script, for example, for dates I have User:Ohconfucius/Bot modules/dmy test page and User:Ohconfucius/MOSNUM script test; of course, any mainspace article with a predefined date format can be used to test. For Common terms, I have User:Ohconfucius/test/Common Terms test page, and for the sources script, there is User:Ohconfucius/script/Sources/test. Which script do you propose to start with? -- Ohc revolution of our times 16:11, 15 June 2022 (UTC)[reply]
I have a test setup in User:Pathoschild/common.js which seems to be working. If you switch your import from User:Ohconfucius/script/MOSNUM dates.js to User:Pathoschild/script/MOSNUM dates.js, does everything still work for you? —Pathoschild (talk) 17:54, 15 June 2022 (UTC)[reply]
After refreshing the cache yesterday, I had a reduced level of functionality: the buttons were there and there was some unlinking; parameters (such as |df=y) were changed or inserted, and little else. Now, strangely enough, the script buttons no longer even show up. -- Ohc revolution of our times 08:35, 16 June 2022 (UTC)[reply]
Can you list some specific replacements you expected to happen on that page which didn't? When the tool links don't appear, do you have any errors in your JavaScript console? —Pathoschild (talk) 02:32, 17 June 2022 (UTC)[reply]
This is the expected outcome. So, as you can see from this diff, it only engages the unlinking function; none of the mdy–>dmy conversions take place (inside or outside of citation templates; none of the CS1 errors are corrected. When using your module, the sidebar buttons appear correct, but I get no error messages that anything is amiss after clicking on them until I look at the diff of the output. Anyway, I'm not sure I know how to access the JS console. -- Ohc revolution of our times 22:25, 17 June 2022 (UTC)[reply]
I fixed the ohc_regex wrapper not saving changes, which should fix many of the issues. I get a slightly different result when editing that page, but I get the same result when using the original script. Can you try it now and list any other cases that don't match what you'd expect? —Pathoschild (talk) 01:44, 18 June 2022 (UTC)[reply]
The problem seems to have been solved, thanks. and it's working like before. I migrated the production script accordingly. I have one question at this stage: is it correct that the MOSNUM script uses both Regex Menu Framework as well as TemplateScript? -- Ohc revolution of our times 13:59, 18 June 2022 (UTC)[reply]
Yep. We've only migrated MOSNUM utils so far, everything else still uses Regex Menu Framework. So the next step would probably be migrating MOSNUM dates to TemplateScript too. I can migrate the code if you're interested (though it'll move the buttons from the main 'tools' section into a new section below it). —Pathoschild (talk) 21:36, 18 June 2022 (UTC)[reply]
Yes please. I look forward to seeing how that's done. Not quite sure of the implications of new button positions, but I'm game. -- Ohc revolution of our times 07:13, 19 June 2022 (UTC)[reply]
I have MOSNUM dates tentatively migrated to TemplateScript in User:Pathoschild/common.js. It's a pretty big change, so I suggest retesting all the features; let me know if anything doesn't work as expected. —Pathoschild (talk) 19:50, 19 June 2022 (UTC) (moved into separate subsection)[reply]
I haven't done anything since I last wrote here (I haven't yet made the above modification), but the MOSNUM script seems to be not working again. I'll take a look at the migrated version in the next couple of days. But in the meantime, if I have to go back and troubleshoot the actions in the last 24 hours. -- Ohc revolution of our times 21:50, 19 June 2022 (UTC)[reply]
Can you check your browser's JavaScript console to see if there are any errors? —Pathoschild (talk) 17:36, 20 June 2022 (UTC)[reply]
There are three lines showing errors:
  1. Some cookies are misusing the recommended “sameSite“ attribute 2
  2. Request to access cookie or storage on “<URL>” was blocked because it came from a tracker and content blocking is enabled. 14
  3. This site appears to use a scroll-linked positioning effect. This may not work well with asynchronous panning; see https://developer.mozilla.org/docs/Mozilla/Performance/ScrollLinkedEffects for further details and to join the discussion on related tools and features!
which unfortunately I don't know what it means for the malfunction.-- Ohc revolution of our times 17:04, 21 June 2022 (UTC)[reply]
Is there any particular reason why it stopped working but is now back? -- Ohc revolution of our times 17:08, 21 June 2022 (UTC)[reply]
Those are regular warnings unrelated to these scripts, so you can ignore those. Next time the buttons disappear, can you send me a screenshot of the messages in the console? (You can use a site like pasteboard to share temporary images.) —Pathoschild (talk) 21:20, 21 June 2022 (UTC)[reply]
Sure thing! -- Ohc revolution of our times 22:06, 21 June 2022 (UTC)[reply]

Migrate MOSNUM dates

[edit]

I have MOSNUM dates tentatively migrated to TemplateScript in User:Pathoschild/common.js. It's a pretty big change, so I suggest retesting all the features; let me know if anything doesn't work as expected. —Pathoschild (talk) 19:50, 19 June 2022 (UTC)[reply]

I can't get my head around this issue: the production version (which uses both Regex Menu Framework and TempoateScript) and test version, which uses exclusively TemplateScript (with RMF disabled) of MOSNUM dates both work when I load up (there are minimal differences between the two), so I made the change to the production script (by disabling RMF). Then I got complaint that the production script was no longer working. Any idea what's wrong with the migration? Regards, -- Ohc revolution of our times 12:58, 28 June 2022 (UTC)[reply]
Your test/MOSNUM dates.js still uses Regex Menu Framework (e.g. the regex function is part of RMF). It just doesn't import it, so it only works because RMF is still being imported elsewhere.
The migrated version is User:Pathoschild/script/MOSNUM dates.js, which has a lot more changes. You'll need to overwrite the entire production script with that migrated version. —Pathoschild (talk) 14:27, 28 June 2022 (UTC)[reply]

Common Terms

[edit]

Can we switch attention over to the next script for now? I partly lost use of the script buttons following this change. My composite script still managed to call the basic unlinking function (without recourse to the script buttons, but it was reported that the button to delink countries disappeared, so I reversed the above change. -- Ohc revolution of our times 19:45, 24 June 2022 (UTC)[reply]

Yep, we'll need to migrate the code before swapping the import. I suggest finishing with the MOSNUM dates/utils first though. If we migrate multiple scripts at once, it'll be harder to track down which particular changes might be causing any new issues you run into. I could migrate this one now if you still want to though. —Pathoschild (talk) 20:19, 24 June 2022 (UTC)[reply]
Fine, I'll go with your suggestion to do one at a time. -- Ohc revolution of our times 05:03, 25 June 2022 (UTC)[reply]

Positioning

[edit]

With regard to this conversation, where it's noted that the position of the script button has drifted downwards after migration to TemplateScript, is there any way of bumping up the position of the buttons, back into the "Tools" section of the add-ons menu? -- Ohc revolution of our times 16:12, 8 July 2022 (UTC)[reply]

TemplateScript doesn't change default sections for compatibility, but it sounds like the main issue is the new sections being under the language list. In that case I can certainly move those up above the language list. —Pathoschild (talk) 20:49, 8 July 2022 (UTC)[reply]
Thanks, that would be cool! -- Ohc revolution of our times 21:03, 8 July 2022 (UTC)[reply]
Done! Users will need to bypass their cache to see the changes. —Pathoschild (talk) 21:27, 8 July 2022 (UTC)[reply]

Composite script

[edit]

Hello,

I think that since I modified my scripts to use your templatescript.js module, my composite scripts – master scripts calling on several other scripts, for example the One Touch: FORMAT subroutine in my vector file – no longer work (I've already had to disable the ONETOUCH_DMY and ONETOUCH_MDY buttons for that reason). Could you offer any pointers as to why this may be the case, and maybe help me get the functionality back? It would be rather helpful as it's particular nuisance to access the relevant sidebar buttons efficiently because the sidebar is now quite long. Thanks in advance.  Ohc revolution of our times 20:42, 4 August 2023 (UTC)[reply]

Hi! What's the specific issue you're having? For example: do you have any errors in the JavaScript console, or is there a specific link that just doesn't appear, or does it appear but clicking it does nothing / works incorrectly? Pathoschild (talk) 16:44, 6 August 2023 (UTC)[reply]
There's no error message, there's nothing much happening visually when I click on the ONETOUCH_DMY and ONETOUCH_MDY buttons. The script button manages to call the CommonTerms script, and then stalls (The dates script should be called next but it isn't). I told you a porkie, for which I apologise: The One Touch: FORMAT meta script (which calls The CommonTerms, dashes, sources and )formatgeneral) works, but just seems quite slow, so giving me the impression that it wasn't working. Cheers, -- Ohc revolution of our times 21:34, 7 September 2023 (UTC)[reply]
So to summarize:
  1. You click the 'One Touch: DMY' tool (defined in vector.js).
  2. It runs Ohc_retrain_links() and Ohc_CommonTerms() fine (loaded from script/Common Terms.js).
  3. It fails to run ohc_delink_dates() (loaded from script/MOSNUM dates.js).
When I loaded your vector.js and ran 'One Touch: DMY', I see an error in the JavaScript console:
Uncaught TypeError: editor is undefined
  in ohc_delink_dates
  in ONETOUCH_DMY
  in <anonymous> javascript:ONETOUCH_DMY():1
That's because ohc_delink_dates is now written for TemplateScript, so it expects the editor argument it provides.
The easiest fix is to add your top-level links like ONETOUCH_DMY with TemplateScript. Then they'll be able to call both TemplateScript scripts (like ohc_delink_dates(editor)) and Regex Menu Framework scripts (like Ohc_retrain_links()), and you'll be able to incrementally remove Regex Menu Framework in the future. If you're interested, I can draft an updated vector.js for you. —Pathoschild (talk) 16:47, 9 September 2023 (UTC)[reply]
Most grateful to you for identifying the problem and solution so quickly. As I wouldn't know how to go about making the change you recommend (I looked under the bonnet and it was all gobbledegook), I would appreciate it if you could draw me up a new vector module. Regards, -- Ohc revolution of our times 17:37, 9 September 2023 (UTC)[reply]
@Ohconfucius: Sorry for the delay! Here's an updated version of your vector.js (see diff). Do you still have the issue with that version? —Pathoschild (talk) 22:01, 30 September 2023 (UTC)[reply]
Thanks for that. Unfortunately, I cannot get it to work. As I don't really understand the changes made, I don't know where to start to troubleshoot. :-( -- Ohc revolution of our times 16:32, 8 October 2023 (UTC)[reply]
What isn't working? Can you list the specific steps with the expected vs actual result? —Pathoschild (talk) 17:26, 8 October 2023 (UTC)[reply]

ArbCom 2023 Elections voter message

[edit]

Hello! Voting in the 2023 Arbitration Committee elections is now open until 23:59 (UTC) on Monday, 11 December 2023. All eligible users are allowed to vote. Users with alternate accounts may only vote once.

The Arbitration Committee is the panel of editors responsible for conducting the Wikipedia arbitration process. It has the authority to impose binding solutions to disputes between editors, primarily for serious conduct disputes the community has been unable to resolve. This includes the authority to impose site bans, topic bans, editing restrictions, and other measures needed to maintain our editing environment. The arbitration policy describes the Committee's roles and responsibilities in greater detail.

If you wish to participate in the 2023 election, please review the candidates and submit your choices on the voting page. If you no longer wish to receive these messages, you may add {{NoACEMM}} to your user talk page. MediaWiki message delivery (talk) 00:22, 28 November 2023 (UTC)[reply]

Nomination for deletion of Template:R

[edit]

Template:R has been nominated for deletion. You are invited to comment on the discussion at the entry on the Templates for discussion page. 142.113.140.146 (talk) 08:30, 15 August 2024 (UTC)[reply]