summaryrefslogtreecommitdiff
path: root/src/SMAPI.Web/Views
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <github@jplamondonw.com>2018-02-25 01:54:57 -0500
committerJesse Plamondon-Willard <github@jplamondonw.com>2018-02-25 01:54:57 -0500
commit833d98f49136325edfc4463097710cf2391dd5b2 (patch)
tree2dfc969c6e27e78b05deb1e59201ded5392b7dc7 /src/SMAPI.Web/Views
parent6fc1bf47136a620b3d270af6307426080b7d1ab2 (diff)
parent51118337e5e8cbb6803ffee4e7c0b411aba2b3e0 (diff)
downloadSMAPI-833d98f49136325edfc4463097710cf2391dd5b2.tar.gz
SMAPI-833d98f49136325edfc4463097710cf2391dd5b2.tar.bz2
SMAPI-833d98f49136325edfc4463097710cf2391dd5b2.zip
Merge branch 'develop' into stable
Diffstat (limited to 'src/SMAPI.Web/Views')
-rw-r--r--src/SMAPI.Web/Views/LogParser/Index.cshtml15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/SMAPI.Web/Views/LogParser/Index.cshtml b/src/SMAPI.Web/Views/LogParser/Index.cshtml
index 20e20ee1..be9f74a0 100644
--- a/src/SMAPI.Web/Views/LogParser/Index.cshtml
+++ b/src/SMAPI.Web/Views/LogParser/Index.cshtml
@@ -1,11 +1,18 @@
@{
ViewData["Title"] = "SMAPI log parser";
- Dictionary<string, LogModInfo[]> contentPacks = Model.ParsedLog?.Mods
+ IDictionary<string, LogModInfo[]> contentPacks = Model.ParsedLog?.Mods
?.GroupBy(mod => mod.ContentPackFor)
.Where(group => group.Key != null)
.ToDictionary(group => group.Key, group => group.ToArray());
+
+ Regex slugInvalidCharPattern = new Regex("[^a-z0-9]", RegexOptions.Compiled | RegexOptions.IgnoreCase);
+ string GetSlug(string modName)
+ {
+ return slugInvalidCharPattern.Replace(modName, "");
+ }
}
+@using System.Text.RegularExpressions
@using Newtonsoft.Json
@using StardewModdingAPI.Web.Framework.LogParsing.Models
@model StardewModdingAPI.Web.ViewModels.LogParserModel
@@ -19,7 +26,7 @@
smapi.logParser({
logStarted: new Date(@Json.Serialize(Model.ParsedLog?.Timestamp)),
showPopup: @Json.Serialize(Model.ParsedLog == null),
- showMods: @Json.Serialize(Model.ParsedLog?.Mods?.ToDictionary(p => p.Name, p => true), new JsonSerializerSettings { Formatting = Formatting.None }),
+ showMods: @Json.Serialize(Model.ParsedLog?.Mods?.ToDictionary(p => GetSlug(p.Name), p => true), new JsonSerializerSettings { Formatting = Formatting.None }),
showLevels: {
trace: false,
debug: false,
@@ -76,8 +83,8 @@
</caption>
@foreach (var mod in Model.ParsedLog.Mods.Where(p => p.ContentPackFor == null))
{
- <tr v-on:click="toggleMod('@mod.Name')" class="mod-entry" v-bind:class="{ hidden: !showMods['@mod.Name'] }">
- <td><input type="checkbox" v-bind:checked="showMods['@mod.Name']" v-if="anyModsHidden" /></td>
+ <tr v-on:click="toggleMod('@GetSlug(mod.Name)')" class="mod-entry" v-bind:class="{ hidden: !showMods['@GetSlug(mod.Name)'] }">
+ <td><input type="checkbox" v-bind:checked="showMods['@GetSlug(mod.Name)']" v-if="anyModsHidden" /></td>
<td>
@mod.Name
@if (contentPacks != null && contentPacks.TryGetValue(mod.Name, out LogModInfo[] contentPackList))