\r
protected function _getRegExpManifest($r, $book, $theme) {\r
$reg = array();\r
- $reg['loading'] = array('^' . $r . 'style/(.*).css$', '^' . $r . 'index.html$', '^' . $r . 'data/style/(.*)$', '^' . $r . 'data/(.*).js$', '^' . $r . 'data/images/' . $theme->parametres->logoLoader . '$');\r
+ $reg['loading'] = array('^' . $r . 'style/(.*).css$', '^' . $r . 'index.html$', '^' . $r . 'data/style/(.*)$', '^' . $r . 'data/(.*).js$', '^' . $r . 'data/images/' . $theme->parametres->logoLoader . '$', '^' . $r . 'style/fonts/(.*).ttf$');\r
$reg['extras'] = array('^' . $r . 'data/links/(.*)$', '^' . $r . 'data/(.*).pdf$', '^' . $r . 'cover.jpg$');\r
$reg['thumbnails'] = array('^' . $r . 'data/thumbnails/p(\d+).jpg$');\r
for ($i = 1; $i <= $book->parametres->pages; $i++) {\r
$var = 'content_' . $i;\r
$reg[$var] = array('^' . $r . 'data/background/150/t' . $i . '.jpg$', '^' . $r . 'data/contents/p' . $i . '.svg$');\r
}\r
- $reg['urgents'] = array('^' . $r . 'images/(.*)$', '^' . $r . 'data/images/(.*)$', '^' . $r . 'style/fonts/(.*).ttf$');\r
+ $reg['urgents'] = array('^' . $r . 'images/(.*)$', '^' . $r . 'data/images/(.*)$');\r
return $reg;\r
}\r
\r
protected $hiddenContents = array();
protected $appcache;
protected $home;
+ protected $widget = true;
function __construct($book_id, $version = 'stable', $phonegap = false, $phonegapVersion = 'latest', $dir = null, $standalone = false, $appcache = false, $home = false) {
global $core;
$this->phonegap = $phonegap;
$this->standalone = $standalone || $this->phonegap;
$this->appcache = $appcache;
+ $this->widget = !$this->phonegap;
cubePHP::set_memory('4G');
$this->writeTexts();
$this->writeExtras();
$this->writeJs();
+ if (!$this->widget) {
+ unlink($this->vdir . '/style/widget.css');
+ }
$this->writeCache();
}
file_put_contents($this->vdir . '/indext.html', $uhtml);
// Write widget html
- $whtml = file_get_contents($this->assets . '/widget.html');
- $script = '<script type="text/javascript" charset="utf-8" src="data/widget.js"></script>';
-
- $style = '<link type="text/css" rel="stylesheet" href="style/widget.css">';
- $vars = array('titre', 'style', 'script');
- foreach ($vars as $v) {
- $whtml = str_replace('<!-- $' . $v . ' -->', $$v, $whtml);
+ if ($this->widget) {
+ $whtml = file_get_contents($this->assets . '/widget.html');
+ $script = '<script type="text/javascript" charset="utf-8" src="data/widget.js"></script>';
+
+ $style = '<link type="text/css" rel="stylesheet" href="style/widget.css">';
+ $vars = array('titre', 'style', 'script');
+ foreach ($vars as $v) {
+ $whtml = str_replace('<!-- $' . $v . ' -->', $$v, $whtml);
+ }
+ file_put_contents($this->vdir . '/widget.html', $whtml);
}
- file_put_contents($this->vdir . '/widget.html', $whtml);
}
protected function writePrint() {
protected function writeJs() {
file_put_contents($this->vdir . '/data/datas.js', $this->writeConfig());
- $finals = array('fluidbook' => $this->jsFiles, 'widget' => $this->widgetJsFiles);
+ $finals = array('fluidbook' => $this->jsFiles);
+ if ($this->widget) {
+ $finals['widget'] = $this->widgetJsFiles;
+ }
foreach ($finals as $jsfinal => $files) {