TL;DR summary:
- Issues incorporating javascript & CSS links to enable Robustify tooltip pop-ups to hyperlinks on our Discourse.
- Some similarities to this earlier case although we’re stopping short of querying the Robustify API; maybe sensible to go this route eventually but had intended to start just by enabling popups for correctly wrapped hyperlinks.
Details:
I am writing with a hopefully straightforward question about implementing a small CSS/JS app on our Discourse forum: we are trying to use a neat little app put together by Mementoweb that attaches a pop-up box to any hyperlinks on a page, allowing you to choose between accessing the site or viewing an earlier cached version of the site if the link is no longer functional. It is a really neat feature!, & we’re hoping it might solve some of the inevitable problems around coming back to a website a couple of years later & finding dead links to unmaintained pages. Initially I hoped to just try ensuring it would work when one of us manually generates a code on the Robustify site (example).
The app runs on a couple of lines of code - links are wrapped with a longer a href tag, & there are links to a CSS stylesheet and some Javascript code in the head tags. I was a little unsure whether Discourse would permit Javascript customization but was really encouraged reading the Beginner’s guide & seeing how much scope there was for modifications. We’re using a remote theme (Sam’s Simple Theme) and I’ve tried to add our code to the site header as a new component:
I haven’t been able to get this up & running yet but thought I’d solved it yesterday, reading up on plugins & switching out our JS type value to “text/discourse-plugin” version=“0.8.13”; I’ve also tried to solve around the slight variables of relocating the CSS (linking the sheet directly instead of as a DOI; copying the tags directly into the CSS space; including as Embedded CSS, etc) without any luck - posts with wrapped links still appear without a popup:
Any guidance much appreciated here!, & I’ll bump this post if I stumble on a solution in the meantime.