This is the talk page for discussing improvements to the QDmodal 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
Hook for scripts
Could this script fire a hook when initStyles has completed? I have scripts I'd want to use it in, but I'm at a loss for how to use the library. • speedy • 🔔︎ • 🚀︎ • 11:12, July 19, 2018 (UTC)
- You shouldn't need to wait for initStyles to complete - the library is ready as soon as it has loaded. I can certainly add a hook though, since that's the convention of library scripts here.
- To me, it seems odd to use a hook when you could load the script with
$.ajax()
and wait for the returned promise (see QDmodal#Usage). - OneTwoThreeFall talk 11:31, July 19, 2018 (UTC)
outsource styles
Hey OneTwoThreeFall,
I would look nicer if your styles would be outsourced and imported via importArticle()
or importStylesheet()
.
Best regards,
Agent Zuri 14:13, February 12, 2019 (UTC)
- Hi! Most of the styles could be in a separate CSS file, however since a few are dynamic based on the page colours/directionality, there'd always be some CSS included in the JS. Therefore, I just include everything in the JS so the CSS isn't split over multiple files. I know it's a bit uglier, but I have tried to make sure they're readable in the JS! (with indentation, line breaks, etc.) - OneTwoThreeFall talk 14:39, February 12, 2019 (UTC)
- Hi, okay, that's reasonable. Regarding theming, have you ever thought about using Less?
- Agent Zuri 18:20, February 12, 2019 (UTC)
- Hmm, I'm not sure Less world help for this scenario - as far as I'd know, it'd require having to compile stylesheets for each individual wiki. - OneTwoThreeFall talk 10:04, February 13, 2019 (UTC)
Translation
Hey again,
The german translation for 'close' is 'Schließen' if you want to add it to your translations object. Or do you want to use i18n-js instead?
Best regards,
Agent Zuri 14:13, February 12, 2019 (UTC)
- Thanks, I've added the German translation with a credit to you! Regarding using I18n-js, making a library depend on another (async) library can introduce unexpected issues - considering the i18n in QDmodal is only a single word, I'd rather just include it in JS to keep things simple. - OneTwoThreeFall talk 14:39, February 12, 2019 (UTC)