From: vincent@cubedesigners.com Date: Fri, 23 Dec 2016 14:49:55 +0000 (+0000) Subject: done #1053 @3 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=36af002386679270185e5b2715d179102c846155;p=cubeextranet.git done #1053 @3 --- diff --git a/fluidbook/compile/_js/fluidbook.js b/fluidbook/compile/_js/fluidbook.js index a517847d2..495d17269 100644 --- a/fluidbook/compile/_js/fluidbook.js +++ b/fluidbook/compile/_js/fluidbook.js @@ -288,6 +288,16 @@ function getBackgroundColor() { } } +function flashAlive() { + displayFlashFluidbook(); + FLASH_ALIVE = true; + clearTimeout(FLASH_ALIVE_TIMEOUT); +} + +function displayFlashFluidbook() { + document.getElementById('fluidbook').style.opacity = 1; +} + /** Initialization code. * If you use your own event management code, change it as required. */ diff --git a/fluidbook/compile/index.html b/fluidbook/compile/index.html index 4614abffa..2f905cbdc 100644 --- a/fluidbook/compile/index.html +++ b/fluidbook/compile/index.html @@ -21,35 +21,48 @@ visibility: hidden; display: none } + $ga diff --git a/fluidbook/compile/style.css b/fluidbook/compile/style.css index 33bded1d6..a2d87b467 100644 --- a/fluidbook/compile/style.css +++ b/fluidbook/compile/style.css @@ -1,5 +1,6 @@ html{height:100%;overflow:hidden;} -#fluidbook{height:100%;} +#fluidbook{height:100%;opacity: 0;} +.flashalive #fluidbook{opacity: 1;} body{height:100%;margin:0;padding:0;font-family:Arial, Helvetica, sans-serif;color:#666;font-size:11px;} .center{margin:10px auto;text-align:center;} blockquote{width:75%;margin:auto;padding-top:150px;} diff --git a/inc/ws/Metier/class.ws.book.parametres.php b/inc/ws/Metier/class.ws.book.parametres.php index 4b6a794c1..e94ec14df 100644 --- a/inc/ws/Metier/class.ws.book.parametres.php +++ b/inc/ws/Metier/class.ws.book.parametres.php @@ -304,7 +304,10 @@ class wsBookParametres extends wsParametres { __('Version HTML5') => 'html5', __("Version HTML5 en images") => 'html5-images') ); - $this->fields['html5priority'] = array('type' => 'boolean', 'default' => 'true', 'editable' => true, 'label' => __("Si flash n'est pas installé, rediriger vers la version HTML5"), 'grade' => 1); + $this->fields['html5priority'] = array('type' => 'combo', 'default' => 'true', 'editable' => true, 'label' => __("Rediriger vers la version HTML5"), 'grade' => 1, + 'datas' => array(__('Si l\'utilisateur a un appareil tactile') => 'false', + __('Si flash n\'est pas installé') => 'notinstalled', + __("Si flash n'est pas pas installé ou bloqué") => 'true')); $this->fields['navOrderH'] = array('type' => 'textarea', 'default' => '', 'editable' => true, 'label' => __('Ordre des icônes dans la nav') . ' (' . __('Si différente') . ')', 'grade' => 3); diff --git a/inc/ws/Metier/class.ws.document.php b/inc/ws/Metier/class.ws.document.php index 9dd6caf95..2a764c5fc 100644 --- a/inc/ws/Metier/class.ws.document.php +++ b/inc/ws/Metier/class.ws.document.php @@ -591,7 +591,7 @@ class wsDocument extends cubeMetier { public function makeHTML5Files($page) { // Then make HD background shots - $resolutions = array(300 => 85, 150 => 85); + $resolutions = array(300 => 85, 150 => 85, 36 => 85); $rratio = $this->getResolutionRatio(); foreach ($resolutions as $r => $q) { $this->makeShotPNM($page, 'html/h' . $r . '-', $r * $rratio, $q, 4, null, false); diff --git a/inc/ws/Util/packager/class.ws.packager.html.php b/inc/ws/Util/packager/class.ws.packager.html.php index ebd7e7193..07648e2eb 100644 --- a/inc/ws/Util/packager/class.ws.packager.html.php +++ b/inc/ws/Util/packager/class.ws.packager.html.php @@ -110,9 +110,9 @@ class wsPackagerHTML extends wsPackager { } if (!isset($this->book->parametres->html5priority)) { - $this->book->parametres->html5priority = true; + $this->book->parametres->html5priority = 'true'; } - $html5priority = CubeIT_Util_Bool::boolval($this->book->parametres->html5priority, false, true); + $html5priority = $this->book->parametres->html5priority; // Stuffs to replace in html @@ -128,9 +128,11 @@ class wsPackagerHTML extends wsPackager { 'flashversion' => $this->getMinFlashVersion(), 'fv' => json_encode($this->getFlashvars()), 'alwaysHTML5' => $alwaysHTML5, - 'html5priority' => $html5priority, 'keywords' => $keywords, - 'allowNetworking' => $this->_allowNeworking); + 'allowNetworking' => $this->_allowNeworking, + 'redirectIfFlashNotInstalled' => in_array($html5priority, array('true', 'notinstalled')) ? 'true' : 'false', + 'redirectIfFlashBlocked' => $html5priority == 'true' ? 'true' : 'false' + ); $this->origHTML = $this->book->parametres->htmlPrepend . file_get_contents($this->vdir . '/index.html'); unlink($this->vdir . '/index.html'); diff --git a/inc/ws/Util/packager/class.ws.packager.phonegap.php b/inc/ws/Util/packager/class.ws.packager.phonegap.php index f2db2a27d..81f752b04 100644 --- a/inc/ws/Util/packager/class.ws.packager.phonegap.php +++ b/inc/ws/Util/packager/class.ws.packager.phonegap.php @@ -28,7 +28,7 @@ class wsPackagerPhonegap extends wsPackager { foreach ($oss as $os) { $vdir = $this->vdir; if (count($oss) > 1) { - $vdir.='/' . $os; + $vdir .= '/' . $os; } $compiler = wsHTML5Compiler::factory($this->book_id, null, $os, 'latest', $vdir, false, !$this->ignoreCache, $this->home); @@ -50,7 +50,13 @@ class wsPackagerPhonegap extends wsPackager { } protected function makeScreenshots() { - $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)); + $resolutions = array( + '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-5-5' => array('width' => 2208, 'height' => 1242, 'zoom' => 1) + ); $views = array(); $s = str_replace("\r", "\n", $this->book->parametres->appScreenshots); @@ -93,7 +99,7 @@ class wsPackagerPhonegap extends wsPackager { $screenHeight = $w; } $url = $baseUrl . $view['url']; - $out = $dir . '/' . $k . '.png'; + $out = $dir . '/' . $k . '.jpeg'; $cl = new cubeCommandLine('xvfb-run'); $cl->setArg('server-args', '-screen 0, ' . $screenWidth . 'x' . $screenHeight . 'x24'); @@ -111,17 +117,17 @@ class wsPackagerPhonegap extends wsPackager { protected function makeAndroidResources($resources) { $icons = array('drawable' => 96, - 'drawable-hdpi' => 72, - 'drawable-ldpi' => 36, - 'drawable-mdpi' => 48, - 'drawable-xhdpi' => 96 + 'drawable-hdpi' => 72, + 'drawable-ldpi' => 36, + 'drawable-mdpi' => 48, + 'drawable-xhdpi' => 96 ); $splashs = array('drawable' => '1024x768', - 'drawable-hdpi' => '1024x768', - 'drawable-ldpi' => '320x480', - 'drawable-mdpi' => '640x960', - 'drawable-xhdpi' => '1280x1920'); + 'drawable-hdpi' => '1024x768', + 'drawable-ldpi' => '320x480', + 'drawable-mdpi' => '640x960', + 'drawable-xhdpi' => '1280x1920'); foreach ($icons as $dir => $size) { $d = $resources . '/' . $dir; @@ -279,7 +285,8 @@ function imagecreatefromfile($file) { case 3: $format = "png"; break; - default:; + default: + ; } // switch $function = "imagecreatefrom" . $format; return $function($file);