-
Notifications
You must be signed in to change notification settings - Fork 178
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #789 from GrosPoulet/master
New plug-ins
- Loading branch information
Showing
4 changed files
with
117 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
var hoverZoomPlugins = hoverZoomPlugins || []; | ||
hoverZoomPlugins.push({ | ||
name:'catawiki', | ||
version:'0.1', | ||
prepareImgLinks:function (callback) { | ||
var res = []; | ||
|
||
// sample: https://cdn.catawiki.net/image/pr:cw_crop/w:98/h:76/sh:0.7/plain/assets/catawiki/assets/2021/5/15/6/9/6/696de2d5-5a9b-4a3d-9639-e878b25d418f.jpg | ||
// original: https://assets.catawiki.nl/assets/2021/5/15/6/9/6/696de2d5-5a9b-4a3d-9639-e878b25d418f.jpg | ||
hoverZoom.urlReplace(res, | ||
'img[src],[style*="url"]', | ||
/(.*catawiki\/assets\/)(.*$)/, | ||
'https://assets.catawiki.nl/assets/$2' | ||
); | ||
|
||
// sample: https://assets.catawiki.nl/assets/2021/8/15/c/8/8/thumb5_c88fbb66-7096-4612-9756-1f6a7f935581.jpg | ||
// original: https://assets.catawiki.nl/assets/2021/8/15/c/8/8/c88fbb66-7096-4612-9756-1f6a7f935581.jpg | ||
hoverZoom.urlReplace(res, | ||
'img[src],[style*="url"]', | ||
/\/thumb.*?_/, | ||
'/' | ||
); | ||
|
||
if (res.length) { | ||
callback($(res), this.name); | ||
} | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
var hoverZoomPlugins = hoverZoomPlugins || []; | ||
hoverZoomPlugins.push({ | ||
name:'themoviedb', | ||
version:'0.1', | ||
prepareImgLinks:function (callback) { | ||
var res = []; | ||
|
||
// sample: https://www.themoviedb.org/t/p/w276_and_h350_face/q0QXFRg5bSnaLjbvhamfclt0eId.jpg | ||
// original: https://www.themoviedb.org/t/p/original/q0QXFRg5bSnaLjbvhamfclt0eId.jpg | ||
hoverZoom.urlReplace(res, | ||
'img[src]', | ||
/\/p\/.*\//, | ||
'/p/original/' | ||
); | ||
|
||
if (res.length) { | ||
callback($(res), this.name); | ||
} | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
var hoverZoomPlugins = hoverZoomPlugins || []; | ||
hoverZoomPlugins.push({ | ||
name:'twibooru', | ||
version:'0.1', | ||
prepareImgLinks:function (callback) { | ||
var res = []; | ||
|
||
// use data-uris attribute when available | ||
$('[data-uris]').each(function () { | ||
var _this = $(this); | ||
var fullsrc = _this.data().uris.full; | ||
if (fullsrc == undefined) return; | ||
var img = _this.find('img'); | ||
if (img.data().hoverZoomSrc == undefined) img.data().hoverZoomSrc = [fullsrc]; | ||
else if (img.data().hoverZoomSrc.indexOf(fullsrc) == -1) img.data().hoverZoomSrc.unshift(fullsrc); | ||
res.push(img); | ||
}); | ||
|
||
/* | ||
// sample: https://cdn.twibooru.org/img/2021/8/4/2516087/thumb.webp | ||
// original: https://cdn.twibooru.org/img/2021/8/4/2516087/full.png | ||
hoverZoom.urlReplace(res, | ||
'img[src]', | ||
/\/(thumb_tiny|thumb_small|thumb|small|medium|large|tall)(\.)(jpeg|png|webp)/, | ||
'/full.png' | ||
); | ||
hoverZoom.urlReplace(res, | ||
'img[src]', | ||
/\/(thumb_tiny|thumb_small|thumb|small|medium|large|tall)(\.)(jpeg|png|webp)/, | ||
'/full.jpeg' | ||
); | ||
// sample: https://cdn.twibooru.org/img/2021/7/18/2503661/thumb.gif | ||
// original: https://cdn.twibooru.org/img/2021/7/18/2503661/full.webm | ||
hoverZoom.urlReplace(res, | ||
'img[src]', | ||
/\/(thumb_tiny|thumb_small|thumb|small|medium|large|tall)(\.)(gif|webm)/, | ||
'/full.gif' | ||
); | ||
hoverZoom.urlReplace(res, | ||
'img[src]', | ||
/\/(thumb_tiny|thumb_small|thumb|small|medium|large|tall)(\.)(gif|webm)/, | ||
'/full.webm' | ||
); | ||
*/ | ||
|
||
if (res.length) { | ||
callback($(res), this.name); | ||
} | ||
} | ||
}); |