]> _ Git - cubeextranet.git/commitdiff
(no commit message)
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Fri, 19 Apr 2013 14:39:18 +0000 (14:39 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Fri, 19 Apr 2013 14:39:18 +0000 (14:39 +0000)
inc/ws/Metier/class.ws.book.parametres.php
inc/ws/Util/html5/class.ws.html5.links.php
inc/ws/Util/packager/class.ws.packager.phonegap.php
inc/ws/Util/packager/class.ws.packager.php
style/ws/html5-screenshot.css [new file with mode: 0644]

index b2a03508a43dc52093796b93c9133b14c80d23b4..a5a1709435ead43f898c4bf1e5d4de75d80b9220 100644 (file)
@@ -103,7 +103,7 @@ class wsBookParametres extends wsParametres {
                        'fieldsnames' => array('fullscreen', 'navOrder', 'tooltipTimer', 'preload', 'pages', 'width', 'height'));\r
                //.\r
                //\r
-               \r
+\r
                $this->fields['bookmark'] = array('type' => 'boolean', 'default' => true, 'editable' => true, 'label' => __('Activer les marques-pages'));\r
                $this->fields['bookmark_email_title'] = array('type' => 'text', 'default' => '', 'editable' => true, 'label' => __("Titre de l'email") . ' "' . __('Envoyer à un ami') . '"', 'hint' => __('Laisser vide pour utiliser la valeur par défaut'));\r
                $this->fields['bookmark_email_body'] = array('type' => 'textarea', 'default' => '', 'editable' => true, 'label' => __("Corps de l'email") . ' "' . __('Envoyer à un ami') . '"', 'hint' => __('Laisser vide pour utiliser la valeur par défaut'));\r
@@ -119,12 +119,12 @@ class wsBookParametres extends wsParametres {
                $this->forms['help'] = array('label' => __('Aide'),\r
                        'fieldsnames' => array('help', '|', 'helpStartup', 'helpStartupTime', '|', 'helpBookmarks', '|', 'helpArrowTooltip'));\r
                // .\r
-               //              \r
+               //\r
                $this->fields['indexAutoScroll'] = array('type' => 'boolean', 'default' => false, 'editable' => true, 'label' => __('Activer le scroll automatique'));\r
                $this->forms['index'] = array('label' => __('Index'), 'fieldsnames' => array('indexAutoScroll'));\r
 \r
                // .\r
-               // \r
+               //\r
                $this->fields['print'] = array('type' => 'boolean', 'default' => true, 'editable' => true, 'label' => __("Activer l'impression"));\r
                $this->fields['printMode'] = array('type' => 'combo', 'default' => 'vector', 'editable' => true, 'label' => __("Mode d'impression"),\r
                        'datas' => array(__('Bitmap') => 'bitmap',\r
@@ -226,7 +226,7 @@ class wsBookParametres extends wsParametres {
                $this->fields['videoReset'] = array('type' => 'boolean', 'default' => false, 'editable' => true, 'label' => __('Réinitialiser les vidéos après la lecture'), 'grade' => 3);\r
                $this->fields['videoBigPlay'] = array('type' => 'boolean', 'default' => true, 'editable' => true, 'label' => __('Afficher le gros bouton Play'), 'grade' => 3);\r
                $this->forms['multimedia'] = array('label' => __('Liens et multimédia'),\r
-                       'fieldsnames' => array('permanentLinks', 'linkBlinkTime', 'customLinkClass','ignoreLinksTypes', 'linkTooltipManager', 'linkCornerSize', '|', 'linkTracker', 'linkTrackerRegexp', '|', 'linkMultimediaPerformanceMode', 'linkMultimediaQuality', '|', 'videoReset', 'videoBigPlay'));\r
+                       'fieldsnames' => array('permanentLinks', 'linkBlinkTime', 'customLinkClass', 'ignoreLinksTypes', 'linkTooltipManager', 'linkCornerSize', '|', 'linkTracker', 'linkTrackerRegexp', '|', 'linkMultimediaPerformanceMode', 'linkMultimediaQuality', '|', 'videoReset', 'videoBigPlay'));\r
                //.\r
                $this->fields['externalArchives'] = array('type' => 'freefile', 'default' => '', 'editable' => true,\r
                        'label' => __('Archives'), 'grade' => 3, 'fileFilter' => $swfFilter);\r
@@ -291,9 +291,11 @@ class wsBookParametres extends wsParametres {
                $this->fields['phonegapId'] = array('type' => 'text', 'default' => 'com.fluidbook.phonegap.$id', 'editable' => true, 'label' => __("Identifiant de l'identifiant"), 'grade' => 5, 'hint' => __('De la forme') . ' com.fluidbook.phonegap.xxxxx');\r
                $this->fields['phonegapVersion'] = array('type' => 'text', 'default' => '1.0.0', 'editable' => true, 'label' => __("Version de l'application"), 'grade' => 5, 'hint' => __('De la forme') . ' 1.2.3');\r
                $this->fields['phonegapPlugins'] = array('type' => 'textarea', 'default' => 'ChildBrowser', 'editable' => true, 'label' => __('Plugins Phonegap'), 'grade' => 5);\r
+               $defaultScreenshots = "P,0\nL,2\nL,index";\r
+               $this->fields['appScreenshots'] = array('type' => 'textarea', 'default' => $defaultScreenshots, 'editable' => true, 'label' => 'Générer les screenshots', 'grade' => 5, 'hint' => __('Une ligne par vue à générer de la forme X,Y (X : P(ortrait) ou L(andscape), Y : numéro de page ou vue (1, index))'));\r
 \r
                $this->forms['phonegap'] = array('label' => __('Applications mobile'),\r
-                       'fieldsnames' => array('phonegapId', 'phonegapVersion', 'phonegapPlugins'));\r
+                       'fieldsnames' => array('phonegapId', 'phonegapVersion', 'phonegapPlugins', 'appScreenshots'));\r
 \r
                $this->fields['secureURL'] = array('type' => 'text', 'default' => 'http://', 'editable' => true, 'label' => __('URL de sécurisation'), 'grade' => 5, 'hint' => __('URL intérrogé pour vérifier si le visiteur à les droits pour consulter la publication'));\r
                $this->fields['secureURLRedirect'] = array('type' => 'text', 'default' => 'http://', 'editable' => true, 'label' => __('Redirection'), 'grade' => 5, 'hint' => __("Si l'authentification échoue, redirection vers cette adresse"));\r
index 7e73949d4130e863f1bf1a95906f04deae39d068..3a840f3c6a76daafa350510f22a56768dd498cb4 100644 (file)
@@ -53,6 +53,9 @@ class wsHTML5Link {
                                        return new webVideoPopupLink($id, $init, $compiler);
                                }
                        case 11:
+                               if($init['to']=='fullScreen'){
+                                       return null;
+                               }
                                return new actionLink($id, $init, $compiler);
                        case 12:
                                return new basketLink($id, $init, $compiler);
index 41711cb9ebb92e25e067e5a78460ea91a12b7f50..823b9513b03fa4fdb29a76d0c9fbbb771fa901b3 100644 (file)
@@ -37,6 +37,7 @@ class wsPackagerPhonegap extends wsPackager {
                        unlink($vdir . '/widget.html');
                        unlink($vdir . '/cache.appcache');
 
+                       $this->makeScreenshots();
 
                        if ($this->makeResources) {
                                if ($os == 'ios') {
@@ -48,6 +49,64 @@ class wsPackagerPhonegap extends wsPackager {
                }
        }
 
+       protected function makeScreenshots() {
+               $resolutions = array('ipad' => '1024x768', 'iphone3-5' => '960x640', 'iphone-4' => '1136x640');
+
+               $views = array();
+               $s=str_replace("\r","\n", $this->book->parametres->appScreenshots);
+               $screenshots=explode("\n",$s);
+
+               foreach ($screenshots as $v) {
+                       $v = trim($v);
+                       if ($v == '') {
+                               continue;
+                       }
+                       list($orientation, $view) = explode(',', $v);
+
+                       if (is_numeric($view)) {
+                               $url = '/page/' . $view;
+                       } else {
+                               $url = '/' . $view;
+                       }
+                       $views[] = array('orientation' => $orientation, 'url' => $url);
+               }
+
+               $baseUrl = 'http://workshop.fluidbook.com/viewerh/' . $this->book->book_id . '_' . $this->book->hash . '_' . $this->book->compilehtml5date . '/index.html#';
+
+
+               foreach ($resolutions as $n => $res) {
+
+                       list($w, $h) = explode('x', $res);
+                       $dir = $this->vdir . '/screenshots/' . $n . '/';
+                       if(!file_exists($dir)){
+                               mkdir($dir,0777,true);
+                       }
+
+                       foreach ($views as $k => $view) {
+                               if ($view['orientation'] == 'P') {
+                                       $screenWidth = $w;
+                                       $screenHeight = $h;
+                               } else {
+                                       $screenWidth = $h;
+                                       $screenHeight = $w;
+                               }
+                               $url = $baseUrl . $view['url'];
+                               $out = $dir . '/' . $k . '.png';
+
+                               $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('url', $url);
+                               $cl->setArg('delay', '1000');
+                               $cl->setArg('out', $out);
+                               $cl->execute();
+                       }
+               }
+       }
+
        protected function makeAndroidResources($resources) {
                $icons = array('drawable' => 96,
                        'drawable-hdpi' => 72,
@@ -125,7 +184,7 @@ class wsPackagerPhonegap extends wsPackager {
        protected function _makeIcon($size, $name, $dir, $os = '') {
 
                $os = strtolower($os);
-               $icoos = $os.'icon';
+               $icoos = $os . 'icon';
 
                if (isset($this->theme->parametres->$icoos) && $this->theme->parametres->$icoos != '') {
                        $base = $this->themeRoot . '/' . $this->theme->parametres->$icoos;
@@ -137,7 +196,7 @@ class wsPackagerPhonegap extends wsPackager {
 
                $it = new cubeImageTools();
                $it->loadImage($base);
-               $it->resize($size, $size, 'ratio',false,'C','M','transparent');
+               $it->resize($size, $size, 'ratio', false, 'C', 'M', 'transparent');
                $it->output('png', $dir . '/' . $name . '.png');
        }
 
index 8e9b84afb0b7ccb391e6819fd6b71747db645b21..9b959dd98d4ba1120232bf4cac7ce387159ba724 100644 (file)
@@ -173,9 +173,6 @@ class wsPackager {
                        mkdir(WS_FILES . '/packager/download', 0777, true);\r
                }\r
 \r
-               fb($zip->commande);\r
-               fb($zip->output);\r
-\r
                if ($rename) {\r
                        rename($zipfile, $final);\r
                }\r
diff --git a/style/ws/html5-screenshot.css b/style/ws/html5-screenshot.css
new file mode 100644 (file)
index 0000000..a3393d8
--- /dev/null
@@ -0,0 +1 @@
+.mview{overflow-y: hidden;}
\ No newline at end of file