Yes you can use them inside the AMD module but keep in mind once you add an event listener on the window object it will be called everytime there is an action:ajaxify.end. If you don't want it triggered after you leave that page you need to turn it off with $(window).off('eventName', myMethod)
Problem with shoutbox plugin after 1.12.2 -> 1.13.0 nodebb upgrade
I have a shoutbox plugin like this one :
It worked well on nodebb v1.12.2 but it fails on nodebb v1.13.0. There is no message on server logs but I see this in console on client :
TypeError: Shoutbox.actions is undefined nodebb.min.js:26976:4 TypeError: Shoutbox.base is undefined nodebb.min.js:26976:4
Thanks for help !
unloaded things are in public/js/lib/ of this plugin which is declared in plugin.json as
"scripts": [ "public/js/loader.js", "public/js/lib/" ],
Is it this thing that should be changed on nodebb 1.13.0 ? We must declare all js scripts explicitly and not only their folder ?
Well... js scripts are loaded when I put all their filenames in plugin.json like this :
"scripts": [ "public/js/loader.js", "public/js/lib/actions.js", "public/js/lib/base.js", "public/js/lib/commands.js", "public/js/lib/settings.js", "public/js/lib/sockets.js", "public/js/lib/utils.js", "public/js/lib/actions/bug.js", "public/js/lib/actions/default.js", "public/js/lib/actions/gist.js", "public/js/lib/actions/hide.js", "public/js/lib/actions/settings.js", "public/js/lib/commands/default.js" ],
It doesn't work like on nodebb v1.12.2 when it was only necessary to put the folder path (like on my previous message).
I don't know if it's intentional from nodebb developers or if it's a problem with a different origin... Mystery... ???
@alfazaz Did you try with the original https://github.com/Schamper/nodebb-plugin-shoutbox. Is it also failing?
@fais3000 I didn't tried this version which was behind for many commits I wanted from the cabane-Libre version. I made also own changes...
It works now like I said : it's necessary to change "scripts" configuration with each filenames (it doesn't work since nodebb v1.13.0 with dirname).
Ne Ho last edited by
@fais3000 I have this issue with the original on version v1.13.3. (Shoutbox.base is undefined)