]> _ Git - fluidbook-toolbox.git/commitdiff
wip #5524 @1
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 22 Feb 2023 07:07:35 +0000 (08:07 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 22 Feb 2023 07:07:35 +0000 (08:07 +0100)
.docker/config/ssh/user/authorized_keys2
.docker/config/ssh/user/known_hosts
app/Fluidbook/Farm.php
resources/linkeditor/js/linkeditor.js
resources/linkeditor/js/linkeditor.loader.js
resources/views/fluidbook_publication/link_editor.blade.php
resources/views/fluidbook_publication/link_editor_icons.blade.php

index fb1cd02c78503362dee7a7652299f07f5e68d415..be802d15587572fda0342b4d2259a976552909c8 100644 (file)
@@ -1,3 +1,4 @@
 #ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDwuvRRPH1/Xph5kTo77b/OBRbpumjmu8EZ83h4wFPeg5oy8EpsMKSevYpXWmEuZuUL34HJdmY1WYb+EecUpcOYM1DfLJwGcD324chf7qddpt/85y/fRyplJQNkWcgzUAppA2AXHR21xgNPsqpMYbuIJmqcAAzGLeBznq3TB/sQqSXkoOqcyZxCXPAr4f+UmO+QG7Ct2iuXDjENEiQ3/Ckn4P9bCKNFkol9qQTznM5NN8x+nxU4+Kpkefxr3mhx6Cxl3K2raa5Yq2BzcXXQQR7eJBoqDEJpGcdAybO5IyMeB0LBXIrsSXy6e4zTj0Aj9k7Kr7ilh5eoJ20T4OvO3KFF stephen@cubedesigners.com
 ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAQEAtabxRZZMjtmq+r8uXsBmfLgAtkxqwigGpx0e6Mx066ukIWIafFsguity6aV5QNI4UfxXnX3QXROcWeIiyLBV4yDGxuq7ah4r0X1CjqHUvHoGpXwJ2DIWPeaa8XyXnavmj0SNtKn0f1T+oJS0fcryUTLyxY7eOgNsr+pp1fVmgca9Efj0BKUXV/SUIjp8JX3x0/E/3PAqG81zus2SxzuOO1b0FKXDq43Gx6Ov3Ok7+Pje4G4pB56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UE6/0TKeNeXQv15z7hQ9192Qnjo2Z7qcnebiZrozxo5i7tArJssHekrkMIzF4ujVL0WLLxXt85YAN/AB4A15B1lTM1Cyarp7kFK3mVD7nicJYsCapEgaVa8im6MIJoASg4/qRCrA006LQqC2TyX5wi9mECgJhKCp80= fluidbookfarmer@cubedesigners.com
index 59c896d8f5cfd712784ac35435f259cdaef810b5..4898ec98f3e10aed91e334de02b48ea71db11872 100644 (file)
@@ -54,3 +54,4 @@
 |1|EmZ7B29Ivw6vXBlnc4XgrTLl9+8=|78a+bA6zcqZqT3mcCSA7DgfgtWQ= ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBEKmRybFZ/yMrtKp92N7MpKSByOo4TNm1yFa96mvH4ktgxG9Iw5LdRBELGknXZO0hRkysrblSsQ6Opu/8ZOdPuo=
 |1|JzPIYF8QCrSBS4t2fVId5Ym7Kyg=|0K3icsRiZpexNkPIchHkADj+UJE= ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBEKmRybFZ/yMrtKp92N7MpKSByOo4TNm1yFa96mvH4ktgxG9Iw5LdRBELGknXZO0hRkysrblSsQ6Opu/8ZOdPuo=
 |1|6wykuWMhStQ5Tv99aBiqb6H+zyY=|cl+8o5TNKooA36tWnHoIAOIvV4k= ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBEGI/UefTFGQMkNX5fjbcI6ZIwDbOvWi0Pu2NAdrnqMI7OEHbFZ2PZdyOFkOvg+r6L989kt9xX7UDC4hb7YbFXI=
+kingkong.cubedesigners.com ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAYlGygCsICCRvgOUYi18Nwudv3z1vUsRmvvDKQ4Gs95
index 91b29488037a0338b65fcd61153035e600441c94..b4f8085023cca70d9a13b31f9faf7e2e8906b24c 100644 (file)
@@ -79,22 +79,13 @@ class Farm
         $start = microtime(true);
         $farmer = self::pickOneServer();
 
-        $path = str_replace('/protected/fluidbookpublication/docs/', '/fluidbook/docs/', $path);
+        $params = ['toolbox' => 1, 'page' => $page, 'format' => $format, 'resolution' => $resolution, 'withText' => $withText, 'withGraphics' => $withGraphics, 'version' => $version, 'force' => $force, 'out' => $path, 'resolutionRatio' => $resolutionRatio, 'mobileRatio' => $mobileFirstRatio];
 
-        $params = ['page' => $page, 'format' => $format, 'resolution' => $resolution, 'withText' => $withText, 'withGraphics' => $withGraphics, 'version' => $version, 'force' => $force, 'out' => $path, 'resolutionRatio' => $resolutionRatio, 'mobileRatio' => $mobileFirstRatio];
+        $output = trim(self::sendRequest($farmer, 'process.php', $params));
 
-        $output = self::sendRequest($farmer, 'process.php', $params);
-
-        if (preg_match('|^/application/fluidbook/docs/[^\s]+$|', $output, $matches)) {
-            $o = str_replace('/fluidbook/docs/', '/protected/fluidbookpublication/docs/', $matches[0]);
-        } else {
-            $o = $output;
-        }
-
-        if (file_exists($o)) {
-            $res = $o;
+        if (file_exists($output)) {
+            $res = $output;
         } else {
-            echo $o;
             $res = false;
         }
 
index e7dd9d5a82de7263e407f77bd5c3a243ca3ac983..ae774af1d2a505e2357375de040afe04e644b346 100644 (file)
@@ -46,7 +46,6 @@ require('select2');
 import 'select2/dist/css/select2.css';
 import 'select2-bootstrap-theme/dist/select2-bootstrap.css';
 
-
 window.MD5 = require("crypto-js/md5");
 
 $.ajaxSetup({
@@ -437,6 +436,15 @@ LinkEditor.prototype = {
         }
     },
 
+    togglePDFThumbnails: function () {
+        this.loader.togglePagesSource();
+        if (this.loader.pagesSource === 'thumbnails') {
+            $('[data-action="togglePDFThumbnails"]').addClass('active');
+        } else {
+            $('[data-action="togglePDFThumbnails"]').removeClass('active');
+        }
+    },
+
     openFluidbook: function () {
         window.open('/fluidbook-publication/preview/' + FLUIDBOOK_DATA.id + '_' + FLUIDBOOK_DATA.hash + '/#/page/' + this.currentPage);
     },
index 7f5627e7e7a977920d7bd4c48aa5c6f931128c0e..d2612012b979d04aa4ef9938fd32f0b22258b938 100644 (file)
@@ -1,11 +1,13 @@
 function LinkeditorLoader(linkeditor) {
     this.linkeditor = linkeditor;
+    this.preloadTimeouts = [];
     this.init();
 }
 
 LinkeditorLoader.prototype = {
 
     init: function () {
+        this.pagesSource = 'pages';
         this.rasterizePages = this.linkeditor.utils.splitPages(FLUIDBOOK_DATA.settings.rasterizePages);
         this.vectorPages = this.linkeditor.utils.splitPages(FLUIDBOOK_DATA.settings.vectorPages);
     },
@@ -33,6 +35,19 @@ LinkeditorLoader.prototype = {
         this.linkeditor.rulers.loadRulers(p, side);
     },
 
+    togglePagesSource: function () {
+        this.pagesSource = this.pagesSource === 'pages' ? 'thumbnails' : 'pages';
+        this.clearPreloads();
+        this.preloadPages();
+    },
+
+    clearPreloads: function () {
+        $.each(this.preloadTimeouts, function (k, timeout) {
+            clearTimeout(timeout);
+        });
+        $("#linkeditor-preload").html('');
+    },
+
     preloadPages: function () {
         let j = 1;
         var $this = this;
@@ -40,11 +55,11 @@ LinkeditorLoader.prototype = {
             if ($('.preload[data-page="' + i + '"]').length >= 1) {
                 continue;
             }
-            setTimeout(function () {
+            this.preloadTimeouts.push(setTimeout(function () {
                 var c = $('<div class="preload" data-page="i"></div>');
                 $("#linkeditor-preload").append(c);
                 $this._loadPage(i, c, true);
-            }, j * 1500);
+            }, j * 1500));
             j++;
         }
     },
@@ -55,13 +70,17 @@ LinkeditorLoader.prototype = {
         if (this.linkeditor.utils.isSpecialPage(p)) {
             c += '<img draggable="false" class="images" src="' + this.linkeditor.utils.getSpecialPageAssetURL(p) + '" />';
         } else {
-            if (this.rasterizePages.indexOf(p) >= 0) {
-                c += '<img draggable="false" src="raster_' + p + '.' + imageFormat + '" />';
-            } else if (this.vectorPages.indexOf(p) >= 0) {
-                c += '<img draggable="false" src="vector_' + p + '.svg" />';
-            } else {
-                c += '<img draggable="false" class="images" src="images_' + p + '.' + imageFormat + '" />';
-                c += '<img draggable="false" class="texts" src="texts_' + p + '.svg" />';
+            if(this.pagesSource==='pages') {
+                if (this.rasterizePages.indexOf(p) >= 0) {
+                    c += '<img draggable="false" src="raster_' + p + '.' + imageFormat + '" />';
+                } else if (this.vectorPages.indexOf(p) >= 0) {
+                    c += '<img draggable="false" src="vector_' + p + '.svg" />';
+                } else {
+                    c += '<img draggable="false" class="images" src="images_' + p + '.' + imageFormat + '" />';
+                    c += '<img draggable="false" class="texts" src="texts_' + p + '.svg" />';
+                }
+            }else if(this.pagesSource==='thumbnails'){
+                c += '<img draggable="false" src="thumb_' + p + '.' + imageFormat + '" />';
             }
         }
         c += '</div>';
index 53d549a1d014884ccb274182d8c2cf44bfdfe4bb..355017bd313ba9d917ed6947272eda2f3ed3e3e6 100644 (file)
                         @endif
                     @endif
                     <div class="separator"></div>
-                    <a href="#" data-action="toggleThumbnailsPDF" data-icon="pdf-thumbnails" data-tooltip="{{__('Afficher les pages du PDF des miniatures')}}"></a>
-                    <a href="#" data-action="toggleWhiteOverlay" data-icon="white-overlay" data-tooltip="{{__('Afficher un overlay blanc semi-opaque au dessus des pages')}}"></a>
-                    <a href="#" data-action="openFluidbook" data-icon="open-fluidbook" data-tooltip="{{__('Ouvrir le fluidbook à la page courante')}}"></a>
+                    @if($fluidbook->pdfThumbnails)toggleThumbnailsPDF
+                        <a href="#" data-action="" data-icon="pdf-thumbnails"
+                           data-tooltip="{{__('Afficher les pages du PDF des miniatures')}}"></a>
+                    @endif
+                    <a href="#" data-action="toggleWhiteOverlay" data-icon="white-overlay"
+                       data-tooltip="{{__('Afficher un overlay blanc semi-opaque au dessus des pages')}}"></a>
+                    <a href="#" data-action="openFluidbook" data-icon="open-fluidbook"
+                       data-tooltip="{{__('Ouvrir le fluidbook à la page courante')}}"></a>
                 </nav>
                 <nav id="linkeditor-toolbar-right">
 
index d98c948202372925abc186e4adfcc2ccd5d4dbb2..1250c8014ec0ee7485a47040093e1cb03cbc5f0f 100644 (file)
@@ -48,6 +48,5 @@
             });
             return '<svg ' + a.join(' ') + ' aria-hidden="true"><use xlink:href="#' + icon + '" /></svg>';
         }
-
     </script>
 @endpush