]> _ Git - cubeextranet.git/commitdiff
wait #4586 @0.5
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Fri, 9 Jul 2021 09:34:23 +0000 (09:34 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Fri, 9 Jul 2021 09:34:23 +0000 (09:34 +0000)
inc/ws/Metier/class.ws.parametres.php
inc/ws/Util/html5/master/class.ws.html5.compiler.php
inc/ws/Util/html5/master/class.ws.html5.links.php

index 58c234e1632009a6d627cffb8beb2b2d85bdb9ea..58162c5d6ae6b00bc9318fc73c44f4085f3474dc 100644 (file)
@@ -118,7 +118,10 @@ class wsParametres extends cubeMetier implements Iterator
     protected function set($varname, $value)\r
     {\r
         if (!$this->_isset($varname)) {\r
-            throw new Exception('You are setting an attribute (' . get_class($this) . '::' . $varname . ') which not exists');\r
+\r
+            $msg = 'You are setting an attribute (' . get_class($this) . '::' . $varname . ') which not exists';\r
+            trigger_error($msg);\r
+            throw new Exception($msg);\r
         }\r
 \r
         if (is_null($value)) {\r
@@ -184,7 +187,9 @@ class wsParametres extends cubeMetier implements Iterator
             return false;\r
         }\r
         if (!$this->_isset($varname)) {\r
-            throw new Exception('You are getting an attribute (' . get_class($this) . '::' . $varname . ') which not exists');\r
+            $msg='You are getting an attribute (' . get_class($this) . '::' . $varname . ') which not exists';\r
+            trigger_error($msg);\r
+            throw new Exception($msg);\r
         }\r
         if (!isset($this->datas[$varname]) || is_null($this->datas[$varname])) {\r
             return $this->getDefault($varname);\r
index 3084618b3107571066692172a3121d875862460b..3f56205e9a6b2db8cb60678f9bdb4fd3471a4c97 100644 (file)
@@ -854,6 +854,7 @@ class wsHTML5Compiler
         $this->writeExtras();
         $this->log('Extras written');
         $this->populateConfig();
+        $this->log('Config populated');
         $this->writeCSS($linksCSS);
         $this->log('CSS written');
         $this->writeIndex();
@@ -1259,11 +1260,11 @@ height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
 
             $favicon = '';
             $hasIos = false;
-            if ($iosico = $this->checkThemeImage($this->theme->parametres->iosicon)) {
-                $hasIos = true;
-                $this->vdir->copy($iosico, 'data/apple-touch-icon.png');
-                $favicon .= '<link rel="apple-touch-icon" href="data/apple-touch-icon.png" />' . "\n\t";
-            }
+            //if ($iosico = $this->checkThemeImage($this->theme->parametres->iosicon)) {
+            //    $hasIos = true;
+            //    $this->vdir->copy($iosico, 'data/apple-touch-icon.png');
+            //    $favicon .= '<link rel="apple-touch-icon" href="data/apple-touch-icon.png" />' . "\n\t";
+            //}
             if ($this->theme->parametres->favicon != '') {
 
                 $pngFile = $this->checkThemeImage($this->theme->parametres->favicon);
@@ -1349,6 +1350,7 @@ height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
     protected function writeIndex()
     {
         $iv = $this->getIndexVars();
+        $this->log('Got index vars');
         foreach ($iv as $k => $v) {
             $this->seo->html = str_replace($k, $v, $this->seo->html);
         }
@@ -2305,6 +2307,8 @@ height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
         $this->lessVariables['slider-thumb-background'] = wsHTML5::colorToCSS($this->theme->parametres->pageBarThumbBack);
         $this->lessVariables['pages-background'] = $this->book->parametres->forceWhiteBackground ? '#ffffff' : 'transparent';
 
+        $this->log('CSS 1');
+
         // General theme
         $cssWidth = $this->cssWidth;
         $cssHeight = $this->cssHeight;
@@ -2331,22 +2335,25 @@ height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
             $this->lessVariables['book-page-correct-width'] = $w;
             $this->lessVariables['book-page-correct-height'] = $h;
         }
+
+        $this->log('CSS 2');
         $this->lessVariables['book-page-height'] = $h;
         $this->lessVariables['book-page-ratio'] = floatval($w) / floatval($h);
 
         $this->lessVariables['page-shade-opacity'] = min(1, $this->theme->parametres->shadeAlpha / 50);
         $this->lessVariables['shadow-opacity'] = wsHTML5::colorToArray($this->theme->parametres->bookShadeColor)['opacity'] * 1.2;
         $this->lessVariables['edges-display'] = $this->_lessBoolean($this->theme->parametres->usePageEdges);
-        $this->lessVariables['edge-left-offset'] = $this->theme->parametres->pageEdgeLeftOffset;
-        $this->lessVariables['edge-right-offset'] = $this->theme->parametres->pageEdgeRightOffset;
-        $this->lessVariables['edges-opacity'] = $this->theme->parametres->pageEdgeOpacity / 100;
+        $this->lessVariables['edge-left-offset'] = 0;
+        $this->lessVariables['edge-right-offset'] = 0;
+        $this->lessVariables['edges-opacity'] = 1;
+
 
         $this->lessVariables['page-number-color'] = wsHTML5::colorToCSS($this->theme->parametres->colorPageNumber);
         $this->lessVariables['display-page-number'] = $this->_lessBoolean($this->theme->parametres->displayPageNumber);
         $this->lessVariables['page-transition-duration'] = $this->book->parametres->mobileTransitionDuration . 's';
 
         $corrText = $this->isMobileFirst() ? 0 : 4;
-
+        $this->log('CSS 3');
         if ($this->cssSVGScale != 1) {
             $texts = '.texts{' . wsHTML5::writeCSSUA('transform-origin', 'top left') . ';';
             $texts .= wsHTML5::writeCSSUA('transform', 'scale(' . round((1 / $this->multiply) * $cssScale * $this->cssSVGScale, 3) . ')') . ';';
@@ -2371,7 +2378,7 @@ height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
 
         // Background
         $res[] = $this->_cssBackground();
-
+        $this->log('CSS 4');
         // Archives
         // Header
         $header = 'header{';
@@ -2387,7 +2394,7 @@ height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
         }
         $header .= '}';
         $res[] = $header;
-
+        $this->log('CSS 5');
         // Logo
         $logo = '#logo{';
         if ($l = $this->checkThemeImage($this->theme->parametres->logo)) {
@@ -2400,7 +2407,7 @@ height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
 
         // Credits
         $res[] = 'footer,footer a{color:' . wsHTML5::colorToCSS($this->theme->parametres->creditsColor) . ';}';
-
+        $this->log('CSS 6');
         // Arrows
         $this->lessVariables['arrows-background'] = wsHTML5::colorToCSS($this->theme->parametres->couleurA);
         $this->lessVariables['arrows-color'] = wsHTML5::colorToCSS($this->theme->parametres->arrowsColor);
@@ -2412,7 +2419,7 @@ height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
         // Audio description buttons
         $this->lessVariables['audiodescription-background'] = wsHTML5::colorToCSS($this->theme->parametres->couleurA);
         $this->lessVariables['audiodescription-color'] = wsHTML5::colorToCSS($this->theme->parametres->couleurA);
-
+        $this->log('CSS 7');
         // Links Styles
         $this->lessVariables['links-color'] = wsHTML5::colorToCSS($this->theme->parametres->linksColor);
         $this->lessVariables['inlineslideshow-transition-time'] = (floatval($this->book->parametres->inlineSlideshowTransitionDuration) * 1000) . 'ms';
@@ -2424,7 +2431,7 @@ height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
         if (!isset($this->book->parametres->bookmarkCornerSize)) {
             $this->book->parametres->bookmarkCornerSize = 10;
         }
-
+        $this->log('CSS 8');
         $this->lessVariables['bookmark-star-disabled-color'] = wsHTML5::colorToCSS($this->theme->parametres->bookmarkStarDisabledColor);
         $this->lessVariables['bookmark-star-enabled-color'] = wsHTML5::colorToCSS($this->theme->parametres->bookmarkStarEnabledColor);
         $this->lessVariables['bookmark-color'] = wsHTML5::colorToCSS($this->theme->parametres->bookmarkBackgroundColor);
@@ -2447,7 +2454,7 @@ height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
             $this->lessVariables['menu-background-blue'] = 'max(45, min(255-45, blue(@menu-background)))';
             $this->lessVariables['menu-button-background'] = 'overlay(rgb(@menu-background-red, @menu-background-green, @menu-background-blue), #c0c0c0)';
         }
-
+        $this->log('CSS 9');
         $this->lessVariables['menu-text'] = $menuTextColor;
         $this->lessVariables['menu-field-background'] = wsHTML5::colorToCSS($this->theme->parametres->subFieldColor);
         $this->lessVariables['menu-field-text'] = wsHTML5::colorToCSS($this->theme->parametres->subTextFieldColor);
@@ -2455,7 +2462,7 @@ height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
         $this->lessVariables['menu-select-text'] = wsHTML5::colorToCSS($this->theme->parametres->subTextSelectColor);
         $this->lessVariables['icon-color'] = wsHTML5::colorToCSS($this->theme->parametres->couleurI);
         $this->lessVariables['menu-overlay'] = wsHTML5::colorToCSS($this->theme->parametres->popupVideoOverlay);
-
+        $this->log('CSS 10');
         // Chapters
         $this->lessVariables['menu-chapters-columns-count'] = max(1, min(6, $this->book->parametres->chaptersColumns));
         $this->lessVariables['menu-chapters-columns-width'] = $this->book->parametres->chaptersColMaxWidth;
@@ -2477,7 +2484,7 @@ height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
             $this->vdir->copy($this->wdir . '/' . $this->book->parametres->externalArchivesBack, 'data/images/' . $this->book->parametres->externalArchivesBack);
             $res[] = '.mview.archives{background-image:url("../images/' . $this->book->parametres->externalArchivesBack . '");}';
         }
-
+        $this->log('CSS 11');
         # Index
         $thumbw = $this->book->parametres->mobileNavigationType === 'portrait' ? 200 : 100;
         $this->lessVariables['thumb-width'] = $thumbw . 'px';
@@ -2492,7 +2499,7 @@ height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
         $this->lessVariables['tooltip-background'] = wsHTML5::colorToCSS($this->theme->parametres->tooltipBackColor);
         $this->lessVariables['tooltip-color'] = wsHTML5::colorToCSS($this->theme->parametres->tooltipTextColor);
         $this->lessVariables['tooltip-font-size'] = 14 * ($this->theme->parametres->tooltipTextSize / 100);
-
+        $this->log('CSS 12');
         #Videos
         if ($this->book->parametres->bigPlayImage) {
             $this->lessVariables['video-bigplay-image'] = '~"../data/links/' . $this->book->parametres->bigPlayImage . '"';
@@ -2509,7 +2516,7 @@ height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
         if ($this->book->parametres->textPopupStylesheet) {
             $res[] = file_get_contents($this->wdir . '/' . $this->book->parametres->textPopupStylesheet);
         }
-
+        $this->log('CSS 13');
         $this->_writeLess($this->lessVariables, $lessContents);
         $this->stylesheets[] = 'data/style/style.css';
         $this->vdir->file_put_contents('data/style/style.css', implode("\n", $res));
index acac53a8a4ad8e08d238907edc9a02c4de7d54a6..69108a61c00079e4316d03cfb277f4943ab853a8 100644 (file)
@@ -788,6 +788,10 @@ class showLinkLink extends normalLink
 
 class tooltipLink extends normalLink
 {
+    public $backgroundColor;
+    public $color;
+    public $tooltipMaxWidth;
+
     public function getClasses()
     {
         return array_merge(array('lazy'), parent::getClasses());
@@ -1425,7 +1429,7 @@ class webVideoLink extends videoLink
         }
     }
 
-    public static function makeVideoTag($link, $width, $height, $compiler)
+    public static function makeVideoTag($link, $width, $height, $compiler = null)
     {
         if ($link->video_service == 0) {
             return parent::makeVideoTag($link, $width, $height, $compiler);