Skip to content

Commit

Permalink
Merge pull request #988 from GrosPoulet/master
Browse files Browse the repository at this point in the history
New plug-in for: eksisozluk.com (#986)
  • Loading branch information
GrosPoulet authored Jul 29, 2022
2 parents b067fae + b857c4c commit 2793c66
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
4 changes: 4 additions & 0 deletions manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -1818,6 +1818,10 @@
{
"js": ["plugins/unlimphotos.js"],
"matches": ["*://*.unlimphotos.com/*"]
},
{
"js": ["plugins/eksisozluk.js"],
"matches": ["*://*.eksisozluk.com/*"]
}
]
}
31 changes: 31 additions & 0 deletions plugins/eksisozluk.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
var hoverZoomPlugins = hoverZoomPlugins || [];
hoverZoomPlugins.push( {
name: 'eksisozluk',
version: '1.0',
prepareImgLinks: function(callback) {
var res = [];

// page hosting link to img: https://eksisozluk.com/entry/140581590
// link to img: https://soz.lk/i/3jadcz74
// fullsize img: https://cdn.eksisozluk.com/2022/7/28/3/3jadcz74.jpg
$('a[href*="/soz.lk/"]:not(.hoverZoomMouseover)').addClass('hoverZoomMouseover').one('mouseover', function() {

var link = undefined;
var href = undefined;

href = this.href;
link = $(this);

// clean previous result
link.data().hoverZoomSrc = [];
hoverZoom.prepareFromDocument($(this), this.href, function(doc) {

let img = doc.querySelector('img');
if (img) return img.src;

}, false); // get source sync
});

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

0 comments on commit 2793c66

Please sign in to comment.