Skip to content

Instantly share code, notes, and snippets.

@pynej
Created June 13, 2013 13:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pynej/921cba07af82c5c0090c to your computer and use it in GitHub Desktop.
Save pynej/921cba07af82c5c0090c to your computer and use it in GitHub Desktop.
Custom code to enable ClientDependency calls from Umbraco Macro's.
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