From f5d164302b6f2a2adf6f0fd10db12ca849df3a6f Mon Sep 17 00:00:00 2001 From: Wolfsblvt Date: Sat, 7 Sep 2024 23:55:34 +0200 Subject: [PATCH] Remove double flags for bookmarks - Remove the double flag if a checkpoint exists - Add the "replace checkpoint" functionality as a Shift+Click option to the checkpoint flag --- public/index.html | 2 +- public/script.js | 9 ++++++++- public/style.css | 4 ++++ 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/public/index.html b/public/index.html index c949839d8..3dd371e18 100644 --- a/public/index.html +++ b/public/index.html @@ -5777,7 +5777,7 @@
-
+
diff --git a/public/script.js b/public/script.js index 22aa140f3..5ea615aa2 100644 --- a/public/script.js +++ b/public/script.js @@ -10563,7 +10563,14 @@ jQuery(async function () { await duplicateCharacter(); }); - $(document).on('click', '.select_chat_block, .bookmark_link, .mes_bookmark', async function () { + $(document).on('click', '.select_chat_block, .bookmark_link, .mes_bookmark', async function (e) { + // If shift is held down, we are not following the bookmark, but creating a new one + if (e.shiftKey) { + var selectedMesId = $(this).closest('.mes').attr('mesid'); + createNewBookmark(selectedMesId); + return; + } + let file_name = $(this).hasClass('mes_bookmark') ? $(this).closest('.mes').attr('bookmark_link') : $(this).attr('file_name').replace('.jsonl', ''); diff --git a/public/style.css b/public/style.css index 91726dd63..a410df236 100644 --- a/public/style.css +++ b/public/style.css @@ -3963,6 +3963,10 @@ input[type="range"]::-webkit-slider-thumb { display: inline-block; } +.mes:not([bookmark_link='']) .mes_create_bookmark { + display: none; +} + .mes_edit_buttons { display: none; flex-direction: row;