$settings = $core->user->getSettings($args[0]);\r
$action = 'search' . ucfirst($args[0]);\r
\r
- $default = isset($_POST['q']) ? $_POST['q'] : __('Rechercher');\r
+ $default = isset($_POST['q']) ? $_POST['q'] : '';\r
// Formulaire de recherche\r
$res = '<form action="' . $action . '" method="post">';\r
- $res .= '<div id="search">' . form::field('q', 20, 128, $default, 'empty_field') . '<a href="#" class="submit">' . cubeMedia::spacer(22, 22) . '</a></div>';\r
+ $res .= '<div id="search">' . cubeForm::field('q', 20, 128, $default, '', '', false, '', __('Rechercher'), 'search') . '<a href="#" class="submit">' . cubeMedia::spacer(22, 22) . '</a></div>';\r
$res .= '</form>';\r
return $res;\r
}\r
\r
public static function bh($class = '') {\r
$class = trim('b ' . $class);\r
- return '<div class="'.$class.'">';\r
+ return '<div class="' . $class . '">';\r
}\r
\r
public static function bf($max = false) {\r
$res .= commonPage::tMain();\r
$res .= commonPage::bh('login');\r
$res .= '<div class="form">';\r
- $res .= '<form action="" method="post" class="notajax">';\r
+ $res .= '<form action="' . $_SERVER['REQUEST_URI'] . '" method="post" class="notajax">';\r
$res .= '<h1>' . $core->typo->Titre(__('Veuillez vous identifier')) . '</h1>';\r
$res .= $message;\r
$res .= '<table>';\r
- $res .= '<tr><td>' . __('Votre e-mail ou login') . ' : </td><td>' . form::field('user_email', 20, 64, '') . '</td></tr>';\r
+ $res .= '<tr><td>' . __('Votre e-mail ou login') . ' : </td><td>' . cubeForm::email('user_email', 20, 64, '') . '</td></tr>';\r
$res .= '<tr><td>' . __('Votre mot de passe') . ' : </td><td>' . form::password('user_password', 20, 64, '') . '</td></tr>';\r
$res .= '<tr><td colspan="2"><a href="#" class="popup" rel="motdepasseOublie">' . __('Mot de passe oublié ? Cliquez ici') . '</a></td></tr>';\r
$res .= '<tr><td colspan="2" class="right"><a href="#" class="submit">' . $core->typo->BoutonOK('Cliquez-ici pour vous identifier') . '</a></td></tr>';\r
}\r
\r
public static function motdepasseOublie($args) {\r
- return '<tr><td>' . __('Entrez votre e-mail') . ' : </td><td>' . form::field('email', 30, 128) . '</td></tr>';\r
+ return '<tr><td>' . __('Entrez votre e-mail') . ' : </td><td>' . cubeForm::email('email', 30, 128) . '</td></tr>';\r
}\r
\r
public static function mesParametres($args) {\r
$dao = new wsDAOBook($core->con);\r
$context_download_id = is_null($dashboard) ? 'contextDownloadBook' : 'contextDashboard_Download' . $dashboard;\r
$context_status_id = is_null($dashboard) ? 'contextStatusBook' : 'contextDashboard_Status' . $dashboard;\r
+ $context_view_id = is_null($dashboard) ? 'contextViewBook' : 'contextView_Status' . $dashboard;\r
\r
if (isset($settings['search']) && !is_null($settings['search'])) {\r
$dao->setSearch($settings['search']);\r
\r
$res .= self::contextBookDownload($context_download_id);\r
$res .= self::contextBookStatus($context_status_id);\r
+ $res .= self::contextBookView($context_view_id);\r
\r
$res .= '<table class="liste">';\r
$res .= '<tr><th>' . commonUrl::orderby('#', 'book_id', $settings, 'sort' . $change) . '</th>';\r
$res.='<td>' . $book->version . '</td>';\r
}\r
if ($book->version > 1 || $droits->admin) {\r
- $res .= '<td class="bouton"><a class="popupFSBar" rel="toolbar=yes" rev="viewer_' . $book->book_id . '" href="' . SITE_PATH . 'viewer/' . $book->book_id . '_' . $book->hash . '/">' . $btVoir . '</a></td>';\r
+ if ($droits->admin) {\r
+ $res .= '<td class="bouton"><a href="#" class="openContextMenu" rel="' . $context_view_id . '" rev="' . $book->book_id . '§' . $book->hash . '">' . $btVoir . '</a></td>';\r
+ } else {\r
+ $res .= '<td class="bouton"><a class="popupFSBar" rel="toolbar=yes" rev="viewer_' . $book->book_id . '" href="' . SITE_PATH . 'viewer/' . $book->book_id . '_' . $book->hash . '/">' . $btVoir . '</a></td>';\r
+ }\r
$res .= '<td class="bouton"><a class="popupFSBar" rel="toolbar=yes" rev="editor_' . $book->book_id . '" href="' . SITE_PATH . 'editor/' . $book->book_id . '">' . $btEdit . '</a></td>';\r
} else {\r
$res.='<td></td><td></td>';\r
return $res;\r
}\r
\r
+ public static function contextBookView($id) {\r
+ global $core;\r
+\r
+ if (wsDroits::admin()) {\r
+ $viewers = array('viewer' => array('title' => __('Version Flash'), 'icon' => cubeMedia::image(IMG . '/flash.png')),\r
+ 'vieweru' => array('title' => __('Version Flash') . ' (' . __('debuggage') . ')', 'icon' => cubeMedia::image(IMG . '/flashbug.png')),\r
+ 'viewerh' => array('title' => __('Version HTML5'), 'icon' => cubeMedia::image(IMG . '/html5.png')));\r
+ }\r
+\r
+ $res = '<div class="contextMenu viewbookContextMenu" id="' . $id . '">';\r
+ $res .= '<ul>';\r
+ $res .= '<li class="head">' . __("Sélectionnez la version") . '</li>';\r
+ foreach ($viewers as $v => $infos) {\r
+ $res .= '<li><a class="popupFSBar" rel="toolbar=yes" rev="' . $v . '_$1" href="' . SITE_PATH . $v . '/$1_$2/">' . $infos['icon'] . $infos['title'] . '</a></li>';\r
+ }\r
+ $res .= '</ul></div>';\r
+ return $res;\r
+ }\r
+\r
public static function traductions($args) {\r
global $core;\r
\r
$res .= '</table>';\r
$res .= commonPage::bf();\r
\r
-\r
-\r
$res .= commonPage::bh();\r
$res .= cubeLang::translationForm(array(PLAYER_SOURCES, WS_COMPILE_ASSETS . '/_html5/js/libs'), $lang_id, null, 'liste', array(), '<a href="#" class="submit">' . $core->typo->Ajouter(__('Enregistrer')) . '</a>', $lang->traductions);\r
$res .= commonPage::bf();\r
$__autoload['wsSWF2HTMLMatrix'] = dirname(__FILE__) . '/class.ws.swf2html.php';\r
$__autoload['wsSecureSWF'] = dirname(__FILE__) . '/class.ws.secure.swf.php';\r
$__autoload['wsTools'] = dirname(__FILE__) . '/class.ws.tools.php';\r
+$__autoload['wsHTML5Compiler'] = dirname(__FILE__) . '/html5/class.ws.html5.compiler.php';\r
?>
\ No newline at end of file
--- /dev/null
+<?php
+
+class wsHTML5Compiler {
+
+ protected $layouts = array();
+ protected $cssSize = array();
+ protected $cssColor = array();
+ protected $cssOpacity = array();
+ protected $cssFont = array();
+ protected $cssWordSpacing = array();
+ protected $cssLetterSpacing = array();
+ protected $cssRotation = array();
+ protected $cssX = array();
+ protected $cssY = array();
+ protected $pdf2htmlRatio;
+ protected $scale;
+ protected $multiply;
+ protected $div = array();
+ protected $numerotation;
+ protected static $resolutions = array(36, 72, 150);
+ protected static $uaPrefixes = array('-moz-', '-webkit-', '-o-', '-ms-', '');
+ protected $fontDocs = array();
+ protected $dir;
+ protected $vdir;
+ protected $book;
+ protected $pages;
+ protected $theme;
+ protected $version;
+ protected $book_id;
+ protected $themeRoot;
+ protected $daoBook;
+
+ function __construct($book_id) {
+ $this->book_id = $book_id;
+
+ $this->vdir = $this->dir = WS_BOOKS . '/html5/' . $book_id . '/';
+
+ if (!file_exists($this->dir)) {
+ mkdir($this->dir, 0777, true);
+ }
+
+ $this->daoBook = new wsDAOBook($core->con);
+ $this->book = $this->daoBook->selectById($book_id);
+ $this->pages = $this->daoBook->getPagesOfBook($book_id);
+
+ $daoTheme = new wsDAOTheme($core->con);
+ $this->theme = $daoTheme->getThemeOfBook($book_id, true);
+ $this->themeRoot = WS_THEMES . '/' . $this->theme->theme_id . '/';
+
+ foreach ($this->pages as $page => $infos) {
+ $file = WS_DOCS . '/' . $infos['document_id'] . '/html/p' . $infos['document_page'] . '.layout';
+ if (file_exists($file)) {
+ $this->layouts[$page] = simplexml_load_file($file, null, LIBXML_ERR_WARNING);
+ }
+ }
+
+ $imagesize = getimagesize(WS_DOCS . '/' . $this->pages[1]['document_id'] . '/html/h72-' . $this->pages[1]['document_page'] . '.jpg');
+ $this->pdf2htmlRatio = round($imagesize[0] / $this->layouts[1]['width'], 2);
+ $this->scale = 4;
+ $this->multiply = $this->pdf2htmlRatio * $this->scale;
+ $this->numerotation = explode(',', $this->book->numerotation);
+
+ $this->createHTML();
+ }
+
+ public function virtualToPhysical($virtual) {
+ if (!in_array($virtual, $this->numerotation)) {
+ return 1;
+ }
+ $p = array_search($virtual, $this->numerotation);
+ return $p + 1;
+ }
+
+ protected function compareLines($a, $b) {
+ if ((float) $a['y'] > (float) $b['y']) {
+ return 1;
+ } else {
+ return -1;
+ }
+ }
+
+ protected function createHTML() {
+ foreach ($this->layouts as $page => $layout) {
+ $this->div[$page] = array();
+ $document_id = $this->pages[$page]['document_id'];
+ $lines = array();
+ foreach ($layout->l as $line) {
+ $lines[] = $line;
+ }
+ usort($lines, array($this, 'compareLines'));
+
+ foreach ($lines as $line) {
+ $this->div[$page][] = $this->addLine($line, $document_id);
+ }
+ }
+ mkdir($this->vdir . '/data/images', 0777, true);
+ mkdir($this->vdir . '/data/contents', 0777, true);
+ mkdir($this->vdir . '/data/background', 0777, true);
+ mkdir($this->vdir . '/data/thumbnails', 0777, true);
+ mkdir($this->vdir . '/data/style', 0777, true);
+ mkdir($this->vdir . '/data/links/pages', 0777, true);
+ mkdir($this->vdir . '/data/l10n/', 0777, true);
+ mkdir($this->vdir . '/swf', 0777, true);
+
+ // Copy style folder
+ $from = WS_COMPILE_ASSETS . '/_html5/style';
+ $to = $this->vdir;
+ `cp -r $from $to`;
+
+ // Copy images folder
+ $from = WS_COMPILE_ASSETS . '/_html5/images';
+ `cp -r $from $to`;
+
+ // Copy swf
+ copy(WS_COMPILE_ASSETS . '/_html5/swf/video.swf', $this->vdir . '/swf/video.swf');
+
+ foreach ($this->div as $n => $page) {
+ file_put_contents($this->vdir . '/data/contents/p' . $n . '.html', $this->writePage($page));
+ }
+ $this->writeFonts();
+ $this->writeImages();
+ $linksCSS = $this->writeLinks();
+ $numCSS = $this->writeCSS($this->vdir . '/data/style/style_%d.css', $linksCSS);
+ $this->writeLangs();
+ $this->writeJs();
+ $this->writeIndex($numCSS);
+ }
+
+ protected function writeIndex($numCSS) {
+ $html = file_get_contents(WS_COMPILE_ASSETS . '/_html5/_index.html');
+
+ $titre = $this->book->parametres->title;
+ $credits = '';
+ // Google analytics
+ $ga = '';
+ if ($this->book->parametres->googleAnalytics != '') {
+ $ga = cubePage::googleAnalytics($this->book->parametres->googleAnalytics);
+ }
+ // Feuilles de style
+ $sheets = array('style/fluidbook.css');
+ for ($i = 0; $i < $numCSS; $i++) {
+ $sheets[] = 'data/style/style_' . $i . '.css';
+ }
+ $style = array();
+ foreach ($sheets as $sheet) {
+ $style[] = '<link type="text/css" rel="stylesheet" href="' . $sheet . '?junk=' . TIME . '" />';
+ }
+ $style = implode("\n\t\t", $style);
+
+ $vars = array('titre', 'credits', 'ga', 'style');
+ foreach ($vars as $v) {
+ $html = str_replace('<!-- $' . $v . ' -->', $$v, $html);
+ }
+ file_put_contents($this->vdir . '/index.html', $html);
+ }
+
+ protected function writeLangs() {
+ global $core;
+ $daoLang = new wsDAOLang($core->con);
+ $lang = $daoLang->selectById($this->book->lang);
+ $langs = $daoLang->selectAll();
+
+
+ $traductions = (!count($this->book->traductions)) ? $lang->traductions : $this->book->traductions;
+ file_put_contents($this->vdir . '/data/l10n/default.json', json_encode($traductions));
+ foreach ($langs as $lang) {
+ file_put_contents($this->vdir . '/data/l10n/' . $lang->lang_id . '.json', json_encode($lang->traductions));
+ }
+ }
+
+ protected function writeLinks() {
+ global $core;
+ $daoDoc = new wsDAODocument($core->con);
+ $daoDoc->getLinksAndRulers($this->book_id, $links, $rulers);
+
+ $i = 0;
+ $pages = array();
+ $css = array();
+ foreach ($links as $linkData) {
+ $link = wsPackagerHTML5Link::getInstance($this->base62($i), $linkData, $this);
+ if (is_null($link)) {
+ continue;
+ }
+ if (!isset($pages[$link->page])) {
+ $pages[$link->page] = '';
+ }
+ $pages[$link->page] .= $link->getHTMLContainer();
+ $css[] = $link->getCSSContainer();
+ $i++;
+ }
+
+ for ($i = 0; $i <= $this->book->parametres->pages + 1; $i++) {
+ $c = '';
+ if (isset($pages[$i])) {
+ $c = $pages[$i];
+ }
+ file_put_contents($this->vdir . 'data/links/pages/p' . $i . '.html', $c);
+ }
+ return $css;
+ }
+
+ protected function writeJs() {
+ $files = array('js/libs/modernizr.js',
+ 'js/libs/jquery/jquery.js',
+ 'js/libs/jquery/jquery.transform.js',
+ 'js/libs/jquery/jquery.mousewheel.js',
+ 'js/libs/jquery/jquery.hashchange.js',
+ 'js/libs/fluidbook/fluidbook.utils.js',
+ 'js/libs/fluidbook/fluidbook.cache.js',
+ 'js/libs/fluidbook/fluidbook.support.js',
+ 'js/libs/fluidbook/fluidbook.viewport.js',
+ 'js/libs/fluidbook/fluidbook.desktop.js',
+ 'js/libs/fluidbook/fluidbook.service.js',
+ 'js/libs/fluidbook/fluidbook.loader.js',
+ 'js/libs/fluidbook/fluidbook.l10n.js',
+ 'js/libs/fluidbook/fluidbook.nav.js',
+ 'js/libs/fluidbook/fluidbook.js',
+ 'js/main.js');
+
+ $mintime = 0;
+ $minimized = WS_COMPILE_ASSETS . '/_html5/js/min.js';
+ if (file_exists($minimized)) {
+ $mintime = filemtime($minimized);
+ }
+ $reminimize = false;
+ foreach ($files as $file) {
+ if (filemtime(WS_COMPILE_ASSETS . '/_html5/' . $file) > $mintime) {
+ $reminimize = true;
+ break;
+ }
+ }
+
+ if ($reminimize) {
+ $js = '';
+ foreach ($files as $file) {
+ $js.=file_get_contents(WS_COMPILE_ASSETS . '/_html5/' . $file);
+ $js.="\n\n";
+ }
+ $tmp = cubeFiles::tempnam();
+ file_put_contents($tmp, $js);
+
+ $compressor = new cubeCommandLine('yuicompressor');
+ $compressor->setPath(CONVERTER_PATH);
+ $compressor->setArg('charset', 'UTF-8');
+ $compressor->setArg('type', 'js');
+ $compressor->setArg('line-break', 1024);
+ $compressor->setArg('o', $minimized);
+ $compressor->setArg(null, $tmp);
+ $compressor->execute();
+ }
+
+ $js = $this->writeConfig();
+ $js.=file_get_contents($minimized);
+ file_put_contents($this->vdir . '/data/fluidbook.js', $js);
+ }
+
+ protected function writeConfig() {
+ $config = cubeObject::merge($this->book->parametres->toStandardObject(), $this->theme->parametres->toStandardObject());
+ $config->numerotation = explode(',', $this->book->numerotation);
+ $config->id = $this->book->book_id;
+ $config->cacheDate = TIME;
+ return 'var DATAS=' . json_encode($config) . ';' . "\n";
+ }
+
+ protected function writeFonts() {
+ $formats = array('ttf', 'woff', 'svg');
+
+ foreach ($this->cssFont as $font => $index) {
+
+ foreach ($formats as $format) {
+ $fontforge = new cubeCommandLine('convert.pe');
+ $fontforge->setPath(CONVERTER_PATH);
+ foreach ($this->fontDocs[$font] as $document_id => $dummy) {
+ $fontforge->setArg(null, WS_DOCS . '/' . $document_id . '/fonts/web/' . $font . '.ttf');
+ }
+ $fontforge->setArg(null, $this->vdir . '/data/style/F' . $index . '.' . $format);
+ $fontforge->execute();
+ }
+ }
+ }
+
+ protected function writeIcons() {
+ $res = array();
+ // Get the colors used to colorize graphics
+ if ($this->theme->parametres->colorizeIcons) {
+ $couleurI = '#' . $this->theme->parametres->couleurI;
+ } else {
+ $couleurI = '#FFFFFF';
+ }
+ $arrowsColor = '#' . $this->theme->parametres->arrowsColor;
+ // 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);
+
+ foreach ($icons as $icon => $color) {
+ wsTools::colorizeAndRasterizeIcon($this->theme->parametres->iconSet, $icon, $color, $this->vdir . '/data/images/', 4, $w, $h);
+ }
+ return $res;
+ }
+
+ protected function writeImages() {
+
+ foreach (self::$resolutions as $r) {
+ mkdir($this->vdir . '/data/background/' . $r, 0777);
+ }
+ foreach ($this->pages as $page => $infos) {
+ foreach (self::$resolutions as $r) {
+ copy(WS_DOCS . '/' . $infos['document_id'] . '/html/h' . $r . '-' . $infos['document_page'] . '.jpg', $this->vdir . '/data/background/' . $r . '/p' . $page . '.jpg');
+ }
+ copy(WS_DOCS . '/' . $infos['document_id'] . '/p' . $infos['document_page'] . '.jpg', $this->vdir . '/data/thumbnails/p' . $page . '.jpg');
+ }
+ }
+
+ protected function writePage($page) {
+ $res = '';
+ foreach ($page as $line) {
+ $res .= $this->writeLine($line);
+ }
+ return $res;
+ }
+
+ protected function writeLine($line) {
+ $res = '';
+ foreach ($line['groups'] as $group) {
+ $res.=$this->writeGroup($group, $line);
+ }
+ return $res;
+ }
+
+ protected function writeGroup($group, $line) {
+ if ($group === false) {
+ return '';
+ }
+
+ $group['y'] = $this->getCSSY(($group['y'] + $line['y']) * $this->multiply);
+ $group['x'] = $this->getCSSX(($group['x']) * $this->multiply);
+
+ $class = array('g');
+ if (!is_null($group['color'])) {
+ $class[] = 'c' . $group['color'];
+ }
+ if (!is_null($group['size'])) {
+ $class[] = 's' . $group['size'];
+ }
+ if (!is_null($group['font'])) {
+ $class[] = 'f' . $group['font'];
+ }
+ if (!is_null($group['x'])) {
+ $class[] = 'x' . $group['x'];
+ }
+ if (!is_null($group['y'])) {
+ $class[] = 'y' . $group['y'];
+ }
+ if (!is_null($line['rotation'])) {
+ $class[] = 'r' . $line['rotation'];
+ }
+ if (!is_null($group['letterspacing'])) {
+ $class[] = 'l' . $group['letterspacing'];
+ }
+ if (!is_null($group['wordspacing'])) {
+ $class[] = 'w' . $group['wordspacing'];
+ }
+ $class = implode(' ', $class);
+
+ $res = '<div class="' . $class . '">';
+ foreach ($group['spans'] as $span) {
+ $res.=$this->writeSpan($span);
+ }
+ $res.='</div>';
+ return $res;
+ }
+
+ protected function writeSpan($span) {
+ if ($span === false) {
+ return '';
+ }
+
+ if ($span['space']) {
+ return $span['text'];
+ } else {
+ return self::escapeHTML($span['text']);
+ }
+ }
+
+ protected function writeCSS($file, $links) {
+ $res = array();
+
+ // General theme
+ $h = $this->book->parametres->height . 'px';
+ $w2 = ($this->book->parametres->width * 2) . 'px';
+ $w = $this->book->parametres->width . 'px';
+ $wm = ($this->book->parametres->width * $this->multiply) . 'px';
+ $hm = ($this->book->parametres->height * $this->multiply) . 'px';
+
+
+ $navTop = ($this->book->parametres->height - 40 - 100) / 2;
+ $res[] = '.portrait #pages,.portrait .doublePage.page,.page,.portrait #shadow,#shadow.single,.page .links{width:' . $w . ';max-width:' . $w . ';height:' . $h . ';max-height:' . $h . '}';
+ $res[] = '.background{' . $this->writeCSSUA('transform-origin', 'top left') . ';}';
+ foreach (self::$resolutions as $r) {
+ $ratio = round(72 / $r, 2);
+ $wr = $this->book->parametres->width / $ratio;
+ $hr = $this->book->parametres->height / $ratio;
+
+ $br = '.background.r' . $r . '{';
+ if ($ratio != 1) {
+ $br.=$this->writeCSSUA('transform', 'scale(' . $ratio . ')') . ';';
+ }
+ $br.='width:' . $wr . 'px;height:' . $hr . 'px;}';
+ $res[] = $br;
+ }
+ $res[] = '.doublePage,#pages,.landscape #shadow.double{width:' . $w2 . ';max-width:' . $w2 . ';height:' . $h . ';max-height:' . $h . '}';
+ $res[] = '.landscape #shadow.single.right{left: ' . $w . ';}';
+ $res[] = '.landscape .page.right{left:' . $w . '}';
+ if ($this->theme->parametres->displayPageNumber) {
+ $res[] = '#pagesnumbers{top:' . $h . ';color:' . self::colorToCSS($this->theme->parametres->colorPageNumber) . '}';
+ $res[] = '#pagesnumbers div{width:' . $w . '}';
+ } else {
+ $res[] = '#pagesnumbers{display:none;}';
+ }
+
+ $texts = '.texts{' . $this->writeCSSUA('transform-origin', 'top left') . ';';
+ $texts.=$this->writeCSSUA('transform', 'scale(' . round(1 / $this->multiply, 2) . ')') . ';';
+ $texts.='width:' . $wm . '; max-width:' . $wm . ';';
+ $texts.='height:' . $hm . '; max-height:' . $hm . ';';
+ $texts.='}';
+ $res[] = $texts;
+
+ // Theme
+ // Background
+ $body = '#deviceView{';
+ $body.='background-color:#' . $this->theme->parametres->backgroundColor . ';';
+ switch ($this->theme->parametres->repeat) {
+ case wsTheme::REPEAT:
+ $body.='background-repeat:repeat;';
+ break;
+ case wsTheme::NONE:
+ $body.='background-repeat:no-repeat;';
+ break;
+ case wsTheme::RATIO:
+ $body.='background-repeat:no-repeat;';
+ break;
+ case wsTheme::STRETCH:
+ $body.='background-repeat:no-repeat;';
+ $body.='background-size:100% 100%;';
+ break;
+ }
+ if ($this->theme->parametres->backgroundImage != '') {
+ copy($this->themeRoot . '/' . $this->theme->parametres->backgroundImage, $this->vdir . '/data/images/' . $this->theme->parametres->backgroundImage);
+ $body.='background-image:url(../images/' . $this->theme->parametres->backgroundImage . ');';
+ $body.='background-position:';
+
+
+ switch ($this->theme->parametres->backgroundVAlign) {
+ case wsTheme::TOP:
+ $body.='top';
+ break;
+ case wsTheme::MIDDLE:
+ $body.='center';
+ break;
+ case wsTheme::BOTTOM:
+ $body.='bottom';
+ break;
+ }
+ $body.=' ';
+ switch ($this->theme->parametres->backgroundHAlign) {
+ case wsTheme::LEFT:
+ $body.='left';
+ break;
+ case wsTheme::CENTER:
+ $body.='center';
+ break;
+ case wsTheme::RIGHT:
+ $body.='right';
+ break;
+ }
+ $body.=';';
+ }
+
+ $body.='}';
+ $res[] = $body;
+
+ // Header
+ $header = '#header{';
+ $header.='height:' . $this->theme->parametres->menuHeight . 'px;';
+ $header.='background-color:' . self::colorToCSS($this->theme->parametres->menuColor) . ';';
+ if ($this->theme->parametres->menuImage != '') {
+ copy($this->themeRoot . '/' . $this->theme->parametres->menuImage, $this->vdir . '/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;';
+ }
+ $header.='}';
+ $res[] = $header;
+
+ //Icons
+ $res = array_merge($res, $this->writeIcons());
+
+ // Logo
+ $logo = '#logo{';
+ if ($this->theme->parametres->logo) {
+ copy($this->themeRoot . '/' . $this->theme->parametres->logo, $this->vdir . '/data/images/' . $this->theme->parametres->logo);
+ $dim = getimagesize($this->vdir . '/data/images/' . $this->theme->parametres->logo);
+ $logo.='background-image:url(../images/' . $this->theme->parametres->logo . ');width:' . $dim[0] . 'px;height:' . $dim[1] . 'px;';
+ }
+ $logo.='}';
+ $res[] = $logo;
+
+ // Credits
+ $res[] = '#credits,#credits a{color:' . self::colorToCSS($this->theme->parametres->creditsColor) . ';}';
+
+ // Arrows
+ $res[] = '#next,#previous{background-color:' . self::colorToCSS($this->theme->parametres->couleurA) . ';}';
+ // Book shadow
+ $shadowColor = self::colorToCSS($this->theme->parametres->bookShadeColor);
+ if ($shadowColor != 'transparent') {
+ $res[] = '#shadow{' . $this->writeCSSUA('box-shadow', '0 0 20px ' . $shadowColor) . '}';
+ }
+
+ // 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) . ';}';
+
+ // Menus
+ # View
+ $res[] = '.portrait #view{width:' . $w . ';min-height:' . $h . '}';
+ $res[] = '.landscape #view{width:' . $w2 . ';min-height:' . $h . '}';
+ $res[] = '#view{background-color:' . self::colorToCSS($this->theme->parametres->couleurB) . ';color:' . self::colorToCSS($this->theme->parametres->subTextColor) . ';}';
+ # Index
+ $ratio = $this->book->parametres->width / $this->book->parametres->height;
+ $thumbh = round(100 / $ratio);
+ $res[] = '#index .thumb img{width:100px;height:' . $thumbh . 'px;}';
+ $res[] = '#index .doubleThumb{height:' . $thumbh . 'px;' . $this->writeCSSUA('box-shadow', '0 0 3px ' . $shadowColor) . '}';
+ $res[] = '#index .doubleThumb .overlay{height:' . $thumbh . 'px;}';
+ $res[] = '#index .doubleThumb .hits.yes{background-color:' . self::colorToCSS($this->theme->parametres->subSelectColor) . ';color:' . self::colorToCSS($this->theme->parametres->subTextSelectColor) . '}';
+
+ // Pages styles
+ foreach ($this->cssColor as $color => $index) {
+ $res[] = '.c' . $index . '{color:#' . $color . '}';
+ }
+
+ foreach ($this->cssSize as $size => $index) {
+ $res[] = '.s' . $index . '{font-size:' . $size . 'px}';
+ }
+
+ foreach ($this->cssLetterSpacing as $letterspacing => $index) {
+ $res[] = '.l' . $index . '{letter-spacing:' . $letterspacing . 'em}';
+ }
+
+ foreach ($this->cssWordSpacing as $wordspacing => $index) {
+ $res[] = '.w' . $index . '{word-spacing:' . $wordspacing . 'em}';
+ }
+
+ foreach ($this->cssX as $x => $index) {
+ $res[] = '.x' . $index . '{left:' . $x . 'px}';
+ }
+
+ foreach ($this->cssY as $y => $index) {
+ $res[] = '.y' . $index . '{top:' . $y . 'px}';
+ }
+
+ foreach ($this->cssRotation as $rotation => $index) {
+ $rotation*= - 1;
+
+
+ $to = 'transform-origin:left top;';
+
+ $css = '.r' . $index . '{';
+ $css.=self::writeCSSUA('transform', 'rotate(' . $rotation . 'deg)') . ';';
+ $css.=self::writeCSSUA('transform-origin', 'left top') . ';';
+ $css.='margin-top:' . round(cos(deg2rad($rotation)) * -1, 2) . 'em !important;';
+ $css.='margin-left:' . round(sin(deg2rad($rotation)), 2) . 'em !important;';
+ $css.='}';
+ $res[] = $css;
+ }
+
+ foreach ($this->cssFont as $font => $index) {
+ $res[] = "@font-face{font-family:F" . $index . ";src:url('F" . $index . ".woff') format('woff'),url('F" . $index . ".ttf') format('truetype'),url('F" . $index . ".svg#" . $font . "') format('svg')}";
+ $res[] = '.f' . $index . '{font-family:F' . $index . ',Arial,Helvetica}';
+ }
+
+ $res = array_chunk($res, 3500);
+ foreach ($res as $k => $css) {
+ file_put_contents(sprintf($file, $k), implode("\n", $css));
+ }
+ return count($res);
+ }
+
+ protected function writeCSSUA($property, $value) {
+ $res = array();
+ foreach (self::$uaPrefixes as $prefix) {
+ $res[] = $prefix . $property . ':' . $value;
+ }
+ return implode(';', $res);
+ }
+
+ protected function addLine($line, $document_id) {
+ $res = array();
+ foreach ($line->a as $group) {
+ $res = array_merge($res, $this->addGroup($group, $document_id));
+ }
+ return array(
+ 'y' => $this->normalizeFloatValue($line['y']),
+ 'rotation' => $this->getCSSRotation($this->normalizeFloatValue($line['rotation'], 0)),
+ "groups" => $res);
+ }
+
+ protected function addGroup($group, $document_id) {
+ $alpha = intval(substr($group['color'], 1, 2), 16);
+ if ($alpha == 0) {
+ return false;
+ }
+
+ $first = true;
+ $letterSpacing = 0;
+ $letterCount = 0;
+ $wordSpacing = 0;
+ $wordCount = 0;
+
+ $res = array();
+ $spans = array();
+
+ foreach ($group->s as $span) {
+ if ($first && trim((string) $span) == '') {
+ continue;
+ }
+ if ($first) {
+ $pos = $x = $span['x'];
+ $pos+=$span['width'];
+ $first = false;
+ } else {
+ if ((float) $span['x'] < (float) $newSpan['x']) {
+ // On change de groupe
+ $ls = $ws = 0;
+ if ($letterCount > 0) {
+ $ls = $letterSpacing / $letterCount;
+ }
+ if ($wordCount > 0) {
+ $ws = $wordSpacing / $wordCount;
+ }
+
+ $res[] = array(
+ 'color' => $this->getCSSColor($group['color']),
+ 'size' => $this->getCSSSize($group['size']),
+ 'font' => $this->getCSSFont((string) $group['font'], $document_id),
+ 'letterspacing' => $this->getCSSLetterSpacing($ls),
+ 'wordspacing' => $this->getCSSLetterSpacing($ws),
+ 'y' => 0,
+ 'x' => $x,
+ 'spans' => $spans);
+
+ $spans = array();
+ $pos = $x = $span['x'];
+ $pos+=$span['width'];
+ } else {
+
+ $diff = $span['x'] - $pos;
+ if ($diff > $group['size'] / 4) {
+ $space = round($diff / $group['size'], 4);
+ if ($space > 2) {
+ // On change de groupe
+ $ls = $ws = 0;
+ if ($letterCount > 0) {
+ $ls = $letterSpacing / $letterCount;
+ }
+ if ($wordCount > 0) {
+ $ws = $wordSpacing / $wordCount;
+ }
+ $res[] = array(
+ 'color' => $this->getCSSColor($group['color']),
+ 'size' => $this->getCSSSize($group['size']),
+ 'font' => $this->getCSSFont($group['font'], $document_id),
+ 'letterspacing' => $this->getCSSLetterSpacing($ls),
+ 'wordspacing' => $this->getCSSLetterSpacing($ws),
+ 'y' => 0,
+ 'x' => $x,
+ 'spans' => $spans);
+
+ $spans = array();
+ $pos = $x = $span['x'];
+ $pos+=$span['width'];
+ } else {
+
+ $newSpan = $this->addSpan('<span style="width:' . $space . 'em;"> </span>', true);
+ array_push($spans, $newSpan);
+ }
+ }
+ }
+ }
+
+
+ $newSpan = $this->addSpan($span);
+ $pos = $span['x'] + $span['width'];
+
+ array_push($spans, $newSpan);
+ $copy = (string) $span;
+ $len = mb_strlen($copy);
+ str_replace(' ', '-', $copy, $w);
+ $l = $len - $w;
+
+ $letterCount+=$l;
+ $wordCount+=$w;
+
+ $letterSpacing+=$l * (float) $span['letterspacing'];
+ $wordSpacing+=$w * (float) $span['wordspacing'];
+ }
+
+ if (count($spans)) {
+ $ls = $ws = 0;
+ if ($letterCount > 0) {
+ $ls = $letterSpacing / $letterCount;
+ }
+ if ($wordCount > 0) {
+ $ws = $wordSpacing / $wordCount;
+ }
+
+ $res[] = array(
+ 'color' => $this->getCSSColor($group['color']),
+ 'size' => $this->getCSSSize($group['size']),
+ 'font' => $this->getCSSFont($group['font'], $document_id),
+ 'letterspacing' => $this->getCSSLetterSpacing($ls),
+ 'wordspacing' => $this->getCSSLetterSpacing($ws),
+ 'y' => 0,
+ 'x' => $x,
+ 'spans' => $spans);
+ }
+
+ return $res;
+ }
+
+ protected function addSpan($span, $space=false) {
+ $text = (string) $span;
+ return array('text' => $text, 'space' => $space, 'x' => $span['x']);
+ }
+
+ protected function getCSSSize($size) {
+ $size = $this->normalizeFloatValue($size);
+ $size*=$this->multiply;
+ return $this->getIndex($size, $this->cssSize);
+ }
+
+ protected function getCSSFont($font, $document_id) {
+ $font = (string) $font;
+ if (!isset($this->fontDocs[$font])) {
+ $this->fontDocs[$font] = array();
+ }
+ $this->fontDocs[$font][$document_id] = true;
+
+ return $this->getIndex($font, $this->cssFont);
+ }
+
+ protected function getCSSColor($color) {
+ $color = trim($color, '#');
+ if (strlen($color) > 6) {
+ $color = substr($color, 2, 6);
+ }
+ if ($color == '000000') {
+ return null;
+ }
+ return $this->getIndex($color, $this->cssColor);
+ }
+
+ protected function getCSSLetterSpacing($letterspacing) {
+
+ $letterspacing = $this->normalizeFloatValue($letterspacing, 4);
+
+ if ($letterspacing == 0) {
+ return null;
+ }
+ return $this->getIndex($letterspacing, $this->cssLetterSpacing);
+ }
+
+ protected function getCSSWordSpacing($wordspacing) {
+ $wordspacing = $this->normalizeFloatValue($wordspacing, 4);
+
+ if ($wordspacing == 0) {
+ return null;
+ }
+ return $this->getIndex($wordspacing, $this->cssWordSpacing);
+ }
+
+ protected function getCSSRotation($rotation) {
+ $rotation = $this->normalizeFloatValue($rotation, 0);
+ if ($rotation == 0) {
+ return null;
+ }
+ return $this->getIndex($rotation, $this->cssRotation);
+ }
+
+ protected function getCSSX($x) {
+ $x = round($x);
+ if ($x == 0) {
+ return null;
+ }
+ return $this->getIndex($x, $this->cssX);
+ }
+
+ protected function getCSSY($y) {
+ $y = round($y);
+ if ($y == 0) {
+ return null;
+ }
+ return $this->getIndex($y, $this->cssY);
+ }
+
+ protected function getIndex($value, &$tab) {
+ $value = (string) $value;
+ if (isset($tab[$value])) {
+ return $tab[$value];
+ }
+ $res = $this->base62(count($tab));
+ $tab[$value] = $res;
+ return $res;
+ }
+
+ protected function normalizeFloatValue($value, $round=3) {
+ $value = str_replace(',', '.', $value);
+ $value = (float) $value;
+ $value = round($value, $round);
+ return $value;
+ }
+
+ protected function base62($val) {
+ $chars = '0123456789abcdefghijklmnopqrstuvwxyz';
+ $base = strlen($chars);
+ $str = '';
+ do {
+ $i = $val % $base;
+ $str = $chars[$i] . $str;
+ $val = ($val - $i) / $base;
+ } while ($val > 0);
+ return $str;
+ }
+
+ public function copyLinkFile($source, $dest, $video=false) {
+ // TODO delete that return;
+ //return;
+ $origDir = WS_BOOKS . '/working/' . $this->book_id . '/';
+ $types = array('mp4', 'ogv', 'webm', 'jpg');
+ if ($video) {
+ return;
+ wsTools::encodeWebVideos($origDir . $source, null, false);
+ $e = explode('.', $source);
+ array_pop($e);
+ $base = implode('.', $e);
+ $source = array();
+ foreach ($types as $type) {
+ $source[] = $base . '.' . $type;
+ }
+ }
+
+ if (!is_array($source)) {
+ $source = array($source);
+ }
+
+ foreach ($source as $so) {
+ $s = $origDir . $so;
+ if (file_exists($s)) {
+ $d = $this->vdir . '/' . $dest . '/' . $so;
+ if (!file_exists(dirname($d))) {
+ mkdir(dirname($d), 0777, true);
+ }
+ copy($s, $d);
+ }
+ }
+ }
+
+ public static function escapeHTML($in) {
+ $in = htmlentities($in, ENT_NOQUOTES, "UTF-8");
+ $in = str_replace(' ', '', $in);
+
+ return $in;
+ }
+
+ public function __destruct() {
+
+ }
+
+ public static function colorToCSS($color, $forceAlpha=null) {
+
+ if (!is_null($forceAlpha)) {
+ $a = $forceAlpha * 255;
+ $a = base_convert($a, 10, 16);
+ if (strlen($color) == 6) {
+ $color = $a . $color;
+ } else {
+ $color = $a . substr($color, 2, 6);
+ }
+ }
+
+ if (strlen($color) == 6) {
+ return '#' . $color;
+ } else {
+ $alpha = substr($color, 0, 2);
+ $red = substr($color, 2, 2);
+ $green = substr($color, 4, 2);
+ $blue = substr($color, 6, 2);
+
+ $components = array('alpha', 'red', 'green', 'blue');
+ foreach ($components as $k => $name) {
+ $hex = substr($color, $k * 2, 2);
+ $$name = intval($hex, 16);
+ }
+ $alpha/=255;
+ if ($alpha == 0) {
+ return 'transparent';
+ } elseif ($alpha == 1) {
+ return '#' . substr($color, 2, 6);
+ }
+ return 'rgba(' . $red . ',' . $green . ',' . $blue . ',' . $alpha . ')';
+ }
+ }
+
+}
+?>
\ No newline at end of file
--- /dev/null
+<?php
+
+class wsPackagerHTML5Link {
+
+ public $left;
+ public $top;
+ public $width;
+ public $height;
+ public $page;
+ public $type;
+ public $to;
+ public $numerotation;
+ public $target;
+ public $interactive;
+ public $video_loop;
+ public $video_sound_on;
+ public $video_controls;
+ public $video_auto_start;
+ public $video_height;
+ public $video_width;
+ public $video_service;
+ public $inline;
+ public $display_area;
+ public $infobulle;
+ public $id;
+ public $packager;
+
+ public static function getInstance($id, $init, &$packager) {
+ switch ($init['type']) {
+ case 1:
+ case 2:
+ return new webLink($id, $init, $packager);
+ case 3:
+ return new mailLink($id, $init, $packager);
+ case 5:
+ return new internalLink($id, $init, $packager);
+ case 4:
+ if ($init['inline']) {
+ return new videoLink($id, $init, $packager);
+ } else {
+ return new videoPopupLink($id, $init, $packager);
+ }
+ case 6:
+ return new multimediaLink($id, $init, $packager);
+ case 7:
+ case 8:
+ case 9:
+ return null;
+ case 10:
+ if ($init['inline']) {
+ return new webVideoLink($id, $init, $packager);
+ } else {
+ return new webVideoPopupLink($id, $init, $packager);
+ }
+ case 11:
+ return new actionLink($id, $init, $packager);
+ case 12:
+ return new basketLink($id, $init, $packager);
+ case 13:
+ return null;
+ case 14:
+ return new colorLink($id, $init, $packager);
+ case 15:
+ return new imageLink($id, $init, $packager);
+ case 16:
+ return new fileLink($id, $init, $packager);
+ default:
+ return null;
+ }
+ }
+
+ public function __construct($id, $init, &$packager) {
+ foreach ($init as $k => $v) {
+ $this->$k = $v;
+ }
+ $this->id = $id;
+ $this->packager = $packager;
+ }
+
+ public function getHTMLContainer() {
+ return '<div class="link" id="link' . $this->id . '">' . $this->getHTMLContent() . '</div>';
+ }
+
+ public function getHTMLContent() {
+ return '';
+ }
+
+ public function copyExternalFile($file, $video=false) {
+ $this->packager->copyLinkFile($file, 'data/links/', $video);
+ }
+
+ public function getCSSContainer() {
+ $css = '#link' . $this->id . '{';
+ $css.='left:' . $this->left . 'px;top:' . $this->top . 'px;';
+ $css.='width:' . $this->width . 'px;height:' . $this->height . 'px;';
+ $css.=$this->getCSS();
+ $css.='}';
+ return $css;
+ }
+
+ public function getCSS() {
+ return '';
+ }
+
+ public static function getUniversalLocation($loc, $css=false) {
+ $datas = parse_url($loc);
+
+ if (isset($datas['scheme']) && !is_null($datas['scheme'])) {
+ return $loc;
+ } else {
+ if ($css) {
+ return '../links/' . $loc;
+ } else {
+ return 'data/links/' . $loc;
+ }
+ }
+ }
+
+}
+
+class normalLink extends wsPackagerHTML5Link {
+
+ public function getHTMLContent() {
+ $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() {
+ return '#';
+ }
+
+ public function getTarget() {
+ return '_self';
+ }
+
+}
+
+class contentLink extends wsPackagerHTML5Link {
+
+}
+
+class webLink extends normalLink {
+
+ public function getURL() {
+ return wsPackagerHTML5Link::getUniversalLocation($this->to);
+ }
+
+ public function getTarget() {
+ return $this->target;
+ }
+
+ public function getCSS() {
+
+ }
+
+}
+
+class mailLink extends normalLink {
+
+ public function getURL() {
+ return 'mailto:' . $this->to;
+ }
+
+ public function getTarget() {
+ return '_self';
+ }
+
+}
+
+class internalLink extends normalLink {
+
+ public function getURL() {
+ return '#/page/' . $this->getPage();
+ }
+
+ public function getPage() {
+ if ($this->numerotation == 'physical') {
+ return $this->to;
+ } else {
+ return $this->packager->virtualToPhysical($this->to);
+ }
+ }
+
+}
+
+class videoLink extends wsPackagerHTML5Link {
+
+ public function getHTMLContent() {
+ $file = $this->to;
+ $e = explode('.', $file);
+ $ext = array_pop($e);
+ $basename = implode('.', $e);
+ $w = round($this->width);
+ $h = round($this->height);
+
+ $res = '<video width="' . $w . '" height="' . $h . '"';
+ if ($this->video_auto_start) {
+ $res.=' autoplay="autoplay"';
+ }
+ if ($this->video_controls) {
+ $res.=' controls="controls"';
+ }
+ if ($this->video_loop) {
+ $res.=' loop="loop"';
+ }
+ if (!$this->video_sound_on) {
+ $res.=' audio="muted"';
+ }
+ $res.=' poster="data/links/' . $basename . '.jpg"';
+ $res.='>';
+
+
+
+ $this->copyExternalFile($this->to, true);
+ $types = array('webm' => 'video/webm; codecs="vp8, vorbis"', 'ogv' => 'video/ogg; codecs="theora, vorbis"', 'mp4' => '');
+ foreach ($types as $ext => $type) {
+ if ($type != '') {
+ $type = " type='" . $type . "'";
+ }
+ $res.='<source src="' . wsPackagerHTML5Link::getUniversalLocation($basename . '.' . $ext) . '"' . $type . ' />';
+ }
+ $flashvars = array('video' => wsPackagerHTML5Link::getUniversalLocation($basename . '.mp4'),
+ 'poster' => wsPackagerHTML5Link::getUniversalLocation($basename . '.jpg'),
+ 'controls' => $this->video_controls == '1',
+ 'autoPlay' => $this->video_auto_start == '1',
+ 'loop' => $this->video_loop);
+ $res.=cubeMedia::flashObject('swf/video.swf', $w, $h, $flashvars, 'swfplayer-' . $basename, '', 9, '#ffffff', '', 'true', 'noscale', 'normal');
+ $res.='</video>';
+ return $res;
+ }
+
+}
+
+class webVideoLink extends videoLink {
+
+ public function getHTMLContent() {
+ return $this->getEmbed();
+ }
+
+ public function getEmbed() {
+ return '<iframe width="' . $this->width . '" height="' . $this->height . '" src="' . $this->getEmbedURL() . '" frameborder="0" allowfullscreen></iframe>';
+ }
+
+ public function getEmbedURL() {
+ if ($this->video_service == 0) {
+ $url = 'http://www.youtube.com/embed/' . $this->to . '?html5=1';
+ } else {
+ $url = 'http://www.dailymotion.com/embed/video/' . $this->to;
+ }
+ return $url;
+ }
+
+}
+
+class actionLink extends internalLink {
+
+ public function getURL() {
+ return '#' . $to;
+ }
+
+}
+
+class basketLink extends wsPackagerHTML5Link {
+
+}
+
+class colorLink extends contentLink {
+
+ public function getCSS() {
+ return 'background-color:' . wsPackagerHTML5::colorToCSS($this->to) . ';';
+ }
+
+}
+
+class imageLink extends contentLink {
+
+ public function getCSS() {
+ $this->copyExternalFile($this->to);
+ return 'background-image:url(' . wsPackagerHTML5Link::getUniversalLocation($this->to, true) . ');background-size:100% 100%;background-repeat:no-repeat;';
+ }
+
+}
+
+class fileLink extends normalLink {
+
+ public function getURL() {
+ $this->copyExternalFile($this->to);
+ return wsPackagerHTML5Link::getUniversalLocation($this->to);
+ }
+
+ public function getTarget() {
+ return '_blank';
+ }
+
+}
+
+class multimediaLink extends wsPackagerHTML5Link {
+
+ public function getHTMLContent() {
+ return cubeMedia::flashObject(wsPackagerHTML5Link::getUniversalLocation($this->to), $this->width, $this->height, array(), '', '', 9, '#ffffff', '', 'true', 'noscale', 'transparent');
+ }
+
+}
+
+class videoPopupLink extends normalLink {
+
+ public function getURL() {
+ $this->copyExternalFile($this->to, true);
+ return '#/video/' . $this->to;
+ }
+
+}
+
+class webVideoPopupLink extends videoPopupLink {
+
+ public function getURL() {
+ if ($this->video_service == 0) {
+ $service = 'youtube';
+ } elseif ($this->video_service == 1) {
+ $service = 'dailymotion';
+ }
+ return '#/webvideo/' . $service . '/' . $this->to;
+ }
+
+}
+
+?>
protected $daoBook;\r
\r
public static function package($book_id, $version) {\r
- //cubePHP::neverStop();\r
- set_time_limit(10);\r
+ cubePHP::neverStop();\r
if ($version == 'html') {\r
$packager = new wsPackagerHTML($book_id);\r
} elseif ($version == 'win-exe') {\r
+++ /dev/null
-<?php
-
-class wsPackagerHTML5Link {
-
- public $left;
- public $top;
- public $width;
- public $height;
- public $page;
- public $type;
- public $to;
- public $numerotation;
- public $target;
- public $interactive;
- public $video_loop;
- public $video_sound_on;
- public $video_controls;
- public $video_auto_start;
- public $video_height;
- public $video_width;
- public $video_service;
- public $inline;
- public $display_area;
- public $infobulle;
- public $id;
- public $packager;
-
- public static function getInstance($id, $init, &$packager) {
- switch ($init['type']) {
- case 1:
- case 2:
- return new webLink($id, $init, $packager);
- case 3:
- return new mailLink($id, $init, $packager);
- case 5:
- return new internalLink($id, $init, $packager);
- case 4:
- if ($init['inline']) {
- return new videoLink($id, $init, $packager);
- } else {
- return new videoPopupLink($id, $init, $packager);
- }
- case 6:
- return new multimediaLink($id, $init, $packager);
- case 7:
- case 8:
- case 9:
- return null;
- case 10:
- if ($init['inline']) {
- return new webVideoLink($id, $init, $packager);
- } else {
- return new webVideoPopupLink($id, $init, $packager);
- }
- case 11:
- return new actionLink($id, $init, $packager);
- case 12:
- return new basketLink($id, $init, $packager);
- case 13:
- return null;
- case 14:
- return new colorLink($id, $init, $packager);
- case 15:
- return new imageLink($id, $init, $packager);
- case 16:
- return new fileLink($id, $init, $packager);
- default:
- return null;
- }
- }
-
- public function __construct($id, $init, &$packager) {
- foreach ($init as $k => $v) {
- $this->$k = $v;
- }
- $this->id = $id;
- $this->packager = $packager;
- }
-
- public function getHTMLContainer() {
- return '<div class="link" id="link' . $this->id . '">' . $this->getHTMLContent() . '</div>';
- }
-
- public function getHTMLContent() {
- return '';
- }
-
- public function copyExternalFile($file, $video=false) {
- $this->packager->copyLinkFile($file, 'data/links/', $video);
- }
-
- public function getCSSContainer() {
- $css = '#link' . $this->id . '{';
- $css.='left:' . $this->left . 'px;top:' . $this->top . 'px;';
- $css.='width:' . $this->width . 'px;height:' . $this->height . 'px;';
- $css.=$this->getCSS();
- $css.='}';
- return $css;
- }
-
- public function getCSS() {
- return '';
- }
-
- public static function getUniversalLocation($loc, $css=false) {
- $datas = parse_url($loc);
-
- if (isset($datas['scheme']) && !is_null($datas['scheme'])) {
- return $loc;
- } else {
- if ($css) {
- return '../links/' . $loc;
- } else {
- return 'data/links/' . $loc;
- }
- }
- }
-
-}
-
-class normalLink extends wsPackagerHTML5Link {
-
- public function getHTMLContent() {
- $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() {
- return '#';
- }
-
- public function getTarget() {
- return '_self';
- }
-
-}
-
-class contentLink extends wsPackagerHTML5Link {
-
-}
-
-class webLink extends normalLink {
-
- public function getURL() {
- return wsPackagerHTML5Link::getUniversalLocation($this->to);
- }
-
- public function getTarget() {
- return $this->target;
- }
-
- public function getCSS() {
-
- }
-
-}
-
-class mailLink extends normalLink {
-
- public function getURL() {
- return 'mailto:' . $this->to;
- }
-
- public function getTarget() {
- return '_self';
- }
-
-}
-
-class internalLink extends normalLink {
-
- public function getURL() {
- return '#/page/' . $this->getPage();
- }
-
- public function getPage() {
- if ($this->numerotation == 'physical') {
- return $this->to;
- } else {
- return $this->packager->virtualToPhysical($this->to);
- }
- }
-
-}
-
-class videoLink extends wsPackagerHTML5Link {
-
- public function getHTMLContent() {
- $file = $this->to;
- $e = explode('.', $file);
- $ext = array_pop($e);
- $basename = implode('.', $e);
- $w = round($this->width);
- $h = round($this->height);
-
- $res = '<video width="' . $w . '" height="' . $h . '"';
- if ($this->video_auto_start) {
- $res.=' autoplay="autoplay"';
- }
- if ($this->video_controls) {
- $res.=' controls="controls"';
- }
- if ($this->video_loop) {
- $res.=' loop="loop"';
- }
- if (!$this->video_sound_on) {
- $res.=' audio="muted"';
- }
- $res.=' poster="data/links/' . $basename . '.jpg"';
- $res.='>';
-
-
-
- $this->copyExternalFile($this->to, true);
- $types = array('webm' => 'video/webm; codecs="vp8, vorbis"', 'ogv' => 'video/ogg; codecs="theora, vorbis"', 'mp4' => '');
- foreach ($types as $ext => $type) {
- if ($type != '') {
- $type = " type='" . $type . "'";
- }
- $res.='<source src="' . wsPackagerHTML5Link::getUniversalLocation($basename . '.' . $ext) . '"' . $type . ' />';
- }
- $flashvars = array('video' => wsPackagerHTML5Link::getUniversalLocation($basename . '.mp4'),
- 'poster' => wsPackagerHTML5Link::getUniversalLocation($basename . '.jpg'),
- 'controls' => $this->video_controls == '1',
- 'autoPlay' => $this->video_auto_start == '1',
- 'loop' => $this->video_loop);
- $res.=cubeMedia::flashObject('swf/video.swf', $w, $h, $flashvars, 'swfplayer-' . $basename, '', 9, '#ffffff', '', 'true', 'noscale', 'normal');
- $res.='</video>';
- return $res;
- }
-
-}
-
-class webVideoLink extends videoLink {
-
- public function getHTMLContent() {
- return $this->getEmbed();
- }
-
- public function getEmbed() {
- return '<iframe width="' . $this->width . '" height="' . $this->height . '" src="' . $this->getEmbedURL() . '" frameborder="0" allowfullscreen></iframe>';
- }
-
- public function getEmbedURL() {
- if ($this->video_service == 0) {
- $url = 'http://www.youtube.com/embed/' . $this->to . '?html5=1';
- } else {
- $url = 'http://www.dailymotion.com/embed/video/' . $this->to;
- }
- return $url;
- }
-
-}
-
-class actionLink extends internalLink {
-
- public function getURL() {
- return '#' . $to;
- }
-
-}
-
-class basketLink extends wsPackagerHTML5Link {
-
-}
-
-class colorLink extends contentLink {
-
- public function getCSS() {
- return 'background-color:' . wsPackagerHTML5::colorToCSS($this->to) . ';';
- }
-
-}
-
-class imageLink extends contentLink {
-
- public function getCSS() {
- $this->copyExternalFile($this->to);
- return 'background-image:url(' . wsPackagerHTML5Link::getUniversalLocation($this->to, true) . ');background-size:100% 100%;background-repeat:no-repeat;';
- }
-
-}
-
-class fileLink extends normalLink {
-
- public function getURL() {
- $this->copyExternalFile($this->to);
- return wsPackagerHTML5Link::getUniversalLocation($this->to);
- }
-
- public function getTarget() {
- return '_blank';
- }
-
-}
-
-class multimediaLink extends wsPackagerHTML5Link {
-
- public function getHTMLContent() {
- return cubeMedia::flashObject(wsPackagerHTML5Link::getUniversalLocation($this->to), $this->width, $this->height, array(), '', '', 9, '#ffffff', '', 'true', 'noscale', 'transparent');
- }
-
-}
-
-class videoPopupLink extends normalLink {
-
- public function getURL() {
- $this->copyExternalFile($this->to, true);
- return '#/video/' . $this->to;
- }
-
-}
-
-class webVideoPopupLink extends videoPopupLink {
-
- public function getURL() {
- if ($this->video_service == 0) {
- $service = 'youtube';
- } elseif ($this->video_service == 1) {
- $service = 'dailymotion';
- }
- return '#/webvideo/' . $service . '/' . $this->to;
- }
-
-}
-
-?>
+++ /dev/null
-<?php\r
-\r
-class wsPackagerHTML5 extends wsPackager {\r
-\r
- protected $layouts = array();\r
- protected $cssSize = array();\r
- protected $cssColor = array();\r
- protected $cssOpacity = array();\r
- protected $cssFont = array();\r
- protected $cssWordSpacing = array();\r
- protected $cssLetterSpacing = array();\r
- protected $cssRotation = array();\r
- protected $cssX = array();\r
- protected $cssY = array();\r
- protected $pdf2htmlRatio;\r
- protected $scale;\r
- protected $multiply;\r
- protected $div = array();\r
- protected $numerotation;\r
- protected static $resolutions = array(36, 72, 150);\r
- protected static $uaPrefixes = array('-moz-', '-webkit-', '-o-', '-ms-', '');\r
- protected $fontDocs = array();\r
-\r
- public function __construct($book_id) {\r
- parent::__construct($book_id);\r
- $this->version = 'html5';\r
- }\r
-\r
- protected function preparePackage() {\r
- parent::preparePackage();\r
-\r
- foreach ($this->pages as $page => $infos) {\r
- $file = WS_DOCS . '/' . $infos['document_id'] . '/html/p' . $infos['document_page'] . '.layout';\r
- if (file_exists($file)) {\r
- $this->layouts[$page] = simplexml_load_file($file, null, LIBXML_ERR_WARNING);\r
- }\r
- }\r
-\r
- $imagesize = getimagesize(WS_DOCS . '/' . $this->pages[1]['document_id'] . '/html/h72-' . $this->pages[1]['document_page'] . '.jpg');\r
- $this->pdf2htmlRatio = round($imagesize[0] / $this->layouts[1]['width'], 2);\r
- $this->scale = 4;\r
- $this->multiply = $this->pdf2htmlRatio * $this->scale;\r
- $this->numerotation = explode(',', $this->book->numerotation);\r
-\r
- $this->createHTML();\r
- }\r
-\r
- public function makePackage() {\r
- parent::makePackage();\r
- return $this->zip();\r
- }\r
-\r
- public function virtualToPhysical($virtual) {\r
- if (!in_array($virtual, $this->numerotation)) {\r
- return 1;\r
- }\r
- $p = array_search($virtual, $this->numerotation);\r
- return $p + 1;\r
- }\r
-\r
- protected function compareLines($a, $b) {\r
- if ((float) $a['y'] > (float) $b['y']) {\r
- return 1;\r
- } else {\r
- return -1;\r
- }\r
- }\r
-\r
- protected function createHTML() {\r
- foreach ($this->layouts as $page => $layout) {\r
- $this->div[$page] = array();\r
- $document_id = $this->pages[$page]['document_id'];\r
- $lines = array();\r
- foreach ($layout->l as $line) {\r
- $lines[] = $line;\r
- }\r
- usort($lines, array($this, 'compareLines'));\r
-\r
- foreach ($lines as $line) {\r
- $this->div[$page][] = $this->addLine($line, $document_id);\r
- }\r
- }\r
- mkdir($this->vdir . '/data/images', 0777, true);\r
- mkdir($this->vdir . '/data/contents', 0777, true);\r
- mkdir($this->vdir . '/data/background', 0777, true);\r
- mkdir($this->vdir . '/data/thumbnails', 0777, true);\r
- mkdir($this->vdir . '/data/style', 0777, true);\r
- mkdir($this->vdir . '/data/links/pages', 0777, true);\r
- mkdir($this->vdir . '/data/l10n/', 0777, true);\r
- mkdir($this->vdir . '/swf', 0777, true);\r
-\r
- // Copy style folder\r
- $from = WS_COMPILE_ASSETS . '/_html5/style';\r
- $to = $this->vdir;\r
- `cp -r $from $to`;\r
-\r
- // Copy images folder\r
- $from = WS_COMPILE_ASSETS . '/_html5/images';\r
- `cp -r $from $to`;\r
-\r
- // Copy swf\r
- copy(WS_COMPILE_ASSETS . '/_html5/swf/video.swf', $this->vdir . '/swf/video.swf');\r
-\r
- foreach ($this->div as $n => $page) {\r
- file_put_contents($this->vdir . '/data/contents/p' . $n . '.html', $this->writePage($page));\r
- }\r
- $this->writeFonts();\r
- $this->writeImages();\r
- $linksCSS = $this->writeLinks();\r
- $numCSS = $this->writeCSS($this->vdir . '/data/style/style_%d.css', $linksCSS);\r
- $this->writeLangs();\r
- $this->writeJs();\r
- $this->writeIndex($numCSS);\r
- }\r
-\r
- protected function writeIndex($numCSS) {\r
- $html = file_get_contents(WS_COMPILE_ASSETS . '/_html5/_index.html');\r
-\r
- $titre = $this->book->parametres->title;\r
- $credits = '';\r
- // Google analytics\r
- $ga = '';\r
- if ($this->book->parametres->googleAnalytics != '') {\r
- $ga = cubePage::googleAnalytics($this->book->parametres->googleAnalytics);\r
- }\r
- // Feuilles de style\r
- $sheets = array('style/fluidbook.css');\r
- for ($i = 0; $i < $numCSS; $i++) {\r
- $sheets[] = 'data/style/style_' . $i . '.css';\r
- }\r
- $style = array();\r
- foreach ($sheets as $sheet) {\r
- $style[] = '<link type="text/css" rel="stylesheet" href="' . $sheet . '?junk=' . TIME . '" />';\r
- }\r
- $style = implode("\n\t\t", $style);\r
-\r
- $vars = array('titre', 'credits', 'ga', 'style');\r
- foreach ($vars as $v) {\r
- $html = str_replace('<!-- $' . $v . ' -->', $$v, $html);\r
- }\r
- file_put_contents($this->vdir . '/index.html', $html);\r
- }\r
-\r
- protected function writeLangs() {\r
- global $core;\r
- $daoLang = new wsDAOLang($core->con);\r
- $lang = $daoLang->selectById($this->book->lang);\r
- $langs = $daoLang->selectAll();\r
-\r
-\r
- $traductions = (!count($this->book->traductions)) ? $lang->traductions : $this->book->traductions;\r
- file_put_contents($this->vdir . '/data/l10n/default.json', json_encode($traductions));\r
- foreach ($langs as $lang) {\r
- file_put_contents($this->vdir . '/data/l10n/' . $lang->lang_id . '.json', json_encode($lang->traductions));\r
- }\r
- }\r
-\r
- protected function writeLinks() {\r
- global $core;\r
- $daoDoc = new wsDAODocument($core->con);\r
- $daoDoc->getLinksAndRulers($this->book_id, $links, $rulers);\r
-\r
- $i = 0;\r
- $pages = array();\r
- $css = array();\r
- foreach ($links as $linkData) {\r
- $link = wsPackagerHTML5Link::getInstance($this->base62($i), $linkData, $this);\r
- if (is_null($link)) {\r
- continue;\r
- }\r
- if (!isset($pages[$link->page])) {\r
- $pages[$link->page] = '';\r
- }\r
- $pages[$link->page] .= $link->getHTMLContainer();\r
- $css[] = $link->getCSSContainer();\r
- $i++;\r
- }\r
-\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
-\r
- protected function writeJs() {\r
- $files = array('js/libs/modernizr.js',\r
- 'js/libs/sylvester.js',\r
- 'js/libs/jquery/jquery.js',\r
- 'js/libs/jquery/jquery.transform.js',\r
- 'js/libs/jquery/jquery.mousewheel.js',\r
- 'js/libs/jquery/jquery.hashchange.js',\r
- 'js/libs/fluidbook/fluidbook.utils.js',\r
- 'js/libs/fluidbook/fluidbook.cache.js',\r
- 'js/libs/fluidbook/fluidbook.support.js',\r
- 'js/libs/fluidbook/fluidbook.viewport.js',\r
- 'js/libs/fluidbook/fluidbook.desktop.js',\r
- 'js/libs/fluidbook/fluidbook.service.js',\r
- 'js/libs/fluidbook/fluidbook.loader.js',\r
- 'js/libs/fluidbook/fluidbook.l10n.js',\r
- 'js/libs/fluidbook/fluidbook.nav.js',\r
- 'js/libs/fluidbook/fluidbook.js',\r
- 'js/main.js');\r
-\r
- $mintime = 0;\r
- $minimized = WS_COMPILE_ASSETS . '/_html5/js/min.js';\r
- if (file_exists($minimized)) {\r
- $mintime = filemtime($minimized);\r
- }\r
- $reminimize = false;\r
- foreach ($files as $file) {\r
- if (filemtime(WS_COMPILE_ASSETS . '/_html5/' . $file) > $mintime) {\r
- $reminimize = true;\r
- break;\r
- }\r
- }\r
-\r
- if ($reminimize) {\r
- $js = '';\r
- foreach ($files as $file) {\r
- $js.=file_get_contents(WS_COMPILE_ASSETS . '/_html5/' . $file);\r
- $js.="\n\n";\r
- }\r
- $tmp = cubeFiles::tempnam();\r
- file_put_contents($tmp, $js);\r
-\r
- $compressor = new cubeCommandLine('yuicompressor');\r
- $compressor->setPath(CONVERTER_PATH);\r
- $compressor->setArg('charset', 'UTF-8');\r
- $compressor->setArg('type', 'js');\r
- $compressor->setArg('line-break', 1024);\r
- $compressor->setArg('o', $minimized);\r
- $compressor->setArg(null, $tmp);\r
- $compressor->execute();\r
- }\r
-\r
- $js = $this->writeConfig();\r
- $js.=file_get_contents($minimized);\r
- file_put_contents($this->vdir . '/data/fluidbook.js', $js);\r
- }\r
-\r
- protected function writeConfig() {\r
- $config = cubeObject::merge($this->book->parametres->toStandardObject(), $this->theme->parametres->toStandardObject());\r
- $config->numerotation = explode(',', $this->book->numerotation);\r
- $config->id = $this->book->book_id;\r
- $config->cacheDate = TIME;\r
- return 'var DATAS=' . json_encode($config) . ';' . "\n";\r
- }\r
-\r
- protected function writeFonts() {\r
- $formats = array('ttf', 'woff', 'svg');\r
-\r
- foreach ($this->cssFont as $font => $index) {\r
-\r
- foreach ($formats as $format) {\r
- $fontforge = new cubeCommandLine('convert.pe');\r
- $fontforge->setPath(CONVERTER_PATH);\r
- foreach ($this->fontDocs[$font] as $document_id => $dummy) {\r
- $fontforge->setArg(null, WS_DOCS . '/' . $document_id . '/fonts/web/' . $font . '.ttf');\r
- }\r
- $fontforge->setArg(null, $this->vdir . '/data/style/F' . $index . '.' . $format);\r
- $fontforge->execute();\r
- }\r
- }\r
- }\r
-\r
- protected function writeIcons() {\r
- $res = array();\r
- // Get the colors used to colorize graphics\r
- if ($this->theme->parametres->colorizeIcons) {\r
- $couleurI = '#' . $this->theme->parametres->couleurI;\r
- } else {\r
- $couleurI = '#FFFFFF';\r
- }\r
- $arrowsColor = '#' . $this->theme->parametres->arrowsColor;\r
- // Set the icon list with the color\r
- $icons = array('nav-bookmark' => $couleurI, 'nav-friend' => $couleurI, 'nav-help' => $couleurI, 'nav-index' => $couleurI, 'nav-sommaire' => $couleurI,\r
- 'next' => $arrowsColor, 'previous' => $arrowsColor, 'search' => $couleurI, 'nav-facebook' => $couleurI, 'nav-twitter' => $couleurI,\r
- 'help-fingers' => $couleurI, 'help-mouse' => $couleurI);\r
-\r
- foreach ($icons as $icon => $color) {\r
- wsTools::colorizeAndRasterizeIcon($this->theme->parametres->iconSet, $icon, $color, $this->vdir . '/data/images/', 4, $w, $h);\r
- }\r
- return $res;\r
- }\r
-\r
- protected function writeImages() {\r
-\r
- foreach (self::$resolutions as $r) {\r
- mkdir($this->vdir . '/data/background/' . $r, 0777);\r
- }\r
- foreach ($this->pages as $page => $infos) {\r
- foreach (self::$resolutions as $r) {\r
- copy(WS_DOCS . '/' . $infos['document_id'] . '/html/h' . $r . '-' . $infos['document_page'] . '.jpg', $this->vdir . '/data/background/' . $r . '/p' . $page . '.jpg');\r
- }\r
- copy(WS_DOCS . '/' . $infos['document_id'] . '/p' . $infos['document_page'] . '.jpg', $this->vdir . '/data/thumbnails/p' . $page . '.jpg');\r
- }\r
- }\r
-\r
- protected function writePage($page) {\r
- $res = '';\r
- foreach ($page as $line) {\r
- $res .= $this->writeLine($line);\r
- }\r
- return $res;\r
- }\r
-\r
- protected function writeLine($line) {\r
- $res = '';\r
- foreach ($line['groups'] as $group) {\r
- $res.=$this->writeGroup($group, $line);\r
- }\r
- return $res;\r
- }\r
-\r
- protected function writeGroup($group, $line) {\r
- if ($group === false) {\r
- return '';\r
- }\r
-\r
- $group['y'] = $this->getCSSY(($group['y'] + $line['y']) * $this->multiply);\r
- $group['x'] = $this->getCSSX(($group['x']) * $this->multiply);\r
-\r
- $class = array('g');\r
- if (!is_null($group['color'])) {\r
- $class[] = 'c' . $group['color'];\r
- }\r
- if (!is_null($group['size'])) {\r
- $class[] = 's' . $group['size'];\r
- }\r
- if (!is_null($group['font'])) {\r
- $class[] = 'f' . $group['font'];\r
- }\r
- if (!is_null($group['x'])) {\r
- $class[] = 'x' . $group['x'];\r
- }\r
- if (!is_null($group['y'])) {\r
- $class[] = 'y' . $group['y'];\r
- }\r
- if (!is_null($line['rotation'])) {\r
- $class[] = 'r' . $line['rotation'];\r
- }\r
- if (!is_null($group['letterspacing'])) {\r
- $class[] = 'l' . $group['letterspacing'];\r
- }\r
- if (!is_null($group['wordspacing'])) {\r
- $class[] = 'w' . $group['wordspacing'];\r
- }\r
- $class = implode(' ', $class);\r
-\r
- $res = '<div class="' . $class . '">';\r
- foreach ($group['spans'] as $span) {\r
- $res.=$this->writeSpan($span);\r
- }\r
- $res.='</div>';\r
- return $res;\r
- }\r
-\r
- protected function writeSpan($span) {\r
- if ($span === false) {\r
- return '';\r
- }\r
-\r
- if ($span['space']) {\r
- return $span['text'];\r
- } else {\r
- return self::escapeHTML($span['text']);\r
- }\r
- }\r
-\r
- protected function writeCSS($file, $links) {\r
- $res = array();\r
-\r
- // General theme\r
- $h = $this->book->parametres->height . 'px';\r
- $w2 = ($this->book->parametres->width * 2) . 'px';\r
- $w = $this->book->parametres->width . 'px';\r
- $wm = ($this->book->parametres->width * $this->multiply) . 'px';\r
- $hm = ($this->book->parametres->height * $this->multiply) . 'px';\r
-\r
-\r
- $navTop = ($this->book->parametres->height - 40 - 100) / 2;\r
- $res[] = '.portrait #pages,.portrait .doublePage.page,.page,.portrait #shadow,#shadow.single,.page .links{width:' . $w . ';max-width:' . $w . ';height:' . $h . ';max-height:' . $h . '}';\r
- $res[] = '.background{' . $this->writeCSSUA('transform-origin', 'top left') . ';}';\r
- foreach (self::$resolutions as $r) {\r
- $ratio = round(72 / $r, 2);\r
- $wr = $this->book->parametres->width / $ratio;\r
- $hr = $this->book->parametres->height / $ratio;\r
-\r
- $br = '.background.r' . $r . '{';\r
- if ($ratio != 1) {\r
- $br.=$this->writeCSSUA('transform', 'scale(' . $ratio . ')') . ';';\r
- }\r
- $br.='width:' . $wr . 'px;height:' . $hr . 'px;}';\r
- $res[] = $br;\r
- }\r
- $res[] = '.doublePage,#pages,.landscape #shadow.double{width:' . $w2 . ';max-width:' . $w2 . ';height:' . $h . ';max-height:' . $h . '}';\r
- $res[] = '.landscape #shadow.single.right{left: ' . $w . ';}';\r
- $res[] = '.landscape .page.right{left:' . $w . '}';\r
- if ($this->theme->parametres->displayPageNumber) {\r
- $res[] = '#pagesnumbers{top:' . $h . ';color:' . self::colorToCSS($this->theme->parametres->colorPageNumber) . '}';\r
- $res[] = '#pagesnumbers div{width:' . $w . '}';\r
- } else {\r
- $res[] = '#pagesnumbers{display:none;}';\r
- }\r
-\r
- $texts = '.texts{' . $this->writeCSSUA('transform-origin', 'top left') . ';';\r
- $texts.=$this->writeCSSUA('transform', 'scale(' . round(1 / $this->multiply, 2) . ')') . ';';\r
- $texts.='width:' . $wm . '; max-width:' . $wm . ';';\r
- $texts.='height:' . $hm . '; max-height:' . $hm . ';';\r
- $texts.='}';\r
- $res[] = $texts;\r
-\r
- // Theme\r
- // Background\r
- $body = '#deviceView{';\r
- $body.='background-color:#' . $this->theme->parametres->backgroundColor . ';';\r
- switch ($this->theme->parametres->repeat) {\r
- case wsTheme::REPEAT:\r
- $body.='background-repeat:repeat;';\r
- break;\r
- case wsTheme::NONE:\r
- $body.='background-repeat:no-repeat;';\r
- break;\r
- case wsTheme::RATIO:\r
- $body.='background-repeat:no-repeat;';\r
- break;\r
- case wsTheme::STRETCH:\r
- $body.='background-repeat:no-repeat;';\r
- $body.='background-size:100% 100%;';\r
- break;\r
- }\r
- if ($this->theme->parametres->backgroundImage != '') {\r
- copy($this->themeRoot . '/' . $this->theme->parametres->backgroundImage, $this->vdir . '/data/images/' . $this->theme->parametres->backgroundImage);\r
- $body.='background-image:url(../images/' . $this->theme->parametres->backgroundImage . ');';\r
- $body.='background-position:';\r
-\r
-\r
- switch ($this->theme->parametres->backgroundVAlign) {\r
- case wsTheme::TOP:\r
- $body.='top';\r
- break;\r
- case wsTheme::MIDDLE:\r
- $body.='center';\r
- break;\r
- case wsTheme::BOTTOM:\r
- $body.='bottom';\r
- break;\r
- }\r
- $body.=' ';\r
- switch ($this->theme->parametres->backgroundHAlign) {\r
- case wsTheme::LEFT:\r
- $body.='left';\r
- break;\r
- case wsTheme::CENTER:\r
- $body.='center';\r
- break;\r
- case wsTheme::RIGHT:\r
- $body.='right';\r
- break;\r
- }\r
- $body.=';';\r
- }\r
-\r
- $body.='}';\r
- $res[] = $body;\r
-\r
- // Header\r
- $header = '#header{';\r
- $header.='height:' . $this->theme->parametres->menuHeight . 'px;';\r
- $header.='background-color:' . self::colorToCSS($this->theme->parametres->menuColor) . ';';\r
- if ($this->theme->parametres->menuImage != '') {\r
- copy($this->themeRoot . '/' . $this->theme->parametres->menuImage, $this->vdir . '/data/images/' . $this->theme->parametres->menuImage);\r
- $header.='background-image:url(../images/' . $this->theme->parametres->menuImage . ');';\r
- $header.='background-repeat:no-repeat;';\r
- $header.='background-size:100% ' . $this->theme->parametres->menuHeight . 'px;';\r
- }\r
- $header.='}';\r
- $res[] = $header;\r
-\r
- //Icons\r
- $res = array_merge($res, $this->writeIcons());\r
-\r
- // Logo\r
- $logo = '#logo{';\r
- if ($this->theme->parametres->logo) {\r
- copy($this->themeRoot . '/' . $this->theme->parametres->logo, $this->vdir . '/data/images/' . $this->theme->parametres->logo);\r
- $dim = getimagesize($this->vdir . '/data/images/' . $this->theme->parametres->logo);\r
- $logo.='background-image:url(../images/' . $this->theme->parametres->logo . ');width:' . $dim[0] . 'px;height:' . $dim[1] . 'px;';\r
- }\r
- $logo.='}';\r
- $res[] = $logo;\r
-\r
- // Credits\r
- $res[] = '#credits,#credits a{color:' . self::colorToCSS($this->theme->parametres->creditsColor) . ';}';\r
-\r
- // Arrows\r
- $res[] = '#next,#previous{background-color:' . self::colorToCSS($this->theme->parametres->couleurA) . ';}';\r
- // Book shadow\r
- $shadowColor = self::colorToCSS($this->theme->parametres->bookShadeColor);\r
- if ($shadowColor != 'transparent') {\r
- $res[] = '#shadow{' . $this->writeCSSUA('box-shadow', '0 0 20px ' . $shadowColor) . '}';\r
- }\r
-\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
- // Menus\r
- # View\r
- $res[] = '.portrait #view{width:' . $w . ';min-height:' . $h . '}';\r
- $res[] = '.landscape #view{width:' . $w2 . ';min-height:' . $h . '}';\r
- $res[] = '#view{background-color:' . self::colorToCSS($this->theme->parametres->couleurB) . ';color:' . self::colorToCSS($this->theme->parametres->subTextColor) . ';}';\r
- # Index\r
- $ratio = $this->book->parametres->width / $this->book->parametres->height;\r
- $thumbh = round(100 / $ratio);\r
- $res[] = '#index .thumb img{width:100px;height:' . $thumbh . 'px;}';\r
- $res[] = '#index .doubleThumb{height:' . $thumbh . 'px;' . $this->writeCSSUA('box-shadow', '0 0 3px ' . $shadowColor) . '}';\r
- $res[] = '#index .doubleThumb .overlay{height:' . $thumbh . 'px;}';\r
- $res[] = '#index .doubleThumb .hits.yes{background-color:' . self::colorToCSS($this->theme->parametres->subSelectColor) . ';color:' . self::colorToCSS($this->theme->parametres->subTextSelectColor) . '}';\r
-\r
- // Pages styles\r
- foreach ($this->cssColor as $color => $index) {\r
- $res[] = '.c' . $index . '{color:#' . $color . '}';\r
- }\r
-\r
- foreach ($this->cssSize as $size => $index) {\r
- $res[] = '.s' . $index . '{font-size:' . $size . 'px}';\r
- }\r
-\r
- foreach ($this->cssLetterSpacing as $letterspacing => $index) {\r
- $res[] = '.l' . $index . '{letter-spacing:' . $letterspacing . 'em}';\r
- }\r
-\r
- foreach ($this->cssWordSpacing as $wordspacing => $index) {\r
- $res[] = '.w' . $index . '{word-spacing:' . $wordspacing . 'em}';\r
- }\r
-\r
- foreach ($this->cssX as $x => $index) {\r
- $res[] = '.x' . $index . '{left:' . $x . 'px}';\r
- }\r
-\r
- foreach ($this->cssY as $y => $index) {\r
- $res[] = '.y' . $index . '{top:' . $y . 'px}';\r
- }\r
-\r
- foreach ($this->cssRotation as $rotation => $index) {\r
- $rotation*= - 1;\r
-\r
-\r
- $to = 'transform-origin:left top;';\r
-\r
- $css = '.r' . $index . '{';\r
- $css.=self::writeCSSUA('transform', 'rotate(' . $rotation . 'deg)') . ';';\r
- $css.=self::writeCSSUA('transform-origin', 'left top') . ';';\r
- $css.='margin-top:' . round(cos(deg2rad($rotation)) * -1, 2) . 'em !important;';\r
- $css.='margin-left:' . round(sin(deg2rad($rotation)), 2) . 'em !important;';\r
- $css.='}';\r
- $res[] = $css;\r
- }\r
-\r
- foreach ($this->cssFont as $font => $index) {\r
- $res[] = "@font-face{font-family:F" . $index . ";src:url('F" . $index . ".woff') format('woff'),url('F" . $index . ".ttf') format('truetype'),url('F" . $index . ".svg#" . $font . "') format('svg')}";\r
- $res[] = '.f' . $index . '{font-family:F' . $index . ',Arial,Helvetica}';\r
- }\r
-\r
- $res = array_chunk($res, 3500);\r
- foreach ($res as $k => $css) {\r
- file_put_contents(sprintf($file, $k), implode("\n", $css));\r
- }\r
- return count($res);\r
- }\r
-\r
- protected function writeCSSUA($property, $value) {\r
- $res = array();\r
- foreach (self::$uaPrefixes as $prefix) {\r
- $res[] = $prefix . $property . ':' . $value;\r
- }\r
- return implode(';', $res);\r
- }\r
-\r
- protected function addLine($line, $document_id) {\r
- $res = array();\r
- foreach ($line->a as $group) {\r
- $res = array_merge($res, $this->addGroup($group, $document_id));\r
- }\r
- return array(\r
- 'y' => $this->normalizeFloatValue($line['y']),\r
- 'rotation' => $this->getCSSRotation($this->normalizeFloatValue($line['rotation'], 0)),\r
- "groups" => $res);\r
- }\r
-\r
- protected function addGroup($group, $document_id) {\r
- $alpha = intval(substr($group['color'], 1, 2), 16);\r
- if ($alpha == 0) {\r
- return false;\r
- }\r
-\r
- $first = true;\r
- $letterSpacing = 0;\r
- $letterCount = 0;\r
- $wordSpacing = 0;\r
- $wordCount = 0;\r
-\r
- $res = array();\r
- $spans = array();\r
-\r
- foreach ($group->s as $span) {\r
- if ($first && trim((string) $span) == '') {\r
- continue;\r
- }\r
- if ($first) {\r
- $pos = $x = $span['x'];\r
- $pos+=$span['width'];\r
- $first = false;\r
- } else {\r
- if ((float) $span['x'] < (float) $newSpan['x']) {\r
- // On change de groupe\r
- $ls = $ws = 0;\r
- if ($letterCount > 0) {\r
- $ls = $letterSpacing / $letterCount;\r
- }\r
- if ($wordCount > 0) {\r
- $ws = $wordSpacing / $wordCount;\r
- }\r
-\r
- $res[] = array(\r
- 'color' => $this->getCSSColor($group['color']),\r
- 'size' => $this->getCSSSize($group['size']),\r
- 'font' => $this->getCSSFont((string) $group['font'], $document_id),\r
- 'letterspacing' => $this->getCSSLetterSpacing($ls),\r
- 'wordspacing' => $this->getCSSLetterSpacing($ws),\r
- 'y' => 0,\r
- 'x' => $x,\r
- 'spans' => $spans);\r
-\r
- $spans = array();\r
- $pos = $x = $span['x'];\r
- $pos+=$span['width'];\r
- } else {\r
-\r
- $diff = $span['x'] - $pos;\r
- if ($diff > $group['size'] / 4) {\r
- $space = round($diff / $group['size'], 4);\r
- if ($space > 2) {\r
- // On change de groupe\r
- $ls = $ws = 0;\r
- if ($letterCount > 0) {\r
- $ls = $letterSpacing / $letterCount;\r
- }\r
- if ($wordCount > 0) {\r
- $ws = $wordSpacing / $wordCount;\r
- }\r
- $res[] = array(\r
- 'color' => $this->getCSSColor($group['color']),\r
- 'size' => $this->getCSSSize($group['size']),\r
- 'font' => $this->getCSSFont($group['font'], $document_id),\r
- 'letterspacing' => $this->getCSSLetterSpacing($ls),\r
- 'wordspacing' => $this->getCSSLetterSpacing($ws),\r
- 'y' => 0,\r
- 'x' => $x,\r
- 'spans' => $spans);\r
-\r
- $spans = array();\r
- $pos = $x = $span['x'];\r
- $pos+=$span['width'];\r
- } else {\r
-\r
- $newSpan = $this->addSpan('<span style="width:' . $space . 'em;"> </span>', true);\r
- array_push($spans, $newSpan);\r
- }\r
- }\r
- }\r
- }\r
-\r
-\r
- $newSpan = $this->addSpan($span);\r
- $pos = $span['x'] + $span['width'];\r
-\r
- array_push($spans, $newSpan);\r
- $copy = (string) $span;\r
- $len = mb_strlen($copy);\r
- str_replace(' ', '-', $copy, $w);\r
- $l = $len - $w;\r
-\r
- $letterCount+=$l;\r
- $wordCount+=$w;\r
-\r
- $letterSpacing+=$l * (float) $span['letterspacing'];\r
- $wordSpacing+=$w * (float) $span['wordspacing'];\r
- }\r
-\r
- if (count($spans)) {\r
- $ls = $ws = 0;\r
- if ($letterCount > 0) {\r
- $ls = $letterSpacing / $letterCount;\r
- }\r
- if ($wordCount > 0) {\r
- $ws = $wordSpacing / $wordCount;\r
- }\r
-\r
- $res[] = array(\r
- 'color' => $this->getCSSColor($group['color']),\r
- 'size' => $this->getCSSSize($group['size']),\r
- 'font' => $this->getCSSFont($group['font'], $document_id),\r
- 'letterspacing' => $this->getCSSLetterSpacing($ls),\r
- 'wordspacing' => $this->getCSSLetterSpacing($ws),\r
- 'y' => 0,\r
- 'x' => $x,\r
- 'spans' => $spans);\r
- }\r
-\r
- return $res;\r
- }\r
-\r
- protected function addSpan($span, $space=false) {\r
- $text = (string) $span;\r
- return array('text' => $text, 'space' => $space, 'x' => $span['x']);\r
- }\r
-\r
- protected function getCSSSize($size) {\r
- $size = $this->normalizeFloatValue($size);\r
- $size*=$this->multiply;\r
- return $this->getIndex($size, $this->cssSize);\r
- }\r
-\r
- protected function getCSSFont($font, $document_id) {\r
- $font = (string) $font;\r
- if (!isset($this->fontDocs[$font])) {\r
- $this->fontDocs[$font] = array();\r
- }\r
- $this->fontDocs[$font][$document_id] = true;\r
-\r
- return $this->getIndex($font, $this->cssFont);\r
- }\r
-\r
- protected function getCSSColor($color) {\r
- $color = trim($color, '#');\r
- if (strlen($color) > 6) {\r
- $color = substr($color, 2, 6);\r
- }\r
- if ($color == '000000') {\r
- return null;\r
- }\r
- return $this->getIndex($color, $this->cssColor);\r
- }\r
-\r
- protected function getCSSLetterSpacing($letterspacing) {\r
-\r
- $letterspacing = $this->normalizeFloatValue($letterspacing, 4);\r
-\r
- if ($letterspacing == 0) {\r
- return null;\r
- }\r
- return $this->getIndex($letterspacing, $this->cssLetterSpacing);\r
- }\r
-\r
- protected function getCSSWordSpacing($wordspacing) {\r
- $wordspacing = $this->normalizeFloatValue($wordspacing, 4);\r
-\r
- if ($wordspacing == 0) {\r
- return null;\r
- }\r
- return $this->getIndex($wordspacing, $this->cssWordSpacing);\r
- }\r
-\r
- protected function getCSSRotation($rotation) {\r
- $rotation = $this->normalizeFloatValue($rotation, 0);\r
- if ($rotation == 0) {\r
- return null;\r
- }\r
- return $this->getIndex($rotation, $this->cssRotation);\r
- }\r
-\r
- protected function getCSSX($x) {\r
- $x = round($x);\r
- if ($x == 0) {\r
- return null;\r
- }\r
- return $this->getIndex($x, $this->cssX);\r
- }\r
-\r
- protected function getCSSY($y) {\r
- $y = round($y);\r
- if ($y == 0) {\r
- return null;\r
- }\r
- return $this->getIndex($y, $this->cssY);\r
- }\r
-\r
- protected function getIndex($value, &$tab) {\r
- $value = (string) $value;\r
- if (isset($tab[$value])) {\r
- return $tab[$value];\r
- }\r
- $res = $this->base62(count($tab));\r
- $tab[$value] = $res;\r
- return $res;\r
- }\r
-\r
- protected function normalizeFloatValue($value, $round=3) {\r
- $value = str_replace(',', '.', $value);\r
- $value = (float) $value;\r
- $value = round($value, $round);\r
- return $value;\r
- }\r
-\r
- protected function base62($val) {\r
- $chars = '0123456789abcdefghijklmnopqrstuvwxyz';\r
- $base = strlen($chars);\r
- $str = '';\r
- do {\r
- $i = $val % $base;\r
- $str = $chars[$i] . $str;\r
- $val = ($val - $i) / $base;\r
- } while ($val > 0);\r
- return $str;\r
- }\r
-\r
- public function copyLinkFile($source, $dest, $video=false) {\r
- // TODO delete that return;\r
- //return;\r
- $origDir = WS_BOOKS . '/working/' . $this->book_id . '/';\r
- $types = array('mp4', 'ogv', 'webm', 'jpg');\r
- if ($video) {\r
- return;\r
- wsTools::encodeWebVideos($origDir . $source, null, false);\r
- $e = explode('.', $source);\r
- array_pop($e);\r
- $base = implode('.', $e);\r
- $source = array();\r
- foreach ($types as $type) {\r
- $source[] = $base . '.' . $type;\r
- }\r
- }\r
-\r
- if (!is_array($source)) {\r
- $source = array($source);\r
- }\r
-\r
- foreach ($source as $so) {\r
- $s = $origDir . $so;\r
- if (file_exists($s)) {\r
- $d = $this->vdir . '/' . $dest . '/' . $so;\r
- if (!file_exists(dirname($d))) {\r
- mkdir(dirname($d), 0777, true);\r
- }\r
- copy($s, $d);\r
- }\r
- }\r
- }\r
-\r
- public static function escapeHTML($in) {\r
- $in = htmlentities($in, ENT_NOQUOTES, "UTF-8");\r
- $in = str_replace(' ', '', $in);\r
-\r
- return $in;\r
- }\r
-\r
- public function __destruct() {\r
- \r
- }\r
-\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
- $alpha = substr($color, 0, 2);\r
- $red = substr($color, 2, 2);\r
- $green = substr($color, 4, 2);\r
- $blue = substr($color, 6, 2);\r
-\r
- $components = array('alpha', 'red', 'green', 'blue');\r
- foreach ($components as $k => $name) {\r
- $hex = substr($color, $k * 2, 2);\r
- $$name = intval($hex, 16);\r
- }\r
- $alpha/=255;\r
- if ($alpha == 0) {\r
- return 'transparent';\r
- } elseif ($alpha == 1) {\r
- return '#' . substr($color, 2, 6);\r
- }\r
- return 'rgba(' . $red . ',' . $green . ',' . $blue . ',' . $alpha . ')';\r
- }\r
- }\r
-\r
-}\r
-\r
-?>
\ No newline at end of file
$css[] = WEBROOT . '/style/common.css';\r
$css[] = CSS_PATH . '/style.css';\r
\r
+$meta['viewport'] = 'width=device-width, initial-scale=1, maximum-scale=1';\r
+\r
$standard = 'XHTML 1.0 Transitional';\r
\r
echo $core->url->getDocument();\r
FIRST_LOAD=true;\r
\r
function load_common_extranet(){\r
+ var viewportWidth=1030;\r
+ if($("#main.big").length>0){\r
+ $("#header").addClass('big');\r
+ viewportWidth=1250;\r
+ }\r
+ \r
+ var is=screen.width/viewportWidth;\r
+ $('meta[name="viewport"]').attr('content','width='+viewportWidth+'px,initial-scale='+is+',maximum-scale:2.0');\r
+ \r
if($(".dashboard").length>=1 && $("#dash").length>=1){\r
$("#dash").sortable('destroy');\r
if(FIRST_LOAD){\r
FIRST_LOAD=true;\r
$.ajax({\r
url : SITE_PATH+'ajax/reloadDashboards',\r
- success : function(data){MyAjax(data);}\r
+ success : function(data){\r
+ MyAjax(data);\r
+ }\r
});\r
}\r
\r
$.ajax({\r
url : SITE_PATH+'ajax/saveTimereport/'+a[1]+'/'+a[2]+'/'+val,\r
success : function(data){\r
- FIRST_LOAD=true;\r
- MyAjax(data);\r
- var td=$(f).parents('td').get(0);\r
- if(parseFloat($(f).val())>0){\r
- $(td).addClass('filled');\r
- }else{\r
- $(td).removeClass('filled');\r
- }\r
- }\r
+ FIRST_LOAD=true;\r
+ MyAjax(data);\r
+ var td=$(f).parents('td').get(0);\r
+ if(parseFloat($(f).val())>0){\r
+ $(td).addClass('filled');\r
+ }else{\r
+ $(td).removeClass('filled');\r
+ }\r
+ }\r
});\r
});\r
\r
var div=$(this).parents('.dashboard').get(0);\r
var liste=$(div).find('.liste');\r
\r
- $(liste).slideToggle('fast',function(){resize();});\r
+ $(liste).slideToggle('fast',function(){\r
+ resize();\r
+ });\r
$(this).toggleClass('close');\r
\r
$.ajax({\r
function refreshFiles(){\r
$.ajax({\r
url : SITE_PATH+'ajax/refreshFichiers',\r
- success : function(data){MyAjax(data);}\r
+ success : function(data){\r
+ MyAjax(data);\r
+ }\r
});\r
}\r
\r
+input[type="text"],input[type="password"],input[type="email"],input[type="search"],select,textarea{
+ font-family:Verdana;
+ font-size:12px;
+}
+
@font-face {
font-family: 'UniversCondensedBold';
src: url('univers-condensedbold-webfont.eot');
\r
td{height:30px;color:#333;}\r
\r
-input[type="text"],input[type="password"],select,textarea{\r
+input[type="text"],input[type="password"],input[type="email"],input[type="search"],select,textarea{\r
color:#666;\r
- font-family:Verdana;\r
- font-size:12px;\r
}\r
\r
.message{text-align:center;font-size:11px;color:#da4f24;background:#fff;}\r
\r
td{height:30px;}\r
\r
-input[type="text"],input[type="password"],select,textarea{\r
+input[type="text"],input[type="password"],input[type="email"],input[type="search"],select,textarea{\r
color:#797D62;\r
- font-family:Verdana;\r
- font-size:12px;\r
}\r
\r
.message{text-align:center;font-size:11px;color:#da4f24;background:#fff;}\r
\r
/* Menu Contextuel */\r
.contextMenu{border:1px solid #000;float:left;position:absolute;display:none;z-index:100000;}\r
-.contextMenu li{border-bottom:1px solid #ccc;padding:12px;padding-left:20px;padding-right:20px;list-style-type:none;background:#fff;height:12px;}\r
-.contextMenu li:hover{background:#ccc;}\r
-.contextMenu li a:hover{text-decoration:none;}\r
+.contextMenu li a{\r
+ border-bottom:1px solid #ccc;\r
+ padding:12px;\r
+ padding-left:20px;\r
+ padding-right:20px;\r
+ background:#fff;\r
+ min-height:12px;\r
+ text-decoration:none;\r
+ display:inline-block;\r
+}\r
+.contextMenu li a:hover{background:#ccc;}\r
.contextMenu li img{margin:5px;margin-right:7px;vertical-align:middle;float:none;}\r
.contextMenu li.head{background:#666b74;font-weight:bold;color:#fff;text-align:center;border-bottom:1px solid #000;}\r
\r
}\r
\r
.ac_results iframe{\r
-display:none;\r
+ display:none;\r
}\r
\r
/* Traduction */\r
}\r
\r
.graphStats .legende{\r
- margin-top:10px;\r
+ margin-top:10px;\r
margin-bottom:10px;\r
}\r
\r
.graphStats .legende td{\r
- margin-top:10px;\r
+ margin-top:10px;\r
margin-bottom:10px;\r
}\r
\r