1 | 1 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,38 @@ |
1 |
+<?php |
|
2 |
+// Add the colorbox style sheet |
|
3 |
+$GLOBALS['TL_CSS'][] = 'assets/colorbox/css/colorbox.min.css|static'; |
|
4 |
+?> |
|
5 |
+<script src="<?= $this->asset('js/colorbox.min.js', 'contao-components/colorbox') ?>"></script> |
|
6 |
+<script type="text/javascript"> |
|
7 |
+ jQuery(function ($) { |
|
8 |
+ $('a[data-lightbox]:not(.video-link)').map(function () { |
|
9 |
+ $(this).colorbox({ |
|
10 |
+ // Put custom options here |
|
11 |
+ loop: false, |
|
12 |
+ rel: $(this).attr('data-lightbox'), |
|
13 |
+ maxWidth: '95%', |
|
14 |
+ maxHeight: '95%' |
|
15 |
+ }); |
|
16 |
+ }); |
|
17 |
+ }); |
|
18 |
+ |
|
19 |
+ $(window).on('load', function () { |
|
20 |
+ |
|
21 |
+ if (Cookies.get('cookie_iframes')) { |
|
22 |
+ |
|
23 |
+ $('.video-link').colorbox({ |
|
24 |
+ iframe: true, |
|
25 |
+ width: '95%', |
|
26 |
+ height: '95%', |
|
27 |
+ maxWidth: '1024px', |
|
28 |
+ maxHeight: '576px', |
|
29 |
+ href: function () { |
|
30 |
+ var videoId = new RegExp('[\\?&]v=([^&#]*)').exec(this.href); |
|
31 |
+ if (videoId && videoId[1]) { |
|
32 |
+ return '//www.youtube-nocookie.com/embed/' + videoId[1] + '?rel=0&wmode=transparent&autoplay=1'; |
|
33 |
+ } |
|
34 |
+ } |
|
35 |
+ }); |
|
36 |
+ } |
|
37 |
+ }); |
|
38 |
+</script> |
|
0 | 39 |
\ No newline at end of file |