* Adding toggle.
* Adding events for the new toggle. Reloading chat when toggled.
* Adding chat reload when tags are added or removed to char.
* Adding main applyCharacterTagsToMessageDivs function to add tags to divs.
* Adding information that the class name is normalized and lowercased to the tooltip.
* Correcting console.traces to console.debug for minimal console printing.
* Lint indentation fix.
* Adding simple cache.
* Adding reload event when a new message is added to chat.
* Changing tags applied from classes to HTML data API.
* Adding guide showing how to select data attributes with CSS.
* Fixing trailing comma pointed out by lint.
* Simplifying re-rendering by deleting previous attributes.
* Adding the feature as default behavior, removing toggles. Will add docs to ST docs.
* Removing code that is no longer needed.
* Re-rendering divs after other tag operations.
* Filtering message ids to only re-render specific divs. Adding suggested changes.
* After testing, it seems to add all messages by one, so it appears it's not needed call this in the printMessages function.
* Lint fixes.
* Cache jquery selector
* Fix local variables assignment
* Move new functions to tags module
* Normalizing tag names before adding them as data-*
* Replace commas with spaces to avoid issues with tag names containing commas.
* Correcting where the comma replacing should go.
* Add error handling for applyCharacterTagsToMessageDivs
---------
Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
* refactor: ♻️ Replace deprecated code defined within this repository
- Replace ““/public/scripts.js” > `callPopup`” with ““/public/scripts/popup.js” > `callGenericPopup`”.
- Replace ““/public/scripts/tokenizers.js” > `getTokenCount`” with ““/public/scripts/tokenizers.js” > `getTokenCountAsync`”.
- Replace ““/public/scripts/extensions/assets/index.js” > `executeSlashCommands`” with ““/public/scripts/extensions/assets/index.js” > `executeSlashCommandsWithOptions`”.
* refactor: ♻️ Replace deprecated code from standard library
1. Replace set of deprecated `escape` and deprecated `unescape` functions with `encodeURIComponent` and `decodeURIComponent` functions.
2. Replace set of `encodeURIComponent` and deprecated `unescape` functions with a custom `convertTextToBinaryString` function.
* refactor: ♻️ Replace deprecated code imported from external library
All of them is from jQuery.
1. Replace `$(document).ready(() => { ... })` → `jQuery(() => { ... })`.
2. Replace event type direct calls.
1) Change
- `$('...').change(function () { ... })` → `$('...').on('change', function () { ... })`.
2) Click
- `$('...').click(function () { ... })` → `$('...').on('click', function () { ... })`.
- `$('...').click()` → `$('...').trigger('click')`.
3) Focus
- `$('...').focus(function () { ... })` → `$('...').on('focus', function () { ... })`.
- `$('...').focus()` → `$('...').trigger('focus')`.
4) Blur
- `$('...').blur(function () { ... })` → `$('...').on('blur', function () { ... })`.
5) Keyup
- `$('...').keyup(function () { ... })` → `$('...').on('keyup', function () { ... })`.
* refactor(Attachment): ♻️ Merge `convertTextToBinaryString` and `convertTextToBase64`
`convertTextToBase64` function use `Uint8Array.prototype.toBase64` if supported by the Browser and use a combination of `Window.btoa` and `String.fromCharCode` as fallback.
* fix: 🐛 Fix Bind World Info to Character Card
Using the new `Popup` class.
* fix: 🐛 Fix Bind World Info to Character Card
Using the new `Popup` class.
* refactor: 🐛 Refactor and fix Character World Info popup
Add singleton back and some optimization.
- **🛡️ Singleton Pattern:** Implemented a singleton pattern using the `characterWorldPopup` variable. This prevents multiple instances of the popup from being created, ensuring a clean and predictable UI. If the popup is already open, it will be brought into focus instead of creating a duplicate.
- **♻️ Improved Readability:** The event handling logic has been extracted into clearly named functions (`handlePrimaryWorldSelect`, `handleExtrasWorldSelect`), making the `Popup` constructor cleaner and the overall code more readable and maintainable.
- **⚙️ Optimized Performance:** The new implementation caches frequently accessed values and jQuery selectors, reducing redundant DOM lookups and improving performance.
---
* refactor(Chat): ♻️ Modernize chat deletion confirmation
Replaces the deprecated `callPopup` with the modern `callGenericPopup` for the chat deletion confirmation dialog.
* Fix /delchat command
* Remove unused code
* Fix type. Change value to debug log
* Remove value logs
* Remove singleton pattern for openCharacterWorldPopup
---------
Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
* feature: customizable mappings for presets per chat template
This adds the ability to assign custom context/instruct presets on a per-chat-template(-hash) basis. Users using custom templates may use this feature to auto-enable the preset of their choice, rather than the built-in defaults.
* fix: do not use chat tempate based instruct preset derivation if a preset was auto-selected already
This fixes issues where regex matched presets are overridden.
* reset chat template hash on connect
* handle derive_mappings being null
* unorthodox eslint requirement adherence
* button styling
* un-nest derivation related properties
* Migrate setting
* add bind model to preset button to the miscellaneous section
* switch to unified button for model preset mappings
* fix bind UI
* eslint
* do not include koboldcpp/ggml-model-xxx.gguf in preset saving
* review fixes
* stray console.log / eslint
* Update checkbox state if no model map exists
---------
Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
* Adding ZLib and Jimp imports.
* Adding checks to see if UUID or URL are from Perchance.
* Adding conversion for Perchance cards and avatar.
* Adding label and example for Perchance character import.
* Adding localization of Perchance import option.
* Lint dangling comma fix.
* Simplifying one liner arrow function.
* Checking .gz at the end of Perchance url.
* Refactoring.
* Handling Base64 avatars.
* Fixing issue with UUID and refactoring.
* Adding char name to Perchance UUID example.
* Undoing unwanted variable name change of avatarBuffer to defaultAvatarBuffer
* Adding null check.
* Minor adjustments: renaming variable and organizing imports.
* Simple refactoring and reducing level of console messages.
* Add character source for perchance
* Add null check
* Use slug for source
---------
Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
* feat(elevenlabs): add new models and deprecate old ones
* feat(elevenlabs): update default model to eleven_turbo_v2_5 and enhance extended settings check
Adjusts conditions to properly enforce mutual exclusivity between fallback expression and default emoji settings
- Ensures "[ No fallback ]" option only appears when both settings are inactive
- Updates migration logic to ONLY reset default emoji setting when fallback is active
Fixes#4205
* ImgGen: ComfyUI support video outputs
* Fix video format check to handle undefined and case sensitivity
* Fix error handling and add output debug log in comfy workflows
* Refactor Comfy generation result
* Add video file extensions constant