Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Romain Courteaud
erp5
Commits
047bdb8b
Commit
047bdb8b
authored
Sep 23, 2022
by
Romain Courteaud
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_web_js_style: WIP rewrite IMG tag on the fly to reduce image size
parent
030a7c37
Pipeline
#23724
failed with stage
in 0 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
0 deletions
+16
-0
bt5/erp5_web_js_style/SkinTemplateItem/portal_skins/erp5_web_js_style_ui/jsstyle.js.js
...plateItem/portal_skins/erp5_web_js_style_ui/jsstyle.js.js
+16
-0
No files found.
bt5/erp5_web_js_style/SkinTemplateItem/portal_skins/erp5_web_js_style_ui/jsstyle.js.js
View file @
047bdb8b
...
...
@@ -230,6 +230,22 @@
url_attribute
,
feed_url
=
null
;
// Improve img rendering by default to reduce size
element_list
=
body_element
.
querySelectorAll
(
'
img
'
);
for
(
i
=
0
;
i
<
element_list
.
length
;
i
+=
1
)
{
element
=
element_list
[
i
];
if
(
!
element
.
getAttribute
(
'
loading
'
))
{
element
.
setAttribute
(
'
loading
'
,
'
lazy
'
);
}
feed_url
=
element
.
getAttribute
(
'
src
'
);
if
((
feed_url
)
&&
(
feed_url
.
indexOf
(
'
/
'
)
===
-
1
))
{
feed_url
=
feed_url
.
split
(
'
?
'
)[
0
]
+
'
?format=jpg&display=small&quality=90
'
;
element
.
setAttribute
(
'
src
'
,
feed_url
);
}
}
if
(
base_uri
!==
undefined
)
{
// Rewrite relative url (copied from renderjs)
for
(
j
=
0
;
j
<
url_attribute_list
.
length
;
j
+=
1
)
{
...
...
Romain Courteaud
@romain
mentioned in commit
1cd405e4
·
Oct 03, 2022
mentioned in commit
1cd405e4
mentioned in commit 1cd405e4e94ff5a9e64e8d6fee51e921fc21a6b9
Toggle commit list
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