]> _ Git - fluidbook-v3.git/commitdiff
WIP #4 @9
authorstephen@cubedesigners.com <stephen@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Tue, 26 Jul 2016 16:40:18 +0000 (16:40 +0000)
committerstephen@cubedesigners.com <stephen@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Tue, 26 Jul 2016 16:40:18 +0000 (16:40 +0000)
framework/application/forms/CMS/Sub/Home/Block.php
framework/application/views/helpers/HomeLayer.php
framework/application/views/scripts/common/content.phtml
framework/application/views/scripts/common/footer.phtml
framework/application/views/scripts/templates/home.phtml
js/101-header.js
js/210-home.js

index e7c9f8e3f7669466a4603a15780a9ca8c7a3296b..bfda0de8cdcbcfc97f3e21e498266daa519fb369 100644 (file)
@@ -4,12 +4,13 @@ class Fluidbook_Form_CMS_Sub_Home_Block extends CubeIT_Form_SubForm {
        public function init() {
                parent::init();
 
-               $title = new Zend_Form_Element_Text('title');
+               $title = new Zend_Form_Element_Textarea('title');
+        $title->setAttrib('rows', 2);
                $title->setLabel('Titre');
                $title->setOrder(10);
                $this->addElement($title);
 
-               $text = new CubeIT_Form_Element_Markitup("text");
+               $text = new CubeIT_Form_Element_Markitup('content');
                $text->setLabel('Texte');
                $text->setAttrib('rows', 8);
                $text->setOrder(20);
index 30a1a2a16b98158799c0fbf2fdb22ab611023f43..47d97ffdc90a5e20a801d892b1e2d73a0fcd6d11 100644 (file)
@@ -5,11 +5,13 @@ class Fluidbook_View_Helper_HomeLayer extends CubeIT_View_Helper_Abstract {
 \r
        protected function _layer($content, $class, $attributes = array()) {\r
 \r
-           $class .= ' section';\r
+           $class .= ' section ' . $this->data['headerstyle'];\r
 \r
                $defaultAttributes = array('class' => $class, 'data-headerstyle' => $this->data['headerstyle']);\r
                $attributes = $this->_mergeAttributes($attributes, $defaultAttributes);\r
 \r
+        $content = $this->htmlElement($content, 'div', array('class' => 'content-inner'));\r
+\r
                $content = $this->backgroundBlock($content, $this->data, array('content-wrapper', 'no-shrink', 'fullheight'));\r
 \r
                return $this->htmlElement($content, 'section', $attributes);\r
index b0ce4f986aa529190dc186d71c7b807a5f34d497..e6d1ea47900ff5e7746824fd3613f31948d6de44 100644 (file)
@@ -4,7 +4,9 @@ $content = $this->layout()->content . "\n";
 echo $this->render('common/header.phtml');\r
 echo '<div id="z">';\r
 echo '<main>';\r
+echo '<div id="contentWrapper">'; // Needed because FullPage.js doesn't work when the wrapper is a <main> element\r
 echo $content;\r
-echo '</main>';\r
 echo $this->render('common/footer.phtml');\r
 echo '</div>';\r
+echo '</main>';\r
+echo '</div>';\r
index d7ff418b28259220b61ac42edbb768c9db545775..1006b6c1f6c54a27f0a6cd04683a0ed1cfd0e087 100644 (file)
@@ -64,4 +64,6 @@ $res .= $this->markupDotclear($this->option('footer'));
 $res .= '</div>'; // .footer-inner\r
 $res .= '</footer>'; // footer.legal\r
 \r
-echo $res;
\ No newline at end of file
+echo '<div class="section fp-auto-height">';\r
+echo $res;\r
+echo '</div>';
\ No newline at end of file
index c2ef6bad5004cfc9a54f00fe640d670448ec580f..9c510a8cd541fab71e0f649a74bd312494974f25 100644 (file)
@@ -1,8 +1,6 @@
 <?php\r
 \r
-$this->headScript()->addFullPage();\r
+//$this->headScript()->addFullPage();\r
 $this->headScript()->addScriptAndStyle('210-home');\r
 \r
-echo '<div id="home">'; // Needed because FullPage.js doesn't work when the wrapper is a <main> element\r
-echo $this->home();\r
-echo '</div>';
\ No newline at end of file
+echo $this->home();
\ No newline at end of file
index b9d63bca68524fad26ea9c55c4a95c6084872835..cf3f5877bcaf37ad080d11244ae792e5696560f9 100644 (file)
@@ -122,7 +122,7 @@ function changeHeaderStyle() {
     var scrollTop = $(window).scrollTop();\r
     var wh = $(window).height();\r
     var section;\r
-    $('#home > section').each(function () {\r
+    $('#contentWrapper > section').each(function () {\r
         var offset = $(this).offset().top;\r
         if (scrollTop >= offset && scrollTop <= offset + wh - 50) {\r
             section = $(this);\r
index 346f3eae74db9d16c3416642784f4e9e8e699515..28773c25a183e6dcae25f163648041de4c9bd52a 100644 (file)
@@ -3,26 +3,50 @@ function load_home() {
     $(window).on('fluidbookresize', resizeHome);\r
     resizeHome();\r
 \r
-    // FullPage.js setup\r
-    $('#home').fullpage({\r
-        navigation: true,\r
-        navigationPosition: 'left',\r
-        verticalCentered: false\r
-    });\r
+    // // FullPage.js setup\r
+    // $('#contentWrapper').fullpage({\r
+    //     navigation: true,\r
+    //     navigationPosition: 'left',\r
+    //     verticalCentered: false,\r
+    //     afterRender: function() {\r
+    //         console.log('FullPage rendered.');\r
+    //     },\r
+    //     afterLoad: function(anchorLink, index) {\r
+    //         console.log('Loaded section #' + index);\r
+    //         updateHeaderStyle();\r
+    //     },\r
+    //     onSlideLeave: function(anchorLink, index, slideIndex, direction, nextSlideIndex) {\r
+    //         updateHeaderStyle();\r
+    //     }\r
+    //\r
+    // });\r
 \r
 }\r
 \r
-function resizeHome() {\r
+// function updateHeaderStyle() {\r
+//     var headerClass = $('.fp-section.active').data('headerstyle');\r
+//     console.info(headerClass);\r
+//     if (headerClass == 'light') {\r
+//         if (!$("header").hasClass('light')) {\r
+//             console.log('adding light...');\r
+//             $("header").addClass('light').removeClass('dark');\r
+//         }\r
+//     } else {\r
+//         if (!$("header").hasClass('dark')) {\r
+//             $("header").addClass('dark').removeClass('light');\r
+//         }\r
+//     }\r
+// }\r
 \r
-    // Todo: see if this can be removed completely if FullPage.js handles the section sizing...\r
+function resizeHome() {\r
 \r
     // Resize sections\r
-    // var wh = $(window).outerHeight() / zoom;\r
-    // var ww = $(window).outerWidth() / zoom;\r
-    // $('#home > section').css('height', wh);\r
-    //\r
-    //\r
-    // resizeHomeContact(ww, wh);\r
+    var wh = $(window).outerHeight() / zoom;\r
+    var ww = $(window).outerWidth() / zoom;\r
+    $('#contentWrapper > section').css('height', wh);\r
+\r
+\r
+    resizeHomeContact(ww, wh);\r
 }\r
 \r
 function resizeHomeContact(ww, wh) {\r