1/**
2 * DokuWiki PrettyPhoto Plugin
3 */
4jQuery(function() {
5    jQuery('a[class=media][href]').each(function() {
6        var $self = jQuery(this);
7        var img =  $self.find('img');
8        if (!img.length) {
9            return false;
10        };
11        var ppath = JSINFO.plugin_prettyphoto.mediapath;
12        if (typeof PRETTYPHOTO_PLUGIN_MEDIAPATH !== "undefined") {
13            ppath = PRETTYPHOTO_PLUGIN_MEDIAPATH;
14        };
15        if ($self.attr("href").indexOf(ppath) != -1) {
16            // Points directly to a media item
17            $self.attr("rel", "prettyPhoto[gallery]");
18        };
19    });
20    var pparams = {};
21    if(typeof PRETTYPHOTO_PLUGIN_PARAMS !== "undefined") {
22        pparams = PRETTYPHOTO_PLUGIN_PARAMS;
23    };
24    jQuery("a[rel^='prettyPhoto']").prettyPhoto(pparams);
25});
26