Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
S
Stable Diffusion Webui
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
novelai-storage
Stable Diffusion Webui
Commits
216b0fa6
Commit
216b0fa6
authored
May 17, 2023
by
AUTOMATIC
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
when adding tooltips, do not scan whole document and instead only scan added elements
parent
3c81d184
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
23 deletions
+40
-23
javascript/hints.js
javascript/hints.js
+40
-23
No files found.
javascript/hints.js
View file @
216b0fa6
...
...
@@ -115,36 +115,53 @@ titles = {
"
Negative Guidance minimum sigma
"
:
"
Skip negative prompt for steps where image is already mostly denoised; the higher this value, the more skips there will be; provides increased performance in exchange for minor quality reduction.
"
}
function
updateTooltipForSpan
(
span
){
if
(
span
.
title
)
return
;
// already has a title
onUiUpdate
(
function
(){
gradioApp
().
querySelectorAll
(
'
span, button, select, p
'
).
forEach
(
function
(
span
){
if
(
span
.
title
)
return
;
// already has a title
let
tooltip
=
localization
[
titles
[
span
.
textContent
]]
||
titles
[
span
.
textContent
];
let
tooltip
=
localization
[
titles
[
span
.
textContent
]]
||
titles
[
span
.
textContent
];
if
(
!
tooltip
){
tooltip
=
localization
[
titles
[
span
.
value
]]
||
titles
[
span
.
value
];
}
tooltip
=
localization
[
titles
[
span
.
value
]]
||
titles
[
span
.
value
];
}
if
(
!
tooltip
){
for
(
const
c
of
span
.
classList
)
{
if
(
c
in
titles
)
{
tooltip
=
localization
[
titles
[
c
]]
||
titles
[
c
];
break
;
}
if
(
!
tooltip
){
for
(
const
c
of
span
.
classList
)
{
if
(
c
in
titles
)
{
tooltip
=
localization
[
titles
[
c
]]
||
titles
[
c
];
break
;
}
}
}
if
(
tooltip
){
span
.
title
=
tooltip
;
}
})
if
(
tooltip
){
span
.
title
=
tooltip
;
}
}
function
updateTooltipForSelect
(
select
){
if
(
select
.
onchange
!=
null
)
return
;
gradioApp
().
querySelectorAll
(
'
select
'
).
forEach
(
function
(
select
){
if
(
select
.
onchange
!=
null
)
return
;
select
.
onchange
=
function
(){
select
.
title
=
localization
[
titles
[
select
.
value
]]
||
titles
[
select
.
value
]
||
""
;
}
}
select
.
onchange
=
function
(){
select
.
title
=
localization
[
titles
[
select
.
value
]]
||
titles
[
select
.
value
]
||
""
;
}
})
observedTooltipElements
=
{
"
SPAN
"
:
1
,
"
BUTTON
"
:
1
,
"
SELECT
"
:
1
,
"
P
"
:
1
}
onUiUpdate
(
function
(
m
){
m
.
forEach
(
function
(
record
){
record
.
addedNodes
.
forEach
(
function
(
node
){
if
(
observedTooltipElements
[
node
.
tagName
]){
updateTooltipForSpan
(
node
)
}
if
(
node
.
tagName
==
"
SELECT
"
){
updateTooltipForSelect
(
node
)
}
if
(
node
.
querySelectorAll
){
node
.
querySelectorAll
(
'
span, button, select, p
'
).
forEach
(
updateTooltipForSpan
)
node
.
querySelectorAll
(
'
select
'
).
forEach
(
updateTooltipForSelect
)
}
})
})
})
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment