From fc04ff3a08956adde55e2668c555d8c2bc6da747 Mon Sep 17 00:00:00 2001 From: Gnome Ann <> Date: Wed, 22 Dec 2021 13:12:35 -0500 Subject: [PATCH] World info folders can now be collapsed by clicking on the folder icon --- aiserver.py | 6 ++++++ static/application.js | 40 +++++++++++++++++++++++++++++++++++----- static/custom.css | 24 +++++++++++++++++++++++- templates/index.html | 4 ++-- 4 files changed, 66 insertions(+), 8 deletions(-) diff --git a/aiserver.py b/aiserver.py index f971cab3..bc9f67d4 100644 --- a/aiserver.py +++ b/aiserver.py @@ -1710,6 +1710,12 @@ def get_message(msg): elif(msg['cmd'] == 'wiexpandfolder'): assert 0 <= int(msg['data']) < len(vars.worldinfo) emit('from_server', {'cmd': 'wiexpandfolder', 'data': msg['data']}, broadcast=True) + elif(msg['cmd'] == 'wifoldercollapsecontent'): + vars.wifolders_d[msg['data']]['collapsed'] = True + emit('from_server', {'cmd': 'wifoldercollapsecontent', 'data': msg['data']}, broadcast=True) + elif(msg['cmd'] == 'wifolderexpandcontent'): + vars.wifolders_d[msg['data']]['collapsed'] = False + emit('from_server', {'cmd': 'wifolderexpandcontent', 'data': msg['data']}, broadcast=True) elif(msg['cmd'] == 'wiupdate'): num = int(msg['num']) fields = ("key", "keysecondary", "content", "comment") diff --git a/static/application.js b/static/application.js index ad747d48..5746f05e 100644 --- a/static/application.js +++ b/static/application.js @@ -419,7 +419,7 @@ function addWiLine(ob) { function addWiFolder(uid, ob) { if(uid !== null) { var uninitialized = $("#wilistfoldercontainer"+null); - var html = "