]> _ Git - cubeextranet.git/commitdiff
(no commit message)
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Tue, 17 Jan 2012 10:29:31 +0000 (10:29 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Tue, 17 Jan 2012 10:29:31 +0000 (10:29 +0000)
fluidbook/compile/_js/fluidbook.js
fluidbook/compile/index.html
inc/ws/Controlleur/class.ws.url.php
inc/ws/Util/packager/class.ws.packager.html.php

index 9a724991bf17887ca2bae5e466cf07c97a1b46bb..f12182ac323ed89233393180ba5291ed1381f530 100644 (file)
@@ -96,10 +96,20 @@ function handleWheel(delta){
 }\r
 \r
 function isMobile(){\r
-       var ua=navigator.userAgent;\r
        var devices = ['iphone', 'ipad', 'ipod', 'droid', 'blackberry', 'mobile','htc','samsung','nokia','archos','galaxy','motorola','pad','tab','slate','motorola', 'symbian', 'phone', 'nintendo', 'playstation','touch','webos','ericsson','metro'];\r
-       var pattern;\r
+       return _isMobile(devices);\r
+}\r
 \r
+function isBadMobile(){\r
+       var devices = ['kindle'];\r
+       return _isMobile(devices);\r
+}\r
+\r
+function _isMobile(devices){\r
+       var ua=navigator.userAgent;\r
+       var pattern;\r
+       \r
+       \r
        for(i=0;i<devices.length;i++){\r
                pattern=new RegExp(devices[i],'i');\r
                if(ua.search(pattern)>-1){\r
index 09bb42534e00d749cd804694a0c6b48ff4f136ad..ee2b1395295b9c01118f4870dfd0f92c571d99b6 100644 (file)
@@ -25,6 +25,8 @@
                <script type="text/javascript">\r
                        if(isMobile()){\r
                                $redirectMobile\r
+                       }else if(isBadMobile()){\r
+                               $redirectPDF\r
                        }else{\r
                                swfobject.embedSWF("$pathToIndex?junk=$junk", "fluidbook", "100%", "100%", "10.0.22","", getFlashvars($junk),   {"allowScriptAccess":"always","quality":"high","scale":"noscale","wmode":getWmode(),"allowFullScreen":"true"},{"bgcolor":"#$bgcolor"});\r
                        }\r
index 34254b9c59fae0c9a0b32587b1a15b9cfeaf787d..3ed76706d1da26a5f4c320e14cdaa737f078b383 100644 (file)
@@ -360,7 +360,7 @@ class wsUrl {
                $writer->save('php://output');\r
        }\r
 \r
-       public static function exportLangAsSheet($s, $lang_id, $ref_id='en') {\r
+       public static function exportLangAsSheet($s, $lang_id, $ref_id = 'en') {\r
                global $core;\r
                $dao = new wsDAOLang($core->con);\r
 \r
@@ -655,7 +655,7 @@ html{height:100%}' . "\n";
                self::commonHTML5Viewer($book_id, $hash, 't');\r
        }\r
 \r
-       public static function commonHTML5Viewer($book_id, $hash, $version='') {\r
+       public static function commonHTML5Viewer($book_id, $hash, $version = '') {\r
                global $core;\r
                self::checkDocumentVersionOfBook($book_id);\r
 \r
@@ -702,7 +702,7 @@ html{height:100%}' . "\n";
                echo self::commonViewer($book_id, $e[1], false, $wmode, $newurl);\r
        }\r
 \r
-       public static function commonViewer($book_id, $hash, $standalone = false, $wmode = 'default', $fps=false) {\r
+       public static function commonViewer($book_id, $hash, $standalone = false, $wmode = 'default', $fps = false) {\r
                if (!defined('MINIMIZE_JS')) {\r
                        define('MINIMIZE_JS', false);\r
                }\r
@@ -762,8 +762,10 @@ html{height:100%}' . "\n";
                        $meta['og:image'] = 'http://workshop.fluidbook.com/services/facebook_thumbnail?id=' . $book->book_id;\r
                }\r
 \r
+               $redirectPDF = 'window.location="data/document.pdf"';\r
+\r
                if ($book->parametres->mobileVersion == 'pdf') {\r
-                       $redirectMobile = 'window.location="data/document.pdf";';\r
+                       $redirectMobile = $redirectPDF;\r
                } else {\r
                        $redirectMobile = 'window.location="/viewerh/' . $book_id . '_' . $hash . '_' . TIME . '/";';\r
                }\r
@@ -773,9 +775,11 @@ html{height:100%}' . "\n";
                $res .= '</head>';\r
                $res .= '<body style="background-color:#' . $theme->parametres->loadingBackColor . '" onload="this.focus();">';\r
                $res .= '<div id="fluidbook"><div style="width:734px;margin:100px auto;"><a href="http://get.adobe.com/flashplayer/" target="_blank"><img src="http://static.workshop.fluidbook.com/fluidbook/compile/getflash.gif" alt="" width="734" height="409"/></a></div></div>';\r
-               $res .= '<script type="text/javascript">';\r
+               $res .= "\n" . '<script type="text/javascript">' . "\n";\r
                $res.='if(isMobile()){' . "\n";\r
                $res.="\t" . $redirectMobile . "\n";\r
+               $res.='} else if(isBadMobile()) {' . "\n";\r
+               $res.="\t" . $redirectPDF . "\n";\r
                $res.='} else {' . "\n";\r
                $res .= "\t" . 'swfobject.embedSWF("index.swf", "fluidbook", "100%", "100%", "10.0.22",';\r
                $res .= '"", ' . json_encode($fv) . ',';\r
index 7243acf4e8ace27fad6527e4ae62b60cd1d2a84b..727ef0f90fe0355e9397158cef4669b9ae66bc47 100644 (file)
@@ -47,14 +47,15 @@ class wsPackagerHTML extends wsPackager {
                }\r
 \r
                $favicon = '';\r
-               \r
+\r
                fb($this->theme->parametres->favicon);\r
                if ($this->theme->parametres->favicon != '') {\r
                        $favicon = '<link rel="shortcut icon" href="data/fluidbook.ico" />';\r
                }\r
 \r
+               $redirectPDF = 'window.location="data/document.pdf";';\r
                if ($this->book->parametres->mobileVersion == 'pdf') {\r
-                       $redirectMobile = 'window.location="data/document.pdf";';\r
+                       $redirectMobile = $redirectPDF;\r
                } else {\r
                        $redirectMobile = 'window.location="m/index.html";';\r
                        $this->prepareHTML5();\r
@@ -82,6 +83,7 @@ class wsPackagerHTML extends wsPackager {
                        'facebook' => $facebook,\r
                        'bgcolor' => $this->theme->parametres->loadingBackColor,\r
                        'redirectMobile' => $redirectMobile,\r
+                       'redirectPDF' => $redirectPDF,\r
                        'junk' => TIME,\r
                        'robots' => $robots,\r
                        'favicon' => $favicon);\r