geotag: warning fix
This commit is contained in:
parent
d39869f6e1
commit
2e43b67ba1
@ -119,7 +119,7 @@
|
||||
// ---------- geo/date tag suggestions ----------
|
||||
// staged client-side until the main save; each item matches
|
||||
// GanjoorPoemGeoDateTagCorrection's shape so it can be sent as-is
|
||||
var geoDateTagSuggestions = @Html.Raw(Model.MyLastEdit != null && Model.MyLastEdit.GeoDateTags != null ? Newtonsoft.Json.JsonConvert.SerializeObject(Model.MyLastEdit.GeoDateTags, new Newtonsoft.Json.JsonSerializerSettings { ContractResolver = new Newtonsoft.Json.Serialization.CamelCasePropertyNamesContractResolver() }) : "[]");
|
||||
var geoDateTagSuggestions = @Html.Raw(Model.MyLastEditGeoDateTagsJson);
|
||||
var geoDateTagCoupletTexts = @Html.Raw(Newtonsoft.Json.JsonConvert.SerializeObject(Model.Couplets.ToDictionary(c => c.Item1.ToString(), c => c.Item2)));
|
||||
$(document).ready(function () {
|
||||
renderPendingGeoDateTags();
|
||||
|
||||
@ -22,6 +22,18 @@ namespace GanjooRazor.Areas.User.Pages
|
||||
/// </summary>
|
||||
public GanjoorPoemCorrectionViewModel MyLastEdit { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// camelCase JSON of MyLastEdit.GeoDateTags, pre-serialized here (rather than inline in the .cshtml
|
||||
/// script block) so the Razor page doesn't embed a C# object-initializer (with its own braces) inside
|
||||
/// a JS statement - that combination was tripping the editor's JS/TS syntax check (TS1109) even though
|
||||
/// it compiled and ran fine.
|
||||
/// </summary>
|
||||
public string MyLastEditGeoDateTagsJson =>
|
||||
JsonConvert.SerializeObject(
|
||||
MyLastEdit?.GeoDateTags ?? Array.Empty<GanjoorPoemGeoDateTagCorrection>(),
|
||||
new JsonSerializerSettings { ContractResolver = new Newtonsoft.Json.Serialization.CamelCasePropertyNamesContractResolver() }
|
||||
);
|
||||
|
||||
/// <summary>
|
||||
/// page
|
||||
/// </summary>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user