From ff7816aac01e163988ee6866d6cda7b8a101da6f Mon Sep 17 00:00:00 2001 From: Jack Date: Fri, 5 Apr 2024 13:18:26 +0200 Subject: [PATCH] refactor: custom text modal rework (#5278) * start work on saved texts popup * passing options through, async fill to not block animation * handle apply * custom text modal start * full save custom text modal refactor * remove import * full finish on saved texts modal * fill when chain re-shows it * fix issues where opening chains within chains would show two modals * extract type * add support for passing data between modals * dont leave the popup if no words were found * use modalchaindata instead of setting popup state directly * handling set and append modes in chain data * move tab insertion code into the custom text modal file * use chain data instead of state module * move event handlers to a different file / to the setup function * move file * rename file * rename id * remove unused line * add generics to incoming and outgoing modal chain data * rework the way custom text textarea is handled * update long custom text warning * remove variable * remember to update the state --- frontend/src/html/popups.html | 35 +- frontend/src/styles/popups.scss | 72 +-- frontend/src/styles/z_media-queries.scss | 10 +- frontend/src/ts/commandline/lists.ts | 2 +- .../ts/controllers/challenge-controller.ts | 2 - .../src/ts/controllers/input-controller.ts | 21 - frontend/src/ts/event-handlers/test.ts | 5 + frontend/src/ts/modals/custom-text.ts | 453 ++++++++++++++++++ frontend/src/ts/modals/mobile-test-config.ts | 2 +- frontend/src/ts/modals/save-custom-text.ts | 121 +++++ frontend/src/ts/modals/saved-texts.ts | 133 +++++ frontend/src/ts/modals/simple-modals.ts | 39 +- frontend/src/ts/modals/word-filter.ts | 28 +- frontend/src/ts/popups/custom-text-popup.ts | 418 ---------------- .../src/ts/popups/save-custom-text-popup.ts | 138 ------ frontend/src/ts/popups/saved-texts-popup.ts | 144 ------ frontend/src/ts/test/custom-text.ts | 13 - frontend/src/ts/test/practise-words.ts | 4 - frontend/src/ts/test/test-logic.ts | 8 - frontend/src/ts/utils/animated-modal.ts | 59 ++- frontend/src/ts/utils/url-handler.ts | 4 - 21 files changed, 826 insertions(+), 885 deletions(-) create mode 100644 frontend/src/ts/modals/custom-text.ts create mode 100644 frontend/src/ts/modals/save-custom-text.ts create mode 100644 frontend/src/ts/modals/saved-texts.ts delete mode 100644 frontend/src/ts/popups/custom-text-popup.ts delete mode 100644 frontend/src/ts/popups/save-custom-text-popup.ts delete mode 100644 frontend/src/ts/popups/saved-texts-popup.ts diff --git a/frontend/src/html/popups.html b/frontend/src/html/popups.html index f40aa218af33..6c2e4910d1c7 100644 --- a/frontend/src/html/popups.html +++ b/frontend/src/html/popups.html @@ -367,8 +367,8 @@
ok
- + + +