public void AddScript(ScriptLoadItem script) { Scripts.Add(script); script.Group = this; }
protected void renderSimpleScript(ScriptLoadItem item, TextWriter writer, AppScripts appScripts) { if (item.Script is InlineScriptResource) { var script = (InlineScriptResource)item.Script; writer.WriteLine("<script>"); writer.WriteLine("(function() {"); writer.WriteLine(script.Body); writer.WriteLine("})();"); writer.WriteLine("</script>"); } else { var script = (FileScriptResource)item.Script; writer.Write("<script src=\""); writeScriptPath(script, appScripts, delegate(string str) { writer.Write(str); }); writer.WriteLine("\"></script>"); } }
public void MoveScript(ScriptLoadGroup to, ScriptLoadItem script) { Scripts.Remove(script); to.AddScript(script); }
protected ScriptLoadItem processScript(ScriptResource resource) { // TODO: This prevents us from referencing scripts on-page because these parent script trees // are built once for the app for all AppScripts, then repeatedly and lost on each request for all // PageScripts if (resource.ParentScripts == null) resource.BuildParentScripts(); ScriptLoadItem script = new ScriptLoadItem(resource); ProcessedScripts[resource] = script; return script; }