From 2316ab9719a37100be28e3126f36b1cc01751cb4 Mon Sep 17 00:00:00 2001 From: Sebastian Schmittner Date: Mon, 16 Dec 2024 20:05:53 +0100 Subject: [PATCH] added display story json modal to emergenzy get the JSON if the save buttons dont work --- editor/code.js | 10 ++++++++++ editor/index.html | 25 +++++++++++++++++++++++-- editor/style.css | 15 ++++++++++++++- 3 files changed, 47 insertions(+), 3 deletions(-) diff --git a/editor/code.js b/editor/code.js index e41ac9a..148973f 100644 --- a/editor/code.js +++ b/editor/code.js @@ -1022,6 +1022,16 @@ document document.addEventListener("keydown", handle_global_key_down); +document + .getElementById("story_modal") + .addEventListener("shown.bs.modal", () => { + document.getElementById("story_code").innerHTML = JSON.stringify( + story, + null, + 2 + ); + }); + async function load_last_story_or_example() { try { const storyJson = localStorage.getItem(current_editor_story_key); diff --git a/editor/index.html b/editor/index.html index cf4967e..29aea10 100644 --- a/editor/index.html +++ b/editor/index.html @@ -13,6 +13,23 @@ + + +