*/
var FilmSlider;
+var s;
(function(){
FilmSlider = function(filmBar, slider, ctxInfos, image, toolbar, breadcrumbs) {
var thisSlider = this;
+ s = this;
this.filmBar = filmBar;
this.filmBarWidth = getObjectWidth(this.filmBar);
var film = filmBar.firstChild;
addListener(this.toolbar, 'click', function(evt){thisSlider.toolbarClickHandler(evt);});
addListener(window, 'load', function(evt){thisSlider.fitToScreen(evt);});
addListener(window, 'load', function(evt){thisSlider._checkSizeAfterLoad(evt);});
+ addListener(window, 'load', function(evt){thisSlider.startThumbnailsLoadQueue(evt);});
// dd listeners
addListener(this.slider, 'mousedown', this.ddHandlers.down);
}
};
+FilmSlider.prototype.startThumbnailsLoadQueue = function(evt) {
+ var thumbnails = this.film.getElementsByTagName('img');
+ this.thumbnailsLoadingOrder = [];
+ var leftSize = this.center;
+ var rightSize = thumbnails.length - this.center - 1;
+ var i;
+ for (i=1 ; i<=Math.min(leftSize, rightSize) ; i++) {
+ this.thumbnailsLoadingOrder.push(thumbnails[this.center + i]);
+ this.thumbnailsLoadingOrder.push(thumbnails[this.center - i]);
+ }
+ if (leftSize > rightSize) {
+ for (i = this.center - rightSize - 1 ; i >= 0 ; i--) {
+ console.log(i);
+ this.thumbnailsLoadingOrder.push(thumbnails[i]);
+ }
+ }
+ else if (leftSize < rightSize) {
+ for (i = this.center + leftSize ; i < thumbnails.length ; i++) {
+ this.thumbnailsLoadingOrder.push(thumbnails[i]);
+ }
+ }
+ var next = this.thumbnailsLoadingOrder.shift();
+ var self = this;
+ addListener(next, 'load', function(evt){self._loadNextThumb(evt);});
+ next.src = next.parentNode.href + '/getThumbnail';
+};
+
+FilmSlider.prototype._loadNextThumb = function(evt) {
+ var next = this.thumbnailsLoadingOrder.shift();
+ if (!next) {return;}
+ var self = this;
+ addListener(next, 'load', function(evt){self._loadNextThumb(evt);});
+ next.src = next.parentNode.href + '/getThumbnail';
+};
+
+
FilmSlider.prototype.startSlideShow = function() {
this.slideShowSlide = this.pendingSlideShowSlide = this.selectedSlide;
return this.slideShowSlide.href;
<div metal:define-macro="film_bar" tal:omit-tag="">
<div id="film_bar">
<table cellspacing="0">
- <tr tal:define="slide_size python:portal_object.thumb_size/2 + 10">
+ <tr tal:define="slide_size python:portal_object.thumb_size/2 + 10;
+ blank_img string:$portal_url/transparent.gif">
<td tal:repeat="info contextInfos/infos">
<a tal:attributes="href info/href;
class info/className;
portfolio:position info/index">
<img tal:define="size info/thumbSize;
margin_top python:(slide_size - size['height']) / 2"
- tal:attributes="src info/src;
+ tal:attributes="src python:info['src'] if info['displayed'] else blank_img;
alt info/title;
height size/height;
width size/width;