var img = this.loadImage(src, width, height, type, callback);
return $(img).get(0).outerHTML;
},
- getThumbImage: function (page, div, shade) {
+ getThumbImage: function (page, div, shade, width) {
var returnHTML = false;
if (div === null || div == undefined) {
div = $('<div />');
}
+ if (width == undefined) {
+ width = 100;
+ }
left = ((page % 2 == 0) && this.fluidbook.l10n.ltr) || ((page % 2 == 1) && this.fluidbook.l10n.rtl);
- var h = this.fluidbook.datas.thumbHeight;
- var s = Math.floor((page - 1) / 100);
- var row = Math.floor(((page - (s * 100)) - 1) / 10);
+ var h = width * (this.fluidbook.datas.thumbHeight / 100);
+ var s = Math.floor((page - 1) / width);
+ var row = Math.floor(((page - (s * width)) - 1) / 10);
var col = (page - 1) % 10;
if (col < 0) {
col += 10;
}
- var spriteleft = col * 100;
+ var spriteleft = col * width;
var spritetop = row * h;
var shadeImage = '';
shadeImage = 'url("images/shadows/thumbnails/' + i + '.png"),';
shadePosition = p + " 0%,";
- shadeSize = '50px ' + h + 'px,';
+ shadeSize = (width / 2) + 'px ' + h + 'px,';
+ }
+
+ var thumbImage = 'url("data/thumbnails/s' + s + '.jpg")';
+ var thumbPosition = (-spriteleft) + 'px ' + (-spritetop) + 'px';
+ var thumbSize = 'auto auto';
+
+ if (width != 100) {
+ thumbImage = 'url("data/background/150/t' + page + '.jpg")';
+ thumbPosition = '0px 0px';
+ thumbSize = '100% 100%';
}
$(div).css({
- backgroundImage: shadeImage + 'url("data/thumbnails/s' + s + '.jpg")',
- backgroundPosition: shadePosition + '' + (-spriteleft) + 'px ' + (-spritetop) + 'px',
- backgroundSize: shadeSize + 'auto auto'
+ backgroundImage: shadeImage + thumbImage,
+ backgroundPosition: shadePosition + thumbPosition,
+ backgroundSize: shadeSize + thumbSize
}).addClass('img');
return $(div).get(0).outerHTML;
},
view += '</div>';
$("#view").append('<div class="mview" data-menu="bookmarks-help">' + view + '</div>');
- this.fluidbook.loader.getThumbImage(2, $("#view .thumb.left .img"), false, 147);
- this.fluidbook.loader.getThumbImage(3, $("#view .thumb.right .img"), false, 147);
+ this.fluidbook.loader.getThumbImage(2, $("#view .thumb.left .img"), true, 147);
+ this.fluidbook.loader.getThumbImage(3, $("#view .thumb.right .img"), true, 147);
if (callback != undefined) {
callback();