]> _ Git - cubeextranet.git/commitdiff
Merge master changes to burgermenu branch.
authorstephen@cubedesigners.com <stephen@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Mon, 30 Oct 2017 10:22:59 +0000 (10:22 +0000)
committerstephen@cubedesigners.com <stephen@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Mon, 30 Oct 2017 10:22:59 +0000 (10:22 +0000)
inc/ws/Util/html5/burgermenu/class.ws.html5.compiler.php
inc/ws/Util/html5/burgermenu/class.ws.html5.links.php

index e6b59a44ee063b93655a8d531d0b6f6ccbec8a0f..6dff4f655ce36c9174139b4632963884e8a72e5b 100644 (file)
@@ -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
+}
index 548c918e49c021e9c8cbebe5edb37d504fd3eda6..76305d856971a5b8d9b8dbce2e9411d6621b3ad0 100644 (file)
@@ -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
+}