Skip to content

Commit

Permalink
Merge pull request #557 from GrosPoulet/master
Browse files Browse the repository at this point in the history
New plug-in : PublicDomainPictures
  • Loading branch information
GrosPoulet authored Aug 29, 2020
2 parents 17d6df9 + f4d08c4 commit 2155d1e
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
4 changes: 4 additions & 0 deletions manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -1347,6 +1347,10 @@
{
"js": ["plugins/booking.js"],
"matches": ["*://*.booking.com/*"]
},
{
"js": ["plugins/publicdomainpictures.js"],
"matches": ["*://*.publicdomainpictures.net/*"]
}
]
}
26 changes: 26 additions & 0 deletions plugins/publicdomainpictures.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
var hoverZoomPlugins = hoverZoomPlugins || [];
hoverZoomPlugins.push({
name:'PublicDomainPictures',
version:'0.1',
prepareImgLinks:function (callback) {
var res = [];

//sample url : https://publicdomainpictures.net/pictures/370000/t2/view-of-cab-of-old-steam-locomotive.jpg
// -> https://publicdomainpictures.net/pictures/370000/velka/view-of-cab-of-old-steam-locomotive.jpg
hoverZoom.urlReplace(res,
'img[src]',
'/t2/',
'/velka/'
);

//sample url : https://as2.ftcdn.net/jpg/02/77/29/25/220_F_277292538_0QTOwR2OqMEuhyEigw0OUMg6GASxGAX7.jpg
// -> https://as2.ftcdn.net/jpg/02/77/29/25/1000_F_277292538_0QTOwR2OqMEuhyEigw0OUMg6GASxGAX7.jpg
hoverZoom.urlReplace(res,
'img[src]',
/\/\d+_F/,
'/1000_F'
);

callback($(res));
}
});

0 comments on commit 2155d1e

Please sign in to comment.