From 3e1b54c6f08aa3fbf78626cb2a25bccb3946fe19 Mon Sep 17 00:00:00 2001 From: Cohee <18619528+Cohee1207@users.noreply.github.com> Date: Wed, 26 Jun 2024 00:26:31 +0300 Subject: [PATCH] Update token counter to new popup --- public/scripts/extensions/token-counter/index.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/public/scripts/extensions/token-counter/index.js b/public/scripts/extensions/token-counter/index.js index 7b2bd36a8..54df1bb66 100644 --- a/public/scripts/extensions/token-counter/index.js +++ b/public/scripts/extensions/token-counter/index.js @@ -1,10 +1,11 @@ -import { callPopup, main_api } from '../../../script.js'; +import { main_api } from '../../../script.js'; import { getContext } from '../../extensions.js'; import { SlashCommand } from '../../slash-commands/SlashCommand.js'; import { SlashCommandParser } from '../../slash-commands/SlashCommandParser.js'; import { getFriendlyTokenizerName, getTextTokens, getTokenCountAsync, tokenizers } from '../../tokenizers.js'; import { resetScrollHeight, debounce } from '../../utils.js'; import { debounce_timeout } from '../../constants.js'; +import { POPUP_TYPE, callGenericPopup } from '../../popup.js'; function rgb2hex(rgb) { rgb = rgb.match(/^rgba?[\s+]?\([\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?/i); @@ -63,8 +64,7 @@ async function doTokenCounter() { }, debounce_timeout.relaxed); dialog.find('#token_counter_textarea').on('input', () => countDebounced()); - $('#dialogue_popup').addClass('wide_dialogue_popup'); - callPopup(dialog, 'text', '', { wide: true, large: true }); + callGenericPopup(dialog, POPUP_TYPE.TEXT, '', { wide: true, large: true }); } /**