]> _ Git - cubeextranet.git/commitdiff
(no commit message)
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Sun, 15 Apr 2012 01:32:46 +0000 (01:32 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Sun, 15 Apr 2012 01:32:46 +0000 (01:32 +0000)
fluidbook/tools/fwstk/nbproject/private/private.properties
inc/ws/Controlleur/class.ws.url.php
inc/ws/DAO/class.ws.dao.book.php
inc/ws/Util/html5/class.ws.html5.compiler.php

index 12e72ab294735e442e8b6f4faebe4b58b6833e1b..a3838e51e587dbfb39284fc960dd3fa35b9de515 100644 (file)
@@ -4,4 +4,4 @@ do.depend=false
 do.jar=true\r
 javac.debug=true\r
 javadoc.preview=true\r
-user.properties.file=C:\\Users\\Vincent\\.netbeans\\7.1\\build.properties\r
+user.properties.file=C:\\Users\\Cube\\.netbeans\\7.1\\build.properties\r
index ab550bd2d1f5d1209ed3ebeb5fdec4b03af96657..cdb64c6c97874535a94a78de13f0cb953ee45ce8 100644 (file)
@@ -670,10 +670,12 @@ html{height:100%}' . "\n";
        }\r
 \r
        public static function viewerhu($args) {\r
+               global $core;\r
+               \r
                commonDroits::min(5);\r
                $args = cubePage::getArgs($args);\r
 \r
-               \r
+               $dao=new wsDAOBook($core->con);\r
                $e = explode('_', $args[0]);\r
                $dao->compile($e[0], 'html5');\r
                $time = self::getHTML5CacheTime($e[0]);\r
index 0423f33d31d1a25e3411702db684823c1cf5afb2..1da69b40dbf8fff12eaa111c1b55f154eb4110cf 100644 (file)
@@ -78,11 +78,16 @@ class wsDAOBook extends commonDAO {
                return $r->book_id + 1;\r
        }\r
 \r
-       public function selectById($book_id = null) {\r
+       public function selectById($book_id = null, $simple = false) {\r
                if (is_null($book_id)) {\r
                        return $this->cree();\r
                }\r
-               $sql = 'SELECT * FROM books_vue WHERE book_id=\'' . $this->con->escape($book_id) . '\' LIMIT 1';\r
+               if ($simple) {\r
+                       $table = 'books';\r
+               } else {\r
+                       $table = 'books_vue';\r
+               }\r
+               $sql = 'SELECT * FROM ' . $table . ' WHERE book_id=\'' . $this->con->escape($book_id) . '\' LIMIT 1';\r
                $r = $this->con->select($sql);\r
                return $this->singleton($r);\r
        }\r
@@ -595,35 +600,31 @@ class wsDAOBook extends commonDAO {
                $c->update('WHERE book_id=\'' . $this->con->escape($book_id) . '\'');\r
        }\r
 \r
-       public function isUpToDate($book_id, $html = false) {\r
-               // V2\r
-               if (!file_exists(WS_BOOKS . '/final/' . $book_id)) {\r
-                       return false;\r
-               }\r
-               $r = $this->con->select('SELECT changedate,compiledate FROM books WHERE book_id=\'' . $this->con->escape($book_id) . '\'');\r
-               if ($r->compiledate < $r->changedate) {\r
-                       return false;\r
-               }\r
-\r
-\r
-               // V1\r
-               if (!file_exists(WS_BOOKS . '/finalv1/' . $book_id . '/index.swf')) {\r
-                       return false;\r
-               }\r
-\r
-\r
-               // HTML5\r
-               $checks = array($r->changedate, cubeFiles::filemtimeRecursive(WS_COMPILE_ASSETS . '/_html5'), cubeFiles::filemtimeRecursive(ROOT . '/inc/ws/Util/html5'));\r
-               $reffile = WS_BOOKS . '/html5/' . $book_id;\r
-\r
-               if (!file_exists($reffile)) {\r
-                       return false;\r
-               }\r
-               $reftime = filemtime($reffile);\r
-               foreach ($checks as $check) {\r
-                       if ($check > $reftime) {\r
+       public function isUpToDate($book, $version) {\r
+               $version = (string) $version;\r
+               if ($version == '2') {\r
+                       if (!file_exists(WS_BOOKS . '/final/' . $book->book_id)) {\r
+                               return false;\r
+                       }\r
+                       if ($book->compiledate < $book->changedate) {\r
                                return false;\r
                        }\r
+               } else if ($version == '1') {\r
+                       // V1\r
+                       if (!file_exists(WS_BOOKS . '/finalv1/' . $book->book_id . '/index.swf')) {\r
+                               return false;\r
+                       }\r
+                       if ($book->compile1date < $book->changedate) {\r
+                               return false;\r
+                       }\r
+               } else if ($version == 'html5') {\r
+                       // HTML5\r
+                       $checks = array($book->changedate, cubeFiles::filemtimeRecursive(WS_COMPILE_ASSETS . '/_html5'), cubeFiles::filemtimeRecursive(ROOT . '/inc/ws/Util/html5'));\r
+                       foreach ($checks as $check) {\r
+                               if ($check > $book->compilehtml5date) {\r
+                                       return false;\r
+                               }\r
+                       }\r
                }\r
                return true;\r
        }\r
@@ -809,33 +810,33 @@ class wsDAOBook extends commonDAO {
                $book = $this->selectById($book_id);\r
                $pages = $this->getPagesOfBook($book_id);\r
 \r
-               $v1 = $v1 && $book->compile1date < $book->changedate;\r
-               $v2 = $v2 && $book->compiledate < $book->changedate;\r
-               $html5 = $html5 && $book->compilehtml5date < $book->changedate;\r
+               $v1 = $v1 && !$this->isUpToDate($book, 1);\r
+               $v2 = $v2 && !$this->isUpToDate($book, 2);\r
+               $html5 = $html5 && !$this->isUpToDate($book, 'html5');\r
 \r
 \r
                if ($v1 || $v2) {\r
-                       fb(time(),'Compile PDF & Widget');\r
+                       fb(time(), 'Compile PDF & Widget');\r
                        $this->compilePDF($book, $pages);\r
                        $this->compileWidget($book, $pages);\r
                }\r
                $res = '';\r
                if ($v1) {\r
-                       fb(time(),'Compile V1');\r
+                       fb(time(), 'Compile V1');\r
                        $res.=$this->compile1($book_id, $book, $pages);\r
                        $this->touchCompile($book_id, '1');\r
                }\r
                if ($v2) {\r
-                       fb(time(),'Compile V2');\r
+                       fb(time(), 'Compile V2');\r
                        $res .= $this->compile3($book_id, $complete, $book, $pages);\r
                        $this->touchCompile($book_id, '2');\r
                }\r
                if ($html5) {\r
-                       fb(time(),'Compile HTML5');\r
+                       fb(time(), 'Compile HTML5');\r
                        $res.=$this->compileHTML5($book_id);\r
                        $this->touchCompile($book_id, 'html5');\r
                }\r
-               fb(time(),'End Compile');\r
+               fb(time(), 'End Compile');\r
                return $res;\r
        }\r
 \r
index ea3f9f60ddd72e62a086ff95e805ecc1ca44809f..2455ea0635284de3b215d82317bc7efe61de4477 100644 (file)
@@ -520,12 +520,13 @@ class wsHTML5Compiler {
 
                $res[] = '#fluidbook{left:' . $offsetLeft . 'px;top:' . $offsetTop . 'px;}';
                $res[] = '.landscape #fluidbook{left:' . $offsetLeft2 . 'px;}';
-               $res[] = '.portrait #pages,.portrait .doublePage.page,.page,.portrait #shadow,#shadow.single,.page .links{width:' . $w . ';max-width:' . $w . ';height:' . $h . ';max-height:' . $h . '}';
+               $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[] = '.landscape .doublePage.next{' . $this->writeCSSUA('transform', 'translate(' . $w2 . ',0)') . '}';
-               $res[] = '.landscape .doublePage.prev{' . $this->writeCSSUA('transform', 'translate(-' . $w2 . ',0)') . '}';
-               $res[] = '.portrait .doublePage.next{' . $this->writeCSSUA('transform', 'translate(' . $w . ',0)') . '}';
-               $res[] = '.portrait .doublePage.prev{' . $this->writeCSSUA('transform', 'translate(-' . $w . ',0)') . '}';
+               $res[] = '.landscape .doublePage._2d.next{' . $this->writeCSSUA('transform', 'translate(' . $w2 . ',0)') . '}';
+               $res[] = '.landscape .doublePage._2d.prev{' . $this->writeCSSUA('transform', 'translate(-' . $w2 . ',0)') . '}';
+               $res[] = '.portrait .doublePage._2d.next{' . $this->writeCSSUA('transform', 'translate(' . $w . ',0)') . '}';
+               $res[] = '.portrait .doublePage._2d.prev{' . $this->writeCSSUA('transform', 'translate(-' . $w . ',0)') . '}';
+               $res[] = '.doublePage._3d{left:' . $w . ';}';
                $res[] = '.landscape #shadow.single.right{left: ' . $w . ';}';
                $res[] = '.landscape .page.right{left:' . $w . '}';
                if ($this->theme->parametres->displayPageNumber) {
@@ -657,7 +658,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{-webkit-tap-highlight-color:' . self::colorToCSS($this->theme->parametres->linksColor, 0.4) . ';}';
+               $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
                # View
@@ -737,10 +738,19 @@ class wsHTML5Compiler {
        }
 
        public static function colorToCSS($color, $forceAlpha = null) {
-
                if (!is_null($forceAlpha)) {
-                       $a = $forceAlpha * 255;
-                       $a = base_convert($a, 10, 16);
+                       if ($forceAlpha <= 0) {
+                               $a = '00';
+                       } elseif ($forceAlpha < 1) {
+                               $a = ceil($forceAlpha * 255);
+                               $a = base_convert($a, 10, 16);
+                               if (strlen($a) == 1) {
+                                       $a = '0' . $a;
+                               }
+                       } else {
+                               $a = 'FF';
+                       }
+
                        if (strlen($color) == 6) {
                                $color = $a . $color;
                        } else {