Hello all,
I help administrate a math forum running vBulletin 4.2.1. I have recently added an element to the editpost, newreply and newthread templates that introduces a live preview of LaTeX to aid in debugging code more efficiently than using the "Preview Post" function repeatedly.
Within this element, I have an input button that, using the onclick event, will copy the value of an internal textarea element to the post body using the javascript code:
Code:
document.getElementsByClassName('cke_source')[0].value += document.getElementById('MathInput').value
This works fine unless the user has opted for the WYSIWYG editor, in which case the DOM is constructed differently.
My question: is there a way to append data to the post message that will work regardless of the editor chosen by the user? I have tried manipulating {vb:raw post.message} to no avail.
I appreciate any insights into how to get this to work.
Best Regards,
Mark.