private static void AddToolDependencies(HtmlDom toolDom)
{
//TODO: I'm disabling this because the existence of the <script> element messes up the Accordion (it trips over it somehow).
//We can return to this approach if/when we fix that or, more likely, abandon the accordion for a better control
return;
//Enhance: this can currently handle a single <script> element in the head of the component html
//Enhance: Load in a different way so that the linked files can be debugged in a browser.
//See http://stackoverflow.com/questions/690781/debugging-scripts-added-via-jquery-getscript-function
var scriptInHead = toolDom.Head.SelectSingleNode("script");
if (scriptInHead != null)
{
var scriptElement = toolDom.RawDom.CreateElement("script");
var path = scriptInHead.GetStringAttribute("src");
// use jquery getScript to dynamically load the script
scriptElement.InnerText =
"$.getScript('" + path + "').done(function() {}).fail(function() {alert('failed to load " + path + "')});";
toolDom.Body.AppendChild(scriptElement);
}
}