]> _ Git - cubeextranet.git/commitdiff
(no commit message)
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Thu, 5 Apr 2012 15:27:36 +0000 (15:27 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Thu, 5 Apr 2012 15:27:36 +0000 (15:27 +0000)
fluidbook/compile/index.html
inc/commons/class.common.tools.php
inc/ws/Controlleur/class.ws.url.php
inc/ws/Metier/class.ws.book.parametres.php
inc/ws/Util/html5/class.ws.html5.compiler.php
inc/ws/Util/packager/class.ws.packager.html.php
js/browserInfos.js

index c15cdc46cea26dc917ea6642ef9b5b43a50f777d..2925fffeeb047751c70b784f96dc83d7e41e244f 100644 (file)
@@ -1,18 +1,19 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="$lang" lang="$lang">\r
+<!DOCTYPE html>\r
+<html>\r
        <head>\r
-               <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />\r
-               <meta http-equiv="Cache-Control" content="max-age=0" />\r
-               <meta http-equiv="Cache-Control" content="no-cache" />\r
-               <meta http-equiv="Expires" content="0" />\r
-               <meta http-equiv="Expires" content="Tue, 01 Jan 1980 1:00:00 GMT" />\r
-               <meta http-equiv="Pragma" content="no-cache" />\r
-               <meta http-equiv="X-UA-Compatible" content="IE=Edge" />\r
+               <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">\r
+               <meta http-equiv="Cache-Control" content="max-age=0">\r
+               <meta http-equiv="Cache-Control" content="no-cache">\r
+               <meta http-equiv="Expires" content="0">\r
+               <meta http-equiv="Expires" content="Tue, 01 Jan 1980 1:00:00 GMT">\r
+               <meta http-equiv="Pragma" content="no-cache">\r
+               <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=IE8">\r
                $favicon\r
                $robots\r
                $facebook\r
+               $description\r
                <title>$title</title>\r
-               <link href="style.css?junk=$junk" rel="stylesheet" type="text/css" />\r
+               <link href="style.css?junk=$junk" rel="stylesheet" type="text/css">\r
                <style type="text/css" media="print">*{ visibility: hidden; display: none }</style>\r
                <script type="text/javascript" src="fluidbook.js?junk=$junk"></script>\r
                <script type="text/javascript">FB_DEFAULT_LANG='$lang';</script>\r
index d9470ff5bd0d33d0f5d8633721e1f113bf628174..70cdc7ed4f8a984a4e4334fb6f8ad88878811dd1 100644 (file)
@@ -148,6 +148,14 @@ class commonTools {
                $res = commonPage::barre();
                $res .= commonPage::tMain();
                $res .= commonPage::bh();
+               $res.='<style type="text/css">
+       @media all and (orientation: portrait) {  
+               #ol{display:none;}
+    }  
+      
+    @media all and (orientation: landscape) {  
+      #op{display:none;}
+    }  </style>';
                $res.='<table class="liste">';
                $res.='<tr><th colspan="2"><strong>' . __('Informations concernant votre navigateur') . '</strong></th></tr>';
                $res.='<tr><td>' . __('Navigateur') . '</td><td>' . $_SERVER['HTTP_USER_AGENT'] . '</td></tr>';
@@ -158,6 +166,9 @@ class commonTools {
                $res.='H264 : <span class="f" data-feature="video.h264"></span><br />';
                $res.='WEBM : <span class="f" data-feature="video.webm"></span><br />';
                $res.='</td></tr>';
+               $res.='<tr><td>' . __("Orientation de l'écran") . '</td><td><span id="op">'.__('Portrait').'</span><span id="ol">'.__('Paysage').'</span></td></tr>';
+               $res.='<tr><td>' . __("Largeur de l'écran") . '</td><td id="swidth"></td></tr>';
+               $res.='<tr><td>' . __("Hauteur de l'écran") . '</td><td id="sheight"></td></tr>';
                $res.='</table>';
                $res .= '</div>';
                $res .= commonPage::bf();
index 01cbf7de6e55fb32cdf7e5d8682c788fd1649bfd..e1f0552c504900451f1378c4fe8c90ba8f61ad85 100644 (file)
@@ -391,7 +391,7 @@ class wsUrl {
 \r
                $s->setTitle(cubeText::str2URL($lang_name));\r
 \r
-               $tab = cubeLang::getTranslationsList(PLAYER_SOURCES, array('php', 'as'), array(), $lang->traductions);\r
+               $tab = cubeLang::getTranslationsList(array(PLAYER_SOURCES, WS_COMPILE_ASSETS . '/_html5/js'), array('php', 'as','js'), array(), $lang->traductions);\r
 \r
                $s->setCellValueByColumnAndRow(0, 1, 'ID', true);\r
                $s->setCellValueByColumnAndRow(1, 1, $ref_name, true);\r
index 722dad6c01da5215503debe03a56d3d879386432..7170434ef702901f650bd3871f5624f36f4b2b26 100644 (file)
@@ -226,9 +226,10 @@ class wsBookParametres extends wsParametres {
 \r
                $this->fields['seoVersion'] = array('type' => 'boolean', 'default' => true, 'editable' => true, 'label' => __('Générer une version pour les moteurs de recherche'));\r
                $this->fields['seoRobots'] = array('type' => 'boolean', 'default' => true, 'editable' => true, 'label' => __('Autoriser le parcours par les moteurs de recherche'));\r
+               $this->fields['seoDescription'] = array('type' => 'textarea', 'default' => '', 'editable' => true, 'label' => __('Meta tag Description'));\r
 \r
                $this->forms['seo'] = array('label' => __('Optimisation pour les moteurs de recherche'),\r
-                       'fieldsnames' => array('seoVersion', 'seoRobots'));\r
+                       'fieldsnames' => array('seoVersion', 'seoRobots', 'seoDescription'));\r
 \r
                $this->fields['plv'] = array('type' => 'boolean', 'default' => false, 'editable' => true, 'label' => __('Activer le mode PLV'), 'grade' => 3);\r
                $this->fields['plvTimer'] = array('type' => 'integer', 'min' => 1, 'max' => 60, 'default' => 5, 'editable' => true, 'label' => __('Temps'), 'grade' => 3);\r
index 176cf8c92665379ac819ed1e4f1ec315fcb49737..1afc73eabc86ac177f276d5616b67d1b96de9277 100644 (file)
@@ -287,7 +287,7 @@ class wsHTML5Compiler {
                }
                $style = array();
                foreach ($sheets as $sheet) {
-                       $style[] = '<link type="text/css" rel="stylesheet" href="' . $sheet . '" />';
+                       $style[] = '<link type="text/css" rel="stylesheet" href="' . $sheet . '">';
                }
                $style = implode("\n\t\t", $style);
 
@@ -295,7 +295,12 @@ class wsHTML5Compiler {
 
                $script = '<script type="text/javascript" src="data/fluidbook.js"></script>';
 
-               $vars = array('titre', 'credits', 'ga', 'style', 'script', 'pagesContents');
+               $description = '';
+               if ($this->book->parametres->seoDescription) {
+                       $description = '<meta name="description" content="' . html::escapeHTML($this->book->parametres->seoDescription) . '">';
+               }
+
+               $vars = array('titre', 'credits', 'ga', 'style', 'script', 'pagesContents', 'description');
                foreach ($vars as $v) {
                        $html = str_replace('<!-- $' . $v . ' -->', $$v, $html);
                }
index 1548366bad352459dce1e8c27e10fe0d42992760..17e1abac478ee0e1edbcf3fc77a666a4a4f25f9d 100644 (file)
@@ -62,7 +62,7 @@ class wsPackagerHTML extends wsPackager {
                $favicon = '';\r
 \r
                if ($this->theme->parametres->favicon != '') {\r
-                       $favicon = '<link rel="shortcut icon" href="data/fluidbook.ico" />';\r
+                       $favicon = '<link rel="shortcut icon" href="data/fluidbook.ico">';\r
                }\r
 \r
                $redirectPDF = 'window.location="data/document.pdf";';\r
@@ -85,23 +85,29 @@ class wsPackagerHTML extends wsPackager {
 \r
                $robots = '';\r
                if (!$seoRobot) {\r
-                       $robots = '<meta name="robots" content="noindex, nofollow" />';\r
+                       $robots = '<meta name="robots" content="noindex, nofollow">';\r
+               }\r
+\r
+               $description = '';\r
+               if ($this->book->parametres->seoDescription) {\r
+                       $description = '<meta name="description" content="' . self::escape($this->book->parametres->seoDescription) . '">';\r
                }\r
 \r
                // Stuffs to replace in html\r
                $toReplace = array('lang' => strtolower($this->book->lang),\r
-                       'title' => self::escape($this->book->parametres->title),\r
                        'ga' => $ga,\r
                        'facebook' => $facebook,\r
                        'bgcolor' => $this->theme->parametres->loadingBackColor,\r
                        'redirectMobile' => $redirectMobile,\r
                        'redirectPDF' => $redirectPDF,\r
                        'junk' => TIME,\r
+                       'description' => $description,\r
                        'robots' => $robots,\r
                        'favicon' => $favicon,\r
                        'flashversion' => $this->getMinFlashVersion(),\r
                        'fv' => json_encode($this->getFlashvars()));\r
 \r
+\r
                $this->origHTML = file_get_contents($this->vdir . '/index.html');\r
                $this->origHTML = $this->replaceHTML($toReplace);\r
 \r
@@ -115,8 +121,11 @@ class wsPackagerHTML extends wsPackager {
                        $redirectScript = '';\r
                        if ($page == 1) {\r
                                $dest = 'index.html';\r
+                               $title = $this->book->parametres->title;\r
                        } else {\r
-                               $dest = 'pages/page' . $page . '.html';\r
+                               $label = $this->_getLabelOfPage($page);\r
+                               $title = $label . ' - ' . $this->book->parametres->title;\r
+                               $dest = 'pages/' . $page . '-' . cubeText::str2URL($label) . '.html';\r
                                $pathToIndex = '../index.swf';\r
                                $pathToGetflash = '../getflash.gif';\r
                                $redirectScript = '<script type="text/javascript">window.location=\'../index.html#/' . $page . '\';</script>';\r
@@ -142,6 +151,7 @@ class wsPackagerHTML extends wsPackager {
 \r
                        $data = str_replace('$alt', $alt, $this->origHTML);\r
                        $data = str_replace('$pathToIndex', $pathToIndex, $data);\r
+                       $data = str_replace('$title', $this->escape($title), $data);\r
                        $data = str_replace('$pathToGetflash', $pathToGetflash, $data);\r
                        $data = str_replace('$redirectScript', $redirectScript, $data);\r
 \r
@@ -203,6 +213,7 @@ class wsPackagerHTML extends wsPackager {
        protected function makeHTMLNav($root) {\r
                $res = '<ul id="nav">';\r
                foreach ($this->pages as $page => $infos) {\r
+                       $label = $this->_getLabelOfPage($page);\r
                        if ($page == 1) {\r
                                if ($root) {\r
                                        $url = 'index.html';\r
@@ -211,17 +222,60 @@ class wsPackagerHTML extends wsPackager {
                                }\r
                        } else {\r
                                if ($root) {\r
-                                       $url = 'pages/page' . $page . '.html';\r
+                                       $url = 'pages/' . $page . '-' . cubeText::str2URL($label) . '.html';\r
                                } else {\r
-                                       $url = 'page' . $page . '.html';\r
+                                       $url = $page . '-' . cubeText::str2URL($label) . '.html';\r
                                }\r
                        }\r
-                       $res .= '<li><a href="' . $url . '">Page ' . $page . '</a></li>';\r
+                       $res .= '<li><a href="' . $url . '">' . $label . '</a></li>';\r
                }\r
                $res .= '</ul>';\r
                return $res;\r
        }\r
 \r
+       protected function _getLabelOfPage($page) {\r
+               if($page==1){\r
+                       return $this->book->parametres->title;\r
+               }\r
+               \r
+               $chapters = $this->book->chapters;\r
+               $virtual = $this->_getVirtualPage($page);\r
+               \r
+               \r
+\r
+               $candidates = array();\r
+               foreach ($chapters as $c) {\r
+                       if ($c->page == $virtual) {\r
+                               $candidates[] = $c;\r
+                       }\r
+               }\r
+               if (!count($candidates)) {\r
+                       return $this->_getLabelOfPage($page-1);\r
+               }\r
+\r
+               usort($candidates, array($this, '_sortCandidates'));\r
+               $c=array_shift($candidates);\r
+               return $c->label;\r
+       }\r
+\r
+       protected function _sortCandidates($a, $b) {\r
+               if ($a->level > $b->level) {\r
+                       return 1;\r
+               } else if ($a->level < $b->level) {\r
+                       return -1;\r
+               } else {\r
+                       return 0;\r
+               }\r
+       }\r
+\r
+       protected function _getVirtualPage($page) {\r
+               $num = explode(',',$this->book->numerotation);\r
+               if (isset($num[$page - 1])) {\r
+                       return $num[$page - 1];\r
+               }\r
+               return 1;\r
+       }\r
+\r
        protected function escape($txt) {\r
                return htmlentities($txt, ENT_COMPAT, 'UTF-8');\r
        }\r
index a218e26c11100da0efae6b9d8d3ec39de71c2776..9f7f1883a16f07338813b9b2649e98c246d95e5a 100644 (file)
@@ -11,6 +11,14 @@ function load_browser_infos(){
        $('.f').each(function(){
                $(this).html(getModernizrValue($(this).attr('data-feature')));
        });
+       
+       $(window).resize(infosResize);
+       infosResize();
+}
+
+function infosResize(){
+       $("#swidth").html(screen.width);
+       $("#sheight").html(screen.height);
 }
 
 function getModernizrValue(f){