}
}
+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.
*/
visibility: hidden;
display: none
}</style>
+ <style type="text/css">body{background-color:#$bgcolor;}</style>
<script type="text/javascript">
- FB_DEFAULT_LANG = '$lang';
- INDEX_EXT = '$index_ext';
- var backgroundColor = "$bgcolor";
- function redirect() {
+ FB_DEFAULT_LANG = '$lang';
+ INDEX_EXT = '$index_ext';
+ FLASH_ALIVE = false;
+ FLASH_ALIVE_TIMEOUT = 0;
+ var backgroundColor = "$bgcolor";
- if (isMobile() || $alwaysHTML5) {
- $redirectMobile
- } else if (isBadMobile()) {
- $redirectPDF
- } else {
- if ($html5priority && supportHTML5Version() && !swfobject.hasFlashPlayerVersion("$flashversion")) {
- $redirectMobile
- return;
- }
+ function redirect() {
+ if (isMobile() || $alwaysHTML5) {
+ $redirectMobile
+ } else if (isBadMobile()) {
+ $redirectPDF
+ } else {
+ if ($redirectIfFlashNotInstalled && supportHTML5Version() && !swfobject.hasFlashPlayerVersion("$flashversion")) {
+ $redirectMobile
+ return;
+ }
+ swfobject.embedSWF("$pathToIndex?junk=$junk", "fluidbook", "100%", "100%", "$flashversion", "", getFlashvars($junk, $fv), {
+ "allowScriptAccess": "always",
+ "quality": "high",
+ "scale": "noscale",
+ "wmode": getWmode(),
+ "allowFullScreen": "true",
+ "allowNetworking": "$allowNetworking",
+ 'allowFullScreenInteractive': 'true'
+ }, {"bgcolor": "#" + getBackgroundColor()});
- document.getElementById('fluidbook').style.opacity = 1;
- swfobject.embedSWF("$pathToIndex?junk=$junk", "fluidbook", "100%", "100%", "$flashversion", "", getFlashvars($junk, $fv), {
- "allowScriptAccess": "always",
- "quality": "high",
- "scale": "noscale",
- "wmode": getWmode(),
- "allowFullScreen": "true",
- "allowNetworking": "$allowNetworking",
- 'allowFullScreenInteractive': 'true'
- }, {"bgcolor": "#" + getBackgroundColor()});
- }
- }
+ if ($redirectIfFlashBlocked) {
+ if (swfobject.hasFlashPlayerVersion("$flashversion")) {
+ FLASH_ALIVE_TIMEOUT = setTimeout(function () {
+ if (!FLASH_ALIVE) {
+ $redirectMobile
+ }
+ }, 1500);
+ }
+ } else {
+ displayFlashFluidbook();
+ }
+ }
+ }
</script>
<script type="text/javascript" src="$spfluidbook.js?junk=$junk"></script>
$ga
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;}
__('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);
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);
}
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
'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');
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);
}
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);
$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');
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;
case 3:
$format = "png";
break;
- default:;
+ default:
+ ;
} // switch
$function = "imagecreatefrom" . $format;
return $function($file);