From 2336b75d925a94ff121073f6287bcdbba81f0e7b Mon Sep 17 00:00:00 2001 From: missionfloyd Date: Thu, 3 Aug 2023 22:58:37 -0600 Subject: [PATCH] Remove unnecessary chat.js (#3445) --- css/chat.css | 7 ++++++- css/chat.js | 4 ---- modules/ui.py | 2 -- server.py | 2 +- 4 files changed, 7 insertions(+), 8 deletions(-) delete mode 100644 css/chat.js diff --git a/css/chat.css b/css/chat.css index ad76f5cc..67bbe512 100644 --- a/css/chat.css +++ b/css/chat.css @@ -26,7 +26,6 @@ div.svelte-362y77>*, div.svelte-362y77>.form>* { #extensions { padding: 0; - padding: 0; } #gradio-chatbot { @@ -46,6 +45,12 @@ div.svelte-362y77>*, div.svelte-362y77>.form>* { min-width: 0 !important; } +#main > :first-child, #extensions { + max-width: 800px; + margin-left: auto; + margin-right: auto; +} + @media screen and (max-width: 688px) { #main { padding: 0px; diff --git a/css/chat.js b/css/chat.js deleted file mode 100644 index e304f125..00000000 --- a/css/chat.js +++ /dev/null @@ -1,4 +0,0 @@ -document.getElementById("main").childNodes[0].style = "max-width: 800px; margin-left: auto; margin-right: auto"; -document.getElementById("extensions").style.setProperty("max-width", "800px"); -document.getElementById("extensions").style.setProperty("margin-left", "auto"); -document.getElementById("extensions").style.setProperty("margin-right", "auto"); diff --git a/modules/ui.py b/modules/ui.py index df36a331..eed2ef66 100644 --- a/modules/ui.py +++ b/modules/ui.py @@ -13,8 +13,6 @@ with open(Path(__file__).resolve().parent / '../css/chat.css', 'r') as f: chat_css = f.read() with open(Path(__file__).resolve().parent / '../css/main.js', 'r') as f: main_js = f.read() -with open(Path(__file__).resolve().parent / '../css/chat.js', 'r') as f: - chat_js = f.read() with open(Path(__file__).resolve().parent / '../css/save_files.js', 'r') as f: save_files_js = f.read() diff --git a/server.py b/server.py index 10ea4ece..d1a23bbe 100644 --- a/server.py +++ b/server.py @@ -597,7 +597,7 @@ def create_interface(): # css/js strings css = ui.css if not shared.is_chat() else ui.css + ui.chat_css - js = ui.main_js if not shared.is_chat() else ui.main_js + ui.chat_js + js = ui.main_js css += apply_extensions('css') js += apply_extensions('js')