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:
@@ -161,6 +161,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
#showRawPrompt,
|
#showRawPrompt,
|
||||||
|
#copyPromptToClipboard,
|
||||||
#groupCurrentMemberPopoutButton {
|
#groupCurrentMemberPopoutButton {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
@@ -2754,7 +2754,7 @@ async function Generate(type, { automatic_trigger, force_name2, resolve, reject,
|
|||||||
// Add quiet generation prompt at depth 0
|
// Add quiet generation prompt at depth 0
|
||||||
if (quiet_prompt && quiet_prompt.length) {
|
if (quiet_prompt && quiet_prompt.length) {
|
||||||
const name = name1;
|
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;
|
lastMesString += quietAppend;
|
||||||
// Bail out early
|
// Bail out early
|
||||||
return lastMesString;
|
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 () {
|
$(document).on("pointerup", "#showRawPrompt", function () {
|
||||||
//console.log(itemizedPrompts[PromptArrayItemForRawPromptDisplay].rawPrompt);
|
//console.log(itemizedPrompts[PromptArrayItemForRawPromptDisplay].rawPrompt);
|
||||||
console.log(PromptArrayItemForRawPromptDisplay);
|
console.log(PromptArrayItemForRawPromptDisplay);
|
||||||
|
@@ -1,6 +1,7 @@
|
|||||||
<h3 class="flex-container justifyCenter alignitemscenter">
|
<h3 class="flex-container justifyCenter alignitemscenter">
|
||||||
Prompt Itemization
|
Prompt Itemization
|
||||||
<div id="showRawPrompt" class="fa-solid fa-square-poll-horizontal menu_button"></div>
|
<div id="showRawPrompt" class="fa-solid fa-square-poll-horizontal menu_button"></div>
|
||||||
|
<div id="copyPromptToClipboard" class="fa-solid fa-copy menu_button"></div>
|
||||||
</h3>
|
</h3>
|
||||||
Tokenizer: {{selectedTokenizer}}<br>
|
Tokenizer: {{selectedTokenizer}}<br>
|
||||||
API Used: {{this_main_api}}<br>
|
API Used: {{this_main_api}}<br>
|
||||||
|
@@ -1,6 +1,7 @@
|
|||||||
<h3 class="flex-container justifyCenter alignitemscenter">
|
<h3 class="flex-container justifyCenter alignitemscenter">
|
||||||
Prompt Itemization
|
Prompt Itemization
|
||||||
<div id="showRawPrompt" class="fa-solid fa-square-poll-horizontal menu_button"></div>
|
<div id="showRawPrompt" class="fa-solid fa-square-poll-horizontal menu_button"></div>
|
||||||
|
<div id="copyPromptToClipboard" class="fa-solid fa-copy menu_button"></div>
|
||||||
</h3>
|
</h3>
|
||||||
Tokenizer: {{selectedTokenizer}}<br>
|
Tokenizer: {{selectedTokenizer}}<br>
|
||||||
API Used: {{this_main_api}}<br>
|
API Used: {{this_main_api}}<br>
|
||||||
|
@@ -1,8 +1,7 @@
|
|||||||
// Ban bracket generation, plus defaults
|
// Ban bracket generation, plus defaults
|
||||||
const badWordsList = [
|
const badWordsList = [
|
||||||
[23], [49209, 23], [23], [49209, 23], [23], [49209, 23], [23], [49209, 23], [23], [49209, 23], [21], [49209, 21],
|
[3], [49356], [1431], [31715], [34387], [20765], [30702], [10691], [49333], [1266],
|
||||||
[21], [49209, 21], [21], [49209, 21], [21], [49209, 21], [21], [49209, 21], [3], [49356], [1431], [31715], [34387],
|
[19438], [43145], [26523], [41471], [2936], [85, 85], [49332], [7286], [1115]
|
||||||
[20765], [30702], [10691], [49333], [1266], [26523], [41471], [2936], [85, 85], [49332], [7286], [1115], [19438, 2542],
|
|
||||||
]
|
]
|
||||||
|
|
||||||
const hypeBotBadWordsList = [
|
const hypeBotBadWordsList = [
|
||||||
|
Reference in New Issue
Block a user