Page 1 of 1 (3 items)
This post has 2 Replies | 2 Followers

Posts 11
Taylor | Forum Activity | Posted: Sat, Oct 12 2019 12:15 PM

Discourse is a popular and rising opensource forum software.

There has been at least one attempt, not by myself, to get RefTagger working with the software.

Any help from Logos would be appreciated! If we can provide any additional help, please let us know.

Posts 5
Steven Tammen | Forum Activity | Replied: Sat, Oct 12 2019 8:09 PM

As the creator of the given thread, I can give a brief summary of the issues in play:

As far as I know, the reason why Reftagger isn’t working on Discourse forums is because Discourse uses a virtual DOM to dramatically improve rendering performance when switching between pages on the site. The problem with this is that Reftagger has no way to access this virtual DOM: even manually triggering it on the actual DOM doesn’t work, since the objects that need to get tagged are in the virtual DOM.

The simplest way to remedy this, as is seems to me, would be to add code server-side that creates the appropriate Reftagger links. As long as these links have the appropriate CSS class, they can then make use of the Reftagger JavaScript for triggering tooltips and making calls to the Reftagger API to display verse information. It’s not the AJAX/display bit of the JavaScript that is causing problems (at least as it seems to me), so I see no reason why we wouldn’t be able to add the appropriate links ourselves, thereby avoiding the problems with the part of the script that goes through the DOM and programmatically creates these links on page load.

As to how we’d do this, I’m almost positive there is a way to add custom functions to the different parts of the Discourse virtual DOM structure known as Widgets. As a first-stab attempt, we could try regular-expression matching on verse references (mimicking the Reftagger behavior), and then adding the appropriate links to Biblia and corresponding CSS class so they can trigger the Reftagger tooltips/API calls. We’d really only probably need to do this for the contents of posts.

The hardest part probably wouldn’t even be coding this (if we let a regular expression library do the heavy lifting and figured out how the Biblia URLs are formed), but figuring out where to stick this code vis-a-vis Discourse.

Posts 11
Taylor | Forum Activity | Replied: Mon, Nov 4 2019 3:56 PM

A solution was found for this on January 2010. Create a theme component for Discourse and add the linked code below to the ```</head>``` CSS.

Page 1 of 1 (3 items) | RSS