]> _ Git - cubeextranet.git/commitdiff
Merging master to html5video + burgermenu branches and adding/adjusting some paramete...
authorstephen@cubedesigners.com <stephen@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Fri, 25 Aug 2017 12:39:17 +0000 (12:39 +0000)
committerstephen@cubedesigners.com <stephen@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Fri, 25 Aug 2017 12:39:17 +0000 (12:39 +0000)
inc/ws/Metier/class.ws.book.parametres.php
inc/ws/Metier/class.ws.theme.parametres.php
inc/ws/Util/html5/burgermenu/class.ws.html5.compiler.php
inc/ws/Util/html5/html5video/class.ws.html5.compiler.php

index ff3cdbc89e5041d79e37cf0783e0e4ac5326838d..027e54715686ea5ea20a5cd94a2013cc417b9386 100644 (file)
@@ -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'));
                //.
                //
 
index 444767c3722878079e0b975766f0712694c74d98..547fc00364d2450b8b5e45ac5a574cdc3d2e04fb 100644 (file)
@@ -172,7 +172,7 @@ class wsThemeParametres extends wsParametres {
                                                   'fieldsnames' => array('transparentBackground', '|', 'backgroundColor', '|', 'backgroundImage',\r
                                                                          'repeat', 'backgroundHAlign', 'backgroundVAlign', '|', 'displayBackgroundDuringLoading'));\r
                /* Menu bar */\r
-               $this->fields['menuHeight'] = array('type' => 'integer', 'default' => 39, 'editable' => true,\r
+               $this->fields['menuHeight'] = array('type' => 'integer', 'default' => 60, 'editable' => true,\r
                                                    'label' => __('Hauteur (en pixels)'));\r
                $this->fields['menuColor'] = array('type' => 'couleurAlpha', 'default' => 'ffffffff', 'editable' => true,\r
                                                   'label' => __("Couleur du fond"));\r
index f4bedb827581c9fab4a7a6674c16f2e084fe63c1..25ec2c4b030c07dd4f838e19b7a216a0a5054f04 100644 (file)
@@ -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;
                                }
                        }
index 7b67d3e859006a057931d192037f6dae37c68189..e9f8fdc224e1a99c4dc9e5937a84c992fdb92f5e 100644 (file)
@@ -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);