Update token counter to new popup
This commit is contained in:
parent
c3461307a0
commit
3e1b54c6f0
|
@ -1,10 +1,11 @@
|
||||||
import { callPopup, main_api } from '../../../script.js';
|
import { main_api } from '../../../script.js';
|
||||||
import { getContext } from '../../extensions.js';
|
import { getContext } from '../../extensions.js';
|
||||||
import { SlashCommand } from '../../slash-commands/SlashCommand.js';
|
import { SlashCommand } from '../../slash-commands/SlashCommand.js';
|
||||||
import { SlashCommandParser } from '../../slash-commands/SlashCommandParser.js';
|
import { SlashCommandParser } from '../../slash-commands/SlashCommandParser.js';
|
||||||
import { getFriendlyTokenizerName, getTextTokens, getTokenCountAsync, tokenizers } from '../../tokenizers.js';
|
import { getFriendlyTokenizerName, getTextTokens, getTokenCountAsync, tokenizers } from '../../tokenizers.js';
|
||||||
import { resetScrollHeight, debounce } from '../../utils.js';
|
import { resetScrollHeight, debounce } from '../../utils.js';
|
||||||
import { debounce_timeout } from '../../constants.js';
|
import { debounce_timeout } from '../../constants.js';
|
||||||
|
import { POPUP_TYPE, callGenericPopup } from '../../popup.js';
|
||||||
|
|
||||||
function rgb2hex(rgb) {
|
function rgb2hex(rgb) {
|
||||||
rgb = rgb.match(/^rgba?[\s+]?\([\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?/i);
|
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);
|
}, debounce_timeout.relaxed);
|
||||||
dialog.find('#token_counter_textarea').on('input', () => countDebounced());
|
dialog.find('#token_counter_textarea').on('input', () => countDebounced());
|
||||||
|
|
||||||
$('#dialogue_popup').addClass('wide_dialogue_popup');
|
callGenericPopup(dialog, POPUP_TYPE.TEXT, '', { wide: true, large: true });
|
||||||
callPopup(dialog, 'text', '', { wide: true, large: true });
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue