]> _ Git - cubeextranet.git/commitdiff
(no commit message)
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Tue, 6 Nov 2012 14:58:46 +0000 (14:58 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Tue, 6 Nov 2012 14:58:46 +0000 (14:58 +0000)
images/extranet/devis.png
images/extranet/devis2page1.png
images/extranet/devis2page2.png
images/extranet/facture-brouillon.png
images/extranet/facture.png
inc/ws/Util/html5/class.ws.html5.compiler.php
inc/ws/Util/packager/class.ws.packager.phonegap.php

index f4cc9152b3f52546c972921d126d77488db6e00e..46b093c1ed797c20eb47bf0fb0c42bf4f93ab073 100644 (file)
Binary files a/images/extranet/devis.png and b/images/extranet/devis.png differ
index 8097cb28dd9a6f6bc350749f6f2a67c81dc52ab5..59a49f409784d74d231ece4edc0e8e228ee9397b 100644 (file)
Binary files a/images/extranet/devis2page1.png and b/images/extranet/devis2page1.png differ
index 1a744681e2a2d9a404d0f9b6f61c6eeb6f2f0a91..c34ab000df790c321f844a5623eb24dd705440dd 100644 (file)
Binary files a/images/extranet/devis2page2.png and b/images/extranet/devis2page2.png differ
index aa3d8b5c2c6099cf5cfaecdf63e6cd5401759bcc..c4ed1faed29af4e56e631cdc0427b2c017004055 100644 (file)
Binary files a/images/extranet/facture-brouillon.png and b/images/extranet/facture-brouillon.png differ
index 4a255f08cb7ae3c95f583c710779f47275fb6bc4..a94e7f2e3c721db412965322efa95c1c8c64863e 100644 (file)
Binary files a/images/extranet/facture.png and b/images/extranet/facture.png differ
index 6ffd20ff16139e89489e768f758372e2230d6833..532a226a745e8b72fae343b36fd9888b17a744ae 100644 (file)
@@ -209,7 +209,10 @@ class wsHTML5Compiler {
        }
 
        public function compile() {
-               $dirsToCreate = array('data/images', 'data/contents', 'data/background', 'data/thumbnails', 'data/style', 'swf');
+               $dirsToCreate = array('data/images', 'data/contents', 'data/background', 'data/thumbnails', 'data/style');
+               if (in_array('flv', $this->getVideosFormats())) {
+                       $dirsToCreate[] = 'swf';
+               }
 
                foreach ($dirsToCreate as $dir) {
                        $d = $this->vdir . '/' . $dir;
@@ -228,7 +231,9 @@ class wsHTML5Compiler {
                `cp -r $from $to`;
 
                // Copy swf
-               copy($this->assets . '/swf/video.swf', $this->vdir . '/swf/video.swf');
+               if (file_exists($this->vdir . '/swf')) {
+                       copy($this->assets . '/swf/video.swf', $this->vdir . '/swf/video.swf');
+               }
 
                $this->loadPlugins();
                $this->writeImages();
@@ -280,9 +285,25 @@ class wsHTML5Compiler {
                array_push($this->jsFiles, $main);
        }
 
+       protected function getVideosFormats($poster = true) {
+               if ($this->phoenag == 'ios') {
+                       $res = array('mp4');
+               } else if ($this->phonegap == 'android') {
+                       $res = array('ogv', 'webm');
+               }
+               if (!$this->phonegap) {
+                       $res[] = 'flv';
+               }
+               if ($poster) {
+                       $res[] = 'jpg';
+               }
+       }
+
        protected function writeCache() {
-               $videosExtensions = array('flv', 'ogv', 'webm', 'mp4');
-               $videos = array('flv' => array(), 'ogv' => array(), 'webm' => array(), 'mp4' => array());
+               $videosExtensions = $this->getVideosFormats(false);
+               foreach ($videosExtensions as $e) {
+                       $videos[$e] = array();
+               }
 
                $cacheFile = $this->vdir . '/cache.appcache';
 
@@ -770,7 +791,7 @@ class wsHTML5Compiler {
                $res[] = $shade;
 
                // Background
-               $body = '#main,#view.index{';
+               $body = '#main,.mview.index{';
                $body.='background-color:#' . $this->theme->parametres->backgroundColor . ';';
                switch ($this->theme->parametres->repeat) {
                        case wsTheme::REPEAT:
@@ -868,9 +889,9 @@ class wsHTML5Compiler {
 
                // Menus
                # View
-               $res[] = '.portrait #view{width:' . $w . ';min-height:' . $h . '}';
-               $res[] = '.landscape #view{width:' . $w2 . ';min-height:' . $h . '}';
-               $res[] = '#view{background-color:' . self::colorToCSS($this->theme->parametres->couleurB, 1) . ';color:' . self::colorToCSS($this->theme->parametres->subTextColor) . ';}';
+               $res[] = '.portrait .mview{width:' . $w . ';min-height:' . $h . '}';
+               $res[] = '.landscape .mview{width:' . $w2 . ';min-height:' . $h . '}';
+               $res[] = '.mview{background-color:' . self::colorToCSS($this->theme->parametres->couleurB, 1) . ';color:' . self::colorToCSS($this->theme->parametres->subTextColor) . ';}';
                # Index
                $ratio = $this->width / $this->height;
                $thumbh = round(100 / $ratio);
@@ -908,7 +929,7 @@ class wsHTML5Compiler {
 
        public function copyLinkFile($source, $dest, $video = false) {
                $origDir = WS_BOOKS . '/working/' . $this->book_id . '/';
-               $types = array('flv', 'mp4', 'ogv', 'webm', 'jpg');
+               $types = $this->getVideosFormats();
                if ($video) {
                        wsTools::encodeWebVideos($origDir . $source, null, true);
                        $e = explode('.', $source);
index 0fc3e02802b71e101692cf53dd0510332cde6fe0..2d310b9289f8f6231eed85f23066d64d769f7ddb 100644 (file)
@@ -12,7 +12,7 @@ class wsPackagerPhonegap extends wsPackager {
        protected function preparePackage() {
                parent::preparePackage();
 
-               $compiler = wsHTML5Compiler::factory($this->book_id, null, true, $this->vdir);
+               $compiler = wsHTML5Compiler::factory($this->book_id, null, 'ios', $this->vdir);
                $compiler->compile();
 
                unlink($this->vdir . '/indext.html');
@@ -27,7 +27,7 @@ class wsPackagerPhonegap extends wsPackager {
        }
 
        protected function makeResources() {
-               $splashs = array('320x480' => 'Default~iphone', '640x960' => 'Default@2x~iphone', '1024x768' => 'Default-Landscape~ipad', '768x1024' => 'Default-Portrait~ipad', '2048x1496' => 'Default-Landscape@2x~ipad', '1536x2008' => 'Default-Portrait@2x~ipad', '640x1136' => 'Default-568h@2x');
+               $splashs = array('320x480' => 'Default~iphone', '640x960' => 'Default@2x~iphone', '1024x748' => 'Default-Landscape~ipad', '768x1004' => 'Default-Portrait~ipad', '2048x1496' => 'Default-Landscape@2x~ipad', '1536x2008' => 'Default-Portrait@2x~ipad', '640x1136' => 'Default-568h@2x~iphone');
                $icons = array(57 => 'icon', 72 => 'icon-72', 114 => 'icon@2x', 144 => 'icon-72@2x');
 
                if (!file_exists($this->resources . '/splash')) {