add VSC MARK comments to vital script.js funcs
| @@ -453,6 +453,7 @@ DOMPurify.addHook('uponSanitizeElement', (node, _, config) => { | ||
| 453 | 453 | }); |
| 454 | 454 | |
| 455 | 455 | // Event source init |
| 456 | +//MARK: event_types | |
| 456 | 457 | export const event_types = { |
| 457 | 458 | APP_READY: 'app_ready', |
| 458 | 459 | EXTRAS_CONNECTED: 'extras_connected', |
| @@ -960,6 +961,7 @@ export async function pingServer() { | ||
| 960 | 961 | } |
| 961 | 962 | } |
| 962 | 963 | |
| 964 | +//MARK: firstLoadInit | |
| 963 | 965 | async function firstLoadInit() { |
| 964 | 966 | try { |
| 965 | 967 | const tokenResponse = await fetch('/csrf-token'); |
| @@ -3861,6 +3863,7 @@ function removeLastMessage() { | ||
| 3861 | 3863 | } |
| 3862 | 3864 | |
| 3863 | 3865 | /** |
| 3866 | + * MARK:Generate() | |
| 3864 | 3867 | * Runs a generation using the current chat context. |
| 3865 | 3868 | * @param {string} type Generation type |
| 3866 | 3869 | * @param {GenerateOptions} options Generation options |
| @@ -4183,7 +4186,6 @@ export async function Generate(type, { automatic_trigger, force_name2, quiet_pro | ||
| 4183 | 4186 | |
| 4184 | 4187 | console.log(`Core/all messages: ${coreChat.length}/${chat.length}`); |
| 4185 | 4188 | |
| 4186 | - // kingbri MARK: - Make sure the prompt bias isn't the same as the user bias | |
| 4187 | 4189 | if ((promptBias && !isUserPromptBias) || power_user.always_force_name2 || main_api == 'novel') { |
| 4188 | 4190 | force_name2 = true; |
| 4189 | 4191 | } |
| @@ -5166,6 +5168,7 @@ export async function Generate(type, { automatic_trigger, force_name2, quiet_pro | ||
| 5166 | 5168 | throw exception; |
| 5167 | 5169 | } |
| 5168 | 5170 | } |
| 5171 | +//MARK: Generate() ends | |
| 5169 | 5172 | |
| 5170 | 5173 | /** |
| 5171 | 5174 | * Stops the generation and any streaming if it is currently running. |
| @@ -7477,7 +7480,7 @@ function reloadLoop() { | ||
| 7477 | 7480 | } |
| 7478 | 7481 | } |
| 7479 | 7482 | |
| 7480 | -//***************SETTINGS****************// | |
| 7483 | +//MARK: getSettings() | |
| 7481 | 7484 | /////////////////////////////////////////// |
| 7482 | 7485 | export async function getSettings() { |
| 7483 | 7486 | const response = await fetch('/api/settings/get', { |
| @@ -7673,6 +7676,7 @@ function selectKoboldGuiPreset() { | ||
| 7673 | 7676 | .trigger('change'); |
| 7674 | 7677 | } |
| 7675 | 7678 | |
| 7679 | +//MARK: saveSettings() | |
| 7676 | 7680 | export async function saveSettings(loopCounter = 0) { |
| 7677 | 7681 | if (!settingsReady) { |
| 7678 | 7682 | console.warn('Settings not ready, scheduling another save'); |
| @@ -9340,6 +9344,7 @@ export function swipe_left(_event, { source, repeated } = {}) { | ||
| 9340 | 9344 | * @param {string} [params.source] The source of the swipe event. |
| 9341 | 9345 | * @param {boolean} [params.repeated] Is the swipe event repeated. |
| 9342 | 9346 | */ |
| 9347 | +//MARK: swipe_right | |
| 9343 | 9348 | export function swipe_right(_event, { source, repeated } = {}) { |
| 9344 | 9349 | if (chat.length - 1 === Number(this_edit_mes_id)) { |
| 9345 | 9350 | closeMessageEditor(); |
| @@ -10357,6 +10362,8 @@ API Settings: ${JSON.stringify(getSettingsContents[getSettingsContents.main_api | ||
| 10357 | 10362 | }); |
| 10358 | 10363 | } |
| 10359 | 10364 | |
| 10365 | + | |
| 10366 | +// MARK: DOM Handlers Start | |
| 10360 | 10367 | jQuery(async function () { |
| 10361 | 10368 | async function doForceSave() { |
| 10362 | 10369 | await saveSettings(); |