Skip to content

Commit

Permalink
Merge pull request #1045 from GrosPoulet/master
Browse files Browse the repository at this point in the history
Follow-up to HomeExchange plug-in (#1043)
  • Loading branch information
GrosPoulet authored Oct 8, 2022
2 parents ee5ed57 + 4c023ce commit 51138b8
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 30 deletions.
32 changes: 16 additions & 16 deletions _locales/hu/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@
"description": "[options] Zoom videos option"
},
"optZoomVideosTooltip": {
"message": "Támogatott formátumok: m4v mkv mp4 ogv webm",
"message": "Támogatott formátumok: 3gpp m4v mkv mp4 ogv webm",
"description": "[options] Tooltip for zoom videos option"
},
"optVideoPositionStep": {
Expand Down Expand Up @@ -268,7 +268,7 @@
"description": "[options] Play audio option"
},
"optPlayAudioTooltip": {
"message": "Támogatott formátumok: Oga ogg opus wav",
"message": "Támogatott formátumok: flac m4a mp3 oga ogg opus wav",
"description": "[options] Tooltip for play audio option"
},
"optAudioVolume": {
Expand Down Expand Up @@ -436,23 +436,23 @@
"description": "[options] Page section for advanced options"
},
"optEnableDownloads": {
"message": "Képek letöltésének engedélyezése akcióbillentyűvel",
"message": "Képek letöltésének engedélyezése műveletbillentyűvel",
"description": "[options] Grant browser permission to allow file downloading using an action key"
},
"optAddToHistory": {
"message": "Megtekintett képek hozzáadása a böngészési előzményekhez",
"description": "[options] Add viewed pictures to the browser's history option"
},
"optAllowHeadersRewriteTooltip": {
"message": "Hasznos, ha az egyik webhelyről származó tartalmakat, például videókat, nagyítani és lejátszani lehet egy másik webhelyen.",
"message": "Hasznos egyik weboldalról származó tartalom (pl. videók) másik weboldalon történő lejátszásához, illetve nagyításához",
"description": "[options] Tooltip for allow rewrite of headers for HTTP(S) request or response option"
},
"optAllowHeadersRewrite": {
"message": "A HTTP(S) kérés vagy válasz fejlécek átírásának engedélyezése",
"description": "[options] Allow rewrite of headers for HTTP(S) request or response option"
},
"optFilterNSFW": {
"message": "NSFW képek kizárása (csak a Redditben)",
"message": "NSFW képek kizárása (csak a Redditen)",
"description": "[options] Exclude NSFW images (Reddit only) option"
},
"optAlwaysPreload": {
Expand All @@ -464,7 +464,7 @@
"description": "[options] Enable albums support option"
},
"optEnableNoFocusMsg": {
"message": "Műveleti billentyűk fókuszának engedélyezése overlay üzenet",
"message": "Műveleti billentyűk fókuszfedvény-üzenet engedélyezése",
"description": "[options] Enable Action Keys focus overlay message option"
},
"optEnableNoFocusMsgTooltip": {
Expand Down Expand Up @@ -588,43 +588,43 @@
"description": "[options] FAQ Question 1"
},
"optFAQ_A1_1": {
"message": "A kiadás után kattintson a \"Mentés\" gombra",
"message": "Szerkesztés után kattintson a \"Mentés\" gombra",
"description": "[options] FAQ Answer 1 part 1"
},
"optFAQ_A1_2": {
"message": "az Opciók oldal alján",
"message": "a Beállítások oldal alján",
"description": "[options] FAQ Answer 1 part 2"
},
"optFAQ_A1_3": {
"message": "Az oldal újratöltése (F5)",
"message": "Töltsd újra az oldalt (F5 billentyű)",
"description": "[options] FAQ Answer 1 part 3"
},
"optFAQ_Q2": {
"message": "Szeretném elrejteni az egérkurzort a nagyított képen vagy videón.",
"description": "[options] FAQ Question 2"
},
"optFAQ_A2_1": {
"message": "A Beállítások -> Általános -> Késleltetések menüpontban aktiválja az \"Egérkurzor elrejtése\" opciót.",
"message": "A Beállítások -> Általános -> Késleltetések menüpontban aktiváld az \"Egérkurzor elrejtése\" opciót.",
"description": "[options] FAQ Answer 2 part 1"
},
"optFAQ_SaveAndReload": {
"message": "Mentse és töltse újra az oldalt (F5)",
"description": "[options] FAQ Save and reload page"
},
"optFAQ_Q3": {
"message": "A HoverZoom+ csak bizonyos oldalakon legyen aktív.",
"message": "A HoverZoom+-t csak bizonyos weboldalakon szeretném aktiválni.",
"description": "[options] FAQ Question 3"
},
"optFAQ_A3_1": {
"message": "Például a HoverZoom+ aktiválásához a DeviantArt.com és az 1X.com oldalon:",
"message": "Példa - a HoverZoom+ engedélyezése csak a DeviantArt.com és az 1X.com weboldalakon:",
"description": "[options] FAQ Answer 3 part 1"
},
"optFAQ_A3_2": {
"message": "A Beállítások -> Oldalak menüpontban aktiválja a \"Whitelist módot\".",
"message": "A Beállítások -> Oldalak menüpontban aktiváld a \"Fehérlista mód\" opciót",
"description": "[options] FAQ Answer 3 part 2"
},
"optFAQ_A3_3": {
"message": "DeviantArt.com & 1X.com hozzáadása az URL-ek listájához (nem nagy- és kisbetű-érzékeny)",
"message": "Add hozzá a DeviantArt.com-t és az 1X.com-t az URL-ek listájához (nem nagy- és kisbetű-érzékeny)",
"description": "[options] FAQ Answer 3 part 3"
},
"optFAQ_Q4": {
Expand All @@ -640,7 +640,7 @@
"description": "[options] FAQ Answer 4 part 2"
},
"optFAQ_Q5": {
"message": "Az akcióbillentyűk nem működnek!",
"message": "A műveletbillentyűk nem működnek!",
"description": "[options] FAQ Question 5"
},
"optFAQ_A5_1": {
Expand Down Expand Up @@ -811,4 +811,4 @@
"message": "kattintson bárhová az oldalon az akcióbillentyűk aktiválásához",
"description": "Action keys are active only if page is focused"
}
}
}
37 changes: 23 additions & 14 deletions plugins/homeexchange.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
var hoverZoomPlugins = hoverZoomPlugins || [];
hoverZoomPlugins.push({
name: 'homeexchange',
version: '0.1',
version: '0.2',
prepareImgLinks: (callback) => {
let res = [];
const re = /\?.[^"]*/;
const patch = '?quality=100&height=1080&width=1080';

// Example URLs:
// https://image.homeexchange.fr/images/home/3694222/1887472/1698493326865718.jpg?quality=80&keep-ratio=true
Expand All @@ -12,32 +14,39 @@ hoverZoomPlugins.push({
// https://image.homeexchange.fr/images/home/2859575/1483460/1719250638093108.jpg?quality=90&height=1100&keep-ratio=true
hoverZoom.urlReplace(
res,
'a[data-picture*="image.homeexchange"]',
/\?.[^"]*/,
'?quality=100&height=800&smart-resize=true&smart-resize=true'
'a[data-picture*="/images/home/"], a[data-picture*="/images/user/"]',
re,
patch
);

hoverZoom.urlReplace(
res,
'[data-bg*="image.homeexchange"]',
/\?.[^"]*/,
'?quality=100&height=800&smart-resize=true&smart-resize=true'
'[data-bg*="/images/home/"], [data-bg*="/images/user/"]',
re,
patch
);

hoverZoom.urlReplace(
res,
'img[src*="image.homeexchange"]',
/\?.[^"]*/,
'?quality=100&width=500&height=500&smart-resize=true&smart-resize=true'
'img[src*="/images/home/"], img[src*="/images/user/"]',
re,
patch
);

hoverZoom.urlReplace(
res,
'.user-image[style*="image.homeexchange"]',
/\?.[^"]*/,
'?quality=100&width=500&height=500&smart-resize=true&smart-resize=true'
'.user-image[style*="/images/home/"], .user-image[style*="/images/user/"]',
re,
patch
);

hoverZoom.urlReplace(
res,
'div[style*="/images/home/"], div[style*="/images/user/"]',
re,
patch
);

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

0 comments on commit 51138b8

Please sign in to comment.