@phenomlab gh#10474 👍
Hi Guys! I've been writing a plugin for parsing a post for magic the gathering card names and loading an image of the card within the post.
That works great, but now instead of loading the image directly into the post, I'd like to make a link to a lightbox where the image will be shown. So far I've parsed the post to replace card names with the anchor element, but I cannot properly load a jquery plugin.
Focusing v0.8.x branch, you can find my current code here: https://github.com/jacobbridges/nodebb-plugin-mtg/tree/v0.3.0
Any help would be very appreciated..I have been on this for hours and I do not want to give up!
Used to be a big fan of MtG. Think I still have a Mox Diamond in my collection that I should probably just sell since its otherwise collecting dust.
Anyways, can you be more specific as to what your problem is? You can't just add the jquery plugin js into your plugin.json script object?
@psychobunny thanks for the response! Sorry it took me a day to get back to you.And if you no longer play I'd happily take that Mox Diamond off your hands.
Anyway, my problem is that I cannot properly load the Stripjs library with my plugin. I've tried several ways to include the script into my application. Most of them end up with
Uncaught Error: Mismatched anonymous define() modulebut when I used require.js in my
main.js, a different error occurred which was the
$(jQuery) was undefined and the jQuery lightbox plugin I am using could not call
$.extend. I doubt I'm explaining this properly as it half sounds like Greek to me. But I assume the
staticDirin my plugin is being ran on page load before jQuery is loaded---that is why
Uncaught Error: Mismatched anonymous define() module
This one is a known pain point for NodeBB, hopefully something we can fix in 1.0 when we move off requirejs and use browserify instead.
See the changes to imagesLoaded.js and masonry.js for how its done; you'll have to make a small modification to the library: