'js/libs/fluidbook/fluidbook.stats.js',
'js/libs/fluidbook/fluidbook.cache.js',
'js/libs/fluidbook/fluidbook.bookmarks.js',
+ 'js/libs/fluidbook/fluidbook.background.js',
'js/libs/fluidbook/views/fluidbook.chapters.js',
'js/libs/fluidbook/views/fluidbook.index.js',
'js/libs/fluidbook/fluidbook.js',
$res[] = $search;
// Background
- $body = '#main,.mview.index{';
- $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;';
- $body.='background-size:cover;';
- break;
- case wsTheme::STRETCH:
- $body.='background-repeat:no-repeat;';
- $body.='background-size:100% 100%;';
- break;
- }
- if ($this->theme->parametres->backgroundImage != '') {
- $this->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.=';';
- }
+ $res[] = $this->_cssBackground();
- $body.='}';
- $res[] = $body;
// Header
$header = 'header{';
return count($res);
}
+protected function _cssBackground() {
+ $body = '#background{';
+ $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;';
+ $body.='background-size:cover;';
+ break;
+ case wsTheme::STRETCH:
+ $body.='background-repeat:no-repeat;';
+ $body.='background-size:100% 100%;';
+ break;
+ }
+ if ($this->theme->parametres->backgroundImage != '') {
+ $bi = $this->themeRoot . '/' . $this->theme->parametres->backgroundImage;
+ if (file_exists($bi)) {
+ $dbi = getimagesize($bi);
+ $this->config->backgroundImageDimensions = array('width' => $dbi[0], 'height' => $dbi[1]);
+ }
+
+ $this->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.='}';
+
+ return $body;
+ }
+
protected function writeCSSUA($property, $value) {
$res = array();
foreach (self::$uaPrefixes as $prefix) {
}
class wsHTML5CompilerDev extends wsHTML5Compiler {
+
}
return array('dir' => $dir, 'fdir' => $fdir);
}
- public function getCSSContainer() {
-
+ public function getCssScale() {
+ if (is_int($this->page)) {
+ return $this->compiler->getCssScale();
+ } else {
+ return 1;
+ }
+ }
+ public function getCSSContainer() {
if (!($this instanceof contentLink) && $this->page % 2 == 1) {
$this->page--;
$this->left+=$this->compiler->width;
}
$css = '#l_' . $this->id . '{';
- $css.='left:' . $this->left * $this->compiler->getCssScale() . 'px;top:' . $this->top * $this->compiler->getCssScale() . 'px;';
- $css.='width:' . $this->width * $this->compiler->getCssScale() . 'px;height:' . $this->height * $this->compiler->getCssScale() . 'px;';
+ $css.='left:' . $this->left * $this->getCssScale() . 'px;top:' . $this->top * $this->getCssScale() . 'px;';
+ $css.='width:' . $this->width * $this->getCssScale() . 'px;height:' . $this->height * $this->getCssScale() . 'px;';
$css.=$this->getCSS();
$css.='}';
return $css;
public function getHTMLContent() {
$this->copyExternalFile($this->to, true);
- $w = round($this->width * $this->compiler->getCssScale());
- $h = round($this->height * $this->compiler->getCssScale());
+ $w = round($this->width * $this->getCssScale());
+ $h = round($this->height * $this->getCssScale());
return self::makeVideoTag($this, $w, $h, $this->compiler);
}
}
public function getEmbed() {
- return '<iframe width="' . $this->width * $this->compiler->getCssScale() . '" height="' . $this->height * $this->compiler->getCssScale() . '" src="' . $this->getEmbedURL() . '" frameborder="0" allowfullscreen></iframe>';
+ return '<iframe width="' . $this->width * $this->getCssScale() . '" height="' . $this->height * $this->getCssScale() . '" src="' . $this->getEmbedURL() . '" frameborder="0" allowfullscreen></iframe>';
}
public function getEmbedURL() {
public function getHTMLContent() {
//$this->copyExternalFile($this->to);
- $w = $this->width * $this->compiler->getCssScale();
- $h = $this->height * $this->compiler->getCssScale();
+ $w = $this->width * $this->getCssScale();
+ $h = $this->height * $this->getCssScale();
if ($this->alternative != '') {
$this->copyExternalFile($this->alternative);
}
public function getHTMLContent() {
$d = $this->unzipFile($this->to);
- $w = $this->width * $this->compiler->getCssScale();
- $h = $this->height * $this->compiler->getCssScale();
+ $w = $this->width * $this->getCssScale();
+ $h = $this->height * $this->getCssScale();
$dr = opendir($d['dir']);
while ($file = readdir($dr)) {