]> _ Git - cubeextranet.git/commitdiff
(no commit message)
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Mon, 29 Jul 2013 12:40:04 +0000 (12:40 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Mon, 29 Jul 2013 12:40:04 +0000 (12:40 +0000)
inc/ws/Controlleur/class.ws.services.php
inc/ws/Util/html5/class.ws.html5.compiler.php

index 6642cdb284f85835ecce328db4b71ac72ba3079e..1f68c41f3f96c431230bc1198a70010416243076 100644 (file)
@@ -693,14 +693,14 @@ class wsServices extends cubeFlashGateway {
 \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
index 1b04a8df4238b0eadb430eca76a5d1545313971f..cea8b7449873452d2e8c91347f5046006d36fa75 100644 (file)
@@ -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 = '<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() {
@@ -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) {