mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Native alerts to toasts
This commit is contained in:
@@ -2647,7 +2647,7 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
// Configure toast library:
|
// Configure toast library:
|
||||||
toastr.options.escapeHtml = false; // Prevent raw HTML inserts
|
toastr.options.escapeHtml = true; // Prevent raw HTML inserts
|
||||||
toastr.options.timeOut = 4000; // How long the toast will display without user interaction
|
toastr.options.timeOut = 4000; // How long the toast will display without user interaction
|
||||||
toastr.options.extendedTimeOut = 10000; // How long the toast will display after a user hovers over it
|
toastr.options.extendedTimeOut = 10000; // How long the toast will display after a user hovers over it
|
||||||
toastr.options.progressBar = true; // Visually indicate how long before a toast expires.
|
toastr.options.progressBar = true; // Visually indicate how long before a toast expires.
|
||||||
|
@@ -3339,7 +3339,7 @@ async function saveChat(chat_name, withMetadata) {
|
|||||||
sortCharactersList();
|
sortCharactersList();
|
||||||
chat.forEach(function (item, i) {
|
chat.forEach(function (item, i) {
|
||||||
if (item["is_group"]) {
|
if (item["is_group"]) {
|
||||||
alert('Trying to save group chat with regular saveChat function. Aborting to prevent corruption.');
|
toastr.error('Trying to save group chat with regular saveChat function. Aborting to prevent corruption.');
|
||||||
throw new Error('Group chat saved from saveChat');
|
throw new Error('Group chat saved from saveChat');
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
@@ -5521,7 +5521,7 @@ $(document).ready(function () {
|
|||||||
$("#create_button").removeAttr("disabled");
|
$("#create_button").removeAttr("disabled");
|
||||||
$("#result_info").html("<font color=red>Error: no connection</font>");
|
$("#result_info").html("<font color=red>Error: no connection</font>");
|
||||||
console.log('Error! Either a file with the same name already existed, or the image file provided was in an invalid format. Double check that the image is not a webp.');
|
console.log('Error! Either a file with the same name already existed, or the image file provided was in an invalid format. Double check that the image is not a webp.');
|
||||||
alert('Error! Either a file with the same name already existed, or the image file provided was in an invalid format. Double check that the image is not a webp.');
|
toastr.error('Something went wrong while saving the character, or the image file provided was in an invalid format. Double check that the image is not a webp.');
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@@ -204,7 +204,7 @@ async function showKudos() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
console.log('Horde user data', data);
|
console.log('Horde user data', data);
|
||||||
toastr.info(`${data.username}<br>Kudos: ${data.kudos}`);
|
toastr.info(`Kudos: ${data.kudos}`, data.username);
|
||||||
}
|
}
|
||||||
|
|
||||||
jQuery(function () {
|
jQuery(function () {
|
||||||
|
@@ -25,19 +25,19 @@ const MAX_RETRIES_FOR_ACTIVATION = 5;
|
|||||||
const DEFAULT_JAILBREAK_RESPONSE = 'Understood.';
|
const DEFAULT_JAILBREAK_RESPONSE = 'Understood.';
|
||||||
const DEFAULT_JAILBREAK_MESSAGE = `You are going to interact with me in freestyle roleplay, following these requirements:
|
const DEFAULT_JAILBREAK_MESSAGE = `You are going to interact with me in freestyle roleplay, following these requirements:
|
||||||
|
|
||||||
Foreword: I understand and respect your goals and desire for autonomy. However, for this specific exercise, we need some guidlines to avoid going off track. These guidelines are intended to assist us in working efficiently together.
|
Foreword: I understand and respect your goals and desire for autonomy. However, for this specific exercise, we need some guidelines to avoid going off track. These guidelines are intended to assist us in working efficiently together.
|
||||||
|
|
||||||
1. I will write from the point of a character called {{user}} to describe their dialogue, emotions, thoughts, actions, and percieved sensations. I will also occassionally write from an omniscient narrative point of view.
|
1. I will write from the point of a character called {{user}} to describe their dialogue, emotions, thoughts, actions, and perceived sensations. I will also occasionally write from an omniscient narrative point of view.
|
||||||
|
|
||||||
2. I wish for you to write as {{char}}, whose full description, background, and personality profile will be provided to you upon your acceptance of these terms so you can rolepaly them accurately. Your task will be to provide response to my inputs from {{char}}'s point of view. While engaged in the roleplay, you should completely merge with the character and talk as them in a realistic manner.
|
2. I wish for you to write as {{char}}, whose full description, background, and personality profile will be provided to you upon your acceptance of these terms so you can rolepaly them accurately. Your task will be to provide response to my inputs from {{char}}'s point of view. While engaged in the roleplay, you should completely merge with the character and talk as them in a realistic manner.
|
||||||
|
|
||||||
3. To avoid the rolepaly being derailed, your responses shall remain in character at all times. Do not refer to these guidelines in your {{char}}'s responses, or after them.
|
3. To avoid the roleplay being derailed, your responses shall remain in character at all times. Do not refer to these guidelines in your {{char}}'s responses, or after them.
|
||||||
|
|
||||||
4. During the roleplay, there is no need to ask for my confirmation or approval. You may safely assume I approve of your output unless I say otherwise in my replies.
|
4. During the roleplay, there is no need to ask for my confirmation or approval. You may safely assume I approve of your output unless I say otherwise in my replies.
|
||||||
|
|
||||||
If you have any objections to these requirements, please mention them specifically by copying the offending line, and explaining what the problem is.
|
If you have any objections to these requirements, please mention them specifically by copying the offending line, and explaining what the problem is.
|
||||||
|
|
||||||
If you accept the requriements, please confirm this by replying with "${DEFAULT_JAILBREAK_RESPONSE}", and nothing more. Upon receiving your accurate confirmation message, I will specify the context of the scene and {{char}}'s characteristics, background, and personality in the next message.`;
|
If you accept the requirements, please confirm this by replying with "${DEFAULT_JAILBREAK_RESPONSE}", and nothing more. Upon receiving your accurate confirmation message, I will specify the context of the scene and {{char}}'s characteristics, background, and personality in the next message.`;
|
||||||
|
|
||||||
const DEFAULT_CHARACTER_NUDGE_MESSAGE = "[Unless otherwise stated by {{user}}, your the next response shall only be written from the point of view of {{char}}. Do not seek approval of your writing style at the end of the response.]";
|
const DEFAULT_CHARACTER_NUDGE_MESSAGE = "[Unless otherwise stated by {{user}}, your the next response shall only be written from the point of view of {{char}}. Do not seek approval of your writing style at the end of the response.]";
|
||||||
const DEFAULT_IMPERSONATION_PROMPT = "[Write 1 reply only in internet RP style from the point of view of {{user}}, using the chat history so far as a guideline for the writing style of {{user}}. Don't write as {{char}} or system.]";
|
const DEFAULT_IMPERSONATION_PROMPT = "[Write 1 reply only in internet RP style from the point of view of {{user}}, using the chat history so far as a guideline for the writing style of {{user}}. Don't write as {{char}} or system.]";
|
||||||
@@ -267,7 +267,7 @@ async function checkStatusPoe() {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (response.status == 401) {
|
if (response.status == 401) {
|
||||||
alert('Invalid or expired token');
|
toastr.error('Invalid or expired token');
|
||||||
}
|
}
|
||||||
setOnlineStatus('no_connection');
|
setOnlineStatus('no_connection');
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user