mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
raw Prompt visible from Itemizer view
This commit is contained in:
@@ -2509,6 +2509,9 @@
|
||||
<div id="avatar_zoom_popupheader" class="fa-solid fa-grip drag-grabber"></div>
|
||||
<img id="zoomed_avatar" src="">
|
||||
</div>
|
||||
<div id="rawPromptPopup" class="list-group">
|
||||
<div id="rawPromptWrapper" class="tokenItemizingSubclass"></div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
@@ -246,6 +246,9 @@ let optionsPopper = Popper.createPopper(document.getElementById('send_form'), do
|
||||
let exportPopper = Popper.createPopper(document.getElementById('export_button'), document.getElementById('export_format_popup'), {
|
||||
placement: 'left'
|
||||
});
|
||||
let rawPromptPopper = Popper.createPopper(document.getElementById('dialogue_popup'), document.getElementById('rawPromptPopup'), {
|
||||
placement: 'right'
|
||||
});
|
||||
|
||||
let dialogueResolve = null;
|
||||
let chat_metadata = {};
|
||||
@@ -2232,6 +2235,7 @@ async function Generate(type, { automatic_trigger, force_name2, resolve, reject,
|
||||
}
|
||||
|
||||
if (power_user.console_log_prompts) {
|
||||
|
||||
console.log(generate_data.prompt);
|
||||
}
|
||||
|
||||
@@ -2280,6 +2284,7 @@ async function Generate(type, { automatic_trigger, force_name2, resolve, reject,
|
||||
let currentArrayEntry = Number(thisPromptBits.length - 1);
|
||||
let additionalPromptStuff = {
|
||||
...thisPromptBits[currentArrayEntry],
|
||||
rawPrompt: generate_data.prompt,
|
||||
mesId: Number(count_view_mes),
|
||||
worldInfoBefore: worldInfoBefore,
|
||||
allAnchors: allAnchors,
|
||||
@@ -2580,6 +2585,7 @@ function promptItemize(itemizedPrompts, requestedMesId) {
|
||||
Only the white numbers really matter. All numbers are estimates.
|
||||
Grey color items may not have been included in the context due to certain prompt format settings.
|
||||
</span>
|
||||
<div id="showRawPrompt" class="fa-solid fa-square-poll-horizontal menu_button"></div>
|
||||
<hr class="sysHR">
|
||||
<div class="justifyLeft">
|
||||
<div class="flex-container">
|
||||
@@ -2693,6 +2699,7 @@ function promptItemize(itemizedPrompts, requestedMesId) {
|
||||
Only the white numbers really matter. All numbers are estimates.
|
||||
Grey color items may not have been included in the context due to certain prompt format settings.
|
||||
</span>
|
||||
<div id="showRawPrompt" class="fa-solid fa-square-poll-horizontal menu_button"></div>
|
||||
<hr class="sysHR">
|
||||
<div class="justifyLeft">
|
||||
<div class="flex-container">
|
||||
@@ -5763,6 +5770,18 @@ $(document).ready(function () {
|
||||
}
|
||||
})
|
||||
|
||||
$(document).on("pointerup", "#showRawPrompt", function () {
|
||||
//let mesIdForItemization = $(this).closest('.mes').attr('mesId');
|
||||
//console.log(generate_data.prompt);
|
||||
console.log(itemizedPrompts[0].rawPrompt);
|
||||
$("#rawPromptWrapper").html(itemizedPrompts[0].rawPrompt.replace(/\n/g, '<br>'));
|
||||
rawPromptPopper.update();
|
||||
$('#rawPromptPopup').toggle();
|
||||
|
||||
//Popper(itemizedPrompts, mesIdForItemization);
|
||||
|
||||
})
|
||||
|
||||
|
||||
//********************
|
||||
//***Message Editor***
|
||||
|
@@ -3193,11 +3193,39 @@ a {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
#export_format_popup {
|
||||
#export_format_popup,
|
||||
#rawPromptPopup {
|
||||
display: none;
|
||||
z-index: 9999;
|
||||
}
|
||||
|
||||
#rawPromptPopup {
|
||||
inset: 0px auto auto 0px;
|
||||
margin: 0px;
|
||||
transform: translate(909px, 47px);
|
||||
display: block;
|
||||
overflow-wrap: break-word;
|
||||
white-space: normal;
|
||||
max-width: calc(((100svw - 500px) / 2) - 10px);
|
||||
position: absolute;
|
||||
z-index: 9999;
|
||||
max-height: 90svh;
|
||||
/*unsure why, but this prevents scrollbars*/
|
||||
height: 49svh;
|
||||
|
||||
padding: 5px;
|
||||
overflow-y: auto;
|
||||
display: none;
|
||||
}
|
||||
|
||||
#rawPopupWrapper {
|
||||
word-wrap: break-word;
|
||||
width: 100%;
|
||||
text-align: start;
|
||||
overflow-y: auto;
|
||||
max-height: 100%;
|
||||
}
|
||||
|
||||
.list-group {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
@@ -4100,6 +4128,10 @@ body.waifuMode #avatar_zoom_popup {
|
||||
|
||||
}
|
||||
|
||||
#showRawPrompt {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.mes-text {
|
||||
padding-right: 25px;
|
||||
}
|
||||
|
Reference in New Issue
Block a user