public JsonNetResult GetManifestAssetList() { JArray GetAssetList() { var initJs = new JsInitialization(_manifestParser); var initCss = new CssInitialization(_manifestParser); var assets = new List <string>(); assets.AddRange(initJs.OptimizeBackOfficeScriptFiles(HttpContext, Enumerable.Empty <string>())); assets.AddRange(initCss.GetStylesheetFiles(HttpContext)); return(new JArray(assets)); } //cache the result if debugging is disabled var result = HttpContext.IsDebuggingEnabled ? GetAssetList() : AppCaches.RuntimeCache.GetCacheItem <JArray>( "Umbraco.Web.Editors.BackOfficeController.GetManifestAssetList", GetAssetList, new TimeSpan(0, 2, 0)); return(new JsonNetResult(JsonNetResult.DefaultJsonSerializerSettings) { Data = result, Formatting = Formatting.None }); }
public JsonNetResult GetManifestAssetList() { Func <JArray> getResult = () => { var plugins = new DirectoryInfo(Server.MapPath("~/App_Plugins")); var parser = new ManifestParser(plugins, ApplicationContext.ApplicationCache.RuntimeCache); var initJs = new JsInitialization(parser); var initCss = new CssInitialization(parser); var jsResult = initJs.GetJavascriptInitializationArray(HttpContext, new JArray()); var cssResult = initCss.GetStylesheetInitializationArray(HttpContext); ManifestParser.MergeJArrays(jsResult, cssResult); return(jsResult); }; //cache the result if debugging is disabled var result = HttpContext.IsDebuggingEnabled ? getResult() : ApplicationContext.ApplicationCache.RuntimeCache.GetCacheItem <JArray>( typeof(BackOfficeController) + "GetManifestAssetList", () => getResult(), new TimeSpan(0, 10, 0)); return(new JsonNetResult { Data = result, Formatting = Formatting.Indented }); }
public JavaScriptResult Application() { var initJs = new JsInitialization(_manifestParser); var initCss = new CssInitialization(_manifestParser); var files = initJs.OptimizeBackOfficeScriptFiles(HttpContext, JsInitialization.GetDefaultInitialization()); var result = JsInitialization.GetJavascriptInitialization(HttpContext, files, "umbraco"); result += initCss.GetStylesheetInitialization(HttpContext); return JavaScript(result); }
public JavaScriptResult Application() { var plugins = new DirectoryInfo(Server.MapPath("~/App_Plugins")); var parser = new ManifestParser(plugins); var initJs = new JsInitialization(parser); var initCss = new CssInitialization(parser); //get the legacy ActionJs file references to append as well var legacyActionJsRef = new JArray(GetLegacyActionJs(LegacyJsActionType.JsUrl)); var result = initJs.GetJavascriptInitialization(HttpContext, JsInitialization.GetDefaultInitialization(), legacyActionJsRef); result += initCss.GetStylesheetInitialization(HttpContext); return JavaScript(result); }
public JavaScriptResult Application() { var plugins = new DirectoryInfo(Server.MapPath("~/App_Plugins")); var parser = new ManifestParser(plugins, ApplicationContext.ApplicationCache.RuntimeCache); var initJs = new JsInitialization(parser); var initCss = new CssInitialization(parser); //get the legacy ActionJs file references to append as well var legacyActionJsRef = new JArray(GetLegacyActionJs(LegacyJsActionType.JsUrl)); var result = initJs.GetJavascriptInitialization(HttpContext, JsInitialization.GetDefaultInitialization(), legacyActionJsRef); result += initCss.GetStylesheetInitialization(HttpContext); return(JavaScript(result)); }