dev

This is the talk page for discussing improvements to the MoreDropdown page.

If you need to report a bug or request a new feature, please do it here.
If you want to make any major changes to this script excluding compatibility, please ask me before making any changes.
If you have any questions about the script, please ask on my talk page. Thanks!

~β˜™Thundercraft5|πŸ’¬|πŸ”Ž|21|GuestbookVanguard-sig.svgLeft on 3:17 AM Jun 29 (Mon) 2020

Appending

Hi,

Where's the menu customisation code supposed to go? Appending to the menu isn't working for me, no matter what I try. AdamPlenty (talk) 19:24, 2 September 2021 (UTC)

It's likely because you're inserting the elements to early because the dropdown doesn't exist when you do. I've added a hook called dev.MoreDropdown.loaded that you can use to wait for the dropdowns to be added.
mw.hook('dev.MoreDropdown.loaded').add(function($dropdown, $userDropdown) {
	// $dropdown is the main dropdown, and $userDropdown is the user dropdown on profile pages
});
~β˜™Thundercraft5|πŸ’¬|πŸ”Ž|21|GuestbookVanguard-sig.svgLeft on 7:40 PM Sep 02 (Thu) 2021
I added the hook to the bottom of the page, but still nothing is happening. I assume it's supposed to go in the user common.js? AdamPlenty (talk) 19:53, 2 September 2021 (UTC)
Yes, it's supposed to go in the user's common.js. JS review will take a little while to get to reviewing my changes, so you'll have to wait until then for results. The hook should go before wherever you're importing the script. You will have to use this code to get a page's name for the main dropdown instead of PAGE_PATHNAME as it's a local variable for the script: mw.config.get('wgArticlePath').replace(/\$1/, "")
Thanks. I'm trying to add a button to load the old editor. Is \"" + mw.config.get('wgArticlePath').replace(/\$1/, "") + fullpage + "?action=submit\" the right thing to use? AdamPlenty (talk) 20:34, 2 September 2021 (UTC)

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Yes, for trying to load the old editor that should be good, just replace fullpage with mw.config.get('wgPageName') as fullpage is also a local variable.
~β˜™Thundercraft5|πŸ’¬|πŸ”Ž|21|GuestbookVanguard-sig.svgLeft on 9:49 PM Sep 02 (Thu) 2021
It all seems to work now. Thanks for your help! AdamPlenty (talk) 22:46, 2 September 2021 (UTC)