glensc / dokuwiki-plugin-lightboxv2

Integrate LightBox v2 for all images
http://www.dokuwiki.org/plugin:lightboxv2
4 stars 2 forks source link

Takes over image links #2

Open trailjeep opened 12 years ago

trailjeep commented 12 years ago
[[http://www.fsf.org/fb|{{http://static.fsf.org/nosvn/no-facebook-me.png?178&nolink|not f'ed}}]]

displays as lightbox image when it should go to the link. Same behavior for internal & external links.

dryoo commented 12 years ago

Me too.

so can't use this plugin.

glensc commented 12 years ago

there's no good way to detect this at javascript side, whether the link goes outside or not as the html is very similar

only thing i can do now, is to check that if the link is absolute (starts with http:// or https://) then it's likely link going outside. as in my installation, internal media links are relative.

glensc commented 12 years ago

so, i tried to do this with .filter() call in jQuery, but adding .filter to chain makes my chrome take up 100% cpu and nothing works. even simple filter, that does return true causes this. i have no idea what is happening.

i.e this simple change broke it all: from:

$('a[class=media]').each(function() {

to:

$('a[class=media]').filter(function() { return true }).each(function() {
dryoo commented 12 years ago

Hello Glensc!

I used diffident method to solve this problem.

I can not make dokuwiki plugin. and I dont know how plugins works, but I want to show this you

I used this library for lightbox. ( http://serennz.sakura.ne.jp/toybox/lightbox/?en )

This codes are activated when there is rel=“lightbox” in <a href= tag.. so I edited manually xhtml.php for dokuwiki to know when to intercept link...

It works with both internal media and external media..

visit here to see my modified code.. & example.

http://vaslor.net/tech/lightbox_in_dokuwiki

Thanks.

deam0n commented 11 years ago

any fix on this?

glensc commented 11 years ago

no, because fix that i made locks up browser. and i have not resolved it myself and don't know where to ask for extra help: https://github.com/glensc/dokuwiki-plugin-lightboxv2/issues/2#issuecomment-7598436

LauraEun commented 11 years ago

would be great to have a fix for that.

I noticed that it still shows the correct link as alternate text, maybe there is a way to filter it when this begins with 'http'.

Or make an optional flag to disable lightbox for those images (eg. &nolightbox) to return to default behaviour