Mouseover Popup Image Viewer

Shows images and videos behind links and thumbnails.

< Feedback on Mouseover Popup Image Viewer

Question/comment

§
Posted:
Edited:

fotki.yandex.ru request

I made this rule

{"r":"(img-fotki\.yandex\.ru/get/\d+/[0-9a-z]+\.[0-9a-z]+/[0-9a-z_-]+)(L|S|XS|XXS)", "s":"http://$1orig", "html":true}

for this site: http://fotki.yandex.ru/users/andrusx/?&p=3 Everything works fine for pictures in the center, but pictures for Albums (on the right) are not shown: "File can't be displayed". Paths for all these pictures are the same. Rule should also work here: http://fotki.yandex.ru/users/andrusx/map/view/recent but has no result. Need your help.

wOxxOmMod
§
Posted:
Edited:

MPIV uses case-insensitive matching so you have to add an explicit _ like this _(L|S|XS|XXS) because otherwise _XS urls endings are matched by previous [0-9a-z_-]+ and a single S from L|S|XS|XXS producing _Xorig in the url instead of _orig.

Tip: open the browser console to see MPIV error messages.

§
Posted:
Big thanks! It took me some time to understand the rule wrighting basic principles, but even after editing rule I can't get it working for all pics on http://fotki.yandex.ru/
Maybe you can suggest your rule for this site.
wOxxOmMod
§
Posted:

Seems like those photos do not have _orig images, only XXXL, so how about a combined rule that shows XXXL for all the pics?

{"r":"img\\d*-fotki\\.yandex\\.(?:ru|net)(/get/.+?/.+?/.+?_)(?:STATIC|)(.+?)_(L|S|XS|XXS)\\d*", "s":"https://img-fotki.yandex.ru$1$2_XXXL"}

§
Posted:
Yes, your rule works. I'll use it from now on.
But my idea was to show large original files.
Is it possible to combine rules for _orig and _XXXL images or get the largest image available?
wOxxOmMod
§
Posted:
Edited:

@kuehlschrank, can you add support for arrays like "s":{"imageurl-1","imageurl-2","imageurl-3"}, so that MPIV would show the first existing imageurl?

@Guillermo, if he won't be interested then I guess you can write your own js code in "s" to check url availability.

§
Posted:
That's the problem, I'm not a programmer and not familiar with JavaScript.
Without help I can't write my own code in "s".
wOxxOmMod
§
Posted:
Edited:
@Guillermo:

{"r":"img\\d*-fotki\\.yandex\\.(?:ru|net)(/get/.+?/.+?/.+?_)(?:STATIC|)(.+?)_(L|S|XS|XXS)\\d*", "s":"url='http://img-fotki.yandex.ru'+m[1]+m[2]+'_'; for(var i=0,q=['orig','XXXL','XXL','XL']; i
§
Posted:
@Guillermo:

{"r":"img\\d*-fotki\\.yandex\\.(?:ru|net)(/get/.+?/.+?/.+?_)(?:STATIC|)(.+?)_(L|S|XS|XXS)\\d*", "s":"url='http://img-fotki.yandex.ru'+m[1]+m[2]+'_'; for(var i=0,q=['orig','XXXL','XXL','XL']; i

synchronous:true is going to freeze the browser until it's finish. If there's a lot of pictures in the page, this is not going to work.
wOxxOmMod
§
Posted:
Edited:

@JixunMoe:

  1. it works on that yandex map page with more than a hundred images, actually the quantity doesn't matter
  2. of course it freezes the browser but just for approximately 0.1sec while HEAD request is being performed and only for the image the mouse is over, so it's negligible. Anyway there is no better solution for js in "s" rule. That's why I asked if kuehlschrank can add the multi-url feature.
§
Posted:
Wow! wOxxOm, thank you!!
Everything works and I didn't notice any lag.
§
Posted:
@JixunMoe:

* it works on that yandex map page with more than a hundred images, actually the quantity doesn't matter
* of course it freezes the browser but just for approximately 0.1sec while HEAD request is being performed and only for the image the mouse is over, so it's negligible. Anyway there is no better solution for js in "s" rule. That's why I asked if kuehlschrank can add the multi-url feature.
Oh.. Sorry I read you wrong.. I thought it was doing the preload on page load :<
kuehlschrankAuthor
§
Posted:
Edited:
@kuehlschrank, can you add support for arrays like "s":{"imageurl-1","imageurl-2","imageurl-3"}, so that MPIV would show the first existing imageurl?
Added in version 2014.9.23. Syntax uses square brackets.
wOxxOmMod
§
Posted:
Edited:
Added in version 2014.9.23. Syntax uses square brackets.
Great!

@Guillermo:
{"r":"img\\d*-fotki\\.yandex\\.(?:ru|net)(/get/.+?/.+?/.+?_)(?:STATIC|)(.+?)_(L|S|XS|XXS)\\d*", "s":["https://img-fotki.yandex.ru$1$2_orig","https://img-fotki.yandex.ru$1$2_XXXL","https://img-fotki.yandex.ru$1$2_XXL","https://img-fotki.yandex.ru$1$2_XL"]}
§
Posted:
What's the difference? Is it better to use url-arrays than rule with JavaScript?
wOxxOmMod
§
Posted:
Edited:
@Guillermo, well, technically it's better to use the built-in functionality if possible, rather than invent workarounds. Now that url-arrays are implemented the new yandex rule is more obvious, more human-readable.
kuehlschrankAuthor
§
Posted:
Edited:
Native implementation doesn't freeze the window and is slightly faster because there's no extra HEAD request. It also will work on websites that forbid dynamic JavaScript evaluation.
§
Posted:
wOxxOm, I have to say that your "url-arrays" rule doesn't work on all links, while rule with JavaScript is OK.
Please, take a look at this links:
example 1
example 2
example 3
All pictures have larger originals, but not the "_orig" attribute.
wOxxOmMod
§
Posted:
Edited:

@Guillermo, that's because yandex returns a GIF error image for the absent _orig link with 404 HTTP status ("not found")

@kuehlschrank, can you handle such cases? I see a suiting example on w3.org.

kuehlschrankAuthor
§
Posted:
TL;DR Fixed in version 2014.9.28.

XHR is not used. I simply change the URL when img.onerror gets called. The problem was that a 404 is not considered an error when the response is an image.
wOxxOmMod
§
Posted:
Awesome!

@Guillermo, here's a more compact url-array version:
{"r":"(img)\\d*(-fotki\\.yandex\\.)(?:ru|net)(/get/.+?/.+?/.+?_)(?:STATIC|)(.+?)_(L|S|XS|XXS)\\d*", "s":["http://$1$2ru$3$4_orig","http://$1$2ru$3$4_XXXL","http://$1$2ru$3$4_XXL","http://$1$2ru$3$4_XL"]}
§
Posted:
Thanks, kuehlschrank and wOxxOm, for your help and attention to my request.
@wOxxOm, I made a little edition of your rule, so that it now works on all pics from fotki.yandex.ru. That's the final working rule:
{"r":"(img)\\d*(-fotki\\.yandex\\.)(?:ru|net)(/get/.+?/.+?/.+?_)(?:STATIC|)(.+?)_(?:-\\d+-|)(L|S|XS|XXS|XXXS)\\d*", "s":["http://$1$2ru$3$4_orig","http://$1$2ru$3$4_XXXL","http://$1$2ru$3$4_XXL","http://$1$2ru$3$4_XL"]}

Post reply

Sign in to post a reply.