Created
June 13, 2013 13:36
-
-
Save pynej/921cba07af82c5c0090c to your computer and use it in GitHub Desktop.
Custom code to enable ClientDependency calls from Umbraco Macro's.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Web; | |
using ClientDependency.Core; | |
using ClientDependency.Core.Mvc; | |
using ClientDependency.Core.Controls; | |
using umbraco.MacroEngines; | |
namespace JSP.ClientDependency | |
{ | |
/// <summary> | |
/// Extensions to the umbraco framework. | |
/// </summary> | |
public static partial class ClientDependencyExtensions { | |
public static DependencyRenderer RequireCss(this DependencyRenderer self, string filePath, string pathNameAlias, int priority) | |
{ | |
self.RegisterDependency(priority, filePath, pathNameAlias, ClientDependencyType.Css); | |
return self; | |
} | |
public static DependencyRenderer RequireCss(this DependencyRenderer self, string filePath, string pathNameAlias) | |
{ | |
self.RegisterDependency(filePath, pathNameAlias, ClientDependencyType.Css); | |
return self; | |
} | |
public static DependencyRenderer RequireCss(this DependencyRenderer self, string filePath) | |
{ | |
self.RegisterDependency(filePath, ClientDependencyType.Css); | |
return self; | |
} | |
public static DependencyRenderer RequireCss(this DependencyRenderer self, string filePath, int priority) | |
{ | |
self.RegisterDependency(priority, filePath, ClientDependencyType.Css); | |
return self; | |
} | |
public static DependencyRenderer RequireJs(this DependencyRenderer self, string filePath, string pathNameAlias, int priority) | |
{ | |
self.RegisterDependency(priority, filePath, pathNameAlias, ClientDependencyType.Javascript); | |
return self; | |
} | |
public static DependencyRenderer RequireJs(this DependencyRenderer self, string filePath, string pathNameAlias) | |
{ | |
self.RegisterDependency(filePath, pathNameAlias, ClientDependencyType.Javascript); | |
return self; | |
} | |
public static DependencyRenderer RequireJs(this DependencyRenderer self, string filePath) | |
{ | |
self.RegisterDependency(filePath, ClientDependencyType.Javascript); | |
return self; | |
} | |
public static DependencyRenderer RequireJs(this DependencyRenderer self, string filePath, int priority) | |
{ | |
self.RegisterDependency(priority, filePath, ClientDependencyType.Javascript); | |
return self; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment