Mobile prompt itemization - duh

- Make it into a popup. There is no space
This commit is contained in:
Wolfsblvt
2025-02-10 15:07:57 +01:00
parent 32ec475ca2
commit aee8441fc4
6 changed files with 24 additions and 5 deletions

View File

@ -5577,7 +5577,7 @@ async function promptItemize(itemizedPrompts, requestedMesId) {
toastr.info(t`Copied!`);
});
popup.dlg.querySelector('#showRawPrompt').addEventListener('click', function () {
popup.dlg.querySelector('#showRawPrompt').addEventListener('click', async function () {
//console.log(itemizedPrompts[PromptArrayItemForRawPromptDisplay].rawPrompt);
console.log(PromptArrayItemForRawPromptDisplay);
console.log(itemizedPrompts);
@ -5585,6 +5585,17 @@ async function promptItemize(itemizedPrompts, requestedMesId) {
const rawPrompt = flatten(itemizedPrompts[PromptArrayItemForRawPromptDisplay].rawPrompt);
// Mobile needs special handholding. The side-view on the popup wouldn't work,
// so we just show an additional popup for this.
if (isMobile()) {
const content = document.createElement('div');
content.classList.add('tokenItemizingMaintext');
content.innerText = rawPrompt;
const popup = new Popup(content, POPUP_TYPE.TEXT, null, { allowVerticalScrolling: true, leftAlign: true });
await popup.show();
return;
}
//let DisplayStringifiedPrompt = JSON.stringify(itemizedPrompts[PromptArrayItemForRawPromptDisplay].rawPrompt).replace(/\n+/g, '<br>');
const rawPromptWrapper = document.getElementById('rawPromptWrapper');
rawPromptWrapper.innerText = rawPrompt;