From b9a0effc7a89cfb71c3bbca6a7a46668c768d70a Mon Sep 17 00:00:00 2001 From: Christian 'ketura' McCarty Date: Sun, 11 Dec 2022 22:18:43 -0600 Subject: [PATCH] Vastly reducing the threshold for chat autolock. Adding a cookie for storing the chat width, meaning that it won't need to be manually set to the same level on each refresh. --- .../gemp-lotr-async/src/main/web/js/gemp-022/chat.js | 2 +- .../gemp-lotr-async/src/main/web/js/gemp-022/hallUi.js | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/gemp-lotr/gemp-lotr-async/src/main/web/js/gemp-022/chat.js b/gemp-lotr/gemp-lotr-async/src/main/web/js/gemp-022/chat.js index 2a435de8f..3c6d40d3e 100644 --- a/gemp-lotr/gemp-lotr-async/src/main/web/js/gemp-022/chat.js +++ b/gemp-lotr/gemp-lotr-async/src/main/web/js/gemp-022/chat.js @@ -337,7 +337,7 @@ var ChatBoxUI = Class.extend({ var noScrollBars = maxScroll <= 0; var ratio = scroll / maxScroll; - if(msgClass === "warningMessage" || noScrollBars || maxScroll <= 30 || ratio >= 0.95) + if(msgClass === "warningMessage" || noScrollBars || maxScroll <= 30 || ratio >= 0.999) locked = true; if(this.pingRegex != null && this.pingRegex.test(message)) diff --git a/gemp-lotr/gemp-lotr-async/src/main/web/js/gemp-022/hallUi.js b/gemp-lotr/gemp-lotr-async/src/main/web/js/gemp-022/hallUi.js index 1fbeb4a84..3333efa79 100644 --- a/gemp-lotr/gemp-lotr-async/src/main/web/js/gemp-022/hallUi.js +++ b/gemp-lotr/gemp-lotr-async/src/main/web/js/gemp-022/hallUi.js @@ -29,6 +29,16 @@ var GempLotrHallUI = Class.extend({ distance: 20 }); + var storedChatSize = $.cookie("chatResize"); + if (storedChatSize == null) + storedChatSize = 300; + + $("#chat").height(storedChatSize); + + $("#chat").resize(function() { + $.cookie("chatResize", $("#chat").height(), { expires:365 }); + }); + this.comm = new GempLotrCommunication(url, function (xhr, ajaxOptions, thrownError) { if (thrownError != "abort") { if (xhr != null) {