/// <summary> /// Gets all needed scripts. /// </summary> /// <returns></returns> public async Task <ActionResult> GetScripts() { var sb = new StringBuilder(); sb.AppendLine(_multiTenancyScriptManager.GetScript()); sb.AppendLine(); sb.AppendLine(_sessionScriptManager.GetScript()); sb.AppendLine(); sb.AppendLine(_localizationScriptManager.GetScript()); sb.AppendLine(); sb.AppendLine(await _authorizationScriptManager.GetScriptAsync()); sb.AppendLine(); sb.AppendLine(await _navigationScriptManager.GetScriptAsync()); sb.AppendLine(); sb.AppendLine(await _settingScriptManager.GetScriptAsync()); sb.AppendLine(GetTriggerScript()); return(Content(sb.ToString(), "application/x-javascript", Encoding.UTF8)); }
public async Task <ActionResult> GetScripts(string culture = "") { if (!culture.IsNullOrEmpty()) { Thread.CurrentThread.CurrentUICulture = new CultureInfo(culture); } var sb = new StringBuilder(); sb.AppendLine(_multiTenancyScriptManager.GetScript()); sb.AppendLine(); sb.AppendLine(_sessionScriptManager.GetScript()); sb.AppendLine(); sb.AppendLine(_localizationScriptManager.GetScript()); sb.AppendLine(); sb.AppendLine(await _featuresScriptManager.GetScriptAsync()); sb.AppendLine(); sb.AppendLine(await _authorizationScriptManager.GetScriptAsync()); sb.AppendLine(); sb.AppendLine(await _navigationScriptManager.GetScriptAsync()); sb.AppendLine(); sb.AppendLine(await _settingScriptManager.GetScriptAsync()); sb.AppendLine(GetTriggerScript()); sb.AppendLine(GetClockProviderScript()); return(Content(sb.ToString(), "application/x-javascript", Encoding.UTF8)); }
public async Task <ActionResult> GetScripts(string culture = "", bool minify = false) { if (!culture.IsNullOrEmpty()) { CultureInfo.CurrentCulture = CultureInfo.GetCultureInfo(culture); CultureInfo.CurrentUICulture = CultureInfo.GetCultureInfo(culture); } var sb = new StringBuilder(); sb.AppendLine(_multiTenancyScriptManager.GetScript()); sb.AppendLine(); sb.AppendLine(_sessionScriptManager.GetScript()); sb.AppendLine(); sb.AppendLine(_localizationScriptManager.GetScript()); sb.AppendLine(); sb.AppendLine(await _featuresScriptManager.GetScriptAsync()); sb.AppendLine(); sb.AppendLine(await _authorizationScriptManager.GetScriptAsync()); sb.AppendLine(); sb.AppendLine(await _navigationScriptManager.GetScriptAsync()); sb.AppendLine(); sb.AppendLine(await _settingScriptManager.GetScriptAsync()); sb.AppendLine(); sb.AppendLine(await _timingScriptManager.GetScriptAsync()); sb.AppendLine(); sb.AppendLine(_customConfigScriptManager.GetScript()); sb.AppendLine(); sb.AppendLine(GetTriggerScript()); return(Content(minify ? _javaScriptMinifier.Minify(sb.ToString()) : sb.ToString(), "application/x-javascript", Encoding.UTF8)); }
/// <summary> /// Gets all needed scripts. /// </summary> public async Task <ActionResult> GetScripts(string culture = "") { if (!culture.IsNullOrEmpty()) { CultureInfo.CurrentCulture = CultureInfo.GetCultureInfo(culture); CultureInfo.CurrentUICulture = CultureInfo.GetCultureInfo(culture); } Logger.Info("Start"); var sb = new StringBuilder(); sb.AppendLine(_multiTenancyScriptManager.GetScript()); sb.AppendLine(); Logger.Info("Start1"); sb.AppendLine(_sessionScriptManager.GetScript()); sb.AppendLine(); Logger.Info("Start2"); sb.AppendLine(_localizationScriptManager.GetScript()); sb.AppendLine(); Logger.Info("Start3"); sb.AppendLine(await _featuresScriptManager.GetScriptAsync()); sb.AppendLine(); Logger.Info("Start4"); sb.AppendLine(await _authorizationScriptManager.GetScriptAsync()); sb.AppendLine(); Logger.Info("Start5"); sb.AppendLine(await _navigationScriptManager.GetScriptAsync()); sb.AppendLine(); Logger.Info("Start6"); sb.AppendLine(await _settingScriptManager.GetScriptAsync()); sb.AppendLine(); Logger.Info("Start7"); sb.AppendLine(await _timingScriptManager.GetScriptAsync()); sb.AppendLine(); Logger.Info("Start8"); sb.AppendLine(GetTriggerScript()); Logger.Info("Start9"); return(Content(sb.ToString(), "application/x-javascript", Encoding.UTF8)); }
public async Task <ActionResult> GetScripts(string culture = "") { if (!culture.IsNullOrEmpty()) { CultureInfo.CurrentCulture = CultureInfoHelper.Get(culture); CultureInfo.CurrentUICulture = CultureInfoHelper.Get(culture); } var sb = new StringBuilder(); sb.AppendLine(multiTenancyScriptManager.GetScript()); sb.AppendLine(); sb.AppendLine(sessionScriptManager.GetScript()); sb.AppendLine(); sb.AppendLine(localizationScriptManager.GetScript()); sb.AppendLine(); sb.AppendLine(await featuresScriptManager.GetScriptAsync()); sb.AppendLine(); sb.AppendLine(await authorizationScriptManager.GetScriptAsync()); sb.AppendLine(); sb.AppendLine(await navigationScriptManager.GetScriptAsync()); sb.AppendLine(); sb.AppendLine(await settingScriptManager.GetScriptAsync()); sb.AppendLine(); sb.AppendLine(await timingScriptManager.GetScriptAsync()); sb.AppendLine(); sb.AppendLine(GetTriggerScript()); return(Content(sb.ToString(), "application/x-javascript", Encoding.UTF8)); }