From 1323ac1d13b3d811481f4be23d878ef67dd5264a Mon Sep 17 00:00:00 2001 From: Cohee <18619528+Cohee1207@users.noreply.github.com> Date: Sat, 29 Mar 2025 16:05:31 +0200 Subject: [PATCH] Remove prompt manager export popup Fixes #3782 --- public/scripts/PromptManager.js | 32 ++----------------- .../promptManagerExportForCharacter.html | 4 --- .../templates/promptManagerExportPopup.html | 12 ------- 3 files changed, 2 insertions(+), 46 deletions(-) delete mode 100644 public/scripts/templates/promptManagerExportForCharacter.html delete mode 100644 public/scripts/templates/promptManagerExportPopup.html diff --git a/public/scripts/PromptManager.js b/public/scripts/PromptManager.js index 6e515baa1..94d642afa 100644 --- a/public/scripts/PromptManager.js +++ b/public/scripts/PromptManager.js @@ -1,6 +1,6 @@ 'use strict'; -import { DOMPurify, Popper } from '../lib.js'; +import { DOMPurify } from '../lib.js'; import { event_types, eventSource, is_send_press, main_api, substituteParams } from '../script.js'; import { is_group_generating } from './group-chats.js'; @@ -1440,36 +1440,8 @@ class PromptManager { footerDiv.querySelector('select').selectedIndex = selectedPromptIndex; // Add prompt export dialogue and options - - const exportForCharacter = await renderTemplateAsync('promptManagerExportForCharacter'); - const exportPopup = await renderTemplateAsync('promptManagerExportPopup', { isGlobalStrategy: 'global' === this.configuration.promptOrder.strategy, exportForCharacter }); - rangeBlockDiv.insertAdjacentHTML('beforeend', exportPopup); - - // Destroy previous popper instance if it exists - if (this.exportPopper) { - this.exportPopper.destroy(); - } - - this.exportPopper = Popper.createPopper( - document.getElementById('prompt-manager-export'), - document.getElementById('prompt-manager-export-format-popup'), - { placement: 'bottom' }, - ); - - const showExportSelection = () => { - const popup = document.getElementById('prompt-manager-export-format-popup'); - const show = popup.hasAttribute('data-show'); - - if (show) popup.removeAttribute('data-show'); - else popup.setAttribute('data-show', ''); - - this.exportPopper.update(); - }; - footerDiv.querySelector('#prompt-manager-import').addEventListener('click', this.handleImport); - footerDiv.querySelector('#prompt-manager-export').addEventListener('click', showExportSelection); - rangeBlockDiv.querySelector('.export-promptmanager-prompts-full').addEventListener('click', this.handleFullExport); - rangeBlockDiv.querySelector('.export-promptmanager-prompts-character')?.addEventListener('click', this.handleCharacterExport); + footerDiv.querySelector('#prompt-manager-export').addEventListener('click', this.handleFullExport); } } diff --git a/public/scripts/templates/promptManagerExportForCharacter.html b/public/scripts/templates/promptManagerExportForCharacter.html deleted file mode 100644 index 2127f7dfb..000000000 --- a/public/scripts/templates/promptManagerExportForCharacter.html +++ /dev/null @@ -1,4 +0,0 @@ -