1 Star 0 Fork 0

王云朋/Auto-Photoshop-StableDiffusion-Plugin

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
thumbnail.js 1.09 KB
一键复制 编辑 原始数据 按行查看 历史
class Thumbnail {
static wrapImgInContainer(img, container_style_class) {
const container = document.createElement('div')
container.className = container_style_class
container.appendChild(img)
return container
}
static addSPButtonToContainer(
container,
button_id,
title,
callbackFunction,
param1
) {
const elem = document.getElementById(button_id)
const clone = elem.cloneNode(true)
const button = clone
button.style.display = null
button.removeAttribute('id')
button.setAttribute('title', title)
// Create button element
button.className = 'thumbnail-image-button'
if (callbackFunction.constructor.name === 'AsyncFunction') {
button.addEventListener(
'click',
async () => await callbackFunction(param1)
)
} else {
button.addEventListener('click', () => callbackFunction(param1))
}
container.appendChild(button)
}
}
module.exports = {
Thumbnail,
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/wentijieda/Auto-Photoshop-StableDiffusion-Plugin.git
[email protected]:wentijieda/Auto-Photoshop-StableDiffusion-Plugin.git
wentijieda
Auto-Photoshop-StableDiffusion-Plugin
Auto-Photoshop-StableDiffusion-Plugin
master

搜索帮助