Exemple #1
0
        public virtual JavaScriptResult Get(string id)
        {
            Components component;

            if (Enum.TryParse(id.Replace(".js", ""), out component))
            {
                return(JavaScript(RenderTargetProcessor.Render(component)));
            }

            return(new JavaScriptResult());
        }
        public static MvcHtmlString GlobalSauce(this HtmlHelper htmlHelper, bool addClosure, params Components[] components)
        {
            var cultureModel = new StringBuilder();

            foreach (var component in components)
            {
                cultureModel.AppendLine(RenderTargetProcessor.Render(component));
            }

            return(addClosure ? new MvcHtmlString($"(function($) {{{cultureModel}}})(jQuery);") : new MvcHtmlString(cultureModel.ToString()));
        }