--- /dev/null
+<!doctype html>\r
+<html>\r
+<head>\r
+ <meta name="viewport" content="width=device-width">\r
+ <script>\r
+ var redirect;\r
+ var locationWithoutHash = window.location.href.split('#')[0];\r
+ var hash = window.location.hash;\r
+ if (window.matchMedia('(min-width: $breakpoint)').matches) {\r
+ redirect = 'd';\r
+ } else {\r
+ redirect = 'mf';\r
+ }\r
+ window.location = './' + redirect + '/index.html?hybrid=1&from=' + encodeURIComponent(locationWithoutHash) + hash;\r
+ </script>\r
+</head>\r
+<body style="background-color: #$bgcolor;">\r
+</body>\r
+</html>
\ No newline at end of file
return;
}
$dest = $this->vdir . 'm';
- $this->_compileHTML5($this->book_id, $this->book, $dest);
-
- try {
- $mfid = $this->book->parametres->mobilefirstFluidbookId;
- if ($mfid != '' && (int)$mfid > 0) {
- $mfbook = $this->daoBook->selectById($mfid);
- $dest .= '/mf';
- $this->_compileHTML5($mfid, $mfbook, $dest);
+
+ $mfid = $this->book->parametres->mobilefirstFluidbookId;
+ if ($mfid != '' && (int)$mfid > 0) {
+ $mfbook = $this->daoBook->selectById($mfid);
+ $this->_compileHTML5($this->book_id, $this->book, $dest . '/d');
+ $this->_compileHTML5($mfid, $mfbook, $dest . '/mf');
+
+ $hybrid = file_get_contents(WS_COMPILE_ASSETS . '/hybrid/index.html');
+ $replace = [
+ 'breakpoint' => ((int)$this->book->parametres->mobilefirstBreakpoint - 1) . 'px',
+ 'bgcolor' => $this->theme->parametres->loadingBackColor
+ ];
+ foreach ($replace as $var => $value) {
+ $hybrid = str_replace('$' . $var, $value, $hybrid);
}
- } catch (Exception $e) {
- die($e->getMessage());
+ file_put_contents($dest . '/index.html', $hybrid);
+ } else {
+ $this->_compileHTML5($this->book_id, $this->book, $dest);
}
fb(time(), 'end prepare html5');