]> _ Git - fluidbook-html5.git/commitdiff
wait #6269 @0.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 22 Sep 2023 12:30:42 +0000 (14:30 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 22 Sep 2023 12:30:42 +0000 (14:30 +0200)
js/libs/fluidbook/fluidbook.loader.js
js/libs/fluidbook/links/fluidbook.links.zoom.js
js/libs/fluidbook/links/fluidbook.links.zoomhd.js
js/libs/fluidbook/workers/loader.js

index 4b60ad9c3e7b5fc3579c96b4c75a9f37d4b3956e..f062524f8d5ef54e10bbf60884220111cc9358c1 100644 (file)
@@ -80,7 +80,7 @@ FluidbookLoader.prototype = {
     preloadStart: function (callback) {
         let $this = this;
         this.init(function () {
-            if($this.fluidbook.sound.enabled) {
+            if ($this.fluidbook.sound.enabled) {
                 $this.fluidbook.sound.preloadSounds();
             }
             if ($this.fluidbook.shortLoading) {
@@ -566,7 +566,7 @@ FluidbookLoader.prototype = {
 
     _preloadContentLinkTextures: function (page, clinks, links, enter, callback) {
         var textures = {};
-        let $this=this;
+        let $this = this;
 
         var cl = '';
         $.each(clinks, function (blendmode, links) {
@@ -602,7 +602,7 @@ FluidbookLoader.prototype = {
             nb++;
             var i = $(this).data('id');
             var url = $(this).data('image').replace(/^\.\./, 'data') + '?j=' + (new Date()).getTime();
-            textures[i] = loadImage($this.getURL(url), cb, 'i_' + i);
+            textures[i] = $this.loadImage($this.getURL(url), cb, 'i_' + i);
         });
 
         if (nb === 0) {
index e139a2840ae46aae2ff7a0da07c508d758ac6d63..02b316821b7b45b6de37a45e17f10c91f2d5002d 100644 (file)
@@ -353,7 +353,7 @@ FluidbookLinksZoom.prototype = {
 
             // Load image before running zoom up animation
             $this.fluidbook.displayLoader();
-            loadImage(zoomImage, function (img) {
+            $this.fluidbook.loader.loadImage($this.fluidbook.loader.getURL(zoomImage), null, null, null, null, function (img) {
                 // Image is set as a background for better scaling / fitting via CSS
                 z.css('background-image', 'url(' + img.src + ')');
                 $this.fluidbook.hideLoader();
index c42a0b848235d71cb61200456f88dbab0f804e74..c8c31071c8f01828734fbae785ba931b84ac5f26 100644 (file)
@@ -57,7 +57,7 @@ FluidbookLinksZoomHD.prototype = {
         });
 
         $(document).on('mousewheel', function (e) {
-            if(this.element===undefined){
+            if (this.element === undefined) {
                 return true;
             }
             var s = $this.scale;
@@ -85,7 +85,7 @@ FluidbookLinksZoomHD.prototype = {
         this.fluidbook.menu.viewWrap(view, 'zoomhd', 'data-fullscreen="1" dir="ltr"', 'h100');
         this.element = $("#view").find('.zoomhdScale');
 
-        this.image = fluidbook.loader.loadImage('data/links/' + link.to, null, null, null, null, function () {
+        this.image = this.fluidbook.loader.loadImage(this.fluidbook.loader.getURL('data/links/' + link.to), null, null, null, null, function () {
             setTimeout(function () {
                 $this.initZoomHD();
                 setTimeout(function () {
@@ -167,7 +167,7 @@ FluidbookLinksZoomHD.prototype = {
     },
 
     setMovePos: function (x, y) {
-        if(this.element===undefined){
+        if (this.element === undefined) {
             return;
         }
         x = Math.max(this.dragMinX, Math.min(this.dragMaxX, x));
@@ -197,7 +197,7 @@ FluidbookLinksZoomHD.prototype = {
     },
 
     resize: function () {
-        if(this.element===undefined){
+        if (this.element === undefined) {
             return;
         }
         this.element.closest('.zoomhdRefScale').css({transform: 'scale(' + this.refScale + ')'});
index 8b6bf314c745bd0a55fd7779feff1370565e2445..f4e79dfc87134d606d74915df36cb7f0b2f24b45 100644 (file)
@@ -33,7 +33,7 @@ loadImage = function (src, width, height, type, callback) {
     axios.get(src, {
         responseType: 'arraybuffer'
     }).then(function (response) {
-        var res = '<img ';
+        var res = '<img crossorigin="anonymous" ';
         if (width != undefined && width != null) {
             res += 'width="' + width + '" ';
         }