1 | /* |
---|
2 | * SlideLightbox - 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 | /*$template->func_combine_script(array('id'=>'jquery.colorbox', 'path'=>'themes/default/js/plugins/jquery.colorbox.min.js')); |
---|
10 | $template->func_combine_css(array('id'=>'colorbox','path'=>'plugins/lightbox/theme/'.$params['theme'].'/colorbox.css'));*/ |
---|
11 | function _lightbox(){ |
---|
12 | |
---|
13 | var $layerShow = $('body').data('layerShow'), |
---|
14 | $lightbox_opt = $('#the_page', $layerShow).data('lightbox'); |
---|
15 | if ($('body').hasClass('lightbox')){ |
---|
16 | $('body').removeClass('lightbox').addClass('lightboxReady'); |
---|
17 | $.getScript('./themes/default/js/plugins/jquery.colorbox.min.js', function(){ |
---|
18 | $('<style />', { |
---|
19 | type: "text/css", |
---|
20 | src : "plugins/lightbox/theme/' + $lightbox_opt.theme + '/colorbox.css", |
---|
21 | }).appendTo('head'); |
---|
22 | _lightbox_init($layerShow,$lightbox_opt) |
---|
23 | }) |
---|
24 | }else{ |
---|
25 | _lightbox_init($layerShow,$lightbox_opt) |
---|
26 | }; |
---|
27 | |
---|
28 | |
---|
29 | |
---|
30 | function _lightbox_init($layerShow,$lightbox_opt){ |
---|
31 | |
---|
32 | $('a[rel=colorbox0]').attr("href", function () { |
---|
33 | return this.name; |
---|
34 | }); |
---|
35 | $('a[rel=colorbox0]').colorbox({ |
---|
36 | current: "", |
---|
37 | transition: $lightbox_opt.transition, |
---|
38 | speed: $lightbox_opt.speed, |
---|
39 | initialWidth: $lightbox_opt.initialWidth, |
---|
40 | initialHeight: $lightbox_opt.initialHeight, |
---|
41 | width: $lightbox_opt.width, |
---|
42 | height: $lightbox_opt.height |
---|
43 | }, |
---|
44 | function() { |
---|
45 | $.post("plugins/lightbox/save_history.php", { |
---|
46 | imgid: this.id, |
---|
47 | catid: $lightbox_opt.catid, |
---|
48 | section: $lightbox_opt.section, |
---|
49 | tagids: $lightbox_opt.tagids |
---|
50 | }); |
---|
51 | }); |
---|
52 | |
---|
53 | $(document).ready(PWG_Colorbox); |
---|
54 | $(window).bind("RVTS_loaded", PWG_Colorbox); |
---|
55 | } |
---|
56 | }; |
---|
57 | |
---|
58 | |
---|