2009-06-19 07:39:16 +00:00
|
|
|
|
using System;
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using System.Text;
|
|
|
|
|
|
using System.Web.UI;
|
|
|
|
|
|
|
|
|
|
|
|
namespace umbraco.presentation.ClientDependency
|
|
|
|
|
|
{
|
2009-06-19 09:32:18 +00:00
|
|
|
|
public class ClientDependencyInclude : Control, IClientDependencyFile
|
2009-06-19 07:39:16 +00:00
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
public ClientDependencyInclude()
|
|
|
|
|
|
{
|
2009-06-19 09:32:18 +00:00
|
|
|
|
DependencyType = ClientDependencyType.Javascript;
|
|
|
|
|
|
Priority = DefaultPriority;
|
2009-07-13 14:51:26 +00:00
|
|
|
|
DoNotOptimize = false;
|
2009-06-19 07:39:16 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
2009-06-19 09:32:18 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// If a priority is not set, the default will be 100.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <remarks>
|
|
|
|
|
|
/// This will generally mean that if a developer doesn't specify a priority it will come after all other dependencies that
|
|
|
|
|
|
/// have unless the priority is explicitly set above 100.
|
|
|
|
|
|
/// </remarks>
|
|
|
|
|
|
protected const int DefaultPriority = 100;
|
|
|
|
|
|
|
2009-07-13 14:51:26 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// If set to true, this file will not be compressed, combined, etc...
|
|
|
|
|
|
/// it will be rendered out as is.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <remarks>
|
|
|
|
|
|
/// Useful for debugging dodgy scripts.
|
|
|
|
|
|
/// Default is false.
|
|
|
|
|
|
/// </remarks>
|
|
|
|
|
|
public bool DoNotOptimize { get; set; }
|
|
|
|
|
|
|
2009-06-19 09:32:18 +00:00
|
|
|
|
public ClientDependencyType DependencyType { get; set; }
|
|
|
|
|
|
public string FilePath { get; set; }
|
|
|
|
|
|
public string PathNameAlias { get; set; }
|
|
|
|
|
|
public string CompositeGroupName { get; set; }
|
|
|
|
|
|
public int Priority { get; set; }
|
|
|
|
|
|
public string InvokeJavascriptMethodOnLoad { get; set; }
|
2009-06-19 07:39:16 +00:00
|
|
|
|
|
|
|
|
|
|
protected override void OnPreRender(EventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
base.OnPreRender(e);
|
2009-06-19 09:32:18 +00:00
|
|
|
|
if (string.IsNullOrEmpty(FilePath))
|
2009-06-19 07:39:16 +00:00
|
|
|
|
throw new NullReferenceException("Both File and Type properties must be set");
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|