Hello fellow math enthusiast!
You could remove the need for editing the "SHOWTHREAD" template by adding a plugin hooked at "parse_templates" with the following Plugin PHP Code:
PHP Code:
if (THIS_SCRIPT === 'showthread')
{
$javascript = '<script type="text/javascript" src="./bestAnswer/bestAnswer.js?version=0"></script>';
$template_hook['headinclude_javascript'] .= $javascript;
}
In the conditional, you should add any other conditions you want to be true before the script is added, such as whether the product is enabled, if the browsing user has permission to use the button, etc.
Adding the version number parameter (which you should increment anytime you change that .js file when you upload an update of this product here) will ensure the new version is loaded by browsers, rather than using the cached older version which browsers will do unless the cache is cleared.
Manual template edits will keep some folks from trying a product (hacking templates is rightfully frowned upon by many, and in addition template hacks have to be done for each active style), and so I wanted to offer a little help to remove that need.