]> _ Git - cubeextranet.git/commitdiff
#1375
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Tue, 27 Jun 2017 15:18:33 +0000 (15:18 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Tue, 27 Jun 2017 15:18:33 +0000 (15:18 +0000)
inc/ws/Util/packager/class.ws.packager.phonegap.php

index a6e345184b3a1116ff4763c65f93122caa26c997..70b85618ca1a9959b7692bfea57ad4f768715191 100644 (file)
@@ -51,11 +51,11 @@ class wsPackagerPhonegap extends wsPackager {
 
        protected function makeScreenshots() {
                $resolutions = array(
-                       'ipad' => array('width' => 1024, 'height' => 768, 'zoom' => 2),
+                       //'ipad' => array('width' => 1024, 'height' => 768, 'zoom' => 2),
                        'ipad-pro' => array('width' => 1366, 'height' => 1024, 'zoom' => 2),
-                       'iphone3-5' => array('width' => 960, 'height' => 640, 'zoom' => 1),
-                       'iphone-4' => array('width' => 1136, 'height' => 640, 'zoom' => 1),
-                       'iphone-4-7' => array('width' => 1334, 'height' => 750, 'zoom' => 1),
+                       //'iphone3-5' => array('width' => 960, 'height' => 640, 'zoom' => 1),
+                       //'iphone-4' => array('width' => 1136, 'height' => 640, 'zoom' => 1),
+                       //'iphone-4-7' => array('width' => 1334, 'height' => 750, 'zoom' => 1),
                        'iphone-5-5' => array('width' => 2208, 'height' => 1242, 'zoom' => 1)
                );
 
@@ -73,7 +73,11 @@ class wsPackagerPhonegap extends wsPackager {
                        if (is_numeric($view)) {
                                $url = '/page/' . $view;
                        } else {
-                               $url = '/' . $view;
+                               if (strpos($view, 'http') === 0) {
+                                       $url = $view;
+                               } else {
+                                       $url = '/' . $view;
+                               }
                        }
                        $views[] = array('orientation' => $orientation, 'url' => $url);
                }
@@ -92,6 +96,7 @@ class wsPackagerPhonegap extends wsPackager {
                        }
 
                        foreach ($views as $k => $view) {
+                               $delay = 2;
                                if ($view['orientation'] == 'L') {
                                        $screenWidth = $w;
                                        $screenHeight = $h;
@@ -99,7 +104,12 @@ class wsPackagerPhonegap extends wsPackager {
                                        $screenWidth = $h;
                                        $screenHeight = $w;
                                }
-                               $url = $baseUrl . $view['url'];
+                               if (strpos($view['url'], 'http') === 0) {
+                                       $url = $view['url'];
+                                       $delay = 5;
+                               } else {
+                                       $url = $baseUrl . $view['url'];
+                               }
                                $out = $dir . '/' . $k . '.jpeg';
 
                                $cl = new CubeIT_CommandLine('xvfb-run');
@@ -109,9 +119,10 @@ class wsPackagerPhonegap extends wsPackager {
                                $cl->setArg('min-height', $screenHeight);
                                $cl->setArg('zoom-factor', $z);
                                $cl->setArg('url', $url);
-                               $cl->setArg('delay', '2000');
+                               $cl->setArg('delay', $delay * 1000);
                                $cl->setArg('out', $out);
                                $cl->execute();
+                               $cl->debug();
                        }
                }
        }