} catch (e) {
}
- this.initInlineSlideshowsIntervals = [];
this.lowdef = false;
this.init();
}
},
initInlineSlideshows: function () {
- var $__this = this;
-
- $.each(this.initInlineSlideshowsInterval, function (k, interval) {
- clearInterval(interval);
- });
+ var $this = this;
$(".inlineslideshow").each(function () {
if ($(this).is(':visible')) {
- $__this.initSlideshow($(this));
+ $this.fluidbook.slideshow.initInlineSlideshow($(this));
} else {
var $s = $(this);
$(this).closest('.link').on('fluidbook.link.show', function () {
if (!$s.data('init')) {
- $__this.initSlideshow($s);
+ $this.fluidbook.slideshow.initInlineSlideshow($s);
}
});
}
});
},
- initSlideshow: function (s) {
- var $this = this;
- s.data('init', true);
- var dir = 'data/links/' + $(s).data('dir') + '/';
- $.each($(s).data('images'), function (k, i) {
- var h = '<div class="slide" style="background-image: url(\'' + dir + i + '\');"></div>';
- s.append(h);
- });
-
- // Move first to end
- s.append(s.find('.slide:eq(0)'));
-
- this.initInlineSlideshowsIntervals.push(setInterval(function () {
- var current = s.find('.slide.show').eq(0);
- var next = $(current).nextAll('.slide:not(.show):eq(0)');
- if ($(next).length === 0) {
- next = s.find('.slide:eq(0)');
- }
-
- $(next).css({display: 'block', zIndex: 2});
-
- setTimeout(function () {
- $(next).addClass('show').one($this.fluidbook.support.getTransitionEndEvent(), function () {
- $(current).removeClass('show').css('display', 'none');
- $(this).css({zIndex: ''});
- });
- }, 100);
-
- }, parseFloat(this.fluidbook.settings.inlineSlideshowDuration) * 1000));
- },
-
resize: function () {
var $this = this;
$("#links .link.iframe").each(function () {
-function FluidbookVacheronSlideshow(fluidbook) {
+function FluidbookDummySlideshow(fluidbook) {
this.fluidbook = fluidbook;
+ this.intervals = [];
}
-FluidbookVacheronSlideshow.prototype = {
- initSlideshow: function (id) {
- }
+FluidbookDummySlideshow.prototype = {
+ initSlideshow: function (s) {
+ var $this = this;
+ s.data('init', true);
+ var dir = 'data/links/' + $(s).data('dir') + '/';
+ $.each($(s).data('images'), function (k, i) {
+ var h = '<div class="slide" style="background-image: url(\'' + dir + i + '\');"></div>';
+ s.append(h);
+ });
+
+ // Move first to end
+ s.append(s.find('.slide:eq(0)'));
+
+ this.intervals.push(setInterval(function () {
+ var current = s.find('.slide.show').eq(0);
+ var next = $(current).nextAll('.slide:not(.show):eq(0)');
+ if ($(next).length === 0) {
+ next = s.find('.slide:eq(0)');
+ }
+
+ $(next).css({display: 'block', zIndex: 2});
+
+ setTimeout(function () {
+ $(next).addClass('show').one($this.fluidbook.support.getTransitionEndEvent(), function () {
+ $(current).removeClass('show').css('display', 'none');
+ $(this).css({zIndex: ''});
+ });
+ }, 100);
+
+ }, parseFloat(this.fluidbook.settings.inlineSlideshowDuration) * 1000));
+ },
};
var $this = this;
$.each(this.instances, function (k, v) {
- var s = (k === 'inline' ? $this.fluidbook.settings.slideshowInlineLibrary : $this.fluidbook.settings.slideshowPopupLibrary);
+ var s = (k === 'inline' ? $this.fluidbook.settings.inlineSlideshowLibrary : $this.fluidbook.settings.popupSlideshowLibrary);
switch (s) {
case 'dummy':
- $this.instances[k] = new FluidbookDummySlideshow($this.fluidbook);
+ if (window.FluidbookDummySlideshow !== undefined) {
+ $this.instances[k] = new FluidbookDummySlideshow($this.fluidbook);
+ }
case 'vacheron':
- $this.instances[k] = new FluidbookVacheronSlideshow($this.fluidbook);
+ if (window.FluidbookVacheronSlideshow !== undefined) {
+ $this.instances[k] = new FluidbookVacheronSlideshow($this.fluidbook);
+ }
break;
case undefined:
case null:
case 'splide':
default:
- $this.instances[k] = new FluidbookSplideSlideshow($this.fluidbook);
+ if (window.FluidbookSplideSlideshow !== undefined) {
+ $this.instances[k] = new FluidbookSplideSlideshow($this.fluidbook);
+ }
break;
}
});
}
FluidbookSlideshow.prototype = {
- initPopupSlideshow: function (id) {
- this.popupInstance.initSlideshow(id);
+ normalizeSlideshowElement: function (s) {
+ if ($(s).attr('id') == null) {
+ $(s).attr('id', 'slideshow_' + Math.round(Math.random() * 11000000));
+ }
+ return $(s);
+ },
+
+ initPopupSlideshow: function (s) {
+ var s = this.normalizeSlideshowElement(s);
+ this.popupInstance.initSlideshow(s);
},
- initInlineSlideshow: function (id) {
- this.inlineInstance.initSlideshow(id);
+ initInlineSlideshow: function (s) {
+ var s = this.normalizeSlideshowElement(s);
+ this.inlineInstance.initSlideshow(s);
},
- initSlideshow: function (id, context) {
+ initSlideshow: function (s, context) {
+ var s = this.normalizeSlideshowElement(s);
if (context === 'popup') {
- this.initPopupSlideshow(id);
+ this.initPopupSlideshow(s);
} else if (context === 'inline') {
- this.initInlineSlideshow(id);
+ this.initInlineSlideshow(s);
}
}
};
}
FluidbookSplideSlideshow.prototype = {
- initSlideshow: function (id) {
- this.slideshowID = '#' + id;
- this.$slideshow = $(this.slideshowID);
+ initSlideshow: function (s) {
+ this.$slideshow = $(s);
+ this.slideshowID = this.$slideshow.attr('id');
this.$wrapper = this.$slideshow.parent();
this.thumbnailsID = this.slideshowID + '_thumbnails';
this.$thumbnails = $(this.thumbnailsID);
-function FluidbookDummySlideshow(fluidbook) {
+function FluidbookVacheronSlideshow(fluidbook) {
this.fluidbook = fluidbook;
}
-FluidbookDummySlideshow.prototype = {
+FluidbookVacheronSlideshow.prototype = {
initSlideshow: function (id) {
}
};