/// <summary> /// Adds script references required by the Sitefinity's CodeMirror component. /// </summary> /// <param name="helper">The helper.</param> /// <returns> /// MvcHtmlString /// </returns> public static MvcHtmlString CodeMirrorScriptReferences(this HtmlHelper helper) { var result = new StringBuilder(); var urlHelper = new UrlHelper(helper.ViewContext.HttpContext.Request.RequestContext); result.Append(ResourceHelper.StyleSheet(helper, urlHelper.EmbeddedResource(typeof(Telerik.Sitefinity.Resources.Reference).FullName, "Telerik.Sitefinity.Resources.Scripts.CodeMirror.codemirror.css")).ToHtmlString()); result.Append(ResourceHelper.StyleSheet(helper, urlHelper.EmbeddedResource(typeof(Telerik.Sitefinity.Resources.Reference).FullName, "Telerik.Sitefinity.Resources.Scripts.CodeMirror.Theme.default.css")).ToHtmlString()); result.Append(ResourceHelper.Script(helper, urlHelper.EmbeddedResource(typeof(Telerik.Sitefinity.Resources.Reference).FullName, "Telerik.Sitefinity.Resources.Scripts.CodeMirror.codemirror.js")).ToHtmlString()); result.Append(ResourceHelper.Script(helper, urlHelper.EmbeddedResource(typeof(Telerik.Sitefinity.Resources.Reference).FullName, "Telerik.Sitefinity.Resources.Scripts.CodeMirror.Mode.htmlmixed.js")).ToHtmlString()); result.Append(ResourceHelper.Script(helper, urlHelper.EmbeddedResource(typeof(Telerik.Sitefinity.Resources.Reference).FullName, "Telerik.Sitefinity.Resources.Scripts.CodeMirror.Mode.xml.js")).ToHtmlString()); result.Append(ResourceHelper.Script(helper, urlHelper.EmbeddedResource(typeof(Telerik.Sitefinity.Resources.Reference).FullName, "Telerik.Sitefinity.Resources.Scripts.CodeMirror.Mode.css.js")).ToHtmlString()); result.Append(ResourceHelper.Script(helper, urlHelper.EmbeddedResource(typeof(Telerik.Sitefinity.Resources.Reference).FullName, "Telerik.Sitefinity.Resources.Scripts.CodeMirror.Mode.javascript.js")).ToHtmlString()); return(MvcHtmlString.Create(result.ToString())); }
/// <summary> /// Registers style sheet reference and ensures that it loads maximum once for a page. /// </summary> /// <param name="helper">The helper.</param> /// <param name="resourcePath">The path to the CSS file.</param> /// <returns> /// MvcHtmlString /// </returns> public static MvcHtmlString StyleSheet(this HtmlHelper helper, string resourcePath) { return(ResourceHelper.StyleSheet(helper, resourcePath, null, false)); }
/// <summary> /// Registers style sheet reference and ensures that it loads maximum once for a page. /// </summary> /// <param name="helper">The helper.</param> /// <param name="resourcePath">The path to the CSS file.</param> /// <param name="sectionName">The name of the section that will render this script. If null it will render on the same place of the page</param> /// <returns> /// MvcHtmlString /// </returns> public static MvcHtmlString StyleSheet(this HtmlHelper helper, string resourcePath, string sectionName) { return(ResourceHelper.StyleSheet(helper, resourcePath, sectionName, true)); }
/// <summary> /// Registers style sheet reference and ensures that it loads maximum once for a page. /// </summary> /// <param name="helper">The helper.</param> /// <param name="resourcePath">The path to the CSS file.</param> /// <param name="attributes">A list of attribute key value pairs to be added to the stylesheet</param> /// <returns> /// MvcHtmlString /// </returns> public static MvcHtmlString StyleSheet(this HtmlHelper helper, string resourcePath, List <KeyValuePair <string, string> > attributes) { return(ResourceHelper.StyleSheet(helper, resourcePath, null, false, attributes)); }