]> _ Git - cubeextranet.git/commitdiff
(no commit message)
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Wed, 30 Jan 2013 16:28:58 +0000 (16:28 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Wed, 30 Jan 2013 16:28:58 +0000 (16:28 +0000)
inc/ws/DAO/class.ws.dao.book.php
inc/ws/Util/html5/class.ws.html5.compiler.php
inc/ws/Util/html5/class.ws.html5.links.php

index a577363e085d12f0eea6a8f128f381e7e2927b16..1543068d81cb45cdfa3545e5872b17052f273095 100644 (file)
@@ -1028,6 +1028,7 @@ class wsDAOBook extends commonDAO {
                $hash .= 'kjgl!az4.';\r
                $hash .= count($pages);\r
                $hash .= round($size[0], 4);\r
+               \r
                $hash = sha1($hash);\r
 \r
                $this->makeTextsIndexes($book, $pages, $index, $textes);\r
index 48bc0fcf0db7cded8f674389800a9aea8527ab17..fda990d9fb614a6d85d183e07792c678f6581d14 100644 (file)
@@ -23,6 +23,7 @@ class wsHTML5Compiler {
                'js/libs/fix/ios-orientation.js',
                'js/libs/fix/detect-zoom.js',
                'js/libs/cube/fb.js',
+               'js/libs/cube/util.js',
                'js/libs/modernizr/modernizr.js',
                'js/libs/modernizr/tests.js',
                'js/libs/json2.js',
@@ -57,7 +58,7 @@ class wsHTML5Compiler {
        );
        public $testJsFiles = array(
                'js/libs/cube/fb.js',
-               'js/libs/modernizr.js',
+               'js/libs/modernizr/modernizr.js',
                'js/libs/jquery/jquery.js',
                'js/libs/jquery/jquery.transform.js',
                'js/libs/jquery/jquery.mousewheel.js',
@@ -66,7 +67,7 @@ class wsHTML5Compiler {
        );
        public $widgetJsFiles = array(
                'js/libs/cube/fb.js',
-               'js/libs/modernizr.js',
+               'js/libs/modernizr/modernizr.js',
                'js/libs/jquery/jquery.js',
                'js/libs/jquery/jquery.transit.js',
                'js/widget.js'
@@ -603,6 +604,11 @@ class wsHTML5Compiler {
 
        protected function writeLinks() {
                global $core;
+
+               $this->config->links = array();
+               $this->config->clinks = array();
+               $this->config->bookmarkGroups = array();
+
                $daoDoc = new wsDAODocument($core->con);
                $daoDoc->getLinksAndRulers($this->book_id, $links, $rulers);
 
@@ -634,7 +640,7 @@ class wsHTML5Compiler {
                $allpages[] = 'aftersearch';
                $allpages[] = 'background';
 
-               $this->config->links = array();
+
 
                foreach ($allpages as $i) {
                        $c = '';
@@ -651,6 +657,16 @@ class wsHTML5Compiler {
                return $css;
        }
 
+       public function addBookmarkGroup($link) {
+               if ($link['left'] > $this->book->parametres->width) {
+                       $link['page']++;
+               }
+               if ($link['page'] <= 0 || $link['page'] > $this->book->parametres->pages) {
+                       continue;
+               }
+               $this->config->bookmarkGroups[] = array('page' => $link['page'], 'nb' => $link['to'], 'name' => $link['extra']);
+       }
+
        protected function writeJs() {
                $config = $this->writeConfig();
                $finals = array('fluidbook' => $this->jsFiles, 'widget' => $this->widgetJsFiles);
@@ -979,6 +995,10 @@ class wsHTML5Compiler {
                $res[] = '.link a.displayArea:hover{opacity:1 !important;}';
                $res[] = '.link a.displayArea{-webkit-tap-highlight-color:' . self::colorToCSS($this->theme->parametres->linksColor, 0.4) . ';background-color:' . self::colorToCSS($this->theme->parametres->linksColor, 0.0001) . ';}';
 
+               // Bookmarks
+               $size = round($this->book->parametres->width * $this->book->parametres->bookmarkCornerSize * 0.0075);
+               $res[] = '#links .bookmark{width:' . $size . 'px;height:' . $size . 'px;}';
+
                // Menus
                # View
                $res[] = '.portrait .mview{width:' . $w . ';min-height:' . $h . '}';
index 64d616d844bb22d970e56a31a7f3e4f88c2730ea..4ac446514e8be55623c0797a347cf97f7425197a 100644 (file)
@@ -71,6 +71,7 @@ class wsHTML5Link {
                        case 19:
                                break;
                        case 20:
+                               $compiler->addBookmarkGroup($init);
                                break;
                        case 21:
                                return new htmlMultimediaLink($id, $init, $compiler);