function FluidbookLinks(fluidbook) {
this.fluidbook = fluidbook;
+ this.initInlineSlideshowsIntervals = [];
this.init();
}
FluidbookLinks.prototype = {
init: function () {
-
var $this = this;
$(document).on('click', '[data-wescosales-ref]', function () {
});
-
// ToDo: consider re-using existing popinOverlay div?
$('body').append('<div id="zoomPopupOverlay"></div><div id="zoomPopupWrapper"><a href="#" class="zoomPopupClose">' + getSpriteIcon('interface-close') + '</a></div>');
-
$(document).on('click', '.zoomPopup', function (e) {
e.preventDefault();
$this.zoomLink(this);
}
fluidbook.wopen($(this).attr('href'), target);
return false;
-
});
}
setTimeout(function () {
$this.fluidbook.initVideos();
+ $this.initInlineSlideshows();
}, 200);
$(fluidbook).trigger('fluidbooklinksready');
+ $(fluidbook).trigger('fluidbook.links.ready');
},
animateLinks: function () {
var animateBookmarks = (this.fluidbook.datas.bookmarkBlinkOnPageChange == true);
var a = $('.link[data-id="' + id + '"] a:eq(0)');
a.get(0).click();
},
+ initInlineSlideshows: function () {
+ var $__this = this;
+
+ $.each(this.initInlineSlideshowsInterval, function (k, interval) {
+ clearInterval(interval);
+ });
+ $(".inlineslideshow").each(function () {
+ var $this = $(this);
+ var dir = 'data/links/' + $(this).data('dir') + '/';
+ $.each($(this).data('images'), function (k, i) {
+ var h = '<div class="slide" style="background-image: url(\'' + dir + i + '\');"></div>';
+ $this.append(h);
+ });
+
+ setTimeout(function () {
+ $this.find('.slide:eq(0)').addClass('show');
+ }, 1000);
+
+ $__this.initInlineSlideshowsIntervals.push(setInterval(function () {
+ var current = $this.find('.slide.show');
+ var next = $(current).nextAll('.slide:not(.show):eq(0)');
+ if ($(next).length == 0) {
+ next = $this.find('.slide:eq(0)');
+ }
+ console.log(current);
+ console.log(next);
+
+ $(next).addClass('show');
+ $(current).removeClass('show');
+ }, parseFloat($__this.fluidbook.datas.inlineSlideshowDuration) * 1000));
+ });
+ },
}