protected static $resolutions = array(36, 72, 150);
protected static $uaPrefixes = array('-moz-', '-webkit-', '-o-', '-ms-', '');
- protected static $jsFiles = array('js/libs/modernizr.js',
+ protected static $jsFiles = array(
+ 'js/libs/cube/fb.js',
+ 'js/libs/modernizr.js',
'js/libs/jquery/jquery.js',
'js/libs/jquery/jquery.transform.js',
'js/libs/jquery/jquery.mousewheel.js',
protected $daoBook;
protected $needToRecompileContents = true;
protected $needToRecompileSettings = true;
+ protected $width;
+ protected $height;
function __construct($book_id) {
global $core;
$this->scale = 4;
$this->multiply = $this->pdf2htmlRatio * $this->scale;
$this->numerotation = explode(',', $this->book->numerotation);
+
+ $daoDoc = new wsDAODocument($core->con);
+ $firstDoc = $daoDoc->selectById($this->pages[1]['document_id']);
+ $size = $firstDoc->generalInfos['size'];
+
+ $this->width = round($size[0],2);
+ $this->height = round($size[1],2);
}
public function virtualToPhysical($virtual) {
}
$config = $this->writeConfig();
- $js=$config.file_get_contents($minimized);
- file_put_contents($this->vdir.'/data/datas.js',$config);
+ $js = $config . file_get_contents($minimized);
+ file_put_contents($this->vdir . '/data/datas.js', $config);
file_put_contents($this->vdir . '/data/fluidbook.js', $js);
}
$config->numerotation = explode(',', $this->book->numerotation);
$config->id = $this->book->book_id;
$config->cacheDate = TIME;
+ $config->width=$this->width;
+ $config->height=$this->height;
return 'var DATAS=' . json_encode($config) . ';' . "\n";
}
$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';
+ $h = $this->height . 'px';
+ $w2 = ($this->width * 2) . 'px';
+ $w = $this->width . 'px';
+ $wm = ($this->width * $this->multiply) . 'px';
+ $hm = ($this->height * $this->multiply) . 'px';
- $navTop = ($this->book->parametres->height - 40 - 100) / 2;
+ $navTop = ($this->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;
+ $wr = $this->width / $ratio;
+ $hr = $this->height / $ratio;
$br = '.background.r' . $r . '{';
if ($ratio != 1) {
// 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).';}';
// Menus
# View
$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;
+ $ratio = $this->width / $this->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) . '}';