/// <summary> /// Process the value described by context. /// </summary> /// /// <param name="context">The context.</param> /// /// <returns> /// A string. /// </returns> public override string ProcessValue(HttpContext context) { //GET MAIN SCRIPT FROM EMBEDDED RESOURCE AND ESCAPE CURLY BRACE var fileContents = FileHelper.GetEmbeddedResource( "Babaganoush.Sitefinity.Resources.Scripts.main.js", typeof(Sitefinity.Startup)); //MERGE VARIABLES TO SCRIPT return(string.Format(fileContents.EscapeForFormat(), PageHelper.GetScriptsPath(), PageHelper.GetWebResourceUrl("Telerik.Sitefinity.Resources.Scripts.jquery.cookie.js"), PageHelper.GetWebResourceUrl("Telerik.Sitefinity.Resources.Scripts.RequireJS.text.js"), PageHelper.GetWebResourceUrl("Babaganoush.Sitefinity.Resources.Scripts.require.css.min.js"), PageHelper.GetWebResourceUrl("Babaganoush.Sitefinity.Resources.Scripts.moment.moment.min.js"), PageHelper.GetWebResourceUrl("Babaganoush.Sitefinity.Resources.Scripts.moment.moment-timezone-with-data.js"), PageHelper.GetWebResourceUrl("Babaganoush.Sitefinity.Resources.Scripts.underscore.lodash.underscore.min.js"), PageHelper.GetWebResourceUrl("Babaganoush.Sitefinity.Resources.Scripts.underscore.underscore.string.min.js"), PageHelper.GetWebResourceUrl("Babaganoush.Sitefinity.Resources.Scripts.glide.jquery.glide.min.js"), PageHelper.GetWebResourceUrl("Babaganoush.Sitefinity.Resources.Scripts.url.url.min.js"), PageHelper.GetWebResourceUrl("Babaganoush.Sitefinity.Resources.Scripts.lostorage.loStorage.min.js"), PageHelper.GetWebResourceUrl("Babaganoush.Sitefinity.Resources.Scripts.baba.api.js"), PageHelper.GetWebResourceUrl("Babaganoush.Sitefinity.Resources.Scripts.baba.helpers.js"), PageHelper.GetWebResourceUrl("Babaganoush.Sitefinity.Resources.Scripts.baba.alerts.js"), PageHelper.GetWebResourceUrl("Telerik.Sitefinity.Resources.Scripts.jquery.blockUI.js"))); }
/// <summary> /// Adds the script resource. /// </summary> /// /// <param name="html">The HTML.</param> /// <param name="resource">The resource.</param> /// <param name="head">(Optional) if set to <c>true</c> [head].</param> /// <param name="id">(Optional) The identifier.</param> public static void AddScriptResource(this HtmlHelper html, string resource, bool head = false, string id = null) { //ADD STYLESHEET TO PAGE HEAD html.AddScriptFile(PageHelper.GetWebResourceUrl(resource), head, resource); }
/// <summary> /// Adds the CSS resource. /// </summary> /// /// <param name="html">The HTML.</param> /// <param name="resource">The resource.</param> public static void AddCssResource(this HtmlHelper html, string resource) { //ADD STYLESHEET TO PAGE HEAD html.AddCssFile(PageHelper.GetWebResourceUrl(resource), resource); }