]> _ Git - cubeextranet.git/commitdiff
(no commit message)
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Thu, 14 Jul 2011 13:37:57 +0000 (13:37 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Thu, 14 Jul 2011 13:37:57 +0000 (13:37 +0000)
inc/ws/Util/packager/html5/class.ws.packager.html5.links.php
inc/ws/Util/packager/html5/class.ws.packager.html5.php

index 71013df069dfcbe40b6bef7613bb353d7545c956..1b68c923a0f7ca555dd5c5e0894e78be7c6e2a41 100644 (file)
@@ -109,7 +109,15 @@ class wsPackagerHTML5Link {
 class normalLink extends wsPackagerHTML5Link {
 
        public function getHTMLContent() {
-               return '<a href="' . $this->getURL() . '" target="' . $this->getTarget() . '"></a>';
+               $class = array();
+               if ($this->display_area) {
+                       $class[] = 'displayArea';
+               }
+               $c = '';
+               if (count($class)) {
+                       $c = ' class="' . implode(' ', $class) . '"';
+               }
+               return '<a href="' . $this->getURL() . '" target="' . $this->getTarget() . '"' . $c . '></a>';
        }
 
        public function getURL() {
@@ -157,11 +165,15 @@ class mailLink extends normalLink {
 class internalLink extends normalLink {
 
        public function getURL() {
-               return '#/pages/' . $this->getPage();
+               return '#/page/' . $this->getPage();
        }
 
        public function getPage() {
-               return $this->to;
+               if ($this->numerotation == 'physical') {
+                       return $this->to;
+               } else {
+                       return $this->to;
+               }
        }
 
 }
@@ -171,10 +183,16 @@ class videoLink extends wsPackagerHTML5Link {
        public function getHTMLContent() {
                $res = '<video width="' . $this->width . '" height="' . $this->height . '"';
                if ($this->video_auto_start) {
-                       $res.=' autoplay';
+                       $res.=' autoplay="autoplay"';
                }
                if ($this->video_controls) {
-                       $res.=' controls';
+                       $res.=' controls="controls"';
+               }
+               if ($this->video_loop) {
+                       $res.=' loop="loop"';
+               }
+               if (!$this->video_sound_on) {
+                       $res.=' audio="muted"';
                }
                $res.='>';
 
index 996c509c420450d25ce8cce44391052780d9fd0c..56d70f1e5bc07dd80888e59a26840d37a04a9396 100644 (file)
@@ -93,8 +93,12 @@ class wsPackagerHTML5 extends wsPackager {
                        $i++;\r
                }\r
 \r
-               foreach ($pages as $n => $c) {\r
-                       file_put_contents($this->vdir . '/data/links/pages/p' . $n . '.html', $c);\r
+               for ($i = 0; $i <= $this->book->parametres->pages + 1; $i++) {\r
+                       $c = '';\r
+                       if (isset($pages[$i])) {\r
+                               $c = $pages[$i];\r
+                       }\r
+                       file_put_contents($this->vdir . '/data/links/pages/p' . $i . '.html', $c);\r
                }\r
                return $css;\r
        }\r
@@ -102,6 +106,7 @@ class wsPackagerHTML5 extends wsPackager {
        protected function writeConfig() {\r
                $config = cubeObject::merge($this->book->parametres->toStandardObject(), $this->theme->parametres->toStandardObject());\r
                $config->id = $this->book->book_id;\r
+               $config->cacheDate = TIME;\r
                return 'DATAS=' . json_encode($config) . ';';\r
        }\r
 \r
@@ -357,6 +362,7 @@ class wsPackagerHTML5 extends wsPackager {
 \r
                // Links Styles\r
                $res = array_merge($res, $links);\r
+               $res[] = '.link a.displayArea:hover,.link a.displayArea.animating{background-color:' . self::colorToCSS($this->theme->parametres->linksColor, 0.4) . ';}';\r
 \r
                // Pages styles\r
                foreach ($this->cssColor as $color => $index) {\r
@@ -581,7 +587,18 @@ class wsPackagerHTML5 extends wsPackager {
                \r
        }\r
 \r
-       public static function colorToCSS($color) {\r
+       public static function colorToCSS($color, $forceAlpha=null) {\r
+\r
+               if (!is_null($forceAlpha)) {\r
+                       $a = $forceAlpha * 255;\r
+                       $a = base_convert($a, 10, 16);\r
+                       if (strlen($color) == 6) {\r
+                               $color = $a . $color;\r
+                       } else {\r
+                               $color = $a . substr($color, 2, 6);\r
+                       }\r
+               }\r
+\r
                if (strlen($color) == 6) {\r
                        return '#' . $color;\r
                } else {\r