From 4d3ece7aba9d3a5e69d2eab3f6e8239a7a9f61bf Mon Sep 17 00:00:00 2001 From: "stephen@cubedesigners.com" Date: Fri, 25 Aug 2017 12:39:17 +0000 Subject: [PATCH] Merging master to html5video + burgermenu branches and adding/adjusting some parameter options. --- inc/ws/Metier/class.ws.book.parametres.php | 6 ++- inc/ws/Metier/class.ws.theme.parametres.php | 2 +- .../burgermenu/class.ws.html5.compiler.php | 3 +- .../html5video/class.ws.html5.compiler.php | 41 +++++++++++++------ 4 files changed, 36 insertions(+), 16 deletions(-) diff --git a/inc/ws/Metier/class.ws.book.parametres.php b/inc/ws/Metier/class.ws.book.parametres.php index ff3cdbc89..027e54715 100644 --- a/inc/ws/Metier/class.ws.book.parametres.php +++ b/inc/ws/Metier/class.ws.book.parametres.php @@ -125,11 +125,15 @@ class wsBookParametres extends wsParametres { $this->fields['preload'] = array('type' => 'integer', 'default' => 16, 'editable' => true, 'label' => __('Nombre de pages à précharger'), 'grade' => 3); + $this->fields['menuPosition'] = array('type' => 'combo', 'default' => 'right', 'editable' => true, 'label' => __("Position du menu"), + 'datas' => array(__('Droite') => 'right', + __('Gauche') => 'left')); + $this->fields['navOrder'] = array('type' => 'textarea', 'default' => 'index, chapters, print, friend, bookmark, pdf, archives, basket, fullscreen, sound, 3d, lang, help', 'editable' => true, 'label' => __('Ordre des icônes dans la nav'), 'grade' => 3); $this->fields['tooltipTimer'] = array('type' => 'float', 'default' => 3, "editable" => true, 'label' => __("Temps maximum d'apparition des infos-bulles (en secondes)")); $this->forms['general'] = array('label' => __('Fonctionnalités générales'), - 'fieldsnames' => array('navOrder', 'tooltipTimer', 'preload', 'pages', 'width', 'height')); + 'fieldsnames' => array('menuPosition', 'navOrder', 'tooltipTimer', 'preload', 'pages', 'width', 'height')); //. // diff --git a/inc/ws/Metier/class.ws.theme.parametres.php b/inc/ws/Metier/class.ws.theme.parametres.php index 444767c37..547fc0036 100644 --- a/inc/ws/Metier/class.ws.theme.parametres.php +++ b/inc/ws/Metier/class.ws.theme.parametres.php @@ -172,7 +172,7 @@ class wsThemeParametres extends wsParametres { 'fieldsnames' => array('transparentBackground', '|', 'backgroundColor', '|', 'backgroundImage', 'repeat', 'backgroundHAlign', 'backgroundVAlign', '|', 'displayBackgroundDuringLoading')); /* Menu bar */ - $this->fields['menuHeight'] = array('type' => 'integer', 'default' => 39, 'editable' => true, + $this->fields['menuHeight'] = array('type' => 'integer', 'default' => 60, 'editable' => true, 'label' => __('Hauteur (en pixels)')); $this->fields['menuColor'] = array('type' => 'couleurAlpha', 'default' => 'ffffffff', 'editable' => true, 'label' => __("Couleur du fond")); diff --git a/inc/ws/Util/html5/burgermenu/class.ws.html5.compiler.php b/inc/ws/Util/html5/burgermenu/class.ws.html5.compiler.php index f4bedb827..25ec2c4b0 100644 --- a/inc/ws/Util/html5/burgermenu/class.ws.html5.compiler.php +++ b/inc/ws/Util/html5/burgermenu/class.ws.html5.compiler.php @@ -34,6 +34,7 @@ class wsHTML5Compiler { 'js/libs/gal/gal.js', 'js/libs/gal/gal.filesystem.js', 'js/libs/interact.js', + 'js/libs/hammer.js', 'js/libs/fluidbook/forms/fluidbook.form.bulle.js', 'js/libs/fluidbook/fluidbook.utils.js', 'js/libs/fluidbook/fluidbook.links.js', @@ -949,7 +950,7 @@ class wsHTML5Compiler { } if (!$reminimize) { - if (filemtime(__FILE__) > $mintime || filemtime(__DIR__ . '/class.ws.html5.links.php') > $mintime) { + if (filemtime(__FILE__) > $mintime || (file_exists(__DIR__ . '/class.ws.html5.links.php') && filemtime(__DIR__ . '/class.ws.html5.links.php') > $mintime)) { $reminimize = true; } } diff --git a/inc/ws/Util/html5/html5video/class.ws.html5.compiler.php b/inc/ws/Util/html5/html5video/class.ws.html5.compiler.php index 7b67d3e85..e9f8fdc22 100644 --- a/inc/ws/Util/html5/html5video/class.ws.html5.compiler.php +++ b/inc/ws/Util/html5/html5video/class.ws.html5.compiler.php @@ -29,6 +29,7 @@ class wsHTML5Compiler { 'js/libs/gal/gal.js', 'js/libs/gal/gal.filesystem.js', 'js/libs/interact.js', + 'js/libs/hammer.js', 'js/libs/fluidbook/forms/fluidbook.form.bulle.js', 'js/libs/fluidbook/fluidbook.utils.js', 'js/libs/fluidbook/fluidbook.links.js', @@ -144,7 +145,7 @@ class wsHTML5Compiler { protected $additionalConfig = array(); protected $fontScale = 1; protected $cache = array(); - protected $backgroundsPrefix = 'p'; + protected $backgroundsPrefix = array(); protected $svg = true; protected $config = array(); protected $assets = ''; @@ -212,9 +213,19 @@ class wsHTML5Compiler { $this->book = $this->daoBook->selectById($book_id); $this->pages = $this->daoBook->getPagesOfBook($book_id); - if ($this->book->parametres->mobileVersion == 'html5-images') { - $this->backgroundsPrefix = 't'; - $this->svg = false; + switch ($this->book->parametres->mobileVersion) { + case 'html5-desktop': + $this->backgroundsPrefix = array('t', 'p'); + $svg = true; + break; + case 'html5-images': + $this->backgroundsPrefix = array('t'); + $svg = false; + break; + default: + $this->backgroundsPrefix = array('p'); + $svg = true; + break; } $daoTheme = new wsDAOTheme($core->con); @@ -1039,6 +1050,7 @@ class wsHTML5Compiler { } } } + $this->config->rasterizePages = cubeArray::parseRange($this->config->rasterizePages); return 'var DATAS=' . json_encode($this->config) . ';' . "\n"; } @@ -1091,10 +1103,7 @@ class wsHTML5Compiler { foreach ($this->getResolutions() as $r) { mkdir($this->vdir . '/data/background/' . $r, 0777, true); } - $srcPrefix = $this->backgroundsPrefix; - if ($this->backgroundsPrefix == 'p') { - $srcPrefix = 'h'; - } + $thumbs = array(); foreach ($this->pages as $page => $infos) { $docdir = wsDocument::getDir($infos['document_id']); @@ -1111,11 +1120,17 @@ class wsHTML5Compiler { } foreach ($this->getResolutions() as $r) { - $ok = $this->copy($docdir . 'html/' . $srcPrefix . $r . '-' . $infos['document_page'] . '.jpg', $this->vdir . '/data/background/' . $r . '/' . $this->backgroundsPrefix . $page . '.jpg'); - if (!$ok && $r = 300) { - $this->maxRes = 150; + foreach ($this->backgroundsPrefix as $backgroundsPrefix) { + $srcPrefix = $backgroundsPrefix; + if ($backgroundsPrefix == 'p') { + $srcPrefix = 'h'; + } + $ok = $this->copy($docdir . 'html/' . $srcPrefix . $r . '-' . $infos['document_page'] . '.jpg', $this->vdir . '/data/background/' . $r . '/' . $backgroundsPrefix . $page . '.jpg'); + if (!$ok && $r = 300) { + $this->maxRes = 150; + } } - $this->copy(WS_DOCS . '/' . $infos['document_id'] . '/p' . $infos['document_page'] . '.jpg', $this->vdir . '/data/thumbnails/p' . $page . '.jpg'); + $this->copy(WS_DOCS . '/' . $infos['document_id'] . '/p' . $infos['document_page'] . '.jpg', $this->vdir . '/data/thumbnails/p' . $page . '.jpg'); } $thumb = false; @@ -1359,7 +1374,7 @@ class wsHTML5Compiler { $res[] = '#shadow>div{' . wsHTML5::writeCSSUA('box-shadow', '0 0 20px ' . $shadowColor) . '}'; } - $lessVariables['links-color']=wsHTML5::colorToCSS($this->theme->parametres->linksColor); + $lessVariables['links-color'] = wsHTML5::colorToCSS($this->theme->parametres->linksColor); // Links Styles $res = array_merge($res, $links); -- 2.39.5