LINTING:
- Added eslint. - Cleaned up lexical declarations in case clauses.
This commit is contained in:
19
.vscode/settings.json
vendored
Normal file
19
.vscode/settings.json
vendored
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
{
|
||||||
|
"cSpell.words": [
|
||||||
|
"apng",
|
||||||
|
"Civitai",
|
||||||
|
"ckpt",
|
||||||
|
"comfyui",
|
||||||
|
"FYUIKMNVB",
|
||||||
|
"gguf",
|
||||||
|
"gligen",
|
||||||
|
"jfif",
|
||||||
|
"locon",
|
||||||
|
"loras",
|
||||||
|
"noimage",
|
||||||
|
"onnx",
|
||||||
|
"rfilename",
|
||||||
|
"unet",
|
||||||
|
"upscaler"
|
||||||
|
]
|
||||||
|
}
|
||||||
8
web/eslint.config.mjs
Normal file
8
web/eslint.config.mjs
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
import globals from "globals";
|
||||||
|
import pluginJs from "@eslint/js";
|
||||||
|
|
||||||
|
|
||||||
|
export default [
|
||||||
|
{languageOptions: { globals: globals.browser }},
|
||||||
|
pluginJs.configs.recommended,
|
||||||
|
];
|
||||||
@@ -606,7 +606,7 @@ class ImageSelect {
|
|||||||
const value = document.querySelector(`input[name="${name}"]:checked`).value;
|
const value = document.querySelector(`input[name="${name}"]:checked`).value;
|
||||||
const elements = this.elements;
|
const elements = this.elements;
|
||||||
switch (value) {
|
switch (value) {
|
||||||
case this.#PREVIEW_DEFAULT:
|
case this.#PREVIEW_DEFAULT: {
|
||||||
const children = elements.defaultPreviews.children;
|
const children = elements.defaultPreviews.children;
|
||||||
const noImage = PREVIEW_NONE_URI;
|
const noImage = PREVIEW_NONE_URI;
|
||||||
let url = "";
|
let url = "";
|
||||||
@@ -626,7 +626,8 @@ class ImageSelect {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
return url;
|
return url;
|
||||||
case this.#PREVIEW_URL:
|
}
|
||||||
|
case this.#PREVIEW_URL: {
|
||||||
const value = elements.customUrl.value;
|
const value = elements.customUrl.value;
|
||||||
if (value.startsWith(Civitai.imagePostUrlPrefix())) {
|
if (value.startsWith(Civitai.imagePostUrlPrefix())) {
|
||||||
try {
|
try {
|
||||||
@@ -644,6 +645,7 @@ class ImageSelect {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return value;
|
return value;
|
||||||
|
}
|
||||||
case this.#PREVIEW_UPLOAD:
|
case this.#PREVIEW_UPLOAD:
|
||||||
return elements.uploadFile.files[0] ?? "";
|
return elements.uploadFile.files[0] ?? "";
|
||||||
case this.#PREVIEW_NONE:
|
case this.#PREVIEW_NONE:
|
||||||
@@ -2112,7 +2114,7 @@ class ModelInfo {
|
|||||||
previewSelect.elements.previews.style.display = "flex";
|
previewSelect.elements.previews.style.display = "flex";
|
||||||
|
|
||||||
const setPreviewButton = new ComfyButton({
|
const setPreviewButton = new ComfyButton({
|
||||||
tooltip: "Overwrite currrent preview with selected image",
|
tooltip: "Overwrite current preview with selected image",
|
||||||
content: "Set as Preview",
|
content: "Set as Preview",
|
||||||
action: async(e) => {
|
action: async(e) => {
|
||||||
const [button, icon, span] = comfyButtonDisambiguate(e.target);
|
const [button, icon, span] = comfyButtonDisambiguate(e.target);
|
||||||
|
|||||||
Reference in New Issue
Block a user