Skip to content

Commit

Permalink
Merge pull request #583 from GrosPoulet/master
Browse files Browse the repository at this point in the history
New plug-in : meetup
  • Loading branch information
GrosPoulet authored Sep 5, 2020
2 parents 49f0c9f + 98ad9a5 commit 04678d9
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
4 changes: 4 additions & 0 deletions manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -1409,6 +1409,10 @@
"js": ["plugins/lostfilmtv.js"],
"matches": ["*://*.lostfilm.tv/*",
"*://*.lostfilm.run/*"]
},
{
"js": ["plugins/meetup.js"],
"matches": ["*://*.meetup.com/*"]
}
]
}
38 changes: 38 additions & 0 deletions plugins/meetup.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
var hoverZoomPlugins = hoverZoomPlugins || [];
hoverZoomPlugins.push({
name:'meetup.com',
version:'1.0',
prepareImgLinks:function (callback) {

var res = [];

hoverZoom.urlReplace(res,
'img[src]',
/(.*)\/(.*)_/,
'$1/highres_'
);

$('[style*=background]').each(function() {
// extract url from style
var backgroundImage = this.style.backgroundImage;
if (backgroundImage.indexOf("url") != -1) {
var reUrl = /.*url\s*\(\s*(.*)\s*\).*/i
backgroundImage = backgroundImage.replace(reUrl, '$1');
// remove leading & trailing quotes
var backgroundImageUrl = backgroundImage.replace(/^['"]/,"").replace(/['"]+$/,"");
var reThumb = /(.*)\/(.*)_/
var fullsizeUrl = backgroundImageUrl.replace(reThumb, '$1/highres_');
if (fullsizeUrl != backgroundImageUrl) {
var link = $(this);
if (link.data().hoverZoomSrc == undefined) { link.data().hoverZoomSrc = [] }
if (link.data().hoverZoomSrc.indexOf(fullsizeUrl) == -1) {
link.data().hoverZoomSrc.unshift(fullsizeUrl);
res.push(link);
}
}
}
});

callback($(res), this.name);
}
});

0 comments on commit 04678d9

Please sign in to comment.