Update debug menu, theme and MUI naming popups

This commit is contained in:
Cohee
2024-06-26 00:24:21 +03:00
parent 1188cb46b8
commit c3461307a0
2 changed files with 32 additions and 29 deletions

View File

@ -2,7 +2,6 @@ import {
saveSettingsDebounced, saveSettingsDebounced,
scrollChatToBottom, scrollChatToBottom,
characters, characters,
callPopup,
reloadMarkdownProcessor, reloadMarkdownProcessor,
reloadCurrentChat, reloadCurrentChat,
getRequestHeaders, getRequestHeaders,
@ -1433,7 +1432,7 @@ export function registerDebugFunction(functionId, name, description, func) {
async function showDebugMenu() { async function showDebugMenu() {
const template = await renderTemplateAsync('debug', { functions: debug_functions }); const template = await renderTemplateAsync('debug', { functions: debug_functions });
callPopup(template, 'text', '', { wide: true, large: true }); callGenericPopup(template, POPUP_TYPE.TEXT, '', { wide: true, large: true });
} }
switchUiMode(); switchUiMode();
@ -2297,11 +2296,13 @@ async function importTheme(file) {
*/ */
async function saveTheme(name = undefined, theme = undefined) { async function saveTheme(name = undefined, theme = undefined) {
if (typeof name !== 'string') { if (typeof name !== 'string') {
name = await callPopup('Enter a theme preset name:', 'input', power_user.theme); const newName = await callGenericPopup('Enter a theme preset name:', POPUP_TYPE.INPUT, power_user.theme);
if (!name) { if (!newName) {
return; return;
} }
name = String(newName);
} }
if (typeof theme !== 'object') { if (typeof theme !== 'object') {
@ -2399,7 +2400,7 @@ function getNewTheme(parsed) {
} }
async function saveMovingUI() { async function saveMovingUI() {
const name = await callPopup('Enter a name for the MovingUI Preset:', 'input'); const name = await callGenericPopup('Enter a name for the MovingUI Preset:', POPUP_TYPE.INPUT);
if (!name) { if (!name) {
return; return;

View File

@ -1,8 +1,9 @@
<h3 data-i18n="Debug Menu">Debug Menu</h3> <div class="scrollY height100p paddingLeftRight5">
<div data-i18n="Debug Warning"> <h3 data-i18n="Debug Menu">Debug Menu</h3>
<div data-i18n="Debug Warning">
Functions in this category are for advanced users only. Don't click anything if you're not sure about the consequences. Functions in this category are for advanced users only. Don't click anything if you're not sure about the consequences.
</div> </div>
<table id="debug_table" class="responsiveTable"> <table id="debug_table" class="responsiveTable">
{{#each functions}} {{#each functions}}
{{#with this}} {{#with this}}
<tr> <tr>
@ -22,4 +23,5 @@
</tr> </tr>
{{/with}} {{/with}}
{{/each}} {{/each}}
</table> </table>
</div>