class normalLink extends wsPackagerHTML5Link {
public function getHTMLContent() {
- return '<a href="' . $this->getURL() . '" target="' . $this->getTarget() . '"></a>';
+ $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() {
class internalLink extends normalLink {
public function getURL() {
- return '#/pages/' . $this->getPage();
+ return '#/page/' . $this->getPage();
}
public function getPage() {
- return $this->to;
+ if ($this->numerotation == 'physical') {
+ return $this->to;
+ } else {
+ return $this->to;
+ }
}
}
public function getHTMLContent() {
$res = '<video width="' . $this->width . '" height="' . $this->height . '"';
if ($this->video_auto_start) {
- $res.=' autoplay';
+ $res.=' autoplay="autoplay"';
}
if ($this->video_controls) {
- $res.=' controls';
+ $res.=' controls="controls"';
+ }
+ if ($this->video_loop) {
+ $res.=' loop="loop"';
+ }
+ if (!$this->video_sound_on) {
+ $res.=' audio="muted"';
}
$res.='>';
$i++;\r
}\r
\r
- foreach ($pages as $n => $c) {\r
- file_put_contents($this->vdir . '/data/links/pages/p' . $n . '.html', $c);\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
protected function writeConfig() {\r
$config = cubeObject::merge($this->book->parametres->toStandardObject(), $this->theme->parametres->toStandardObject());\r
$config->id = $this->book->book_id;\r
+ $config->cacheDate = TIME;\r
return 'DATAS=' . json_encode($config) . ';';\r
}\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
// Pages styles\r
foreach ($this->cssColor as $color => $index) {\r
\r
}\r
\r
- public static function colorToCSS($color) {\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