2014-10-01 07:19:14 +02:00
|
|
|
<?php
|
|
|
|
|
2015-04-02 08:24:26 +02:00
|
|
|
// Add the mediabox style sheet and javascript
|
2014-10-01 07:19:14 +02:00
|
|
|
$GLOBALS['TL_CSS'][] = 'assets/mootools/mediabox/'. MEDIABOX .'/css/mediaboxAdvBlack21.css||static';
|
2015-04-02 08:24:26 +02:00
|
|
|
$GLOBALS['TL_JAVASCRIPT'][] = 'system/modules/rateit/public/js/mootools/mediabox/mediabox-rateit.js|static';
|
2014-10-01 07:19:14 +02:00
|
|
|
|
|
|
|
?>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
(function($) {
|
|
|
|
window.addEvent('domready', function() {
|
|
|
|
var links = $$('a').filter(function(el) {
|
|
|
|
return el.getAttribute('data-lightbox') != null;
|
|
|
|
});
|
|
|
|
$$(links).mediabox({
|
|
|
|
// Put custom options here
|
|
|
|
}, function(el) {
|
|
|
|
return [el.href, el.title, el.getAttribute('data-lightbox')];
|
|
|
|
}, function(el) {
|
|
|
|
var data = this.getAttribute('data-lightbox').split(' ');
|
|
|
|
return (this == el) || (data[0] && el.getAttribute('data-lightbox').match(data[0]));
|
|
|
|
});
|
|
|
|
$('mbImage').addEvent('swipe', function(e) {
|
|
|
|
(e.direction == 'left') ? $('mbNextLink').fireEvent('click') : $('mbPrevLink').fireEvent('click');
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
String.prototype.endsWith = function(suffix) {
|
|
|
|
return this.indexOf(suffix, this.length - suffix.length) !== -1;
|
|
|
|
};
|
|
|
|
})(document.id);
|
|
|
|
</script>
|