]> _ Git - cubeextranet.git/commitdiff
(no commit message)
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Mon, 22 Apr 2013 13:06:22 +0000 (13:06 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Mon, 22 Apr 2013 13:06:22 +0000 (13:06 +0000)
inc/ws/Util/class.ws.exporter.php
inc/ws/Util/packager/class.ws.packager.phonegap.php

index 395d5001f0023985459e73bfe9675f23600ce7f1..cc0495aed2df0cd105d0d1632cc2b171481982c2 100644 (file)
@@ -169,9 +169,6 @@ class wsExporter {
        }
 
        protected function _rsync($src, $dest, $erase = false, $chown = null) {
-               if (!is_null($chown)) {
-                       
-               }
                if (is_file($src)) {
                        $dir = dirname($dest);
                        if (!file_exists($dir)) {
@@ -190,17 +187,21 @@ class wsExporter {
 
                $cp = new cubeCommandLine('rsync');
                $cp->setPath(CONVERTER_PATH);
-               if ($erase) {
-                       $cp->setArg('del');
-               }
+
                $cp->setArg('t');
                $cp->setArg('r');
-               $cp->setArg('z');
                $cp->setArg('v');
-               $cp->setArg(null, $src . '*');
-               $cp->setArg(null, $dest);
+               if ($erase) {
+                       $cp->setArg('force');
+                       $cp->setArg('delete-after');
+               }
+               $cp->setArg(null, rtrim($src, '/') . '/');
+               $cp->setArg(null, rtrim($dest, '/') . '/');
                $cp->execute();
 
+               fb($cp->commande);
+               fb($cp->output);
+
                if (!is_null($chown)) {
                        `chown -R $chown $dest`;
                }
index 823b9513b03fa4fdb29a76d0c9fbbb771fa901b3..e7e5c1b607e40dc420780eaa0a9dd0756383dde2 100644 (file)
@@ -37,9 +37,8 @@ class wsPackagerPhonegap extends wsPackager {
                        unlink($vdir . '/widget.html');
                        unlink($vdir . '/cache.appcache');
 
-                       $this->makeScreenshots();
-
                        if ($this->makeResources) {
+                               $this->makeScreenshots();
                                if ($os == 'ios') {
                                        $this->makeIOSResources($vdir . '/Resources');
                                } elseif ($os == 'android') {
@@ -50,11 +49,11 @@ class wsPackagerPhonegap extends wsPackager {
        }
 
        protected function makeScreenshots() {
-               $resolutions = array('ipad' => '1024x768', 'iphone3-5' => '960x640', 'iphone-4' => '1136x640');
+               $resolutions = array('ipad' => array('width' => 1024, 'height' => 768, 'zoom' => 2), 'iphone3-5' => array('width' => 960, 'height' => 640, 'zoom' => 1), 'iphone-4' => array('width' => 1136, 'height' => 640, 'zoom' => 1));
 
                $views = array();
-               $s=str_replace("\r","\n", $this->book->parametres->appScreenshots);
-               $screenshots=explode("\n",$s);
+               $s = str_replace("\r", "\n", $this->book->parametres->appScreenshots);
+               $screenshots = explode("\n", $s);
 
                foreach ($screenshots as $v) {
                        $v = trim($v);
@@ -71,15 +70,17 @@ class wsPackagerPhonegap extends wsPackager {
                        $views[] = array('orientation' => $orientation, 'url' => $url);
                }
 
-               $baseUrl = 'http://workshop.fluidbook.com/viewerh/' . $this->book->book_id . '_' . $this->book->hash . '_' . $this->book->compilehtml5date . '/index.html#';
+               $baseUrl = 'http://workshop.fluidbook.com/viewerh/' . $this->book->book_id . '_' . $this->book->hash . '_' . $this->book->compilehtml5date . '/index.html?s=1#';
 
 
                foreach ($resolutions as $n => $res) {
+                       $z = isset($res['zoom']) ? $res['zoom'] : 1;
+                       $w = $res['width'] * $z;
+                       $h = $res['height'] * $z;
 
-                       list($w, $h) = explode('x', $res);
                        $dir = $this->vdir . '/screenshots/' . $n . '/';
-                       if(!file_exists($dir)){
-                               mkdir($dir,0777,true);
+                       if (!file_exists($dir)) {
+                               mkdir($dir, 0777, true);
                        }
 
                        foreach ($views as $k => $view) {
@@ -95,10 +96,10 @@ class wsPackagerPhonegap extends wsPackager {
 
                                $cl = new cubeCommandLine('xvfb-run');
                                $cl->setArg('server-args', '-screen 0, ' . $screenWidth . 'x' . $screenHeight . 'x24');
-                               $cl->setArg(null, 'cutycapt');
-                               $cl->setArg('min-width',$screenWidth);
-                               $cl->setArg('min-height',$screenHeight);
-                               $cl->setArg('user-styles','http://workshop.fluidbook.com/style/ws/html5-screenshot.css');
+                               $cl->setArg(null, 'CutyCapt');
+                               $cl->setArg('min-width', $screenWidth);
+                               $cl->setArg('min-height', $screenHeight);
+                               $cl->setArg('zoom-factor', $z);
                                $cl->setArg('url', $url);
                                $cl->setArg('delay', '1000');
                                $cl->setArg('out', $out);
@@ -115,7 +116,6 @@ class wsPackagerPhonegap extends wsPackager {
                        'drawable-xhdpi' => 96
                );
 
-
                $splashs = array('drawable' => '1024x768',
                        'drawable-hdpi' => '1024x768',
                        'drawable-ldpi' => '320x480',
@@ -162,7 +162,7 @@ class wsPackagerPhonegap extends wsPackager {
 
                foreach ($splashs as $size => $name) {
                        list($width, $height) = explode('x', $size);
-                       $this->_makeSplash($width, $height, $name, $resources . '/icons');
+                       $this->_makeSplash($width, $height, $name, $resources . '/splash');
                }
                foreach ($icons as $size => $name) {
                        $this->_makeIcon($size, $name, $resources . '/icons', 'ios');