mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-03-02 10:57:45 +01:00
Switch to module init function pattern
This commit is contained in:
parent
a80741a20e
commit
e2a09ad5a7
@ -6750,9 +6750,6 @@
|
||||
<script type="module" src="lib/swiped-events.js"></script>
|
||||
<script type="module" src="lib/eventemitter.js"></script>
|
||||
<script type="module" src="scripts/i18n.js"></script>
|
||||
<script type="module" src="scripts/bulk-edit.js"></script>
|
||||
<script type="module" src="scripts/setting-search.js"></script>
|
||||
<script type="module" src="scripts/server-history.js"></script>
|
||||
<script type="module" src="script.js"></script>
|
||||
<script>
|
||||
window.addEventListener('load', (event) => {
|
||||
|
@ -264,6 +264,9 @@ import { registerExtensionSlashCommands as initExtensionSlashCommands } from './
|
||||
import { ToolManager } from './scripts/tool-calling.js';
|
||||
import { addShowdownPatch } from './scripts/util/showdown-patch.js';
|
||||
import { applyBrowserFixes } from './scripts/browser-fixes.js';
|
||||
import { initServerHistory } from './scripts/server-history.js';
|
||||
import { initSettingsSearch } from './scripts/setting-search.js';
|
||||
import { initBulkEdit } from './scripts/bulk-edit.js';
|
||||
|
||||
//exporting functions and vars for mods
|
||||
export {
|
||||
@ -965,6 +968,9 @@ async function firstLoadInit() {
|
||||
initCfg();
|
||||
initLogprobs();
|
||||
initInputMarkdown();
|
||||
initServerHistory();
|
||||
initSettingsSearch();
|
||||
initBulkEdit();
|
||||
await initScrapers();
|
||||
doDailyExtensionUpdatesCheck();
|
||||
await hideLoader();
|
||||
|
@ -30,11 +30,6 @@ const toggleBulkEditMode = (isBulkEdit) => {
|
||||
}
|
||||
};
|
||||
|
||||
characterGroupOverlay.addStateChangeCallback((state) => {
|
||||
if (state === BulkEditOverlayState.select) enableBulkEdit();
|
||||
if (state === BulkEditOverlayState.browse) disableBulkEdit();
|
||||
});
|
||||
|
||||
/**
|
||||
* Toggles bulk edit mode on/off when the edit button is clicked.
|
||||
*/
|
||||
@ -117,8 +112,13 @@ function disableBulkSelect() {
|
||||
/**
|
||||
* Entry point that runs on page load.
|
||||
*/
|
||||
jQuery(() => {
|
||||
export function initBulkEdit() {
|
||||
characterGroupOverlay.addStateChangeCallback((state) => {
|
||||
if (state === BulkEditOverlayState.select) enableBulkEdit();
|
||||
if (state === BulkEditOverlayState.browse) disableBulkEdit();
|
||||
});
|
||||
|
||||
$('#bulkEditButton').on('click', onEditButtonClick);
|
||||
$('#bulkSelectAllButton').on('click', onSelectAllButtonClick);
|
||||
$('#bulkDeleteButton').on('click', onDeleteButtonClick);
|
||||
});
|
||||
}
|
||||
|
@ -80,7 +80,7 @@ function onServerConnectClick() {
|
||||
});
|
||||
}
|
||||
|
||||
jQuery(function () {
|
||||
export function initServerHistory() {
|
||||
$('[data-server-history]').each(createServerAutocomplete);
|
||||
$(document).on('click', '[data-server-connect]', onServerConnectClick);
|
||||
});
|
||||
}
|
||||
|
@ -49,6 +49,6 @@ function removeHighlighting() {
|
||||
$('.highlighted').removeClass('highlighted'); // Remove CSS class from previously highlighted elements
|
||||
}
|
||||
|
||||
jQuery(() => {
|
||||
export function initSettingsSearch() {
|
||||
$('#settingsSearch').on('input change', searchSettings);
|
||||
});
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user