commit 5bee381ea7348eaad4b3df71cb91d23338abf9c7 Author: city-unit <140349364+city-unit@users.noreply.github.com> Date: Sun Jul 23 18:36:04 2023 -0400 Clean Start diff --git a/README.md b/README.md new file mode 100644 index 0000000..0b99b44 --- /dev/null +++ b/README.md @@ -0,0 +1,30 @@ +# SillyTavern Extension Example + +Provide a brief description of how your extension works, what problem it aims to solve. + +## Features + +Describe some of the main selling points of your extension. + +## Installation and Usage + +### Installation + +In most cases, this should just be using ST's inbuilt extension installer. + +### Usage + +Explain how to use this extension. + +## Prerequisites + +Specify the version of ST necessary here. + +## Support and Contributions + +Where should someone ask for support? +How can they help add to this extension? + +## License + +Be cool, use an open source license. \ No newline at end of file diff --git a/example.html b/example.html new file mode 100644 index 0000000..cfa43df --- /dev/null +++ b/example.html @@ -0,0 +1,2 @@ + \ No newline at end of file diff --git a/index.js b/index.js new file mode 100644 index 0000000..c2fe78c --- /dev/null +++ b/index.js @@ -0,0 +1,35 @@ +// The main script for the extension +// The following are examples of some basic extension functionality + +//You'll likely need to import extension_settings, getContext, and loadExtensionSettings from extensions.js +import { extension_settings, getContext, loadExtensionSettings } from "../../../extensions.js"; + +// Keep track of where your extension is located +const extensionName = "example-extension"; +const extensionFolderPath = `scripts/extensions/third-party/${extensionName}/`; +const extensionSettings = extension_settings[extensionName]; + + +function onButtonClick() { + // This function is called when the button is clicked + // You can do whatever you want here +} + +// This function is called when the extension is loaded +jQuery(async () => { + // This is an example of loading HTML from a file + const settingsHtml = await $.get( + `${extensionFolderPath}/example.html` + ); + + // Append settingsHtml to extensions_settings + // extension_settings and extensions_settings2 are the left and right columns of the settings menu + // You can append to either one + $("#extensions_settings").append(settingsHtml); + + // These are examples of listening for events + $("#my_button").on("click", onButtonClick()); + + // Load settings when starting things up (if you have any) + loadSettings(); +}); diff --git a/manifest.json b/manifest.json new file mode 100644 index 0000000..eb15bd3 --- /dev/null +++ b/manifest.json @@ -0,0 +1,11 @@ +{ + "display_name": "Name Displayed in SillyTavern", + "loading_order": 9, + "requires": [], + "optional": [], + "js": "index.js", + "css": "style.css", + "author": "yourNameHere", + "version": "1.0.0", + "homePage": "yourUrlHere" +} diff --git a/style.css b/style.css new file mode 100644 index 0000000..3152e14 --- /dev/null +++ b/style.css @@ -0,0 +1 @@ +/* All style elements for your extension go here */ \ No newline at end of file