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
c4a00aff
Commit
c4a00aff
authored
Mar 19, 2024
by
AUTOMATIC1111
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use existing quote_js function for #15316
parent
522121be
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
html/extra-networks-copy-path-button.html
html/extra-networks-copy-path-button.html
+2
-2
modules/ui_extra_networks.py
modules/ui_extra_networks.py
+2
-2
No files found.
html/extra-networks-copy-path-button.html
View file @
c4a00aff
<div
class=
"copy-path-button card-button"
<div
class=
"copy-path-button card-button"
title=
"Copy path to clipboard"
title=
"Copy path to clipboard"
onclick=
"extraNetworksCopyCardPath(event, '{filename}')"
onclick=
'extraNetworksCopyCardPath(event, {filename})'
data-clipboard-text=
"{filename}"
>
data-clipboard-text=
{filename}
>
</div>
</div>
\ No newline at end of file
modules/ui_extra_networks.py
View file @
c4a00aff
...
@@ -10,7 +10,6 @@ from modules.images import read_info_from_image, save_image_with_geninfo
...
@@ -10,7 +10,6 @@ from modules.images import read_info_from_image, save_image_with_geninfo
import
gradio
as
gr
import
gradio
as
gr
import
json
import
json
import
html
import
html
import
re
from
fastapi.exceptions
import
HTTPException
from
fastapi.exceptions
import
HTTPException
from
modules.infotext_utils
import
image_from_url_text
from
modules.infotext_utils
import
image_from_url_text
...
@@ -152,6 +151,7 @@ def quote_js(s):
...
@@ -152,6 +151,7 @@ def quote_js(s):
s
=
s
.
replace
(
'"'
,
'
\\
"'
)
s
=
s
.
replace
(
'"'
,
'
\\
"'
)
return
f
'"{s}"'
return
f
'"{s}"'
class
ExtraNetworksPage
:
class
ExtraNetworksPage
:
def
__init__
(
self
,
title
):
def
__init__
(
self
,
title
):
self
.
title
=
title
self
.
title
=
title
...
@@ -239,7 +239,7 @@ class ExtraNetworksPage:
...
@@ -239,7 +239,7 @@ class ExtraNetworksPage:
)
)
onclick
=
html
.
escape
(
onclick
)
onclick
=
html
.
escape
(
onclick
)
btn_copy_path
=
self
.
btn_copy_path_tpl
.
format
(
**
{
"filename"
:
re
.
sub
(
r"[\\\"']"
,
r"\\\g<0>"
,
item
[
"filename"
])})
btn_copy_path
=
self
.
btn_copy_path_tpl
.
format
(
**
{
"filename"
:
quote_js
(
item
[
"filename"
])})
btn_metadata
=
""
btn_metadata
=
""
metadata
=
item
.
get
(
"metadata"
)
metadata
=
item
.
get
(
"metadata"
)
if
metadata
:
if
metadata
:
...
...
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