Extension talk:FancyBoxThumbs

From MediaWiki.org
Jump to: navigation, search

Contents

Thread titleRepliesLast modified
Customizing fancy function for certain pages/images?316:10, 8 April 2013
Thank you021:14, 27 March 2013
Installed but not working113:05, 13 March 2013
Issues with MW 1.20.2318:34, 1 February 2013
Version 2.0 Released017:34, 30 January 2013
CSS error in jquery.fancybox-1.3.4.css (FancyBoxThumbs 1.0.1)223:36, 20 November 2012
Doubled dots don't get replaced211:59, 31 October 2012
Clashes with MW 1.16 jquery615:06, 18 May 2012
Display imagetitle with link012:40, 10 April 2012
The image's box never displays, just new page with image301:49, 5 January 2012
Shared repository408:05, 7 December 2011
[Bug] Hardcoded URL304:32, 23 November 2011
Excellent Extension!!205:07, 16 November 2011
FancyBox stopped working after short urls enabled008:53, 10 October 2011
Bug?118:25, 19 September 2011
Gallery enable method104:17, 23 August 2011
Fork merge205:47, 21 July 2011
ToDo002:07, 14 May 2011
I'm not able to make FancyBox running in my Mediawiki, I got the error "Property or method not supported by the object jquery.fancybox-1.3.4.pack.js"402:07, 14 May 2011

Customizing fancy function for certain pages/images?

I tried the extension (on MW 1.18.1) and i basically like it. But i would like to choose, what pages/images get fancy thumbs and what pages/images do behave the normal way. Is there any way to include a switch?

Schmelzle18:05, 24 January 2012

The plugin looks for any link ("a" tag) with the class="image" attribute and triggers FancyBox for that link/image. If you could somehow remove the class="image" attribute, you could selectively turn it off. However, I think this is a lot easier said than done.

Gilluminate03:04, 25 January 2012

Maybe a dependency on the user group would also help, e.g. Users in group "admins" get info page for pictures by clicking on images, all others get FancyBox instead.

Schmelzle10:51, 26 January 2012

Hi, it'a very simple way, just hold CRTL key then click on image ! This open a new window with all sizes of images !!

 
 
 

Fantastic extension. Thank you!

Cdaringe (talk)21:14, 27 March 2013

Installed but not working

Hi, FancyBox looks great and I would love to get it working on my wiki but am having issues. I tried installing it both from the master.zip file in your download link, and from git, but neither seems to work for me. You can see details of my installation at http://linuxproblems.org/wiki/Special:Version. Also here's a test page I set up http://linuxproblems.org/wiki/Test. Any ideas what might be wrong? I can't see any errors in my logs. Ed.

86.135.61.16721:04, 12 March 2013

Not to worry, it looks like this was a problem with the mediawiki skin I'm using - cavenishmw. It works with other skins.

86.135.61.16713:05, 13 March 2013
 

Issues with MW 1.20.2

Was using this extension on MW 1.19.1, PHP 5.3.14 and all was great!
After update to MW 1.20.2 stopped working. The list of extension is the same as for MW 1.19.1.

I will be grateful for any help!

ZelChief (talk)18:25, 23 January 2013

I'm thinking this might have something to do with it: http://www.mediawiki.org/wiki/ResourceLoader/Migration_guide_for_extension_developers

Something tells me they made the old way obsolete in 1.20

I'll keep looking into this and see how I can fix. Thanks for the heads up!!

Gilluminate (talk)23:35, 25 January 2013
 

I have completely rewritten this extension from the ground up. It is now fully compatible with 1.20.

Gilluminate (talk)16:55, 30 January 2013

Very quickly! Thank you for your work!

ZelChief (talk)18:34, 1 February 2013
 
 

Version 2.0 Released

Hi all, I've rewritten this extension from the ground up.

You can read more detailed information about this release on my blog.

One thing to note is that fancyBox v2 has a different license. fancyBox v2 is licensed under Creative Commons Attribution-NonCommercial 3.0 license. You are free to use fancyBox for your personal or non-profit website projects. You can get the author's permission to use fancyBox for commercial websites by paying a fee.

Let me know how this new version works for you!

Gilluminate (talk)17:00, 30 January 2013

CSS error in jquery.fancybox-1.3.4.css (FancyBoxThumbs 1.0.1)

If FancyBoxThumbs will be used with IE then you get a lot of linking errors.
FIX: Change all lines containing i.e.

.fancybox-ie #fancybox-bg-n { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_n.png', sizingMethod='scale'); }

to

.fancybox-ie #fancybox-bg-n { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='extensions/FancyBoxThumbs/fancybox/fancy_shadow_n.png', sizingMethod='scale'); }
Greg09:24, 20 November 2012

Greg, Thanks for the heads up. I'll work this fix into the next release.

Gilluminate (talk)23:24, 20 November 2012

Actually, it was a pretty quick fix. I just added it to the repo.

Gilluminate (talk)23:36, 20 November 2012
 
 

Doubled dots don't get replaced

I'm using version 1.0.1 with MW 1.17.0.

There's a slight glitch with the doubled dots which stem from the splitting algorithm for 4 character file extensions in FancyBoxThumbs.php somehow don't get replaced as intended in line 69:

.' var img_src = img_src.replace("..", ".");' // change ..jpg to .jpg but do not change .jpeg

As a workaround I changed line 68 to not insert (another) dot in the first place, which seems to solve the problem but surely is not a perfect solution:

.' var img_src = img_split1[0]+img_split2[0]+""+img_type;'
Nakohdo (talk)09:56, 30 March 2012
Edited by author.
Last edit: 11:59, 31 October 2012

I found the culprit. There were some double dots in my relative path to the upload directory which got in the way. I changed lines 68ff. to the following so the replacement only affects the file type extension for which it is meant and not the whole path to the image file:

  1.  .' img_type = "."+img_type;'
    
  2.  .' img_type = img_type.replace("..", ".");' // change ..jpg to .jpg but do not change .jpeg
    
  3.  .' img_src = img_split1[0]+img_split2[0]+img_type;'
    
  4. </syntaxhihglight>
    
Nakohdo (talk)12:30, 31 March 2012

Just confirming that this workaround also does work with MW 1.19.2

Nakohdo (talk)11:56, 31 October 2012
 
 

Clashes with MW 1.16 jquery

Hi.

Great extension, but the problem is that when I enable it all my other jquery extensions die and the MW jquery based Usability Initiative functions stop working (e.g. WikiEditor). I suspect this is because this extension is not using jquery in noConflict mode? Is this possible?
Thanks

Mitchelln 16:45, 18 February 2011 (UTC)01:58, 14 May 2011

Thanks for the suggestion, Mitchelln. I've updated version 0.4 with noConflict mode. Hopefully I've implemented it correctly.

Gilluminate 21:19, 12 May 2011 (UTC)01:59, 14 May 2011

Thanks for that! I'll test it out and let you know how I get on :)

Mitchelln 10:45, 13 May 2011 (UTC)01:59, 14 May 2011
 

I'm afraid it still doesn't work :( As soon as I enable FancyBox all other MW jquery stuff dies :(

Mitchelln 10:55, 13 May 2011 (UTC)01:59, 14 May 2011

It might be the JQuery version I'm loading. I'll install the MW extension and test it out. Thanks!

Gilluminate 15:17, 13 May 2011 (UTC)02:00, 14 May 2011
 

Can you tell me what version of MW you are using? What version of JQuery is loading by default?

Gilluminate19:41, 17 May 2011

JFTR I'm using this extension (version 1.0.1) with MW 1.17.0 and some other extensions which rely heavily on jQuery (namely Header Tabs, version 0.9/106054; UsabilityInitiative, version 0.1.1; and Categorize, version 0.1.2) and all seems to be ok. Great extension!

EDIT: The extension doesn't work on the MW 1.16.0 clon (predecessor) of the above mentioned wiki. The JavaScript code gets loaded but not executed.

Nakohdo (talk)09:48, 30 March 2012
 
 
 
 

Display imagetitle with link

Hey!
I love this extension, but I got a little problem displaying the title in IE9.
I added three lines of code in FancyBoxThumbs.php (after line 69):

  1. .' var img_src = img_split1[0]+img_split2[0]+"."+img_type;'
    
  2. .' var img_src = img_src.replace("..", ".");' // change ..jpg to .jpg but do not change .jpeg
    
  3. .' var img_title = $(this).children().first().attr("alt");'
    
  4. .' if(img_title == \'\') { var img_title_split = $(this).attr("href").split(":"); img_title = img_title_split[1]; };'
    
  5. .' $(this).attr("title", "<a href=\"" + $(this).attr("href") + "\">" + img_title + "</ a>");'
    
  6. .' $(this).attr("href", img_src);'
    
  7. .' $(this).attr("rel", "group");'
    

If I display a picture without an "alt"-tag in IE9 I get the title "undefined", but in Firefox 14.0a1 (and lower) everything works fine.
I appreciate your help,

Greg12:40, 10 April 2012

The image's box never displays, just new page with image

Edited by another user.
Last edit: 19:34, 14 June 2011

I've installed FancyBoxThumbs-0.4 onto Mediawiki 1.16.2, and am not seeing the same behavior as I see on the example page for this extension. The example page works on all my browsers but my wiki does not. When an image is clicked instead of a box , or even that image's wiki page, it just shows a blank page with that image. I've watched the Apache error logs and have seen nothing related to this, and as far as I know I don't have any other JQuery extensions enabled. Any ideas are greatly appreciated.

User:treydock19:32, 14 June 2011

The same for me. I noticed enabling FancyBoxThumbs impeaches SmoothGallery to function properly, maybe is there a conflict with it?

82.245.211.11107:44, 31 July 2011
 

Had the same problem. Downloaded the extension, unzipped it and copied it with the original folder-name "gilluminate" to the webserver. There was the problem! Although I added the corrected line include_once("$IP/extensions/gillluminate/FancyBoxThumbs.php"); to my LocalSettings.php it didn't work because the extension itself assumed that it's in the directory FancyBoxThumbs. Renamed the extension-directory to FancyBoxThumbs changed LocalSettings to include_once("$IP/extensions/FancyBoxThumbs/FancyBoxThumbs.php"); and now everything works fine.

194.25.185.14610:04, 4 January 2012

Sorry about the folder naming mix up. I've added better instructions to the Extension page about that. The reason it's weird is because I'm using github to host the files and letting github create the zip file. I'll consider changing my method, but for now I'm hoping a little added instruction helps people out.

Gilluminate01:49, 5 January 2012
 
 

Shared repository

Hi, I uses shared repository for my wiki, however seems it's not yet compatible with images placed in shared repository? Thanks.

REX 15:09, 30 September 2011 (UTC)15:09, 30 September 2011

You are right REX, it assumes the src to the image is a relative path to the root of the wiki. I'll have it fixed for external images in the next release (1.0). Thanks for the heads up.

Gilluminate21:39, 30 September 2011
 

Actually, I believe the plugin is doing it correctly. It might be a limitation of Fancybox. I'll keep investigating.

Gilluminate22:57, 30 September 2011

Thanks! With src, it also still has problem with hashed directory.

REX07:03, 8 October 2011
 

It seems that the problem only occurs to images in shared repository which resized (due to thumbs etc). :)

REX08:05, 7 December 2011
 
 

[Bug] Hardcoded URL

Hi,

thanks for the nice extension, I was very relieved to get rid of the RegEx crap that I was fighting with before.

However, there is one severe bug in FancyBox:

There's a hardcoded URL in FancyBoxThumbs.php, line 71:

.' $(this).attr("title", $(this).attr("title") + "<br />Origen: <a 
style=\"color:#888888;\" href=\"http://www.frikipedia.es/friki/ 
Archivo:"+pieces[pieces.length-1]+"\">" + pieces[pieces.length-1] + "</ 
a>");'

"http://www.frikipedia.es/friki/Archivo:" should not be hardcoded and must be replaced with the current URL and "/File:"

and "Origen" seems to be some other language than english, so I suppose it should be "Origin:" or "Source:"


Additionally I have two proposals:

1. The loading of jQueryMin from Google is a question of preference, but I prefer to keep it local. So I changed line 54

src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"

into

src="'.$wgScriptPath.$FBT_Dir.'/jquery.min.js"

(of course after putting jquery.min.js in the extension directory.


2. I added this to my css to make it clearer where the extension will load; it'll add a magnifier cursor:

a[rel^="group"] img { 
        cursor: -webkit-zoom-in; 
        cursor: -moz-zoom-in; 
} 
 
#fancybox-overlay { 
        cursor: -webkit-zoom-out !important; 
        cursor: -moz-zoom-out !important; 
}

Hope this feedback is useful, Cheers,

Auco21:52, 20 October 2011
Edited by another user.
Last edit: 15:42, 30 October 2011

I think it's important notes.

Also I observed this extension conflict with vector extension (version 0.2): vector extension load /skins/common/jquery.min.js.

Unikum16:28, 29 October 2011

Hi. Just tested FancyBoxThumbs 1.0 with MediaWiki 1.18.0rc1 and it works fine :)

Maybe be carreful with your jQuery version because MediaWiki now load

and use "jQuery JavaScript Library v1.6.4".

Alaflix08:09, 22 November 2011

Thanks Alaflix! I have updated the JQuery version in this new version 1.0.1, but keep in mind that the JQuery in the extension will only load if JQuery is not already present. Meaning, if MediaWiki has loaded it's own latest supported version, the extension will automatically use that version; if for whatever reason that version does not load, the extension loads a version as a backup option. It is unlikely that the version in this extension will ever be loaded.

Gilluminate04:32, 23 November 2011
 
 
 

Excellent Extension!!

Excellent extension! I am very happy with it. I've tried several others, but this is the first to work flawlessly on Mediawiki 1.17.

http://wheretosee.org/wildlife/Photo_Gallery

68.114.5.2618:31, 28 October 2011

Here is a suggestion for future updates that will make the extension work better with mobile devices such as the iPad and iPhone: place the Forward and Reverse buttons outside the border of the picture, and appear immediately. Right now, the Forward and Reverse buttons only appear when there is a mouse-over. But touch devices have no mouse-over capability, so it is awkward to use this on an iPad. If the buttons appeared immediately (rather than after a not-possible mouseover), the functionality would be greatly improved. Also, the Forward / Previous buttons are too small for most mobile devices (especially an iPhone). Larger buttons would be easier to see and use on the small screens of mobile devices.

Stamps Howard04:26, 16 November 2011

This extension merely implements a JQuery plugin known as FancyBox. Your suggestions relate to FancyBox and not to the extension.

Gilluminate05:07, 16 November 2011
 
 

FancyBox stopped working after short urls enabled

Edited by 2 users.
Last edit: 08:53, 10 October 2011

Hi,

I had fancybox working perfectly, then I set up short urls and the image box stopped working :

I get the following error reported in Explorer :

Webpage error details

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Tablet PC 2.0; .NET CLR 1.1.4322; Media Center PC 6.0; InfoPath.3; AskTbUT2V5/5.9.1.14019)
Timestamp: Mon, 7 Mar 2011 00:28:13 UTC


Message: Object doesn't support this property or method
Line: 25
Char: 185
Code: 0
URI:


The enlarged images appears below the main page.

Regards

Drew01:57, 14 May 2011

I've modified "FancyBoxThumbs.php Line 56" onto Mediawiki 1.16.5 ,FancyBoxThumbs0.7

Because "jquery.fancybox-1.3.4.css" not Loading.

Added ".$wgScriptPath."

$out->addScript('<link rel="stylesheet" href="'.$wgScriptPath.''.$FBT_Dir.'/jquery.fancybox-1.3.4.css" type="text/css" />');
Schu13:25, 18 September 2011

Thanks for the tip. I got it in the latest release.

Gilluminate18:25, 19 September 2011
 

Gallery enable method

To enable the Gallery for all pictures on the page, do the following:

1. Open the file: FancyBoxThumbs.php

2. Find the line:

.' $(this).attr("href", img_src);'

3. Insert the following line under found line:

.' $(this).attr("rel", "group");'

4. Save the file

Temporary solution. Better than nothing.

Aev14:35, 15 August 2011

Great solution. Added to version 0.7

Gilluminate04:17, 23 August 2011
 

Fork merge

I've created a fork, adding some functionality (or, for the sake of being precise, customization) and would like it to merge to the main source for everyone to use freely. It corrects some bugs and, IMHO, works better. You can find it on here. Please credit me. Thank you.

EDIT: It may work in 1.17 only.

Krusher15:27, 15 May 2011

Good to hear, Krusher! Long live open source.

Gilluminate19:43, 17 May 2011
 

Really good fork. It works fine in 1.17. All but navigation between images at one page or in one gallery. Navigation daoesn't work.

94.139.99.8305:47, 21 July 2011
 

Hi all, Thanks for the interest and feedback. I do have plans to address all of these issues as well as implement gallery support. I created this plugin out of necessity at work and thought I'd share what I'd done knowing that it wasn't perfect and that I could continue to improve upon it. I have been slammed at work and with other things going on in my life right now, so I haven't been able to dedicate as much time as I had hoped. But I haven't forgotten about it, and I promise I'll work more on it.

The joy of open source is that you don't have to wait for me to do it. Please feel free to build upon this code and add it to the project.

Thanks

Gilluminate 17:06, 3 May 2011 (UTC)01:57, 14 May 2011

I'm not able to make FancyBox running in my Mediawiki, I got the error "Property or method not supported by the object jquery.fancybox-1.3.4.pack.js"

Hi, I saw the demo of your extension and I found it amazing, sò following step by step the instructions I dowloaded and installed FancyBoxThumbs on my wiki (1.16.1), but I wont run. With galleries or single thumbnails when I click on an image, it is opened at the bottom of the gallery page, and the browser (I use IE8) report me the following error:

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)
Timestamp: Sun, 6 Feb 2011 00:12:25 UTC

Property or method not supported by the object
jquery.fancybox-1.3.4.pack.js?270
Line: 25
Char: 185
Code: 0
URI: http://192.168.1.230/mediawiki/extensions/FancyBoxThumbs/fancybox/jquery.fancybox-1.3.4.pack.js?270

Is there any chance to solve the problem ? Thanks !

FrancoR 00:21, 6 February 2011 (UTC)02:01, 14 May 2011

Sounds like a jQuery conflict. Maybe it conflicts with your theme. Could you try it with the MediaWiki Vector Skin and give a feedback?. Thanks

Filburt 07:32, 14 February 2011 (UTC)02:02, 14 May 2011
Edited by author.
Last edit: 02:04, 14 May 2011

I normally use the vector skin and also, to avoid conflict with other extensions, I disabled all of them, but nothing changed. So, I tried to delete the FancyBox extension (I made a lot of tries so I could misconfigured something) and reinstalled it as new. Now got the error "img_split1[1] is undefined" to the following line:


<script type="text/javascript">$(document).ready(function() {$("a.image").each(function(){var img_split1 = $(this).children
().first().attr("src").split("/thumb");var img_type = img_split1[1].substr(img_split1[1].length -4);var img_split2 = img_split1
[1].split(img_type);var img_src = img_split1[0]+img_split2[0]+"."+img_type;var img_src = img_src.replace("..", ".");$(this).attr
("href", img_src);});$("a.image").fancybox();});</script>


Also just to be shure I'm using the right version, I downloaded it from the http://www.gilluminate.com/extensions/ site. Again, thanks a lot in advance for the support.


I made another test installation with a blank MW 1.16.2 and the blank extension and for me it works. I know that the split function is handled in different ways by different browsers - but I tested it with IE7+, Opera, Firefox and Chrome.

FrancoR 09:49, 14 February 2011 (UTC)02:02, 14 May 2011

Anywhere there seems to be a jQuery conflict in your installation.

Filburt 16:29, 15 February 2011 (UTC)02:04, 14 May 2011

Today I tried to put in the FancyBoxThumb.php the following line:

.'alert(img_split1 = $(this).children().first().attr("src"));'

just between .' and var_img... of

.'var img_type = img_split1[1].substr(img_split1[1].length - 4);'

This just to see if attr("src") had something wrong in it, due the fact the error I usually got was in splitting this attribute. After restarted httpd, the code messaged box me the attribute (the correct path of the image), but I don't know how, the FancyBox start running correctly. So I removed the debug code from the FancyBoxThumbs.php and restarted httpd again and with my great happyness everything was ok. I tried with IE8 and Firefox and was OK with both. I really think I didn't nothing special and everything start running by itself (??). Now also my wiki have that great extension. Really thanka a lot for all the support you gave me.

FrancoR 21:31, 15 February 2011 (UTC)02:06, 14 May 2011