1 | /* |
---|
2 | * SlideGThumb - v1.0 - 01-01-2014 |
---|
3 | * plugin for Slide and Lightbox |
---|
4 | * Original by P@t for Lightbox : http://fr.piwigo.org/ext/extension_view.php?eid=591 |
---|
5 | * Modified by Miklfe : http://piwitheme.fr/ |
---|
6 | * |
---|
7 | */ |
---|
8 | |
---|
9 | function _lightbox(){ |
---|
10 | if ($('body').hasClass('lightbox')){ |
---|
11 | var url= './plugins/lightbox/js/jquery.colorbox.js'; |
---|
12 | $.getScript(url, function (data, textStatus) { |
---|
13 | if (textStatus === "success") { |
---|
14 | try { |
---|
15 | CAGinit(); |
---|
16 | } catch(err) { |
---|
17 | alert(err); |
---|
18 | } |
---|
19 | } else { |
---|
20 | alert("script not loaded"); |
---|
21 | } |
---|
22 | }); |
---|
23 | |
---|
24 | /* $.getScript('./plugins/lightbox/js/jquery.colorbox.js').fail(alert()); |
---|
25 | _lightbox_init(); |
---|
26 | $('body').removeClass('lightbox').addClass('lightboxReady'); |
---|
27 | }) |
---|
28 | }else{ |
---|
29 | _lightbox_init()*/ |
---|
30 | }; |
---|
31 | |
---|
32 | function _lightbox_init(){ |
---|
33 | var $layerShow = $('body').data('layerShow'), |
---|
34 | $lightbox_opt = $('#the_page', $layerShow).data('lightbox'); |
---|
35 | //function PWG_Colorbox() {alert(); |
---|
36 | alert(); |
---|
37 | $('a[rel=colorbox0]').attr("href", function () { |
---|
38 | return this.name; |
---|
39 | }); |
---|
40 | $('a[rel=colorbox0]').colorbox({ |
---|
41 | current: "", |
---|
42 | transition: $lightbox_opt.transition, |
---|
43 | speed: $lightbox_opt.speed, |
---|
44 | initialWidth: $lightbox_opt.initialWidth, |
---|
45 | initialHeight: $lightbox_opt.initialHeight, |
---|
46 | width: $lightbox_opt.width, |
---|
47 | height: $lightbox_opt.height |
---|
48 | }, |
---|
49 | function() { |
---|
50 | $.post("plugins/lightbox/save_history.php", { |
---|
51 | imgid: this.id, |
---|
52 | catid: $lightbox_opt.catid, |
---|
53 | section: $lightbox_opt.section, |
---|
54 | tagids: $lightbox_opt.tagids |
---|
55 | }); |
---|
56 | }); |
---|
57 | //} |
---|
58 | }; |
---|
59 | }; |
---|
60 | |
---|