]> _ Git - cubeextranet.git/commitdiff
HTML5 priority when flash not installed on the user browser
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Tue, 18 Aug 2015 18:01:20 +0000 (18:01 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Tue, 18 Aug 2015 18:01:20 +0000 (18:01 +0000)
fluidbook/compile/_js/fluidbook.js
fluidbook/compile/_zinc/send.bat
fluidbook/compile/index.html
inc/ws/Metier/class.ws.book.parametres.php
inc/ws/Util/packager/class.ws.packager.html.php

index de4fa2298faad3e9459f330530fa619a771d9dc7..943ca6245bbfca267f7db1b3726fda545f23603d 100644 (file)
@@ -20,6 +20,17 @@ function getWmode() {
     }
 }
 
+function supportHTML5Version() {
+    var prefixes = 'transform WebkitTransform MozTransform OTransform msTransform'.split(' ');
+    var div = document.createElement('div');
+    for (var i = 0; i < prefixes.length; i++) {
+        if (div && div.style[prefixes[i]] !== undefined) {
+            return true;
+        }
+    }
+    return false;
+}
+
 function getLocation() {
     return window.location.toString();
 }
index 451b9db32a6ab0a58827314c33bef88f4847e736..51436f91be23caa4980255f94eca55ed0c816329 100644 (file)
@@ -1,5 +1,5 @@
 @echo off\r
 rm Fluidbook.app.zip\r
-"C:\Program Files (x86)\7-Zip\7z.exe" a -tzip Fluidbook.app.zip Fluidbook.app\r
+"C:\Program Files\7-Zip\7z.exe" a -tzip Fluidbook.app.zip Fluidbook.app\r
 "H:\Applications\PortableApps\PuTTYPortable\App\putty\pscp.exe" "Fluidbook.exe" extranet@extranet.cubedesigners.com:/home/extranet/www/fluidbook/compile/\r
 "H:\Applications\PortableApps\PuTTYPortable\App\putty\pscp.exe" "Fluidbook.app.zip" extranet@extranet.cubedesigners.com:/home/extranet/www/fluidbook/compile/
\ No newline at end of file
index 29b2d6ffd43bd12f1d56c6460123f1d630111520..4614abffa9a63188853006b26eca74bb236ababf 100644 (file)
                INDEX_EXT = '$index_ext';
                var backgroundColor = "$bgcolor";
                function redirect() {
+
+
                        if (isMobile() || $alwaysHTML5) {
                                $redirectMobile
                        } else if (isBadMobile()) {
                                $redirectPDF
                        } else {
+                               if ($html5priority && supportHTML5Version() && !swfobject.hasFlashPlayerVersion("$flashversion")) {
+                                       $redirectMobile
+                                       return;
+                               }
+
                                document.getElementById('fluidbook').style.opacity = 1;
                                swfobject.embedSWF("$pathToIndex?junk=$junk", "fluidbook", "100%", "100%", "$flashversion", "", getFlashvars($junk, $fv), {
                                        "allowScriptAccess": "always",
index 4799e22605d49855136893a53b1f46095134d0da..52b06c46dba810581f127d7f9f60da863467a806 100644 (file)
@@ -291,12 +291,14 @@ class wsBookParametres extends wsParametres {
                $this->forms['offline'] = array('label' => __('Version offline'),
                                                'fieldsnames' => array('offlineTitle', 'offlineLink'));
 
-               $this->fields['alwaysHTML5'] = array('type' => 'boolean', 'default' => 'false', 'editable' => true, 'label' => __('Toujours utiliser la version HTML5'), 'grade' => 3);
+               $this->fields['alwaysHTML5'] = array('type' => 'boolean', 'default' => 'true', 'editable' => true, 'label' => __('Toujours utiliser la version HTML5'), 'grade' => 3);
                $this->fields['mobileVersion'] = array('type' => 'combo', 'default' => 'html5-images', 'editable' => true, 'label' => __('Version mobile'), 'grade' => 3,
                                                       'datas' => array(__('Rediriger vers le PDF') => 'pdf',
                                                                        __('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' => 3);
+
 
                $this->fields['navOrderH'] = array('type' => 'textarea', 'default' => '', 'editable' => true, 'label' => __('Ordre des icônes dans la nav') . ' (' . __('Si différente') . ')', 'grade' => 3);
 
@@ -330,7 +332,7 @@ class wsBookParametres extends wsParametres {
                $this->fields['mobileIgnoreBackgroundLinks'] = array('type' => 'boolean', 'default' => false, 'editable' => true, 'label' => __('Ignorer les liens de background'));
 
                $this->forms['mobile'] = array('label' => __('Version mobile'),
-                                              'fieldsnames' => array('alwaysHTML5', 'mobileLVersion', 'mobileVersion', 'mobileNavigationType', '|', 'mobileNavScale', '|', 'mobileTransitions', 'mobileTransitionDuration', '|', 'navOrderH', '|', 'mobileIconVector', 'mobileServerConfig', 'mobilePlugins', '|', 'mobileVideosPath', '|', 'mobileExtraXSpace', '|', 'mobileIgnoreBackgroundLinks'));
+                                              'fieldsnames' => array('alwaysHTML5', 'html5priority', 'mobileLVersion', 'mobileVersion', 'mobileNavigationType', '|', 'mobileNavScale', '|', 'mobileTransitions', 'mobileTransitionDuration', '|', 'navOrderH', '|', 'mobileIconVector', 'mobileServerConfig', 'mobilePlugins', '|', 'mobileVideosPath', '|', 'mobileExtraXSpace', '|', 'mobileIgnoreBackgroundLinks'));
 
                $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');
                $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');
index 3f47e7ccf86c6b5a2406040db3fa42f5fd58d17e..9d48b49ad9f0a52832dab8fb206ce2d853be8c1a 100644 (file)
@@ -109,6 +109,11 @@ class wsPackagerHTML extends wsPackager {
                        $alwaysHTML5 = 'false';
                }
 
+               if (!isset($this->book->parametres->html5priority)) {
+                       $this->book->parametres->html5priority = true;
+               }
+               $html5priority = CubeIT_Util_Bool::boolval($this->book->parametres->html5priority, false, true);
+
                // Stuffs to replace in html
                $toReplace = array('lang' => strtolower($this->book->lang),
                                   'ga' => $ga,
@@ -123,10 +128,10 @@ class wsPackagerHTML extends wsPackager {
                                   'flashversion' => $this->getMinFlashVersion(),
                                   'fv' => json_encode($this->getFlashvars()),
                                   'alwaysHTML5' => $alwaysHTML5,
+                                  'html5priority' => $html5priority,
                                   'keywords' => $keywords,
                                   'allowNetworking' => $this->_allowNeworking);
 
-
                $this->origHTML = $this->book->parametres->htmlPrepend . file_get_contents($this->vdir . '/index.html');
                unlink($this->vdir . '/index.html');
                $this->origHTML = $this->replaceHTML($toReplace);