This is the talk page for discussing improvements to the MoreDropdown page.
- Please sign and date your posts by typing four tildes (
~~~~). - Put new text under old text. Click here to start a new topic.
- If you're new to the wiki, please take a look at the talk page help.
- Be polite
- Assume good faith
- Be welcoming
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!
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.loadedthat 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 });
-
- 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_PATHNAMEas 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, 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
- 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, for trying to load the old editor that should be good, just replace
fullpagewithmw.config.get('wgPageName')asfullpageis also a local variable.- It all seems to work now. Thanks for your help! AdamPlenty (talk) 22:46, 2 September 2021 (UTC)