Completes: U4-3712 Allow c# property editors to have custom js injected into the js initialization block so they can load in angular controllers

This commit is contained in:
Shannon
2013-11-28 14:27:58 +11:00
parent 478b7cde42
commit 50e10155e7
10 changed files with 162 additions and 70 deletions

View File

@@ -1,6 +1,7 @@
using System.Collections.Generic;
using System.IO;
using System.Text.RegularExpressions;
using System.Web;
using ClientDependency.Core;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
@@ -37,7 +38,7 @@ namespace Umbraco.Web.UI.JavaScript
/// <summary>
/// Processes all found manifest files and outputs the main.js file containing all plugin manifests
/// </summary>
public string GetJavascriptInitialization(JArray umbracoInit, JArray additionalJsFiles = null)
public string GetJavascriptInitialization(HttpContextBase httpContext, JArray umbracoInit, JArray additionalJsFiles = null)
{
foreach (var m in _parser.GetManifests())
{
@@ -51,7 +52,10 @@ namespace Umbraco.Web.UI.JavaScript
}
//now we can optimize if in release mode
umbracoInit = CheckIfReleaseAndOptimized(umbracoInit, ClientDependencyType.Javascript);
umbracoInit = CheckIfReleaseAndOptimized(umbracoInit, ClientDependencyType.Javascript, httpContext);
//now we need to merge in any found cdf declarations on property editors
ManifestParser.MergeJArrays(umbracoInit, ScanPropertyEditors(ClientDependencyType.Javascript, httpContext));
return ParseMain(
umbracoInit.ToString(),