From af3508cbeb50bc1fa4a67716803542ad929a2b14 Mon Sep 17 00:00:00 2001 From: "vincent@cubedesigners.com" Date: Thu, 9 May 2019 15:59:40 +0000 Subject: [PATCH] #2654 --- .../mobilefirst/class.ws.html5.compiler.php | 88 ++++++++++--------- 1 file changed, 45 insertions(+), 43 deletions(-) diff --git a/inc/ws/Util/html5/mobilefirst/class.ws.html5.compiler.php b/inc/ws/Util/html5/mobilefirst/class.ws.html5.compiler.php index 5696eaa25..9ff37552b 100644 --- a/inc/ws/Util/html5/mobilefirst/class.ws.html5.compiler.php +++ b/inc/ws/Util/html5/mobilefirst/class.ws.html5.compiler.php @@ -75,7 +75,6 @@ class wsHTML5Compiler 'js/libs/fluidbook/fluidbook.tooltip.js', 'js/libs/fluidbook/fluidbook.bookmarks.js', 'js/libs/fluidbook/fluidbook.background.js', - 'js/libs/fluidbook/fluidbook.mobilefirst.js', 'js/libs/fluidbook/fluidbook.pad.js', 'js/libs/fluidbook/fluidbook.audiodescription.js', 'js/libs/fluidbook/fluidbook.privacy.js', @@ -90,8 +89,13 @@ class wsHTML5Compiler 'js/libs/fluidbook/fluidbook.landingpage.js', 'js/libs/fluidbook/fluidbook.slideshow.js', 'js/libs/fluidbook/fluidbook.print.js', + 'js/libs/fluidbook/fluidbook.secure.js', 'js/libs/fluidbook/fluidbook.js', - 'js/main.js'] + 'js/main.js'], + 'mobilefirst' => [ + 'js/libs/fluidbook/fluidbook.mobilefirst.js', + 'js/libs/fluidbook/mobilefirst/fluidbook.mobilefirst.slider.js', + ], ]; public $specialJsFiles = array(); @@ -294,7 +298,7 @@ class wsHTML5Compiler if ($this->book->parametres->mobileNavigationType === 'mobilefirst') { $this->initMobileFirst(); - }else{ + } else { } @@ -1667,47 +1671,47 @@ class wsHTML5Compiler } - $this->makeThumbSprites($thumbs); + //$this->makeThumbSprites($thumbs); $this->log('Made thumbnails'); } - public function makeThumbSprites(array $thumbs) - { - $cols = 10; - $rows = 10; - $perSprite = $cols * $rows; - $k = 0; - $res = ''; - $pages = count($thumbs); - - $hash = ''; - for ($i = 1; $i <= $pages; $i += $perSprite) { - $num = min(1 + $pages - $i, $perSprite); - $srows = ceil($num / $cols); - $files = array(); - $mtime = 0; - for ($j = 0; $j < $perSprite; $j++) { - $p = $i + $j; - if ($p > $pages) { - break; - } - $files[] = $thumbs[$p]; - $hash .= $thumbs[$p] . '--' . filemtime($thumbs[$p]); - } - - $cache = WS_CACHE . '/thumbsprites/' . hash('sha256', $hash) . '.jpg'; - $dest = 'data/thumbnails/s' . $k . '.jpg'; - if (!file_exists($cache)) { - $ratio = $this->width / $this->height; - $thumbh = round(100 / $ratio); - $cmd = 'montage ' . implode(' ', $files) . ' -geometry 100x' . $thumbh . '!+0+0 -background transparent -tile ' . $cols . 'x' . $srows . ' ' . $cache; - $res .= `$cmd`; - } - $this->vdir->copy($cache, $dest); - $k++; - } - return $res; - } +// public function makeThumbSprites(array $thumbs) +// { +// $cols = 10; +// $rows = 10; +// $perSprite = $cols * $rows; +// $k = 0; +// $res = ''; +// $pages = count($thumbs); +// +// $hash = ''; +// for ($i = 1; $i <= $pages; $i += $perSprite) { +// $num = min(1 + $pages - $i, $perSprite); +// $srows = ceil($num / $cols); +// $files = array(); +// $mtime = 0; +// for ($j = 0; $j < $perSprite; $j++) { +// $p = $i + $j; +// if ($p > $pages) { +// break; +// } +// $files[] = $thumbs[$p]; +// $hash .= $thumbs[$p] . '--' . filemtime($thumbs[$p]); +// } +// +// $cache = WS_CACHE . '/thumbsprites/' . hash('sha256', $hash) . '.jpg'; +// $dest = 'data/thumbnails/s' . $k . '.jpg'; +// if (!file_exists($cache)) { +// $ratio = $this->width / $this->height; +// $thumbh = round(100 / $ratio); +// $cmd = 'montage ' . implode(' ', $files) . ' -geometry 100x' . $thumbh . '!+0+0 -background transparent -tile ' . $cols . 'x' . $srows . ' ' . $cache; +// $res .= `$cmd`; +// } +// $this->vdir->copy($cache, $dest); +// $k++; +// } +// return $res; +// } protected function _makeCover($orig) { @@ -1898,8 +1902,6 @@ class wsHTML5Compiler $lessVariables['menu-overlay'] = wsHTML5::colorToCSS($this->theme->parametres->popupVideoOverlay); // Chapters - - foreach ($this->book->chapters as $chapter) { if (substr($chapter->page, 0, 1) != '#') { continue; -- 2.39.5