mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Switch to module exports
This commit is contained in:
@ -1,6 +1,6 @@
|
|||||||
import { callPopup, eventSource, event_types, saveSettings, saveSettingsDebounced, getRequestHeaders, animation_duration } from '../script.js';
|
import { callPopup, eventSource, event_types, saveSettings, saveSettingsDebounced, getRequestHeaders, animation_duration } from '../script.js';
|
||||||
import { hideLoader, showLoader } from './loader.js';
|
import { hideLoader, showLoader } from './loader.js';
|
||||||
import { renderTemplate, renderTemplateAsync } from '../script.js';
|
import { renderTemplate, renderTemplateAsync } from './templates.js';
|
||||||
import { isSubsetOf, setValueByPath } from './utils.js';
|
import { isSubsetOf, setValueByPath } from './utils.js';
|
||||||
export {
|
export {
|
||||||
getContext,
|
getContext,
|
||||||
|
@ -4,7 +4,7 @@ TODO:
|
|||||||
//const DEBUG_TONY_SAMA_FORK_MODE = true
|
//const DEBUG_TONY_SAMA_FORK_MODE = true
|
||||||
|
|
||||||
import { getRequestHeaders, callPopup, processDroppedFiles } from '../../../script.js';
|
import { getRequestHeaders, callPopup, processDroppedFiles } from '../../../script.js';
|
||||||
import { deleteExtension, extensionNames, getContext, installExtension, renderExtensionTemplate } from '../../extensions.js';
|
import { deleteExtension, extensionNames, getContext, installExtension, renderExtensionTemplateAsync } from '../../extensions.js';
|
||||||
import { executeSlashCommands } from '../../slash-commands.js';
|
import { executeSlashCommands } from '../../slash-commands.js';
|
||||||
import { getStringHash, isValidUrl } from '../../utils.js';
|
import { getStringHash, isValidUrl } from '../../utils.js';
|
||||||
export { MODULE_NAME };
|
export { MODULE_NAME };
|
||||||
@ -355,7 +355,8 @@ async function updateCurrentAssets() {
|
|||||||
// This function is called when the extension is loaded
|
// This function is called when the extension is loaded
|
||||||
jQuery(async () => {
|
jQuery(async () => {
|
||||||
// This is an example of loading HTML from a file
|
// This is an example of loading HTML from a file
|
||||||
const windowHtml = $(renderExtensionTemplate(MODULE_NAME, 'window', {}));
|
const windowTemplate = await renderExtensionTemplateAsync(MODULE_NAME, 'window', {});
|
||||||
|
const windowHtml = $(windowTemplate);
|
||||||
|
|
||||||
const assetsJsonUrl = windowHtml.find('#assets-json-url-field');
|
const assetsJsonUrl = windowHtml.find('#assets-json-url-field');
|
||||||
assetsJsonUrl.val(ASSETS_JSON_URL);
|
assetsJsonUrl.val(ASSETS_JSON_URL);
|
||||||
@ -366,7 +367,7 @@ jQuery(async () => {
|
|||||||
const rememberKey = `Assets_SkipConfirm_${getStringHash(url)}`;
|
const rememberKey = `Assets_SkipConfirm_${getStringHash(url)}`;
|
||||||
const skipConfirm = localStorage.getItem(rememberKey) === 'true';
|
const skipConfirm = localStorage.getItem(rememberKey) === 'true';
|
||||||
|
|
||||||
const template = renderExtensionTemplate(MODULE_NAME, 'confirm', { url });
|
const template = await renderExtensionTemplateAsync(MODULE_NAME, 'confirm', { url });
|
||||||
const confirmation = skipConfirm || await callPopup(template, 'confirm');
|
const confirmation = skipConfirm || await callPopup(template, 'confirm');
|
||||||
|
|
||||||
if (confirmation) {
|
if (confirmation) {
|
||||||
|
@ -22,7 +22,6 @@ import {
|
|||||||
ANIMATION_DURATION_DEFAULT,
|
ANIMATION_DURATION_DEFAULT,
|
||||||
setActiveGroup,
|
setActiveGroup,
|
||||||
setActiveCharacter,
|
setActiveCharacter,
|
||||||
renderTemplateAsync,
|
|
||||||
} from '../script.js';
|
} from '../script.js';
|
||||||
import { isMobile, initMovingUI, favsToHotswap } from './RossAscends-mods.js';
|
import { isMobile, initMovingUI, favsToHotswap } from './RossAscends-mods.js';
|
||||||
import {
|
import {
|
||||||
@ -39,6 +38,7 @@ import { registerSlashCommand } from './slash-commands.js';
|
|||||||
import { tags } from './tags.js';
|
import { tags } from './tags.js';
|
||||||
import { tokenizers } from './tokenizers.js';
|
import { tokenizers } from './tokenizers.js';
|
||||||
import { BIAS_CACHE } from './logit-bias.js';
|
import { BIAS_CACHE } from './logit-bias.js';
|
||||||
|
import { renderTemplateAsync } from './templates.js';
|
||||||
|
|
||||||
import { countOccurrences, debounce, delay, download, getFileText, isOdd, resetScrollHeight, shuffle, sortMoments, stringToRange, timestampToMoment } from './utils.js';
|
import { countOccurrences, debounce, delay, download, getFileText, isOdd, resetScrollHeight, shuffle, sortMoments, stringToRange, timestampToMoment } from './utils.js';
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user