From abbc09a67e1d367485430dd6ee1dfe8625f46129 Mon Sep 17 00:00:00 2001 From: "stephen@cubedesigners.com" Date: Tue, 30 Jan 2018 19:25:25 +0000 Subject: [PATCH] Merge changes from master branch. WIP #1852 @0.25 --- .../landing-page/class.ws.html5.compiler.php | 24 +++++++++++++++---- .../landing-page/class.ws.html5.links.php | 1 - 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/inc/ws/Util/html5/landing-page/class.ws.html5.compiler.php b/inc/ws/Util/html5/landing-page/class.ws.html5.compiler.php index 339a2853e..760ff5cc2 100644 --- a/inc/ws/Util/html5/landing-page/class.ws.html5.compiler.php +++ b/inc/ws/Util/html5/landing-page/class.ws.html5.compiler.php @@ -1293,6 +1293,8 @@ class wsHTML5Compiler { protected function writeCSS($file, $links) { $res = array(); + $lessContents = ''; + $lessVariables = array(); $lessVariables['slider-display'] = $this->_lessBoolean($this->theme->parametres->pagesBar); $lessVariables['slider-thumb-background'] = wsHTML5::colorToCSS($this->theme->parametres->pageBarThumbBack); @@ -1360,11 +1362,9 @@ class wsHTML5Compiler { $res[] = $shade; // SVG - $res[] = 'svg .fill-c-menu-back{fill:' . wsHTML5::colorToCSS($this->theme->parametres->couleurB) . ';}'; $res[] = 'svg .fill-c-menu-text{fill:' . wsHTML5::colorToCSS($this->theme->parametres->subTextColor) . ';}'; - // Background $res[] = $this->_cssBackground(); @@ -1449,6 +1449,20 @@ class wsHTML5Compiler { $lessVariables['icon-color'] = wsHTML5::colorToCSS($this->theme->parametres->couleurI); $lessVariables['menu-overlay'] = wsHTML5::colorToCSS($this->theme->parametres->popupVideoOverlay); + // Chapters + + + foreach ($this->book->chapters as $chapter) { + if (substr($chapter->page, 0, 1) != '#') { + continue; + } + if ($chapter->color == '') { + continue; + } + $color = trim($chapter->color, '#'); + $lessContents .= '.mview.c_' . $color . '{.menu-color(#' . $color . ');}'; + } + // Archives if ($this->book->parametres->externalArchivesBack) { $this->vdir->copy($this->wdir . '/' . $this->book->parametres->externalArchivesBack, 'data/images/' . $this->book->parametres->externalArchivesBack); @@ -1469,7 +1483,7 @@ class wsHTML5Compiler { $res[] = '.zoomPopupClose {background-color:' . wsHTML5::colorToCSS($this->theme->parametres->couleurB) . ';}'; - $this->_writeLess($lessVariables); + $this->_writeLess($lessVariables, $lessContents); $res = array_chunk($res, 3500); foreach ($res as $k => $css) { @@ -1480,7 +1494,7 @@ class wsHTML5Compiler { return count($res); } - protected function _writeLess($variables) { + protected function _writeLess($variables, $lessContents = '') { if ($this->widget) { $this->lessFiles[] = 'widget'; } @@ -1498,9 +1512,9 @@ class wsHTML5Compiler { $bookVariables[] = '@' . trim($k) . ':' . $v . ';'; } file_put_contents($tmp . '/book-variables.less', implode("\n", $bookVariables)); + file_put_contents($tmp . '/additional.less', $lessContents); foreach ($this->lessFiles as $f) { - $source_less = $this->assets . '/style/' . $f . '.less'; $destination_less = $tmp . '/' . $f . '.less'; $destination_css = $tmp . '/' . $f . '.css'; diff --git a/inc/ws/Util/html5/landing-page/class.ws.html5.links.php b/inc/ws/Util/html5/landing-page/class.ws.html5.links.php index 4781c0655..997d37a81 100644 --- a/inc/ws/Util/html5/landing-page/class.ws.html5.links.php +++ b/inc/ws/Util/html5/landing-page/class.ws.html5.links.php @@ -91,7 +91,6 @@ class wsHTML5Link { case 11: return new actionLink($id, $init, $compiler); case 12: - return new basketLink($id, $init, $compiler); case 13: // zoom area return new zoomLink($id, $init, $compiler); -- 2.39.5