add VSC MARK comments to vital script.js funcs

This commit is contained in:
RossAscends
2025-05-21 17:41:24 +09:00
parent b3e317393b
commit fe0db6ec78

View File

@ -453,6 +453,7 @@ DOMPurify.addHook('uponSanitizeElement', (node, _, config) => {
});
// Event source init
//MARK: event_types
export const event_types = {
APP_READY: 'app_ready',
EXTRAS_CONNECTED: 'extras_connected',
@ -960,6 +961,7 @@ export async function pingServer() {
}
}
//MARK: firstLoadInit
async function firstLoadInit() {
try {
const tokenResponse = await fetch('/csrf-token');
@ -3861,6 +3863,7 @@ function removeLastMessage() {
}
/**
* MARK:Generate()
* Runs a generation using the current chat context.
* @param {string} type Generation type
* @param {GenerateOptions} options Generation options
@ -4183,7 +4186,6 @@ export async function Generate(type, { automatic_trigger, force_name2, quiet_pro
console.log(`Core/all messages: ${coreChat.length}/${chat.length}`);
// kingbri MARK: - Make sure the prompt bias isn't the same as the user bias
if ((promptBias && !isUserPromptBias) || power_user.always_force_name2 || main_api == 'novel') {
force_name2 = true;
}
@ -5166,6 +5168,7 @@ export async function Generate(type, { automatic_trigger, force_name2, quiet_pro
throw exception;
}
}
//MARK: Generate() ends
/**
* Stops the generation and any streaming if it is currently running.
@ -7477,7 +7480,7 @@ function reloadLoop() {
}
}
//***************SETTINGS****************//
//MARK: getSettings()
///////////////////////////////////////////
export async function getSettings() {
const response = await fetch('/api/settings/get', {
@ -7673,6 +7676,7 @@ function selectKoboldGuiPreset() {
.trigger('change');
}
//MARK: saveSettings()
export async function saveSettings(loopCounter = 0) {
if (!settingsReady) {
console.warn('Settings not ready, scheduling another save');
@ -9340,6 +9344,7 @@ export function swipe_left(_event, { source, repeated } = {}) {
* @param {string} [params.source] The source of the swipe event.
* @param {boolean} [params.repeated] Is the swipe event repeated.
*/
//MARK: swipe_right
export function swipe_right(_event, { source, repeated } = {}) {
if (chat.length - 1 === Number(this_edit_mes_id)) {
closeMessageEditor();
@ -10357,6 +10362,8 @@ API Settings: ${JSON.stringify(getSettingsContents[getSettingsContents.main_api
});
}
// MARK: DOM Handlers Start
jQuery(async function () {
async function doForceSave() {
await saveSettings();