Create encrypt_images_info.js
Browse files- encrypt_images_info.js +32 -0
encrypt_images_info.js
ADDED
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
lsLoad = false;
|
2 |
+
onUiUpdate(function () {
|
3 |
+
if (lsLoad) return;
|
4 |
+
if (!opts) return;
|
5 |
+
if (!opts["encrypt_image_is_enable"]) return;
|
6 |
+
lsLoad = true;
|
7 |
+
let enable = opts["encrypt_image_is_enable"] == "是";
|
8 |
+
|
9 |
+
function renderInfo(txtOrImg2img, isEnable) {
|
10 |
+
let info = document.getElementById("encrypt_image_" + txtOrImg2img + "2img_info");
|
11 |
+
let top = document.getElementById(txtOrImg2img + "2img_neg_prompt");
|
12 |
+
if (!top) return;
|
13 |
+
|
14 |
+
if (!info) {
|
15 |
+
let parent = top.parentNode;
|
16 |
+
info = document.createElement("div");
|
17 |
+
info.style.minWidth = "100%";
|
18 |
+
info.style.textAlign = "center";
|
19 |
+
info.style.opacity = 0.5;
|
20 |
+
info.style.fontSize = ".89em";
|
21 |
+
info.id = "encrypt_image_" + txtOrImg2img + "2img_info";
|
22 |
+
parent.insertBefore(info, top.nextSibling);
|
23 |
+
}
|
24 |
+
|
25 |
+
info.innerHTML = isEnable
|
26 |
+
? "图片加密插件已经启用,图片将加密保存在服务器。"
|
27 |
+
: "图片加密插件已安装但未启用。";
|
28 |
+
}
|
29 |
+
|
30 |
+
renderInfo("txt", enable);
|
31 |
+
renderInfo("img", enable);
|
32 |
+
});
|