From: Vincent Vanwaelscappel Date: Wed, 22 Feb 2023 07:07:35 +0000 (+0100) Subject: wip #5524 @1 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=deb0b48b16f111f6b42118a8b6a564a9f586e270;p=fluidbook-toolbox.git wip #5524 @1 --- diff --git a/.docker/config/ssh/user/authorized_keys2 b/.docker/config/ssh/user/authorized_keys2 index fb1cd02c7..be802d155 100644 --- a/.docker/config/ssh/user/authorized_keys2 +++ b/.docker/config/ssh/user/authorized_keys2 @@ -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+Pje4G4pB56rJiiXlPxrBlY0e8Pz/7+kFF8izCiztJLtZig32Dx0HbLYGtSvIPJKYxK8DDD/RWWpL3mgNPYZ2PE3wHf4c7CTlxLCDP+NeRS1yQ== vincent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aVa8im6MIJoASg4/qRCrA006LQqC2TyX5wi9mECgJhKCp80= fluidbookfarmer@cubedesigners.com diff --git a/.docker/config/ssh/user/known_hosts b/.docker/config/ssh/user/known_hosts index 59c896d8f..4898ec98f 100644 --- a/.docker/config/ssh/user/known_hosts +++ b/.docker/config/ssh/user/known_hosts @@ -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 diff --git a/app/Fluidbook/Farm.php b/app/Fluidbook/Farm.php index 91b294880..b4f808502 100644 --- a/app/Fluidbook/Farm.php +++ b/app/Fluidbook/Farm.php @@ -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; } diff --git a/resources/linkeditor/js/linkeditor.js b/resources/linkeditor/js/linkeditor.js index e7dd9d5a8..ae774af1d 100644 --- a/resources/linkeditor/js/linkeditor.js +++ b/resources/linkeditor/js/linkeditor.js @@ -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); }, diff --git a/resources/linkeditor/js/linkeditor.loader.js b/resources/linkeditor/js/linkeditor.loader.js index 7f5627e7e..d2612012b 100644 --- a/resources/linkeditor/js/linkeditor.loader.js +++ b/resources/linkeditor/js/linkeditor.loader.js @@ -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 = $('
'); $("#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 += ''; } else { - if (this.rasterizePages.indexOf(p) >= 0) { - c += ''; - } else if (this.vectorPages.indexOf(p) >= 0) { - c += ''; - } else { - c += ''; - c += ''; + if(this.pagesSource==='pages') { + if (this.rasterizePages.indexOf(p) >= 0) { + c += ''; + } else if (this.vectorPages.indexOf(p) >= 0) { + c += ''; + } else { + c += ''; + c += ''; + } + }else if(this.pagesSource==='thumbnails'){ + c += ''; } } c += ''; diff --git a/resources/views/fluidbook_publication/link_editor.blade.php b/resources/views/fluidbook_publication/link_editor.blade.php index 53d549a1d..355017bd3 100644 --- a/resources/views/fluidbook_publication/link_editor.blade.php +++ b/resources/views/fluidbook_publication/link_editor.blade.php @@ -198,9 +198,14 @@ @endif @endif
- - - + @if($fluidbook->pdfThumbnails)toggleThumbnailsPDF + + @endif + +