I've converted a script that I hope to get embedded on a StackExchange site (Lego Answers) to a GreaseMonkey/Userscript but I'd like to get it interacting with the live preview when creating or editing questions and answers.
At the moment the script runs once the page is loaded and looks for our custom tags (for example [part:3700:4]
) and when it finds one, calls a webservice to retrieve the part name and image details and then replaces the tag with the image.
However, this doesn't work with either inline editing or creating a question as the preview updates on the fly.
Has anyone else hooked a userscript or similar into the preview for this sort of feature?
The script can be seen here: