private static string GenerateProxy(IHubManager hubManager, IJavaScriptMinifier javaScriptMinifier, bool includeDocComments) { string script = _templateFromResource.Value; var hubs = new StringBuilder(); var first = true; foreach (var descriptor in hubManager.GetHubs().OrderBy(h => h.Name)) { if (!first) { hubs.AppendLine(";"); hubs.AppendLine(); hubs.Append(" "); } GenerateType(hubManager, hubs, descriptor, includeDocComments); first = false; } if (hubs.Length > 0) { hubs.Append(";"); } script = script.Replace("/*hubs*/", hubs.ToString()); return(javaScriptMinifier.Minify(script)); }
public ScriptPipeline_Tests() { minifier = Mock.Of<IJavaScriptMinifier>(); urlGenerator = Mock.Of<IUrlGenerator>(); var container = new TinyIoCContainer(); settings = new CassetteSettings(); container.Register(minifier); container.Register(urlGenerator); container.Register(settings); pipeline = new ScriptPipeline(container, settings); }
public ScriptPipeline_Tests() { minifier = Mock.Of <IJavaScriptMinifier>(); urlGenerator = Mock.Of <IUrlGenerator>(); var container = new TinyIoCContainer(); settings = new CassetteSettings(); container.Register(minifier); container.Register(urlGenerator); container.Register(settings); pipeline = new ScriptPipeline(container, settings); }
private string MinifyJavaScript(List <string> files, IJavaScriptMinifier minifier) { try { var inputJavaScript = new StringBuilder(); foreach (var file in files) { inputJavaScript.Append(ReadFile(file) + "\n"); } return(minifier.CompressContent(inputJavaScript.ToString())); } catch (Exception e) { throw new Exception(string.Format("Error processing: {0}", e.Message), e); } }
public MenusController( IMenusAppService menuAppService, IUserAppService userAppService, INavigationScriptManager navigationScriptManager, ITenantCache tenantCache, IRepository <User, long> userRepository, IJavaScriptMinifier javaScriptMinifier, ISessionAppService sessionAppService, TenantManager tenantManager, ITenantAppService tenantAppService, IUnitOfWorkManager unitOfWorkManager) { _menuAppService = menuAppService; _userRepository = userRepository; _navigationScriptManager = navigationScriptManager; _javaScriptMinifier = javaScriptMinifier; _tenantAppService = tenantAppService; _sessionAppService = sessionAppService; _tenantManager = tenantManager; _unitOfWorkManager = unitOfWorkManager; }
/// <summary> /// Constructor. /// </summary> public AbpScriptsController( IMultiTenancyScriptManager multiTenancyScriptManager, ISettingScriptManager settingScriptManager, INavigationScriptManager navigationScriptManager, ILocalizationScriptManager localizationScriptManager, IAuthorizationScriptManager authorizationScriptManager, IFeaturesScriptManager featuresScriptManager, ISessionScriptManager sessionScriptManager, ITimingScriptManager timingScriptManager, ISecurityScriptManager securityScriptManager, IJavaScriptMinifier javaScriptMinifier) { _multiTenancyScriptManager = multiTenancyScriptManager; _settingScriptManager = settingScriptManager; _navigationScriptManager = navigationScriptManager; _localizationScriptManager = localizationScriptManager; _authorizationScriptManager = authorizationScriptManager; _featuresScriptManager = featuresScriptManager; _sessionScriptManager = sessionScriptManager; _timingScriptManager = timingScriptManager; _securityScriptManager = securityScriptManager; _javaScriptMinifier = javaScriptMinifier; }
public AbpServiceProxiesController(IApiProxyScriptManager proxyScriptManager, IJavaScriptMinifier javaScriptMinifier) { _proxyScriptManager = proxyScriptManager; _javaScriptMinifier = javaScriptMinifier; }
public DefaultJavaScriptProxyGenerator(IHubManager manager, IJavaScriptMinifier javaScriptMinifier) { _manager = manager; _javaScriptMinifier = javaScriptMinifier; _generatedTemplate = new Lazy <string>(() => GenerateProxy(_manager, _javaScriptMinifier, includeDocComments: false)); }
public AbpServiceProxiesController(ScriptProxyManager scriptProxyManager, IJavaScriptMinifier javaScriptMinifier) { _scriptProxyManager = scriptProxyManager; _javaScriptMinifier = javaScriptMinifier; }
public DefaultJavaScriptProxyGenerator(IHubLocator hubLocator, IJavaScriptMinifier javascriptMinifier) { _hubLocator = hubLocator; _javascriptMinifier = javascriptMinifier; }
public RxJsProxyGenerator(IHubManager manager, IJavaScriptMinifier javaScriptMinifier) { _manager = manager; _javaScriptMinifier = javaScriptMinifier ?? NullJavaScriptMinifier.Instance; _generatedTemplate = new Lazy <string>(() => GenerateProxy(_manager, _javaScriptMinifier, includeDocComments: false)); }
public DefaultJavaScriptProxyGenerator(IHubManager manager, IJavaScriptMinifier javaScriptMinifier) { _manager = manager; _javaScriptMinifier = javaScriptMinifier ?? NullJavaScriptMinifier.Instance; }
private string MinifyJavaScript(List<string> files, IJavaScriptMinifier minifier) { try { var inputJavaScript = new StringBuilder(); foreach (var file in files) { inputJavaScript.Append(ReadFile(file) + "\n"); } return minifier.CompressContent(inputJavaScript.ToString()); } catch (Exception e) { throw new Exception(string.Format("Error processing: {0}", e.Message), e); } }
public IJavaScriptBundleBuilder WithMinifier(IJavaScriptMinifier javaScriptMinifier) { this.javaScriptMinifier = javaScriptMinifier; return this; }
public IJavaScriptBundleBuilder WithMinifier(JavaScriptMinifiers javaScriptMinifier) { this.javaScriptMinifier = MapMinifierEnumToType(javaScriptMinifier); return this; }
public IJavaScriptBundleBuilder WithMinifier(IJavaScriptMinifier javaScriptMinifier) { this.javaScriptMinifier = javaScriptMinifier; return(this); }
public IJavaScriptBundleBuilder WithMinifier(JavaScriptMinifiers javaScriptMinifier) { this.javaScriptMinifier = MapMinifierEnumToType(javaScriptMinifier); return(this); }