예제 #1
0
		public void AddScript(ScriptLoadItem script)
		{
			Scripts.Add(script);
			script.Group = this;
		}
예제 #2
0
		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>");
			}
		}
예제 #3
0
		public void MoveScript(ScriptLoadGroup to, ScriptLoadItem script)
		{
			Scripts.Remove(script);
			to.AddScript(script);
		}
예제 #4
0
		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;
		}