public void CreateHTML(StreamWriter sw, string path) { string html = Properties.Resources.template_html; _log.UpdateProgressWithCancellationCheck("HTML: replacing global variables"); html = ReplaceVariables(html); _log.UpdateProgressWithCancellationCheck("HTML: building CSS"); html = html.Replace("<!--${Css}-->", BuildCss(path)); _log.UpdateProgressWithCancellationCheck("HTML: building JS"); html = html.Replace("<!--${Js}-->", BuildEIJs(path)); _log.UpdateProgressWithCancellationCheck("HTML: building Combat Replay link"); html = html.Replace("<!--${JsCRLink}-->", BuildCRLinkJs(path)); html = html.Replace("'${logDataJson}'", ToJson(LogDataDto.BuildLogData(_log, _usedSkills, _usedBuffs, _usedDamageMods, _cr, _light))); #if DEBUG html = html.Replace("<!--${Vue}-->", "<script src=\"https://cdn.jsdelivr.net/npm/[email protected]/dist/vue.js\"></script>"); #else html = html.Replace("<!--${Vue}-->", "<script src=\"https://cdn.jsdelivr.net/npm/[email protected]/dist/vue.min.js\"></script>"); #endif _log.UpdateProgressWithCancellationCheck("HTML: building Graph Data"); html = html.Replace("'${graphDataJson}'", ToJson(ChartDataDto.BuildChartData(_log))); _log.UpdateProgressWithCancellationCheck("HTML: building Combat Replay JS"); html = html.Replace("<!--${CombatReplayScript}-->", BuildCombatReplayScript(path)); sw.Write(html); return; }
/// <summary> /// Create the damage taken distribution table for a given player /// </summary> /// <param name="p"></param> /// <param name="phaseIndex"></param> public void CreateHTML(StreamWriter sw, string path) { string html = Properties.Resources.tmplMain; (string externalPath, string cdnPath) = BuildAssetPaths(path); _log.UpdateProgressWithCancellationCheck("HTML: replacing global variables"); html = html.Replace("${bootstrapTheme}", !_light ? "slate" : "yeti"); _log.UpdateProgressWithCancellationCheck("HTML: building CSS"); html = html.Replace("<!--${Css}-->", BuildCss(externalPath, cdnPath)); _log.UpdateProgressWithCancellationCheck("HTML: building JS"); html = html.Replace("<!--${Js}-->", BuildEIJs(externalPath, cdnPath)); _log.UpdateProgressWithCancellationCheck("HTML: building Combat Replay JS"); html = html.Replace("<!--${CombatReplayJS}-->", BuildCombatReplayJS(externalPath, cdnPath)); html = html.Replace("<!--${HealingExtensionJS}-->", BuildHealingExtensionJS(externalPath, cdnPath)); string json = ToJson(LogDataDto.BuildLogData(_log, _cr, _light, _parserVersion, _uploadLink)); html = html.Replace("'${logDataJson}'", _compressJson ? ("'" + CompressAndBase64(json) + "'") : json); // Compression stuff html = html.Replace("<!--${CompressionRequire}-->", _compressJson ? "<script src=\"https://cdnjs.cloudflare.com/ajax/libs/pako/1.0.10/pako.min.js\"></script>" : ""); html = html.Replace("<!--${CompressionUtils}-->", _compressJson ? Properties.Resources.compressionUtils : ""); sw.Write(html); return; }
/// <summary> /// Create the damage taken distribution table for a given player /// </summary> /// <param name="p"></param> /// <param name="phaseIndex"></param> public void CreateHTML(StreamWriter sw, string path) { string html = Properties.Resources.tmplMain; _log.UpdateProgressWithCancellationCheck("HTML: replacing global variables"); html = html.Replace("${bootstrapTheme}", !_light ? "slate" : "yeti"); _log.UpdateProgressWithCancellationCheck("HTML: building CSS"); html = html.Replace("<!--${Css}-->", BuildCss(path)); _log.UpdateProgressWithCancellationCheck("HTML: building JS"); html = html.Replace("<!--${Js}-->", BuildEIJs(path)); _log.UpdateProgressWithCancellationCheck("HTML: building Combat Replay JS"); html = html.Replace("<!--${CombatReplayJS}-->", BuildCombatReplayJS(path)); html = html.Replace("'${logDataJson}'", ToJson(LogDataDto.BuildLogData(_log, _usedSkills, _usedBuffs, _usedDamageMods, _cr, _light, _parserVersion, _uploadLink))); _log.UpdateProgressWithCancellationCheck("HTML: building Graph Data"); html = html.Replace("'${graphDataJson}'", ToJson(new ChartDataDto(_log))); sw.Write(html); return; }