mirror of
https://github.com/DominikDoom/a1111-sd-webui-tagcomplete.git
synced 2026-01-26 11:09:54 +00:00
Rename queues to fit const naming convention
This commit is contained in:
@@ -39,9 +39,9 @@ var umiPreviousTags = [];
|
||||
/// Similar to a callback system, but primitive.
|
||||
|
||||
// Queues
|
||||
const afterInsertQueue = [];
|
||||
const afterSetupQueue = [];
|
||||
const afterConfigChangeQueue = [];
|
||||
const QUEUE_AFTER_INSERT = [];
|
||||
const QUEUE_AFTER_SETUP = [];
|
||||
const QUEUE_AFTER_CONFIG_CHANGE = [];
|
||||
|
||||
// List of parsers to try
|
||||
const parsers = [];
|
||||
const PARSERS = [];
|
||||
@@ -113,7 +113,7 @@ async function processQueueReturn(queue, context, ...args)
|
||||
// Specific to tag completion parsers
|
||||
async function processParsers(textArea, prompt) {
|
||||
// Get all parsers that have a successful trigger condition
|
||||
let matchingParsers = parsers.filter(parser => parser.triggerCondition());
|
||||
let matchingParsers = PARSERS.filter(parser => parser.triggerCondition());
|
||||
// Guard condition
|
||||
if (matchingParsers.length === 0) {
|
||||
return null;
|
||||
|
||||
@@ -226,7 +226,7 @@ async function syncOptions() {
|
||||
CFG = newCFG;
|
||||
|
||||
// Callback
|
||||
processQueue(afterConfigChangeQueue, null);
|
||||
processQueue(QUEUE_AFTER_CONFIG_CHANGE, null);
|
||||
}
|
||||
|
||||
// Create the result list div and necessary styling
|
||||
@@ -362,7 +362,7 @@ function insertTextAtCursor(textArea, result, tagword) {
|
||||
previousTags = tags;
|
||||
|
||||
// Callback
|
||||
processQueue(afterInsertQueue, null, tagType);
|
||||
processQueue(QUEUE_AFTER_INSERT, null, tagType);
|
||||
|
||||
// If it was a yaml wildcard, also update the umiPreviousTags
|
||||
if (tagType === ResultType.yamlWildcard && originalTagword.length > 0) {
|
||||
@@ -1266,7 +1266,7 @@ async function setup() {
|
||||
gradioApp().appendChild(acStyle);
|
||||
|
||||
// Callback
|
||||
processQueue(afterSetupQueue, null);
|
||||
processQueue(QUEUE_AFTER_SETUP, null);
|
||||
}
|
||||
|
||||
onUiUpdate(async () => {
|
||||
|
||||
Reference in New Issue
Block a user