Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
S
stable-diffusion-webui
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
stable-diffusion-webui
Commits
e4e0918f
Commit
e4e0918f
authored
Jan 21, 2023
by
AUTOMATIC
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove timestamp for js files, reformat code
parent
7c8852b8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
26 deletions
+8
-26
ui.py
modules/ui.py
+8
-26
No files found.
modules/ui.py
View file @
e4e0918f
...
...
@@ -1918,38 +1918,20 @@ def create_ui():
def
reload_javascript
():
scripts_list
=
modules
.
scripts
.
list_scripts
(
"javascript"
,
".js"
)
js_files
=
[]
for
basedir
,
filename
,
path
in
scripts_list
:
path
=
path
[
len
(
script_path
)
+
1
:]
js_files
.
append
(
path
)
head
=
f
'<script type="text/javascript" src="file={os.path.abspath("script.js")}"></script>
\n
'
inline
=
[
f
"{localization.localization_js(shared.opts.localization)};"
]
inline
=
f
"{localization.localization_js(shared.opts.localization)};"
if
cmd_opts
.
theme
is
not
None
:
inline
.
append
(
f
"set_theme('{cmd_opts.theme}');"
,
)
inline
+=
f
"set_theme('{cmd_opts.theme}');"
t
=
int
(
time
.
time
())
head
=
[
f
"""
<script type="text/javascript" src="file=./script.js?{t}"></script>
"""
.
strip
()
]
inline_code
=
"
\n
"
.
join
(
inline
)
head
.
append
(
f
"""
<script type="text/javascript">
{inline_code}
</script>
"""
.
strip
())
for
file
in
js_files
:
head
.
append
(
f
"""
<script type="text/javascript" src="file={file}?{t}"></script>
"""
.
strip
())
head
+=
f
'<script type="text/javascript">{inline}</script>
\n
'
for
script
in
modules
.
scripts
.
list_scripts
(
"javascript"
,
".js"
):
head
+=
f
'<script type="text/javascript" src="file={script.path}"></script>
\n
'
def
template_response
(
*
args
,
**
kwargs
):
res
=
shared
.
GradioTemplateResponseOriginal
(
*
args
,
**
kwargs
)
head_inject
=
"
\n
"
.
join
(
head
)
res
.
body
=
res
.
body
.
replace
(
b
'</head>'
,
f
'{head_inject}</head>'
.
encode
(
"utf8"
))
res
.
body
=
res
.
body
.
replace
(
b
'</head>'
,
f
'{head}</head>'
.
encode
(
"utf8"
))
res
.
init_headers
()
return
res
...
...
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