From: vincent@cubedesigners.com Date: Sun, 15 Apr 2012 01:32:46 +0000 (+0000) Subject: (no commit message) X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=d110a2c59aa354f667f62783008952b8ae17534c;p=cubeextranet.git --- diff --git a/fluidbook/tools/fwstk/nbproject/private/private.properties b/fluidbook/tools/fwstk/nbproject/private/private.properties index 12e72ab29..a3838e51e 100644 --- a/fluidbook/tools/fwstk/nbproject/private/private.properties +++ b/fluidbook/tools/fwstk/nbproject/private/private.properties @@ -4,4 +4,4 @@ do.depend=false do.jar=true javac.debug=true javadoc.preview=true -user.properties.file=C:\\Users\\Vincent\\.netbeans\\7.1\\build.properties +user.properties.file=C:\\Users\\Cube\\.netbeans\\7.1\\build.properties diff --git a/inc/ws/Controlleur/class.ws.url.php b/inc/ws/Controlleur/class.ws.url.php index ab550bd2d..cdb64c6c9 100644 --- a/inc/ws/Controlleur/class.ws.url.php +++ b/inc/ws/Controlleur/class.ws.url.php @@ -670,10 +670,12 @@ html{height:100%}' . "\n"; } public static function viewerhu($args) { + global $core; + commonDroits::min(5); $args = cubePage::getArgs($args); - + $dao=new wsDAOBook($core->con); $e = explode('_', $args[0]); $dao->compile($e[0], 'html5'); $time = self::getHTML5CacheTime($e[0]); diff --git a/inc/ws/DAO/class.ws.dao.book.php b/inc/ws/DAO/class.ws.dao.book.php index 0423f33d3..1da69b40d 100644 --- a/inc/ws/DAO/class.ws.dao.book.php +++ b/inc/ws/DAO/class.ws.dao.book.php @@ -78,11 +78,16 @@ class wsDAOBook extends commonDAO { return $r->book_id + 1; } - public function selectById($book_id = null) { + public function selectById($book_id = null, $simple = false) { if (is_null($book_id)) { return $this->cree(); } - $sql = 'SELECT * FROM books_vue WHERE book_id=\'' . $this->con->escape($book_id) . '\' LIMIT 1'; + if ($simple) { + $table = 'books'; + } else { + $table = 'books_vue'; + } + $sql = 'SELECT * FROM ' . $table . ' WHERE book_id=\'' . $this->con->escape($book_id) . '\' LIMIT 1'; $r = $this->con->select($sql); return $this->singleton($r); } @@ -595,35 +600,31 @@ class wsDAOBook extends commonDAO { $c->update('WHERE book_id=\'' . $this->con->escape($book_id) . '\''); } - public function isUpToDate($book_id, $html = false) { - // V2 - if (!file_exists(WS_BOOKS . '/final/' . $book_id)) { - return false; - } - $r = $this->con->select('SELECT changedate,compiledate FROM books WHERE book_id=\'' . $this->con->escape($book_id) . '\''); - if ($r->compiledate < $r->changedate) { - return false; - } - - - // V1 - if (!file_exists(WS_BOOKS . '/finalv1/' . $book_id . '/index.swf')) { - return false; - } - - - // HTML5 - $checks = array($r->changedate, cubeFiles::filemtimeRecursive(WS_COMPILE_ASSETS . '/_html5'), cubeFiles::filemtimeRecursive(ROOT . '/inc/ws/Util/html5')); - $reffile = WS_BOOKS . '/html5/' . $book_id; - - if (!file_exists($reffile)) { - return false; - } - $reftime = filemtime($reffile); - foreach ($checks as $check) { - if ($check > $reftime) { + public function isUpToDate($book, $version) { + $version = (string) $version; + if ($version == '2') { + if (!file_exists(WS_BOOKS . '/final/' . $book->book_id)) { + return false; + } + if ($book->compiledate < $book->changedate) { return false; } + } else if ($version == '1') { + // V1 + if (!file_exists(WS_BOOKS . '/finalv1/' . $book->book_id . '/index.swf')) { + return false; + } + if ($book->compile1date < $book->changedate) { + return false; + } + } else if ($version == 'html5') { + // HTML5 + $checks = array($book->changedate, cubeFiles::filemtimeRecursive(WS_COMPILE_ASSETS . '/_html5'), cubeFiles::filemtimeRecursive(ROOT . '/inc/ws/Util/html5')); + foreach ($checks as $check) { + if ($check > $book->compilehtml5date) { + return false; + } + } } return true; } @@ -809,33 +810,33 @@ class wsDAOBook extends commonDAO { $book = $this->selectById($book_id); $pages = $this->getPagesOfBook($book_id); - $v1 = $v1 && $book->compile1date < $book->changedate; - $v2 = $v2 && $book->compiledate < $book->changedate; - $html5 = $html5 && $book->compilehtml5date < $book->changedate; + $v1 = $v1 && !$this->isUpToDate($book, 1); + $v2 = $v2 && !$this->isUpToDate($book, 2); + $html5 = $html5 && !$this->isUpToDate($book, 'html5'); if ($v1 || $v2) { - fb(time(),'Compile PDF & Widget'); + fb(time(), 'Compile PDF & Widget'); $this->compilePDF($book, $pages); $this->compileWidget($book, $pages); } $res = ''; if ($v1) { - fb(time(),'Compile V1'); + fb(time(), 'Compile V1'); $res.=$this->compile1($book_id, $book, $pages); $this->touchCompile($book_id, '1'); } if ($v2) { - fb(time(),'Compile V2'); + fb(time(), 'Compile V2'); $res .= $this->compile3($book_id, $complete, $book, $pages); $this->touchCompile($book_id, '2'); } if ($html5) { - fb(time(),'Compile HTML5'); + fb(time(), 'Compile HTML5'); $res.=$this->compileHTML5($book_id); $this->touchCompile($book_id, 'html5'); } - fb(time(),'End Compile'); + fb(time(), 'End Compile'); return $res; } diff --git a/inc/ws/Util/html5/class.ws.html5.compiler.php b/inc/ws/Util/html5/class.ws.html5.compiler.php index ea3f9f60d..2455ea063 100644 --- a/inc/ws/Util/html5/class.ws.html5.compiler.php +++ b/inc/ws/Util/html5/class.ws.html5.compiler.php @@ -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 {