-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprompt-help-button.plugin.js
41 lines (36 loc) · 1.07 KB
/
prompt-help-button.plugin.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/**
* Prompt Help Button
* v.1.0.0, 2022-03-24
*
* https://github.com/ogmaresca/easydiffusion-plugins
*/
"use strict";
(function() {
const usingDiffusers = typeof testDiffusers !== 'undefined' && testDiffusers?.checked;
if (!usingDiffusers) {
console.warn('Diffusers is disabled - not adding a prompt help button');
return;
}
const helpButton = createElement(
'a',
{
href: 'https://invoke-ai.github.io/InvokeAI/features/PROMPTS/#prompt-syntax-features',
target: '_blank',
style: 'margin-left: 0.25em',
},
undefined,
createElement(
'i',
undefined,
['fa-solid', 'fa-circle-question', 'help-btn'],
createElement(
'span',
undefined,
['simple-tooltip', 'top-right'],
'Click to learn about diffusers prompt syntax',
),
),
);
const promptLabel = document.querySelector('label[for="prompt"]');
promptLabel.appendChild(helpButton);
})();