DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:lightboxv2

This is an old revision of the document!


Lightbox v2

Compatible with DokuWiki

2006-11-06, 2009-12-25, 2010-11-07, 2011-05-25a

plugin Integrate LightBoxv2 for all images

Last updated on
2009-03-12
Provides
CSS/JS-only
Repository
Source
Conflicts with
indexmenu, indexmenu2

This extension has not been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues.

Similar to colorbox, lightbox, popupviewer, prettyphoto

Tagged with ajax, images, javascript, media

Integrate LightBox v2 JavaScript animation

INSTALL

Just install the plugin by PluginManager

CHANGES

  • 20111124 - Added code to github; no other changes;
  • 20090312 - JavaScript compression support; Konqueror support;
  • 20080808 - release that actually works (again);

USAGE

and link your image like this

{{wiki:dokuwiki-128.png?direct|Image Description}}

Image Description

or like this

{{wiki:dokuwiki-128.png?200x50&direct|Image Description}}

Image Description

Discussion

  • This module doesn't work on my dokuwiki version (Release 2009-12-25c “Lemming”). When i click on the picture, it opens in a new tab. I try to activate/deactivate the Compact CSS option but no change.Thanks by advance

  • Is there any way someone could make this js more selective about when it is called? It seems to get called no matter what file I pick whether it is a picture, pdf, doc, whatever. The js always gets activated. Thanks

  • Can somebody adapt this plugin to be able to use images in BBCode syntax? Thanks.

  • Does this plugin work in dokuwiki-rc2007-05-24? I cannot get it to display images with LightBox, only in the same tab. The gallery plugin which uses LightBox (but not version 2, which it states, has DokuWiki-incompatible dependencies) works on the other hand. Thank you.
it's required to disable the option “Compact CSS and javascript output” — winky 2010-03-11 11:31

  • If you install this Plugin, it seems that the plugin “indexmenu1” doesn't work correctly. Bastian
The reason is that it extends array methods with its prototypes. The result is a lot of functions added as items in any new array. I don't know a way to prevent this and adding extra code to indexmenu in order to check items is not a good solution for me. — Samuele Tognini 2007-10-24 14:10

—-

Completely non-functional on my installation. The requirement of the direct option in image links makes it impractical anyway. — Carl Manzi 2007-09-28 17:22

Don't work with JavaScript compression turned on

You don't need the pseudo plugin cause the js-code is included by the js.php script (see javascript). But an error in the file script.js prevents it from being included if (and only if) compression for JavaScript and CSS files is enabled. This is because the first comment contains another comment and therefore is not properly closed. The compression code deletes the whole file, cause the comment is not closed. Just replace the header comment with the following one and the lightbox is there:
// ---- prototype.js
/*  Prototype JavaScript framework, version 1.4.0
 *  (c) 2005 Sam Stephenson <sam@conio.net>
 *
 *  THIS FILE IS AUTOMATICALLY GENERATED. When sending patches, please diff
 *  against the source tree, available from the Prototype darcs repository.
 *
 *  Prototype is freely distributable under the terms of an MIT-style license.
 *
 *  For details, see the Prototype web site: http://prototype.conio.net/
 *
 *--------------------------------------------------------------------------*/

Uwe Koloska 2008-01-13 23:00


How can i use little pictures without lightbox and large pictures with lightbox in one page ?

Conflict

It seemed to me that this plugin conflicts with indexmenu2 (either JavaScript menu or plain HTML) but works fine with indexmenu.

Jason Xu 2008-01-14 23:13

The download links on top of the page are both broken.

Dario Berzano 2008-07-22 22:32

New working version

I did some improvements on this plugin to integrate the v2.04 version of Lightbox in DokuWiki the way lightboxv2 implemented it.
Explanations and a downloadable file are available here: http://laurent.beneytout.free.fr/doku.php?id=projects:lightbox

laurentb 2008-08-08 22:45

small bugfix

I had to add a leading slash to the path in lines No 5585 and 5587 to display the close-button correctly in namespaces.

    fileLoadingImage:        '/lib/plugins/lightbox/images/loading.gif',     
//    fileLoadingImage:        'images/loading.gif',
    fileBottomNavCloseImage: '/lib/plugins/lightbox/images/closelabel.gif',
//    fileBottomNavCloseImage: 'images/closelabel.gif',

Konrad Bauckmeier 2008-12-09

ogeidix

20090312 release

I followed the work of Laurent Beneytout and put together new version, which works with compression enabled, additionally adds konqueror from kde3 support (as I use it)

You can grab the plugin code from here: http://glen.alkohol.ee/pld/lightbox-20090312.tar.bz2

I also remade the plugin from original code and left out changes that had no reason (like replacing the next/prev)

The trick of fixing for JavaScript was to change single tick to \x27 in JavaScript and to compress the produced JavaScript with shrinksafe.

You can see the build scripts from here also here, here and here, or grab whole source package.

Elan Ruusamäe 2009-03-12 04:48

having DokuWiki patched with directlink patch I would be able to use always direct link to media.

The selector would be then in js/lightbox.js:

    start: function(imageLink) {
/// ...
        this.imageArray =
            $$(imageLink.tagName + '[href][class="media"]').
            collect(function(anchor){
-                   return [anchor.href, anchor.firstChild.getAttribute('title')]; }).
+                   var url = anchor.directlink ? anchor.directlink : anchor.href;
+                   return [url, anchor.firstChild.getAttribute('title')]; }).
            uniq();
 
-       while (this.imageArray[imageNum][0] != imageLink.href) { imageNum++; }
+       var url = imageLink.directlink ? imageLink.directlink : imageLink.href;
+       while (this.imageArray[imageNum][0] != url) { imageNum++; }

Elan Ruusamäe 2009-03-12 22:41

plugin/lightboxv2.1322909222.txt.gz · Last modified: 2011-12-03 11:47 by glen

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki