Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
yohobuywap-node
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
郭成尧
8 years ago
Commit
16c20ed5257f07598e92eada74bcd27e4f36e688
1 parent
5646dd28
query
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
public/js/plugin/lazyload.js
public/js/plugin/lazyload.js
View file @
16c20ed
...
...
@@ -28,7 +28,7 @@ const imgSrcHandle = (imgUrl, params) => {
}
imgUrl
=
url
;
}
else
if
(
/imageView2/
.
test
(
query
))
{
if
(
!
/
\/
q
\/\d
+/
.
test
(
imgUrl
))
{
if
(
!
/
\/
q
\/\d
+/
.
test
(
query
))
{
imgUrl
+=
`
/
q
/
$
{
params
.
q
}
`
;
}
else
{
imgUrl
=
imgUrl
.
replace
(
/
\/
q
\/\d
+/g
,
'/q/'
+
params
.
q
);
...
...
@@ -42,13 +42,13 @@ const imgSrcHandle = (imgUrl, params) => {
imgUrl
=
imgUrl
.
replace
(
/format
\/
png/i
,
'format/webp'
).
replace
(
/format
\/
jpg/i
,
'format/webp'
);
}
}
else
if
(
/imageMogr2/
.
test
(
query
))
{
if
(
!
/
\/
quality
\/\d
+/
.
test
(
imgUrl
))
{
if
(
!
/
\/
quality
\/\d
+/
.
test
(
query
))
{
imgUrl
+=
`
/
quality
/
$
{
params
.
q
}
`
;
}
else
{
imgUrl
=
imgUrl
.
replace
(
/
\/
quality
\/\d
+/g
,
'/quality/'
+
params
.
q
);
}
if
(
window
.
supportWebp
&&
!
/format
\/
/
.
test
(
imgUrl
))
{
if
(
window
.
supportWebp
&&
!
/format
\/
/
.
test
(
query
))
{
imgUrl
+=
'/format/webp'
;
}
...
...
Please
register
or
login
to post a comment