]> _ Git - cubeextranet.git/commitdiff
(no commit message)
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Wed, 22 Aug 2012 18:33:51 +0000 (18:33 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Wed, 22 Aug 2012 18:33:51 +0000 (18:33 +0000)
inc/ws/Util/html5/class.ws.html5.compiler.php
inc/ws/Util/html5/class.ws.html5.links.php

index 5e003aa46d3897662381672d2760f865058eff1c..b0c33374670abe9fd23027c6f877c3ebd8d617f9 100644 (file)
@@ -97,8 +97,8 @@ class wsHTML5Compiler {
        protected $daoBook;
        protected $needToRecompileContents = true;
        protected $needToRecompileSettings = true;
-       protected $width;
-       protected $height;
+       public $width;
+       public $height;
        protected $cssWidth;
        protected $cssHeight;
        protected $cssOneWidth;
@@ -443,17 +443,17 @@ class wsHTML5Compiler {
                }
        }
 
-       protected function writeExtras(){
-               if($this->theme->parametres->afterSearch!=''){
+       protected function writeExtras() {
+               if ($this->theme->parametres->afterSearch != '') {
                        copy($this->themeRoot . '/' . $this->theme->parametres->afterSearch, $this->vdir . '/data/images/' . $this->theme->parametres->afterSearch);
                }
        }
-       
+
        protected function writeLinks() {
                global $core;
                $daoDoc = new wsDAODocument($core->con);
                $daoDoc->getLinksAndRulers($this->book_id, $links, $rulers);
-               
+
                $i = 0;
                $pages = array();
                $css = array();
@@ -462,16 +462,18 @@ class wsHTML5Compiler {
                        if (is_null($link)) {
                                continue;
                        }
+
+                       $c = $link->getHTMLContainer();
+                       $css[] = $link->getCSSContainer();
                        if (!isset($pages[$link->page])) {
                                $pages[$link->page] = '';
                        }
-                       $pages[$link->page] .= $link->getHTMLContainer();
-                       $css[] = $link->getCSSContainer();
+                       $pages[$link->page].=$c;
                        $i++;
                }
-               
-               $allpages=range(0,$this->book->parametres->pages+1);
-               $allpages[]='aftersearch';
+
+               $allpages = range(0, $this->book->parametres->pages + 1);
+               $allpages[] = 'aftersearch';
 
                $this->config->links = array();
 
@@ -570,7 +572,7 @@ class wsHTML5Compiler {
                // Set the icon list with the color
                $icons = array('nav-bookmark' => $couleurI, 'nav-friend' => $couleurI, 'nav-help' => $couleurI, 'nav-index' => $couleurI, 'nav-sommaire' => $couleurI,
                        'next' => $arrowsColor, 'previous' => $arrowsColor, 'search' => $couleurI, 'nav-facebook' => $couleurI, 'nav-twitter' => $couleurI,
-                       'help-fingers' => $couleurI, 'help-mouse' => $couleurI,'nav-home'=>$couleurI);
+                       'help-fingers' => $couleurI, 'help-mouse' => $couleurI, 'nav-home' => $couleurI);
 
                foreach ($icons as $icon => $color) {
                        wsTools::colorizeAndRasterizeIcon($this->theme->parametres->iconSet, $icon, $color, $this->vdir . '/data/images/', 4, $w, $h);
@@ -617,7 +619,7 @@ class wsHTML5Compiler {
                copy($s, $t);
        }
 
-               protected function writeCSS($file, $links) {
+       protected function writeCSS($file, $links) {
                $res = array();
 
                // General theme
@@ -638,8 +640,8 @@ class wsHTML5Compiler {
                $navTop = ($cssHeight - 40 - 100) / 2;
 
 
-               $res[] = '.portrait #pages,.portrait .doublePage.page,.page,.portrait #shadow,#shadow.single,.page .links,.doublePage._3d{width:' . $w . ';max-width:' . $w . ';height:' . $h . ';max-height:' . $h . '}';
-               $res[] = '.doublePage,#pages,.landscape #shadow.double{width:' . $w2 . ';max-width:' . $w2 . ';height:' . $h . ';max-height:' . $h . '}';
+               $res[] = '.portrait #pages,.portrait .doublePage.page,.page,.portrait #shadow,#shadow.single,.doublePage._3d{width:' . $w . ';max-width:' . $w . ';height:' . $h . ';max-height:' . $h . '}';
+               $res[] = '.doublePage,#pages,#links,.landscape #shadow.double{width:' . $w2 . ';max-width:' . $w2 . ';height:' . $h . ';max-height:' . $h . '}';
                $res[] = '.landscape .doublePage._2d.next{' . $this->writeCSSUA('transform', 'translate3d(' . $w2 . ',0,0)') . '}';
                $res[] = '.landscape .doublePage._2d.prev{' . $this->writeCSSUA('transform', 'translate3d(-' . $w2 . ',0,0)') . '}';
                $res[] = '.portrait .doublePage._2d.next{' . $this->writeCSSUA('transform', 'translate3d(' . $w . ',0,0)') . '}';
@@ -776,6 +778,7 @@ class wsHTML5Compiler {
                // Links Styles
                $res = array_merge($res, $links);
                $res[] = '.link a.displayArea:hover,.link a.displayArea.animating{background-color:' . self::colorToCSS($this->theme->parametres->linksColor, 0.4) . ';}';
+               $res[] = '.link a.displayArea:hover{opacity:1 !important;}';
                $res[] = '.link a.displayArea{-webkit-tap-highlight-color:' . self::colorToCSS($this->theme->parametres->linksColor, 0.4) . ';background-color:' . self::colorToCSS($this->theme->parametres->linksColor, 0.0001) . ';}';
 
                // Menus
@@ -903,6 +906,7 @@ class wsHTML5Compiler {
 }
 
 class wsHTML5CompilerDev extends wsHTML5Compiler {
+       
 }
 
 ?>
\ No newline at end of file
index 7cc74b6941b136dbaf5accb4b8da9892bbdd28e8..250d9d3df821c9dcba7eb8db47b9509af590665a 100644 (file)
@@ -78,7 +78,7 @@ class wsHTML5Link {
        }
 
        public function getHTMLContainer() {
-               return '<div class="link" id="link' . $this->id . '">' . $this->getHTMLContent() . '</div>';
+               return '<div class="link" id="l_' . $this->id . '">' . $this->getHTMLContent() . '</div>';
        }
 
        public function getHTMLContent() {
@@ -98,7 +98,13 @@ class wsHTML5Link {
        }
 
        public function getCSSContainer() {
-               $css = '#link' . $this->id . '{';
+               
+               if($this->page%2==1){
+                       $this->page--;
+                       $this->left+=$this->compiler->width;
+               }
+               
+               $css = '#l_' . $this->id . '{';
                $css.='left:' . $this->left * $this->compiler->getCssScale() . 'px;top:' . $this->top * $this->compiler->getCssScale() . 'px;';
                $css.='width:' . $this->width * $this->compiler->getCssScale() . 'px;height:' . $this->height * $this->compiler->getCssScale() . 'px;';
                $css.=$this->getCSS();