From 2ad252a848357d802a2d289fef20558ce092ab97 Mon Sep 17 00:00:00 2001 From: "stephen@cubedesigners.com" Date: Mon, 30 Oct 2017 10:22:59 +0000 Subject: [PATCH] Merge master changes to burgermenu branch. --- .../burgermenu/class.ws.html5.compiler.php | 41 +++++++++++++++++-- .../html5/burgermenu/class.ws.html5.links.php | 7 +++- 2 files changed, 42 insertions(+), 6 deletions(-) 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 e6b59a44e..6dff4f655 100644 --- a/inc/ws/Util/html5/burgermenu/class.ws.html5.compiler.php +++ b/inc/ws/Util/html5/burgermenu/class.ws.html5.compiler.php @@ -54,6 +54,7 @@ class wsHTML5Compiler { 'js/libs/fluidbook/fluidbook.privacy.js', 'js/libs/fluidbook/fluidbook.zoom.js', 'js/libs/fluidbook/fluidbook.menu.js', + 'js/libs/fluidbook/fluidbook.sound.js', 'js/libs/fluidbook/menu/fluidbook.chapters.js', 'js/libs/fluidbook/menu/fluidbook.index.js', 'js/libs/fluidbook/fluidbook.js', @@ -329,6 +330,8 @@ class wsHTML5Compiler { $this->log('Langs written'); $this->writeIndex(); $this->log('Index written'); + $this->writeSounds(); + $this->log('Sound written'); $this->writeTexts(); $this->log('Texts written'); $this->writeExtras(); @@ -426,6 +429,13 @@ class wsHTML5Compiler { } } + protected function writeSounds() { + if ($this->book->parametres->soundTheme == '') { + return; + } + $this->vdir->copyDirectory(WS_SOUNDS . '/' . $this->book->parametres->soundTheme, 'data/sounds'); + } + protected function writeIndex() { global $core; @@ -529,6 +539,8 @@ class wsHTML5Compiler { foreach ($svgfiles as $svgfile) { if (file_exists($svgfile)) { $svg .= file_get_contents($svgfile); + } else { + die($svgfile . ' does not exist'); } } @@ -575,7 +587,7 @@ class wsHTML5Compiler { $this->vdir->file_put_contents('index.html', $html); $this->vdir->file_put_contents('indexu.html', $uhtml); - $this->vdir->file_put_contents('indext.html', $uhtml); + $this->vdir->file_put_contents('indext.html', $thtml); // Write widget html if ($this->widget) { @@ -712,6 +724,7 @@ class wsHTML5Compiler { global $core; if ($this->book->parametres->customLinkClass == 'WescoSalesLink') { + $this->specialJsFiles[] = 'js/libs/interact.min.js'; $this->specialJsFiles[] = 'js/libs/fluidbook/special/wescosales.js'; $this->specialCSS[] = 'wescosales'; } @@ -735,6 +748,24 @@ class wsHTML5Compiler { $daoDoc = new wsDAODocument($core->con); $daoDoc->getLinksAndRulers($this->book_id, $links, $rulers); + if ($this->book->parametres->tabsHTML5 != '') { + $links[] = [ + 'page' => 'background', + 'top' => 0, + 'left' => 0, + 'width' => 100, + 'height' => 100, + 'type' => 6, + 'to' => $this->book->parametres->tabsHTML5, + 'alternative' => $this->book->parametres->tabsHTML5, + 'image' => '', + 'inline' => 1, + 'interactive' => 1, + 'class' => 'tabslink', + ]; + } + + foreach ($links as $linkData) { if (isset($linkData['image']) && $linkData['image']) { $dupData = $linkData; @@ -1202,8 +1233,8 @@ class wsHTML5Compiler { $lessVariables['page-number-color'] = wsHTML5::colorToCSS($this->theme->parametres->colorPageNumber); $lessVariables['display-page-number'] = $this->_lessBoolean($this->theme->parametres->displayPageNumber); + $lessVariables['page-transition-duration'] = $this->book->parametres->mobileTransitionDuration . 's'; - $res[] = '.doublePage._2d,.doublePage._3d{' . wsHTML5::writeCSSUA('transition', 'all ' . $this->book->parametres->mobileTransitionDuration . 's ease-in-out') . '}'; $res[] = '.background{' . wsHTML5::writeCSSUA('transform-origin', 'top left') . ';}'; foreach ($this->getResolutions() as $r) { @@ -1245,12 +1276,13 @@ class wsHTML5Compiler { // Header $header = 'header{'; $header .= 'height:' . $this->theme->parametres->menuHeight . 'px;'; - $header .= 'background-color:' . wsHTML5::colorToCSS($this->theme->parametres->menuColor) . ';'; if ($this->theme->parametres->menuImage != '') { $this->vdir->copy($this->themeRoot . '/' . $this->theme->parametres->menuImage, 'data/images/' . $this->theme->parametres->menuImage); $header .= 'background-image:url(../images/' . $this->theme->parametres->menuImage . ');'; $header .= 'background-repeat:no-repeat;'; $header .= 'background-size:100% ' . $this->theme->parametres->menuHeight . 'px;'; + } else { + $header .= 'background-color:' . wsHTML5::colorToCSS($this->theme->parametres->menuColor) . ';'; } $header .= '}'; $res[] = $header; @@ -1311,6 +1343,7 @@ class wsHTML5Compiler { $menuMultiply = $menuColor->multiply($menuColor); $menuMultiply2 = $menuMultiply->multiply($menuColor); + // Archives if ($this->book->parametres->externalArchivesBack) { $this->vdir->copy($this->wdir . '/' . $this->book->parametres->externalArchivesBack, 'data/images/' . $this->book->parametres->externalArchivesBack); @@ -1521,4 +1554,4 @@ class wsHTML5Compiler { } -} \ No newline at end of file +} diff --git a/inc/ws/Util/html5/burgermenu/class.ws.html5.links.php b/inc/ws/Util/html5/burgermenu/class.ws.html5.links.php index 548c918e4..76305d856 100644 --- a/inc/ws/Util/html5/burgermenu/class.ws.html5.links.php +++ b/inc/ws/Util/html5/burgermenu/class.ws.html5.links.php @@ -27,6 +27,7 @@ class wsHTML5Link { public $extra; public $id; public $rot; + public $class; protected $_init; @@ -198,7 +199,7 @@ class wsHTML5Link { } public function getHTMLContainerClass() { - $res = 'link'; + $res = trim('link ' . $this->class); if ($this->page % 2 == 1) { $res .= ' odd'; } @@ -863,7 +864,9 @@ class htmlMultimediaLink extends wsHTML5Link { } foreach ($this->_config['inject'] as $i) { + $infos = ['path' => 'data/links/' . $this->alternative . '/']; $i = str_replace('$id', '"#l_' . $this->id . '"', $i); + $i = str_replace('$init', CubeIT_Util_Json::encode($infos), $i); $this->compiler->htmlmultimedia[] = $i; } @@ -1304,4 +1307,4 @@ class zoomLink extends normalLink { public function getClasses() { return array_merge(['zoomPopup'], parent::getClasses()); } -} \ No newline at end of file +} -- 2.39.5