'js/libs/jquery/jquery.scrollto.js',
'js/libs/jquery/jquery.localscroll.js',
'js/libs/jquery/perfect-scrollbar.jquery.js',
+ 'js/libs/mmenu/jquery.mmenu.js',
+ 'js/libs/mmenu/jquery.mmenu.rtl.js',
+ 'js/libs/mmenu/jquery.mmenu.offcanvas.js',
'js/libs/gsap/TweenMax.js',
'js/libs/gsap/jquery.gsap.js',
'js/libs/gal/gal.js',
'js/libs/gal/gal.filesystem.js',
- 'js/libs/interact.js',
'js/libs/hammer.js',
'js/libs/fluidbook/forms/fluidbook.form.bulle.js',
'js/libs/fluidbook/fluidbook.utils.js',
'js/libs/fluidbook/fluidbook.slider.js',
'js/libs/fluidbook/fluidbook.nav.js',
'js/libs/fluidbook/fluidbook.touch.js',
- 'js/libs/fluidbook/fluidbook.interact.js',
'js/libs/fluidbook/fluidbook.loader.js',
'js/libs/fluidbook/fluidbook.search.js',
'js/libs/fluidbook/fluidbook.help.js',
$message = sprintf($this->__('Your browser is not up to date and is not able to run this publication. %sLearn more%s'), '<br /><a href="http://www.whatbrowser.org/intl/' . $this->config->defaultLang . '/" target="_blank">', '</a>');
$splash = '';
- if ($this->theme->parametres->logoLoader) {
- $dim = getimagesize($this->themeRoot . '/' . $this->theme->parametres->logoLoader);
+ if ($this->theme->parametres->logoLoader && file_exists($this->themeRoot . $this->theme->parametres->logoLoader)) {
+ $dim = getimagesize($this->themeRoot . $this->theme->parametres->logoLoader);
if ($dim !== false) {
- $this->copy($this->themeRoot . '/' . $this->theme->parametres->logoLoader, $this->vdir . '/data/images/' . $this->theme->parametres->logoLoader);
+ $this->copy($this->themeRoot . $this->theme->parametres->logoLoader, $this->vdir . '/data/images/' . $this->theme->parametres->logoLoader);
$splash .= '<div class="logo"><img src="data/images/' . $this->theme->parametres->logoLoader . '" width="' . $dim[0] . '" height="' . $dim[1] . '" alt="" /></div>';
}
}
$this->addFilesInfos('archives', $this->wdir . '/' . $this->book->parametres->externalArchives);
$this->copy($this->wdir . '/' . $this->book->parametres->externalArchives, $this->vdir . '/data/images/' . $this->book->parametres->externalArchives);
}
+
+ if ($this->book->parametres->navExtraImage != '') {
+ $this->copy($this->wdir . '/' . $this->book->parametres->navExtraImage, $this->vdir . '/data/images/' . $this->book->parametres->navExtraImage);
+ }
+
+ if ($this->book->parametres->navExtraImageMobile != '') {
+ $this->copy($this->wdir . '/' . $this->book->parametres->navExtraImageMobile, $this->vdir . '/data/images/' . $this->book->parametres->navExtraImageMobile);
+ }
+
}
protected function writeLinks() {
}
if (!$reminimize) {
- if (filemtime(__FILE__) > $mintime || filemtime(__DIR__ . '/class.ws.html5.links.php') > $mintime) {
+ if (filemtime(__FILE__) > $mintime || (file_exists(__DIR__ . '/class.ws.html5.links.php') && filemtime(__DIR__ . '/class.ws.html5.links.php') > $mintime)) {
$reminimize = true;
}
}
$res[] = 'svg .fill-c-menu-text{fill:' . wsHTML5::colorToCSS($this->theme->parametres->subTextColor) . ';}';
// Search field
- $searchColor = wsHTML5::colorToCSS($this->theme->parametres->couleurS);
- $searchBackColor = wsHTML5::colorToCSS($this->theme->parametres->searchFieldColor);
- $search = '#q{';
- $search .= 'color:' . $searchColor . ';';
- $search .= 'background-color:' . $searchBackColor . ';';
- if ($this->theme->parametres->searchShadeAlpha > 0) {
- $search .= wsHTML5::writeCSSUA('box-shadow', '1px 1px 4px rgba(0,0,0,' . ($this->theme->parametres->searchShadeAlpha / 100) . ')') . ' inset;';
- }
- $search .= '}';
- $search .= '#searchHints,.hint{color:' . $searchColor . ';background-color:' . $searchBackColor . ';}';
- $search .= '.hint:hover{color:' . $searchBackColor . ';background-color:' . $searchColor . ';}';
-
- $res[] = $search;
+// $searchColor = wsHTML5::colorToCSS($this->theme->parametres->couleurS);
+// $searchBackColor = wsHTML5::colorToCSS($this->theme->parametres->searchFieldColor);
+// $search = '#q{';
+// $search .= 'color:' . $searchColor . ';';
+// $search .= 'background-color:' . $searchBackColor . ';';
+// if ($this->theme->parametres->searchShadeAlpha > 0) {
+// $search .= wsHTML5::writeCSSUA('box-shadow', '1px 1px 4px rgba(0,0,0,' . ($this->theme->parametres->searchShadeAlpha / 100) . ')') . ' inset;';
+// }
+// $search .= '}';
+// $search .= '#searchHints,.hint{color:' . $searchColor . ';background-color:' . $searchBackColor . ';}';
+// $search .= '.hint:hover{color:' . $searchBackColor . ';background-color:' . $searchColor . ';}';
+//
+// $res[] = $search;
// Background
$res[] = $this->_cssBackground();
$lessVariables['menu-text'] = $menuTextColor;
$lessVariables['menu-field-background'] = wsHTML5::colorToCSS($this->theme->parametres->subFieldColor);
$lessVariables['menu-field-text'] = wsHTML5::colorToCSS($this->theme->parametres->subTextFieldColor);
+ $lessVariables['icon-color'] = wsHTML5::colorToCSS($this->theme->parametres->couleurI);
$menuMultiply = $menuColor->multiply($menuColor);
$bookVariables = array();
foreach ($variables as $k => $v) {
- $bookVariables[] = '@' . $k . ':' . $v . ';';
+ $bookVariables[] = '@' . trim($k) . ':' . $v . ';';
}
file_put_contents($tmp . '/book-variables.less', implode("\n", $bookVariables));
}
$css = '#l_' . $this->id . '{';
- $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 .= 'left:' . round($this->left * $this->getCssScale()) . 'px;top:' . round($this->top * $this->getCssScale()) . 'px;';
+ $css .= 'width:' . round($this->width * $this->getCssScale()) . 'px;height:' . round($this->height * $this->getCssScale()) . 'px;';
$origin = false;
if ($this->rot) {
$css .= wsHTML5::writeCSSUA('transform', 'rotate(' . $this->rot . 'deg)');
// Data attributes
$attributes = [
'maxzoom' => $this->to,
+ 'width' => round($this->width),
+ 'height' => round($this->height)
];
// Set data attributes
}
public function generateImage() {
- $left = CubeIT_Files::tempnam();
+
+ $maxzoom = ((int)$this->to !== 0) ? $this->to : 2; // Max zoom level might not always be set in the link editor
+
+ // TODO: Consider generating higher-res images (eg. 2x) for HiDPI screens. Maybe some extra optimisations can be done on the larger images...
+
+ $extractOptions = [
+ // The Poppler::extractArea function accepts a resolution setting and uses that to determine the
+ // scale factor on the extracted images. It does so by dividing by 72, so we can pass our own scale
+ // factor by setting the resolution to 72 * $maxzoom
+ 'resolution' => 72 * $maxzoom
+ ];
+
+ // Round all link co-ordinates because there seems to be a problem with the the Workshop link editor
+ // where link "left" values (and maybe others) change fractionally upon saves. This causes problems later when
+ // extracting the zoom images from the PDF because it causes a cache-miss and the images are regenerated again.
+ $x = round($this->left);
+ $y = round($this->top);
+ $w = round($this->width);
+ $h = round($this->height);
+ $bookwidth = round($this->compiler->book->parametres->width);
+
+ //error_log("--- Book Width: $bookwidth ---");
$p = wsDAOBook::getDocumentPage($this->compiler->book_id, $this->page);
$pdfpath = wsDocument::getDir($p['document_id']) . 'original.pdf';
+
+ $left = CubeIT_Files::tempnam();
$leftfile = CubeIT_CommandLine_Poppler::extractArea($pdfpath,
$p['document_page'],
- array('x' => $this->left, 'y' => $this->top, 'width' => $this->width, 'height' => $this->height),
- $left, array(), WS_CACHE . '/zoomarea/' . $this->compiler->book_id . '/');
-
- $bookwidth = $this->compiler->book->parametres->width;
+ array('x' => $x, 'y' => $y, 'width' => $w, 'height' => $h),
+ $left, $extractOptions, WS_CACHE . '/zoomarea/' . $this->compiler->book_id . '/');
- if (($this->left + $this->width) > $bookwidth) {
+ if (($x + $w) > $bookwidth) {
$p = wsDAOBook::getDocumentPage($this->compiler->book_id, $this->page + 1);
$pdfpath = wsDocument::getDir($p['document_id']) . 'original.pdf';
- $diff = ($this->width + $this->left) - $bookwidth;
+ $diff = ($w + $x) - $bookwidth;
$right = CubeIT_Files::tempnam();
$rightfile = CubeIT_CommandLine_Poppler::extractArea($pdfpath,
$p['document_page'],
- array('x' => 0, 'y' => $this->top, 'width' => $diff, 'height' => $this->height),
- $right, array(), WS_CACHE . '/zoomarea/' . $this->compiler->book_id . '/');
+ array('x' => 0, 'y' => $y, 'width' => $diff, 'height' => $h),
+ $right, $extractOptions, WS_CACHE . '/zoomarea/' . $this->compiler->book_id . '/');
$both = CubeIT_Files::tempnam() . '.jpg';
CubeIT_CommandLine_Imagemagick::append(array($leftfile, $rightfile), $both, 'horizontal');