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