});
if (cl === '') {
- callback(textures);
+ callback(textures, cl);
return;
}
$("body").append('<div class="texture_clinks" data-page="' + page + '">' + cl + '</div>');
var cb = function () {
loaded++;
if (loaded === nb) {
- callback(textures);
+ callback(textures, cl);
}
};
+
$('.texture_clinks[data-page="' + page + '"] .contentLink[data-image]').each(function () {
if ((enter && $(this).is('[data-animation-hide]')) || (!enter && $(this).is('[data-animation-hide-on-leave]'))) {
return;
}
nb++;
- var i = $(this).data('image');
- var url = i.replace(/^\.\./, 'data');
- textures[i] = loadImage(url, cb);
+ var i = $(this).data('id');
+ var url = $(this).data('image').replace(/^\.\./, 'data') + '?j=' + (new Date()).getTime();
+ textures[i] = loadImage(url, cb, 'i_' + i);
});
if (nb === 0) {
- callback(textures);
+ callback(textures, cl);
return;
}
},
return;
}
var $this = this;
- var clinks = this.handleExtension(this.fluidbook.settings.clinks[page]);
- this._preloadContentLinkTextures(page, clinks, enter, function (textures) {
+ this._preloadContentLinkTextures(page, this.fluidbook.settings.clinks[page], enter, function (textures, clinks) {
var d = 1024;
var c = document.getElementById("pscanvas");
c.width = d;
}
// Draw content links
-
if (clinks !== '') {
$('.texture_clinks[data-page="' + page + '"] .contentLink').each(function () {
if ((enter && $(this).is('[data-animation-hide]')) || (!enter && $(this).is('[data-animation-hide-on-leave]'))) {
ctx.fillStyle = $(this).attr('data-color');
ctx.fillRect(left, top, width, height);
} else if ($(this).is('[data-image]')) {
- var i = $(this).data('image');
+ var i = $(this).data('id');
+ console.log(i, textures[i], left, top, width, height);
if (textures[i] !== undefined && textures[i] !== null) {
ctx.drawImage(textures[i], left, top, width, height);
}