summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docs/release-notes.md1
-rw-r--r--src/SMAPI.Web/Views/JsonValidator/Index.cshtml6
-rw-r--r--src/SMAPI.Web/wwwroot/Content/js/json-validator.js8
3 files changed, 8 insertions, 7 deletions
diff --git a/docs/release-notes.md b/docs/release-notes.md
index 0b0a0f9e..dec552d6 100644
--- a/docs/release-notes.md
+++ b/docs/release-notes.md
@@ -6,6 +6,7 @@
* For the web UI:
* If a JSON validator upload can't be saved to Pastebin (e.g. due to rate limits), it's now uploaded to Amazon S3 instead. Files uploaded to S3 expire after one month.
* Updated the JSON validator for Content Patcher 1.10.0.
+ * Fixed JSON validator no longer letting you change format when viewing results.
## 3.0.1
Released 02 December 2019 for Stardew Valley 1.4.0.1.
diff --git a/src/SMAPI.Web/Views/JsonValidator/Index.cshtml b/src/SMAPI.Web/Views/JsonValidator/Index.cshtml
index a5a134ac..a042f024 100644
--- a/src/SMAPI.Web/Views/JsonValidator/Index.cshtml
+++ b/src/SMAPI.Web/Views/JsonValidator/Index.cshtml
@@ -27,17 +27,17 @@
{
<meta name="robots" content="noindex" />
}
- <link rel="stylesheet" href="~/Content/css/json-validator.css?r=20191203" />
+ <link rel="stylesheet" href="~/Content/css/json-validator.css?r=20191204" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/tmont/sunlight@1.22.0/src/themes/sunlight.default.min.css" />
<script src="https://cdn.jsdelivr.net/npm/jquery@3.3.1/dist/jquery.min.js" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/gh/tmont/sunlight@1.22.0/src/sunlight.min.js" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/gh/tmont/sunlight@1.22.0/src/plugins/sunlight-plugin.linenumbers.min.js" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/gh/tmont/sunlight@1.22.0/src/lang/sunlight.javascript.min.js" crossorigin="anonymous"></script>
- <script src="~/Content/js/json-validator.js"></script>
+ <script src="~/Content/js/json-validator.js?r=20191204"></script>
<script>
$(function() {
- smapi.jsonValidator(@Json.Serialize(this.Url.PlainAction("Index", "JsonValidator", values: null)), @Json.Serialize(Model.PasteID));
+ smapi.jsonValidator(@Json.Serialize(this.Url.PlainAction("Index", "JsonValidator", new { schemaName = "$schemaName", id = "$id" })), @Json.Serialize(Model.PasteID));
});
</script>
}
diff --git a/src/SMAPI.Web/wwwroot/Content/js/json-validator.js b/src/SMAPI.Web/wwwroot/Content/js/json-validator.js
index 76b5f6d4..401efbee 100644
--- a/src/SMAPI.Web/wwwroot/Content/js/json-validator.js
+++ b/src/SMAPI.Web/wwwroot/Content/js/json-validator.js
@@ -70,10 +70,10 @@ smapi.LineNumberRange = function (maxLines) {
/**
* UI logic for the JSON validator page.
- * @param {any} sectionUrl The base JSON validator page URL.
- * @param {any} pasteID The Pastebin paste ID for the content being viewed, if any.
+ * @param {string} urlFormat The URL format for a file, with $schemaName and $id placeholders.
+ * @param {string} pasteID The Pastebin paste ID for the content being viewed, if any.
*/
-smapi.jsonValidator = function (sectionUrl, pasteID) {
+smapi.jsonValidator = function (urlFormat, pasteID) {
/**
* The original content element.
*/
@@ -138,7 +138,7 @@ smapi.jsonValidator = function (sectionUrl, pasteID) {
// change format
$("#output #format").on("change", function() {
var schemaName = $(this).val();
- location.href = new URL(schemaName + "/" + pasteID, sectionUrl).toString();
+ location.href = urlFormat.replace("$schemaName", schemaName).replace("$id", pasteID);
});
// upload form