diff options
author | Jesse Plamondon-Willard <github@jplamondonw.com> | 2017-10-29 15:28:07 -0400 |
---|---|---|
committer | Jesse Plamondon-Willard <github@jplamondonw.com> | 2017-10-29 15:28:07 -0400 |
commit | 7ed1fbf0aac5a3b777e3ed5b8f104bd27ce4bf0c (patch) | |
tree | 333eb368e137ef79dba97535e5483466e98d89e7 /src/SMAPI.Web/wwwroot | |
parent | 7abd8426b71606ce94eb6ba6f3eafc01b9b7f4d2 (diff) | |
download | SMAPI-7ed1fbf0aac5a3b777e3ed5b8f104bd27ce4bf0c.tar.gz SMAPI-7ed1fbf0aac5a3b777e3ed5b8f104bd27ce4bf0c.tar.bz2 SMAPI-7ed1fbf0aac5a3b777e3ed5b8f104bd27ce4bf0c.zip |
defer log compression to backend and significantly improve compression (#358)
Diffstat (limited to 'src/SMAPI.Web/wwwroot')
-rw-r--r-- | src/SMAPI.Web/wwwroot/Content/js/log-parser.js | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/src/SMAPI.Web/wwwroot/Content/js/log-parser.js b/src/SMAPI.Web/wwwroot/Content/js/log-parser.js index 498fb335..8e30ae12 100644 --- a/src/SMAPI.Web/wwwroot/Content/js/log-parser.js +++ b/src/SMAPI.Web/wwwroot/Content/js/log-parser.js @@ -1,4 +1,4 @@ -/* globals $, LZString */ +/* globals $ */ var smapi = smapi || {}; smapi.logParser = function(sectionUrl, pasteID) { @@ -63,14 +63,9 @@ smapi.logParser = function(sectionUrl, pasteID) { $("#submit").on("click", function() { $("#popup-upload").fadeOut(); - var raw = $("#input").val(); - if (raw) { + var paste = $("#input").val(); + if (paste) { memory = ""; - var paste = LZString.compressToUTF16(raw); - if (paste.length * 2 > 524288) { - $("#output").html('<div id="log" class="color-red"><h1>Unable to save!</h1>This log cannot be saved due to its size.<hr />' + $("#input").val() + "</div>"); - return; - } $("#uploader").attr("data-text", "Saving..."); $("#uploader").fadeIn(); $ @@ -271,7 +266,7 @@ smapi.logParser = function(sectionUrl, pasteID) { $("#uploader").fadeIn(); $.get(sectionUrl + "/fetch/" + pasteID, function(data) { if (data.success) { - $("#input").val(LZString.decompressFromUTF16(data.content) || data.content); + $("#input").val(data.content); loadData(); } else { $("#output").html('<div id="log" class="color-red"><h1>Fetching the log failed!</h1><p>' + data.error + '</p><pre id="rawlog"></pre></div>'); |