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
f6a40a2f
Commit
f6a40a2f
authored
Apr 30, 2023
by
Aarni Koskela
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix unused variables
parent
8ccc2712
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
14 additions
and
21 deletions
+14
-21
javascript/aspectRatioOverlay.js
javascript/aspectRatioOverlay.js
+3
-8
javascript/contextMenus.js
javascript/contextMenus.js
+2
-2
javascript/extensions.js
javascript/extensions.js
+2
-2
javascript/extraNetworks.js
javascript/extraNetworks.js
+2
-2
javascript/imageMaskFix.js
javascript/imageMaskFix.js
+0
-1
javascript/imageParams.js
javascript/imageParams.js
+0
-1
javascript/notification.js
javascript/notification.js
+1
-1
javascript/progressbar.js
javascript/progressbar.js
+2
-2
javascript/ui.js
javascript/ui.js
+2
-2
No files found.
javascript/aspectRatioOverlay.js
View file @
f6a40a2f
...
@@ -55,19 +55,14 @@ function dimensionChange(e, is_width, is_height){
...
@@ -55,19 +55,14 @@ function dimensionChange(e, is_width, is_height){
var
cleintRectCentreY
=
cleintRectTop
+
(
targetElement
.
clientHeight
/
2
)
var
cleintRectCentreY
=
cleintRectTop
+
(
targetElement
.
clientHeight
/
2
)
var
cleintRectCentreX
=
cleintRectLeft
+
(
targetElement
.
clientWidth
/
2
)
var
cleintRectCentreX
=
cleintRectLeft
+
(
targetElement
.
clientWidth
/
2
)
var
viewRectTop
=
cleintRectCentreY
-
(
scaledy
/
2
)
// TODO: unused?
var
arscale
=
Math
.
min
(
scaledx
/
currentWidth
,
scaledy
/
currentHeight
)
var
viewRectLeft
=
cleintRectCentreX
-
(
scaledx
/
2
)
// TODO: unused?
var
arRectWidth
=
scaledx
var
arRectHeight
=
scaledy
var
arscale
=
Math
.
min
(
arRectWidth
/
currentWidth
,
arRectHeight
/
currentHeight
)
var
arscaledx
=
currentWidth
*
arscale
var
arscaledx
=
currentWidth
*
arscale
var
arscaledy
=
currentHeight
*
arscale
var
arscaledy
=
currentHeight
*
arscale
var
arRectTop
=
cleintRectCentreY
-
(
arscaledy
/
2
)
var
arRectTop
=
cleintRectCentreY
-
(
arscaledy
/
2
)
var
arRectLeft
=
cleintRectCentreX
-
(
arscaledx
/
2
)
var
arRectLeft
=
cleintRectCentreX
-
(
arscaledx
/
2
)
arRectWidth
=
arscaledx
var
arRectWidth
=
arscaledx
arRectHeight
=
arscaledy
var
arRectHeight
=
arscaledy
arPreviewRect
.
style
.
top
=
arRectTop
+
'
px
'
;
arPreviewRect
.
style
.
top
=
arRectTop
+
'
px
'
;
arPreviewRect
.
style
.
left
=
arRectLeft
+
'
px
'
;
arPreviewRect
.
style
.
left
=
arRectLeft
+
'
px
'
;
...
...
javascript/contextMenus.js
View file @
f6a40a2f
...
@@ -35,7 +35,7 @@ contextMenuInit = function(){
...
@@ -35,7 +35,7 @@ contextMenuInit = function(){
menuEntries
.
forEach
(
function
(
entry
){
menuEntries
.
forEach
(
function
(
entry
){
let
contextMenuEntry
=
document
.
createElement
(
'
a
'
)
let
contextMenuEntry
=
document
.
createElement
(
'
a
'
)
contextMenuEntry
.
innerHTML
=
entry
[
'
name
'
]
contextMenuEntry
.
innerHTML
=
entry
[
'
name
'
]
contextMenuEntry
.
addEventListener
(
"
click
"
,
function
(
e
)
{
contextMenuEntry
.
addEventListener
(
"
click
"
,
function
()
{
entry
[
'
func
'
]();
entry
[
'
func
'
]();
})
})
contextMenuList
.
append
(
contextMenuEntry
);
contextMenuList
.
append
(
contextMenuEntry
);
...
@@ -78,7 +78,7 @@ contextMenuInit = function(){
...
@@ -78,7 +78,7 @@ contextMenuInit = function(){
}
}
function
removeContextMenuOption
(
uid
){
function
removeContextMenuOption
(
uid
){
menuSpecs
.
forEach
(
function
(
v
,
k
)
{
menuSpecs
.
forEach
(
function
(
v
)
{
let
index
=
-
1
let
index
=
-
1
v
.
forEach
(
function
(
e
,
ei
){
if
(
e
[
'
id
'
]
==
uid
){
index
=
ei
}})
v
.
forEach
(
function
(
e
,
ei
){
if
(
e
[
'
id
'
]
==
uid
){
index
=
ei
}})
if
(
index
>=
0
){
if
(
index
>=
0
){
...
...
javascript/extensions.js
View file @
f6a40a2f
function
extensions_apply
(
_
,
_
,
disable_all
){
function
extensions_apply
(
_
disabled_list
,
_update_list
,
disable_all
){
var
disable
=
[]
var
disable
=
[]
var
update
=
[]
var
update
=
[]
...
@@ -16,7 +16,7 @@ function extensions_apply(_, _, disable_all){
...
@@ -16,7 +16,7 @@ function extensions_apply(_, _, disable_all){
return
[
JSON
.
stringify
(
disable
),
JSON
.
stringify
(
update
),
disable_all
]
return
[
JSON
.
stringify
(
disable
),
JSON
.
stringify
(
update
),
disable_all
]
}
}
function
extensions_check
(
_
,
_
){
function
extensions_check
(){
var
disable
=
[]
var
disable
=
[]
gradioApp
().
querySelectorAll
(
'
#extensions input[type="checkbox"]
'
).
forEach
(
function
(
x
){
gradioApp
().
querySelectorAll
(
'
#extensions input[type="checkbox"]
'
).
forEach
(
function
(
x
){
...
...
javascript/extraNetworks.js
View file @
f6a40a2f
...
@@ -10,7 +10,7 @@ function setupExtraNetworksForTab(tabname){
...
@@ -10,7 +10,7 @@ function setupExtraNetworksForTab(tabname){
tabs
.
appendChild
(
search
)
tabs
.
appendChild
(
search
)
tabs
.
appendChild
(
refresh
)
tabs
.
appendChild
(
refresh
)
search
.
addEventListener
(
"
input
"
,
function
(
evt
){
search
.
addEventListener
(
"
input
"
,
function
(){
var
searchTerm
=
search
.
value
.
toLowerCase
()
var
searchTerm
=
search
.
value
.
toLowerCase
()
gradioApp
().
querySelectorAll
(
'
#
'
+
tabname
+
'
_extra_tabs div.card
'
).
forEach
(
function
(
elem
){
gradioApp
().
querySelectorAll
(
'
#
'
+
tabname
+
'
_extra_tabs div.card
'
).
forEach
(
function
(
elem
){
...
@@ -55,7 +55,7 @@ function tryToRemoveExtraNetworkFromPrompt(textarea, text){
...
@@ -55,7 +55,7 @@ function tryToRemoveExtraNetworkFromPrompt(textarea, text){
var
partToSearch
=
m
[
1
]
var
partToSearch
=
m
[
1
]
var
replaced
=
false
var
replaced
=
false
var
newTextareaText
=
textarea
.
value
.
replaceAll
(
re_extranet_g
,
function
(
found
,
index
){
var
newTextareaText
=
textarea
.
value
.
replaceAll
(
re_extranet_g
,
function
(
found
){
m
=
found
.
match
(
re_extranet
);
m
=
found
.
match
(
re_extranet
);
if
(
m
[
1
]
==
partToSearch
){
if
(
m
[
1
]
==
partToSearch
){
replaced
=
true
;
replaced
=
true
;
...
...
javascript/imageMaskFix.js
View file @
f6a40a2f
...
@@ -23,7 +23,6 @@ function imageMaskResize() {
...
@@ -23,7 +23,6 @@ function imageMaskResize() {
const
nw
=
previewImage
.
naturalWidth
;
const
nw
=
previewImage
.
naturalWidth
;
const
nh
=
previewImage
.
naturalHeight
;
const
nh
=
previewImage
.
naturalHeight
;
const
portrait
=
nh
>
nw
;
const
portrait
=
nh
>
nw
;
const
factor
=
portrait
;
const
wW
=
Math
.
min
(
w
,
portrait
?
h
/
nh
*
nw
:
w
/
nw
*
nw
);
const
wW
=
Math
.
min
(
w
,
portrait
?
h
/
nh
*
nw
:
w
/
nw
*
nw
);
const
wH
=
Math
.
min
(
h
,
portrait
?
h
/
nh
*
nh
:
w
/
nw
*
nh
);
const
wH
=
Math
.
min
(
h
,
portrait
?
h
/
nh
*
nh
:
w
/
nw
*
nh
);
...
...
javascript/imageParams.js
View file @
f6a40a2f
window
.
onload
=
(
function
(){
window
.
onload
=
(
function
(){
window
.
addEventListener
(
'
drop
'
,
e
=>
{
window
.
addEventListener
(
'
drop
'
,
e
=>
{
const
target
=
e
.
composedPath
()[
0
];
const
target
=
e
.
composedPath
()[
0
];
const
idx
=
selected_gallery_index
();
if
(
target
.
placeholder
.
indexOf
(
"
Prompt
"
)
==
-
1
)
return
;
if
(
target
.
placeholder
.
indexOf
(
"
Prompt
"
)
==
-
1
)
return
;
let
prompt_target
=
get_tab_index
(
'
tabs
'
)
==
1
?
"
img2img_prompt_image
"
:
"
txt2img_prompt_image
"
;
let
prompt_target
=
get_tab_index
(
'
tabs
'
)
==
1
?
"
img2img_prompt_image
"
:
"
txt2img_prompt_image
"
;
...
...
javascript/notification.js
View file @
f6a40a2f
...
@@ -9,7 +9,7 @@ onUiUpdate(function(){
...
@@ -9,7 +9,7 @@ onUiUpdate(function(){
notificationButton
=
gradioApp
().
getElementById
(
'
request_notifications
'
)
notificationButton
=
gradioApp
().
getElementById
(
'
request_notifications
'
)
if
(
notificationButton
!=
null
){
if
(
notificationButton
!=
null
){
notificationButton
.
addEventListener
(
'
click
'
,
function
(
evt
)
{
notificationButton
.
addEventListener
(
'
click
'
,
()
=>
{
Notification
.
requestPermission
();
Notification
.
requestPermission
();
},
true
);
},
true
);
}
}
...
...
javascript/progressbar.js
View file @
f6a40a2f
// code related to showing and updating progressbar shown as the image is being made
// code related to showing and updating progressbar shown as the image is being made
function
rememberGallerySelection
(
id_gallery
){
function
rememberGallerySelection
(){
}
}
function
getGallerySelectedIndex
(
id_gallery
){
function
getGallerySelectedIndex
(){
}
}
...
...
javascript/ui.js
View file @
f6a40a2f
...
@@ -207,7 +207,7 @@ function submit_img2img(){
...
@@ -207,7 +207,7 @@ function submit_img2img(){
return
res
return
res
}
}
function
restoreProgressTxt2img
(
x
){
function
restoreProgressTxt2img
(){
var
id
=
localStorage
.
getItem
(
"
txt2img_task_id
"
)
var
id
=
localStorage
.
getItem
(
"
txt2img_task_id
"
)
if
(
id
)
{
if
(
id
)
{
...
@@ -218,7 +218,7 @@ function restoreProgressTxt2img(x){
...
@@ -218,7 +218,7 @@ function restoreProgressTxt2img(x){
return
[
id
]
return
[
id
]
}
}
function
restoreProgressImg2img
(
x
){
function
restoreProgressImg2img
(){
var
id
=
localStorage
.
getItem
(
"
img2img_task_id
"
)
var
id
=
localStorage
.
getItem
(
"
img2img_task_id
"
)
if
(
id
)
{
if
(
id
)
{
...
...
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