add VSC MARK comments to vital script.js funcs

fe0db6ec787cc20057d7262c300b6c047e46dd12

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

1 files changed, +9 -2Showing whitespace changes
public/script.js+9 -2
@@ -453,6 +453,7 @@ DOMPurify.addHook('uponSanitizeElement', (node, _, config) => {
453453});
454454
455455// Event source init
456+//MARK: event_types
456457export const event_types = {
457458 APP_READY: 'app_ready',
458459 EXTRAS_CONNECTED: 'extras_connected',
@@ -960,6 +961,7 @@ export async function pingServer() {
960961 }
961962}
962963
964+//MARK: firstLoadInit
963965async function firstLoadInit() {
964966 try {
965967 const tokenResponse = await fetch('/csrf-token');
@@ -3861,6 +3863,7 @@ function removeLastMessage() {
38613863}
38623864
38633865/**
3866+ * MARK:Generate()
38643867 * Runs a generation using the current chat context.
38653868 * @param {string} type Generation type
38663869 * @param {GenerateOptions} options Generation options
@@ -4183,7 +4186,6 @@ export async function Generate(type, { automatic_trigger, force_name2, quiet_pro
41834186
41844187 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
41874189 if ((promptBias && !isUserPromptBias) || power_user.always_force_name2 || main_api == 'novel') {
41884190 force_name2 = true;
41894191 }
@@ -5166,6 +5168,7 @@ export async function Generate(type, { automatic_trigger, force_name2, quiet_pro
51665168 throw exception;
51675169 }
51685170}
5171+//MARK: Generate() ends
51695172
51705173/**
51715174 * Stops the generation and any streaming if it is currently running.
@@ -7477,7 +7480,7 @@ function reloadLoop() {
74777480 }
74787481}
74797482
7480-//***************SETTINGS****************//
7483+//MARK: getSettings()
74817484///////////////////////////////////////////
74827485export async function getSettings() {
74837486 const response = await fetch('/api/settings/get', {
@@ -7673,6 +7676,7 @@ function selectKoboldGuiPreset() {
76737676 .trigger('change');
76747677}
76757678
7679+//MARK: saveSettings()
76767680export async function saveSettings(loopCounter = 0) {
76777681 if (!settingsReady) {
76787682 console.warn('Settings not ready, scheduling another save');
@@ -9340,6 +9344,7 @@ export function swipe_left(_event, { source, repeated } = {}) {
93409344 * @param {string} [params.source] The source of the swipe event.
93419345 * @param {boolean} [params.repeated] Is the swipe event repeated.
93429346 */
9347+//MARK: swipe_right
93439348export function swipe_right(_event, { source, repeated } = {}) {
93449349 if (chat.length - 1 === Number(this_edit_mes_id)) {
93459350 closeMessageEditor();
@@ -10357,6 +10362,8 @@ API Settings: ${JSON.stringify(getSettingsContents[getSettingsContents.main_api
1035710362 });
1035810363}
1035910364
10365+
10366+// MARK: DOM Handlers Start
1036010367jQuery(async function () {
1036110368 async function doForceSave() {
1036210369 await saveSettings();