add VSC MARK comments to vital script.js funcs

fe0db6ec787cc20057d7262c300b6c047e46dd12

RossAscends <124905043+RossAscends@users.noreply.github.com>

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