]> _ Git - cubeextranet.git/commitdiff
(no commit message)
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Sun, 10 Jul 2011 02:11:08 +0000 (02:11 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Sun, 10 Jul 2011 02:11:08 +0000 (02:11 +0000)
fluidbook/icones/1/mobile/nav-bookmark.svg
fluidbook/icones/1/mobile/nav-friend.svg
fluidbook/icones/1/mobile/nav-help.svg
fluidbook/icones/1/mobile/nav-index.svg
fluidbook/icones/1/mobile/nav-sommaire.svg
fluidbook/icones/1/mobile/next.svg
fluidbook/icones/1/mobile/previous.svg
inc/ws/Util/packager/class.ws.packager.html5.php

index ca12c90cf9074099eb4029a0359fd9a85cbdbcfa..0ff3bd47da9ceb9141bc204b6548da975453a34b 100644 (file)
@@ -3,6 +3,6 @@
 <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN" "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">\r
 <svg version="1.0" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"\r
         width="11px" height="20px" viewBox="0 0 11 20" enable-background="new 0 0 11 20" xml:space="preserve">\r
-<path fill-rule="evenodd" clip-rule="evenodd" d="M5.542,0.993c0.624,0,4.468,2.532,4.468,5.199V18.09c0,1.105-0.896,0.974-2,0.974\r
+<path fill-rule="evenodd" clip-rule="evenodd" fill="$colorize" d="M5.542,0.993c0.624,0,4.468,2.532,4.468,5.199V18.09c0,1.105-0.896,0.974-2,0.974\r
        c0,0-1.201-5.28-2.493-5.28c-1.2,0-2.498,5.28-2.498,5.28c-1.104,0-2,0.132-2-0.974V6.192C1.019,3.525,4.845,0.993,5.542,0.993z"/>\r
 </svg>\r
index 6c331dd4a4a3bcf9ac058aa97db5befa301d3879..3593791ca2d093c3cb997d5a7a5464c78a3462c4 100644 (file)
@@ -3,6 +3,6 @@
 <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN" "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">\r
 <svg version="1.0" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"\r
         width="19px" height="20px" viewBox="0 0 19 20" enable-background="new 0 0 19 20" xml:space="preserve">\r
-<path d="M13.436,0.969H5.581c-2.508,0-4.56,2.052-4.56,4.56v2.907c0,2.508,2.051,4.56,4.56,4.56h0.435v4.999l4.763-4.999h2.657\r
+<path fill="$colorize" d="M13.436,0.969H5.581c-2.508,0-4.56,2.052-4.56,4.56v2.907c0,2.508,2.051,4.56,4.56,4.56h0.435v4.999l4.763-4.999h2.657\r
        c2.507,0,4.559-2.052,4.559-4.56V5.528C17.994,3.021,15.942,0.969,13.436,0.969"/>\r
 </svg>\r
index 6a0ed7cad174cc9871d3e8ac5526b335cb12b0dd..4b04058d828ea57f074064c65b06f7a7460972f6 100644 (file)
@@ -3,7 +3,7 @@
 <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN" "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">\r
 <svg version="1.0" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"\r
         width="14px" height="20px" viewBox="0 0 14 20" enable-background="new 0 0 14 20" xml:space="preserve">\r
-<path d="M2.061,6.388c0.274,0.282,0.612,0.423,1.011,0.423c0.678,0,1.138-0.403,1.38-1.209c0.257-0.771,0.571-1.354,0.942-1.75\r
+<path  fill="$colorize" d="M2.061,6.388c0.274,0.282,0.612,0.423,1.011,0.423c0.678,0,1.138-0.403,1.38-1.209c0.257-0.771,0.571-1.354,0.942-1.75\r
        c0.371-0.396,0.948-0.594,1.733-0.594c0.67,0,1.218,0.196,1.643,0.588C9.194,4.239,9.407,4.72,9.407,5.291\r
        c0,0.292-0.07,0.563-0.209,0.813c-0.139,0.25-0.311,0.477-0.514,0.68s-0.533,0.505-0.99,0.904C7.174,8.145,6.76,8.539,6.454,8.87\r
        c-0.307,0.332-0.553,0.717-0.738,1.156s-0.278,0.958-0.278,1.557c0,0.479,0.126,0.838,0.38,1.08\r
index 023cefef95f24f2cfb57a91ff98e61c23882db95..5d3c042f63a9d150c1a50f98e30b52392c70f1d1 100644 (file)
@@ -5,7 +5,7 @@
         width="27px" height="20px" viewBox="0 0 27 20" enable-background="new 0 0 27 20" xml:space="preserve">\r
 <g>\r
        <g>\r
-               <path fill-rule="evenodd" clip-rule="evenodd" fill="#FFFFFF" d="M5.984,10.041H2.987c-1.104,0-2,0.895-2,1.999v3.037\r
+               <path fill-rule="evenodd" clip-rule="evenodd" fill="$colorize" d="M5.984,10.041H2.987c-1.104,0-2,0.895-2,1.999v3.037\r
                        c0,1.105,0.896,2,2,2h2.997c1.104,0,2-0.895,2-2v-3.037C7.984,10.935,7.089,10.041,5.984,10.041z M15.013,10.041h-3.029\r
                        c-1.104,0-2,0.895-2,1.999v3.037c0,1.105,0.896,2,2,2h3.029c1.104,0,2-0.895,2-2v-3.037\r
                        C17.013,10.935,16.116,10.041,15.013,10.041z M5.984,1H2.987c-1.104,0-2,0.896-2,2v3.037c0,1.105,0.896,2,2,2h2.997\r
index 4ae7441cd37d300f417624192b892adef2619777..d824beaf17677f9a6bd2cb8ea50fc9b5e107e948 100644 (file)
@@ -5,7 +5,7 @@
         width="22px" height="20px" viewBox="0 0 22 20" enable-background="new 0 0 22 20" xml:space="preserve">\r
 <g>\r
        <g>\r
-               <path fill-rule="evenodd" clip-rule="evenodd" d="M19.152,1H9C7.896,1,7,1.896,7,3v0.064c0,1.104,0.896,2,2,2h10.152\r
+               <path fill-rule="evenodd" clip-rule="evenodd"  fill="$colorize" d="M19.152,1H9C7.896,1,7,1.896,7,3v0.064c0,1.104,0.896,2,2,2h10.152\r
                        c1.104,0,2-0.896,2-2V3C21.152,1.896,20.256,1,19.152,1z M3.151,1H3C1.896,1,1,1.896,1,3v0.064c0,1.104,0.896,2,2,2h0.151\r
                        c1.104,0,2-0.896,2-2V3C5.151,1.896,4.256,1,3.151,1z M19.152,7H9C7.896,7,7,7.896,7,9v0.064c0,1.104,0.896,2,2,2h10.152\r
                        c1.104,0,2-0.896,2-2V9C21.152,7.896,20.256,7,19.152,7z M3.151,7H3C1.896,7,1,7.896,1,9v0.064c0,1.104,0.896,2,2,2h0.151\r
index b289d19a12f71a96449af25ca02be1d88ff0bb9b..fc1617f4b9385dca39f2d95b612ed0ae6c349883 100644 (file)
@@ -1,17 +1,21 @@
 <?xml version="1.0" encoding="utf-8"?>\r
 <!-- Generator: Adobe Illustrator 15.0.2, SVG Export Plug-In . SVG Version: 6.00 Build 0)  -->\r
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN" "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">\r
-<svg version="1.0" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"\r
-        width="43px" height="66px" viewBox="0 0 43 66" enable-background="new 0 0 43 66" xml:space="preserve">\r
-<path d="M28.904,23.623l-9.655,12.491c-1.907,1.916-5.009,1.916-6.926,0.004c-1.917-1.914-1.666-3.792,0-6.931l4.798-8.924\r
-       l-4.798-8.926c-1.847-2.902-1.917-5.012-0.01-6.928c1.917-1.913,5.019-1.913,6.936,0l9.545,12.355c0,0,1.546,1.793,1.546,3.496\r
-       S28.904,23.623,28.904,23.623z"/>\r
-<g>\r
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\r
+<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="40px"\r
+        height="100px" viewBox="1.5 1.75 40 100" enable-background="new 1.5 1.75 40 100" xml:space="preserve">\r
+<g id="Layer_2">\r
+</g>\r
+<g id="Layer_1">\r
+       <path fill="$colorize" d="M31.904,39.623l-9.655,12.49c-1.907,1.916-5.009,1.916-6.926,0.005c-1.917-1.914-1.666-3.792,0-6.931l4.798-8.924\r
+               l-4.798-8.927c-1.847-2.902-1.917-5.012-0.01-6.928c1.917-1.913,5.019-1.913,6.936,0l9.545,12.355c0,0,1.546,1.792,1.546,3.496\r
+               S31.904,39.623,31.904,39.623z"/>\r
        <g>\r
-               <path fill-rule="evenodd" clip-rule="evenodd" d="M26.978,53.23l-4.015-5.195c-0.804-0.805-2.108-0.805-2.911,0\r
-                       s-0.783,1.693,0,2.914l2.018,3.754l-2.018,3.752c-0.702,1.32-0.803,2.111,0,2.916s2.107,0.805,2.911,0l4.064-5.256\r
-                       c0,0,0.603-0.697,0.603-1.414C27.63,53.986,26.978,53.23,26.978,53.23z M15.144,47.453c-0.893,0-1.605,0.721-1.605,1.609v11.26\r
-                       c0,0.889,0.713,1.609,1.605,1.609c0.894,0,1.606-0.721,1.606-1.609v-11.26C16.75,48.174,16.037,47.453,15.144,47.453z"/>\r
+               <g>\r
+                       <path fill="$colorize" d="M27.979,80.23l-4.016-5.195c-0.804-0.805-2.108-0.805-2.911,0c-0.803,0.805-0.783,1.693,0,2.914l2.018,3.754\r
+                               l-2.018,3.752c-0.702,1.32-0.803,2.111,0,2.916c0.803,0.805,2.107,0.805,2.911,0l4.064-5.256c0,0,0.603-0.697,0.603-1.414\r
+                               C28.63,80.986,27.979,80.23,27.979,80.23z M16.144,74.453c-0.893,0-1.605,0.721-1.605,1.609v11.26\r
+                               c0,0.889,0.713,1.609,1.605,1.609c0.894,0,1.606-0.722,1.606-1.609v-11.26C17.75,75.174,17.037,74.453,16.144,74.453z"/>\r
+               </g>\r
        </g>\r
 </g>\r
 </svg>\r
index b80c38515aad5aa7f53060180f94db93fa8eb833..d68cb27d12adb58128fe2bd1babaf96b4713b5ce 100644 (file)
@@ -2,17 +2,16 @@
 <!-- Generator: Adobe Illustrator 15.0.2, SVG Export Plug-In . SVG Version: 6.00 Build 0)  -->\r
 <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN" "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">\r
 <svg version="1.0" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"\r
-        width="43px" height="66px" viewBox="0 0 43 66" enable-background="new 0 0 43 66" xml:space="preserve">\r
-<path d="M13.224,23.648l9.649,12.491c1.912,1.915,5.012,1.915,6.928,0.004c1.914-1.914,1.664-3.793,0-6.932l-4.795-8.924\r
-       l4.799-8.926c1.846-2.902,1.914-5.012,0.002-6.928c-1.914-1.913-5.016-1.913-6.932,0L13.328,16.79c0,0-1.542,1.793-1.542,3.496\r
-       S13.224,23.648,13.224,23.648z"/>\r
+        width="40px" height="100px" viewBox="1.5 1.75 40 100" enable-background="new 1.5 1.75 40 100" xml:space="preserve">\r
+<path fill="$colorize" d="M12.936,39.623l9.655,12.49c1.907,1.916,5.009,1.916,6.927,0.005c1.917-1.914,1.665-3.792,0-6.931l-4.799-8.924l4.799-8.927\r
+       c1.846-2.902,1.917-5.012,0.01-6.928c-1.918-1.913-5.02-1.913-6.937,0l-9.545,12.354c0,0-1.546,1.793-1.546,3.496\r
+       S12.936,39.623,12.936,39.623z"/>\r
 <g>\r
        <g>\r
-               <path fill-rule="evenodd" clip-rule="evenodd" d="M22.076,48.061c-0.806-0.805-2.11-0.805-2.916,0l-4.016,5.196\r
-                       c0,0-0.648,0.755-0.648,1.471s0.605,1.414,0.605,1.414l4.058,5.255c0.804,0.805,2.108,0.805,2.914,0.001\r
-                       c0.805-0.806,0.7-1.596,0-2.916l-2.017-3.753l2.018-3.754C22.852,49.754,22.88,48.866,22.076,48.061z M26.98,47.479\r
-                       c-0.889,0-1.608,0.721-1.608,1.609v11.259c0,0.889,0.72,1.609,1.608,1.609s1.609-0.721,1.609-1.609V49.089\r
-                       C28.59,48.2,27.869,47.479,26.98,47.479z"/>\r
+               <path fill="$colorize" d="M17.084,80.23l4.016-5.195c0.803-0.805,2.107-0.805,2.911,0c0.802,0.805,0.782,1.693,0,2.914l-2.019,3.754l2.019,3.752\r
+                       c0.701,1.32,0.802,2.111,0,2.916c-0.804,0.805-2.107,0.805-2.911,0l-4.065-5.256c0,0-0.603-0.697-0.603-1.414\r
+                       C16.433,80.986,17.084,80.23,17.084,80.23z M28.918,74.453c0.895,0,1.605,0.721,1.605,1.609v11.26\r
+                       c0,0.889-0.713,1.609-1.605,1.609c-0.895,0-1.605-0.722-1.605-1.609v-11.26C27.313,75.174,28.025,74.453,28.918,74.453z"/>\r
        </g>\r
 </g>\r
 </svg>\r
index fd922ccad04af025d308668e09341d6576eaad91..5e9f26281c239df3fe7fef6f3f88a39815605b55 100644 (file)
@@ -65,8 +65,7 @@ class wsPackagerHTML5 extends wsPackager {
                }\r
                $this->writeFonts();\r
                $this->writeImages();\r
-               $this->writeTheme();\r
-               file_put_contents($this->vdir . '/data/style/style.css', $this->writeCSS());\r
+               $this->writeCSS($this->vdir . '/data/style/style_%d.css');\r
 \r
                file_put_contents($this->vdir . '/data/datas.js', $this->writeConfig());\r
        }\r
@@ -87,8 +86,48 @@ class wsPackagerHTML5 extends wsPackager {
                }\r
        }\r
 \r
-       protected function writeTheme() {\r
-               // Icons\r
+       protected function writeIcons() {\r
+               $res = array();\r
+               // Get the colors used to colorize graphics\r
+               if ($this->theme->parametres->colorizeIcons) {\r
+                       $couleurI = '#' . $this->theme->parametres->couleurI;\r
+               } else {\r
+                       $couleurI = '#FFFFFF';\r
+               }\r
+               $arrowsColor = '#' . $this->theme->parametres->arrowsColor;\r
+               // Set the icon list with the color\r
+               $icons = array('nav-bookmark' => $couleurI, 'nav-friend' => $couleurI, 'nav-help' => $couleurI, 'nav-index' => $couleurI, 'nav-sommaire' => $couleurI,\r
+                       'next' => $arrowsColor, 'previous' => $arrowsColor);\r
+\r
+               foreach ($icons as $icon => $color) {\r
+                       // Get content of the svg\r
+                       $svg = file_get_contents(WS_ICONS . '/' . $this->theme->parametres->iconSet . '/mobile/' . $icon . '.svg');\r
+                       // Colorize it\r
+                       $svg = str_replace('$colorize', $color, $svg);\r
+                       // Write the file\r
+                       file_put_contents($this->vdir . '/data/images/' . $icon . '.svg', $svg);\r
+                       $svg = simplexml_load_string($svg);\r
+                       $w = (string) $svg['width'];\r
+                       $h = (string) $svg['height'];\r
+                       $w = rtrim($w, 'px');\r
+                       $h = rtrim($h, 'px');\r
+                       // Finally rasterize it\r
+                       $this->rasterizeSVG($this->vdir . '/data/images/' . $icon . '.svg', 'image/png', $w, $h, 4);\r
+                       $res[] = '#icon-' . $icon . '{width:' . $w . 'px;height:' . $h . 'px;background-image:url(data/images/' . $icon . '.svg), url(data/images/' . $icon . '.png);background-repeat:no-repeat;background-size:' . $w . 'px ' . $h . 'px}';\r
+               }\r
+               return $res;\r
+       }\r
+\r
+       protected function rasterizeSVG($file, $type, $w, $h, $scale=1) {\r
+               $batik = new cubeCommandLine('/usr/local/batik/batik-rasterizer');\r
+               $batik->setArg('d', $this->vdir . '/data/images');\r
+               $batik->setArg('m', 'image/png');\r
+               if ($scale != 1) {\r
+                       $batik->setArg('w', $w * $scale);\r
+                       $batik->setArg('h', $h * $scale);\r
+               }\r
+               $batik->setManualArg($file);\r
+               $batik->execute();\r
        }\r
 \r
        protected function writeImages() {\r
@@ -184,7 +223,7 @@ class wsPackagerHTML5 extends wsPackager {
                return self::escapeHTML($span['text']);\r
        }\r
 \r
-       protected function writeCSS() {\r
+       protected function writeCSS($file) {\r
                $res = array();\r
 \r
 \r
@@ -274,10 +313,18 @@ class wsPackagerHTML5 extends wsPackager {
                $header.='}';\r
                $res[] = $header;\r
 \r
+               //Icons\r
+               $res = array_merge($res, $this->writeIcons());\r
+\r
                // Logo\r
                $logo = '#logo{';\r
-\r
+               if ($this->theme->parametres->logo) {\r
+                       copy($this->themeRoot . '/' . $this->theme->parametres->logo, $this->vdir . '/data/images/' . $this->theme->parametres->logo);\r
+                       $dim = getimagesize($this->vdir . '/data/images/' . $this->theme->parametres->logo);\r
+                       $logo.='background-image:url(../images/' . $this->theme->parametres->logo . ');width:' . $dim[0] . 'px;height:' . $dim[1] . 'px;';\r
+               }\r
                $logo.='}';\r
+               $res[] = $logo;\r
 \r
                // Credits\r
                $res[] = '#credits,#credits a{color:' . self::colorToCSS($this->theme->parametres->creditsColor) . ';}';\r
@@ -333,7 +380,11 @@ class wsPackagerHTML5 extends wsPackager {
                        $res[] = "@font-face{font-family:F" . $index . ";src:url('F" . $index . ".eot');src:url('F" . $index . ".eot?#iefix') format('eot'),url('F" . $index . ".ttf') format('truetype'),url('F" . $index . ".svgz#" . $font . "') format('svgz'),url('F" . $index . ".svg#" . $font . "') format('svg')}";\r
                        $res[] = '.f' . $index . '{font-family:F' . $index . ',Arial,Helvetica}';\r
                }\r
-               return implode("\n", $res);\r
+\r
+               $res = array_chunk($res, 4000);\r
+               foreach ($res as $k => $css) {\r
+                       file_put_contents(sprintf($file, $k), implode("\n", $css));\r
+               }\r
        }\r
 \r
        protected function writeCSSUA($property, $value) {\r
@@ -511,7 +562,6 @@ class wsPackagerHTML5 extends wsPackager {
                        foreach ($components as $k => $name) {\r
                                $hex = substr($color, $k * 2, 2);\r
                                $$name = intval($hex, 16);\r
-                               fb($hex . '->' . $$name, $name);\r
                        }\r
                        $alpha/=255;\r
                        if ($alpha == 0) {\r