callback();
} else {
var $this = this;
- if (window.gal !== undefined && window.gal!==null && !OFFLINEAPP) {
+ if (window.gal !== undefined && window.gal !== null && !OFFLINEAPP) {
window.gal.downloadAndCall('content_' + page, function () {
$this.__loadBackground(page, callback);
}, 250);
var ctx = c.getContext("2d");
ctx.clearRect(0, 0, d, d);
+ var wr = d / $this.fluidbook.datas.width;
+ var hr = d / $this.fluidbook.datas.height;
+
// Draw background
if (this.backgrounds[page] !== undefined && this.backgrounds[page] !== null) {
ctx.drawImage(this.backgrounds[page].get(0), 0, 0, d, d);
}
}
+ // Draw content links
+ var clinks = this.fluidbook.datas.clinks[page];
+ if (clinks !== '') {
+ $("body").append('<div id="texture_clinks">' + clinks + '</div>');
+ $("#texture_clinks .contentLink").each(function () {
+ var left = parseFloat($(this).css('left')) * wr;
+ var top = parseFloat($(this).css('top')) * hr;
+ var width = parseFloat($(this).css('width')) * wr;
+ var height = parseFloat($(this).css('height')) * hr;
+ if ($(this).is('[data-color]')) {
+ ctx.fillStyle = $(this).attr('data-color');
+ ctx.fillRect(left, top, width, height);
+ } else {
+
+ }
+ });
+
+ $("#texture_clinks").remove();
+ }
+
// Draw the shadow if necessary
if (this.fluidbook.datas.shadeAlpha > 0) {
- var sw = 1024 * .25;
+ var sw = d * .25;
var s, x;
if (page % 2 === 0) {
// Left