I'm the maintainer for the Mass Actions block. I'm trying to convert it from YUI to jQuery/AMD so that it's compatible with Moodle when YUI is fully removed. Right now, the block has two javascript files; one of them (js/module_selector.js) defines a class that the other file (/module.js) instantiates. I tried not including an init function in module_selector.js, but Moodle kept throwing errors saying "unexpected token" and the unexpected token was an opening parenthesis from what looked like an auto-generated init function.
So, I added the init function and that stopped. Of course, the next problem was that module.js couldn't find the class to instance it, even though both files were added with a js_call_amd() call. In an effort to get this working, I've moved all the class logic into the define() call in module.js, but this really violates the single responsibility principle.
So, I'm looking for a little help in the form of any tips anyone can offer on getting this conversion completed successfully. I've been using the following pages for reference in this effort:
https://docs.moodle.org/dev/Javascript_Modules
https://docs.moodle.org/dev/jQuery
I suspect there's something on one or both of those pages that I am not correctly understanding and, obviously, I've yet to figure out what that is. Thank you in advance!