From 01ea9b089f8923d8db81e1f7d50fcb6bf4f6cf8d Mon Sep 17 00:00:00 2001 From: "vincent@cubedesigners.com" Date: Mon, 29 Jul 2013 12:40:04 +0000 Subject: [PATCH] --- inc/ws/Controlleur/class.ws.services.php | 4 +-- inc/ws/Util/html5/class.ws.html5.compiler.php | 28 +++++++++++++------ 2 files changed, 21 insertions(+), 11 deletions(-) diff --git a/inc/ws/Controlleur/class.ws.services.php b/inc/ws/Controlleur/class.ws.services.php index 6642cdb28..1f68c41f3 100644 --- a/inc/ws/Controlleur/class.ws.services.php +++ b/inc/ws/Controlleur/class.ws.services.php @@ -693,14 +693,14 @@ class wsServices extends cubeFlashGateway { protected function _getRegExpManifest($r, $book, $theme) { $reg = array(); - $reg['loading'] = array('^' . $r . 'style/(.*).css$', '^' . $r . 'index.html$', '^' . $r . 'data/style/(.*)$', '^' . $r . 'data/(.*).js$', '^' . $r . 'data/images/' . $theme->parametres->logoLoader . '$'); + $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$'); $reg['extras'] = array('^' . $r . 'data/links/(.*)$', '^' . $r . 'data/(.*).pdf$', '^' . $r . 'cover.jpg$'); $reg['thumbnails'] = array('^' . $r . 'data/thumbnails/p(\d+).jpg$'); for ($i = 1; $i <= $book->parametres->pages; $i++) { $var = 'content_' . $i; $reg[$var] = array('^' . $r . 'data/background/150/t' . $i . '.jpg$', '^' . $r . 'data/contents/p' . $i . '.svg$'); } - $reg['urgents'] = array('^' . $r . 'images/(.*)$', '^' . $r . 'data/images/(.*)$', '^' . $r . 'style/fonts/(.*).ttf$'); + $reg['urgents'] = array('^' . $r . 'images/(.*)$', '^' . $r . 'data/images/(.*)$'); return $reg; } diff --git a/inc/ws/Util/html5/class.ws.html5.compiler.php b/inc/ws/Util/html5/class.ws.html5.compiler.php index 1b04a8df4..cea8b7449 100644 --- a/inc/ws/Util/html5/class.ws.html5.compiler.php +++ b/inc/ws/Util/html5/class.ws.html5.compiler.php @@ -143,6 +143,7 @@ class wsHTML5Compiler { 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; @@ -160,6 +161,7 @@ class wsHTML5Compiler { $this->phonegap = $phonegap; $this->standalone = $standalone || $this->phonegap; $this->appcache = $appcache; + $this->widget = !$this->phonegap; cubePHP::set_memory('4G'); @@ -300,6 +302,9 @@ class wsHTML5Compiler { $this->writeTexts(); $this->writeExtras(); $this->writeJs(); + if (!$this->widget) { + unlink($this->vdir . '/style/widget.css'); + } $this->writeCache(); } @@ -565,15 +570,17 @@ class wsHTML5Compiler { file_put_contents($this->vdir . '/indext.html', $uhtml); // Write widget html - $whtml = file_get_contents($this->assets . '/widget.html'); - $script = ''; - - $style = ''; - $vars = array('titre', 'style', 'script'); - foreach ($vars as $v) { - $whtml = str_replace('', $$v, $whtml); + if ($this->widget) { + $whtml = file_get_contents($this->assets . '/widget.html'); + $script = ''; + + $style = ''; + $vars = array('titre', 'style', 'script'); + foreach ($vars as $v) { + $whtml = str_replace('', $$v, $whtml); + } + file_put_contents($this->vdir . '/widget.html', $whtml); } - file_put_contents($this->vdir . '/widget.html', $whtml); } protected function writePrint() { @@ -732,7 +739,10 @@ class wsHTML5Compiler { 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) { -- 2.39.5