mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Add copy to clipboard button on prompt itemization popup (#1124)
* Add copy to clipboard button on prompt itemization popup * Minor fix for NovelAI Summarize and new bad words
This commit is contained in:
@@ -2754,7 +2754,7 @@ async function Generate(type, { automatic_trigger, force_name2, resolve, reject,
|
||||
// Add quiet generation prompt at depth 0
|
||||
if (quiet_prompt && quiet_prompt.length) {
|
||||
const name = name1;
|
||||
const quietAppend = isInstruct ? formatInstructModeChat(name, quiet_prompt, false, true, '', name1, name2, false) : `\n${name}: ${quiet_prompt}`;
|
||||
const quietAppend = isInstruct ? formatInstructModeChat(name, quiet_prompt, false, true, '', name1, name2, false) : `\n${quiet_prompt}`;
|
||||
lastMesString += quietAppend;
|
||||
// Bail out early
|
||||
return lastMesString;
|
||||
@@ -8018,6 +8018,18 @@ jQuery(async function () {
|
||||
}
|
||||
})
|
||||
|
||||
$(document).on("pointerup", "#copyPromptToClipboard", function () {
|
||||
let rawPrompt = itemizedPrompts[PromptArrayItemForRawPromptDisplay].rawPrompt;
|
||||
let rawPromptValues = rawPrompt;
|
||||
|
||||
if (Array.isArray(rawPrompt)) {
|
||||
rawPromptValues = rawPrompt.map(x => x.content).join('\n');
|
||||
}
|
||||
|
||||
navigator.clipboard.writeText(rawPromptValues);
|
||||
toastr.info('Copied!', '', { timeOut: 2000 });
|
||||
});
|
||||
|
||||
$(document).on("pointerup", "#showRawPrompt", function () {
|
||||
//console.log(itemizedPrompts[PromptArrayItemForRawPromptDisplay].rawPrompt);
|
||||
console.log(PromptArrayItemForRawPromptDisplay);
|
||||
|
Reference in New Issue
Block a user