*/
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;
}
};
+FilmSlider.prototype.translateImgUrl = function(url) {
+ var canonicalImgUrl;
+ if (this.ctxUrlTranslation[0]) {
+ canonicalImgUrl = url.replace(this.ctxUrlTranslation[0],
+ this.ctxUrlTranslation[1]);
+ }
+ else {
+ canonicalImgUrl = url;
+ }
+ return canonicalImgUrl;
+};
+
FilmSlider.prototype.thumbnailClickHandler = function(evt) {
var target = getTargetedObject(evt);
while (target.tagName !== 'A' && target !== this.filmBar) { target = target.parentNode; }
history.pushState(target.href, '', target.href);
var imgBaseUrl = target.href;
- var canonicalImgUrl;
- if (this.ctxUrlTranslation[0]) {
- canonicalImgUrl = imgBaseUrl.replace(this.ctxUrlTranslation[0],
- this.ctxUrlTranslation[1]);
- }
- else { canonicalImgUrl = imgBaseUrl; }
+ var canonicalImgUrl = this.translateImgUrl(imgBaseUrl);
var ajaxUrl = imgBaseUrl + '/photo_view_ajax';
var thisFS = this;
FilmSlider.prototype.startThumbnailsLoadQueue = function(evt) {
var thumbnails = this.film.getElementsByTagName('img');
+ if (thumbnails.length === 1) { return; }
this.thumbnailsLoadingOrder = [];
var leftSize = this.center;
var rightSize = thumbnails.length - this.center - 1;
var next = this.thumbnailsLoadingOrder.shift();
var self = this;
addListener(next, 'load', function(evt){self._loadNextThumb(evt);});
- next.src = next.parentNode.href + '/getThumbnail';
+ next.src = this.translateImgUrl(next.parentNode.href) + '/getThumbnail';
};
FilmSlider.prototype._loadNextThumb = function(evt) {
if (!next) {return;}
var self = this;
addListener(next, 'load', function(evt){self._loadNextThumb(evt);});
- next.src = next.parentNode.href + '/getThumbnail';
+ next.src = this.translateImgUrl(next.parentNode.href) + '/getThumbnail';
};