]> _ Git - fluidbook-v3.git/commitdiff
done #483 @1.5
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Tue, 26 Jul 2016 14:23:53 +0000 (14:23 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Tue, 26 Jul 2016 14:23:53 +0000 (14:23 +0000)
framework/application/configs/application.ini
framework/application/controllers/AjaxController.php
framework/application/views/helpers/Exemples.php
framework/application/views/helpers/LinkQuote.php
framework/application/views/scripts/common/footer.phtml
js/002-common.js
less/002-common.less
less/240-text.less

index 810434a7dd2f47e6d56ff4e565d3962a3b7ae125..d0a0eb867bd03d814729e576e62d4e0c7872e40b 100644 (file)
@@ -48,7 +48,6 @@ webhost = www.fluidbook.com
 locales.fr = www.fluidbook.com
 locales.en = en.fluidbook.com
 
-
 acl.perpage = true
 acl.roles[] = superadmin
 acl.roles[] = admin
@@ -64,7 +63,7 @@ firephp = true
 
 minify.js = false
 
-seo.universalAnalytics =
+seo.universalAnalytics = UA-4339912-9
 
 httpauth.username = fluidbook
 httpauth.password = fb2016
index a834f5a6f1a464782fdd8b4355ca858d5e81e896..b4eaf78c3620bb9ab0f967ec911542b2f57fcb1b 100644 (file)
@@ -8,7 +8,7 @@ class AjaxController extends CubeIT_Controller_AjaxController {
                // Take form ID from URL so we can differentiate between the popup and the embedded versions of the form
                if ($formID) {
                        $form->setId($formID);
-                       $form->setAction($form->getAction() .'/'. $formID);
+                       $form->setAction($form->getAction() . '/' . $formID);
                } else {
                        $formID = $form->getId();
                }
@@ -18,14 +18,16 @@ class AjaxController extends CubeIT_Controller_AjaxController {
                        $xml = simplexml_load_file($url);
 
                        $okmessage = array_pop($xml->xpath('//alert'));
-                       if(null!==$okmessage){
-                               $okmessage=(string)$okmessage->content;
+                       if (null !== $okmessage) {
+                               $okmessage = (string)$okmessage->content;
                        }
-                       
-                       $this->_datas->addReplace('#'. $formID, '<div id="confirmationQuote">' . $okmessage . '</div>');
+
+                       $this->_datas->addReplace('#' . $formID, '<div id="confirmationQuote">' . $okmessage . '</div>');
+                       $this->_datas->addGAEvent('form', 'sent', 'quote');
                } else {
                        $this->_datas->refreshForm($form); // Respond with validation errors
                        $this->_datas->addAction('eval', "displayErrors('$formID')");
+                       $this->_datas->addGAEvent('form', 'error', 'quote');
                }
 
        }
index cdd9ed9c497ebfad5d14adbd59f4990e173ce5da..975741fd2242467529e7309fdfb90f72bfd6b7e9 100644 (file)
@@ -121,7 +121,7 @@ class Fluidbook_View_Helper_Exemples extends CubeIT_View_Helper_Abstract {
        protected function _rollover($f, $category) {\r
                $res = '';\r
                if ($f->getUrl()) {\r
-                       $res = $this->link(__('Voir le Fluidbook'), $f->getUrl(), array('class' => 'button'));\r
+                       $res = $this->link(__('Voir le Fluidbook'), $f->getUrl(), array('class' => 'button', 'data-event' => array('category' => 'exemple', 'action' => 'see', 'label' => $f->getTitle())));\r
                }\r
                if ($category == 3) {\r
                        $firstCat = 0;\r
index 08fb270e7c8c37517b91dccf3040748ec930d32d..30b46363cd2271cea9f9e7cb6bf215dea51d9b7f 100644 (file)
@@ -7,6 +7,6 @@ class Fluidbook_View_Helper_LinkQuote extends CubeIT_View_Helper_Abstract {
        public function linkQuote($label) {\r
                $this->headScript()->addScriptAndStyle('005-fancyselect');\r
                $this->headScript()->addScriptAndStyle('315-quote');\r
-               return $this->linkPopup($label, '/ajaxpopup/quoteForm', array('class' => 'quoteLink'));\r
+               return $this->linkPopup($label, 'internal:contact', array('data-popup-href' => '/ajaxPopup/quoteForm', 'class' => 'quoteLink', 'data-event' => array('category' => 'form', 'action' => 'open', 'label' => 'quote')));\r
        }\r
 }
\ No newline at end of file
index a7d94588d4209189e96c39b4aa01a453de079fff..d7ff418b28259220b61ac42edbb768c9db545775 100644 (file)
@@ -38,13 +38,13 @@ foreach ($this->option('social_networks') as $social) {
        $res .= '<style type="text/css">';\r
        $res .= '#s-' . $social['icon'] . ':hover{background-color: ' . $social['color'] . ';border-color: ' . $social['color'] . ';}';\r
        $res .= '</style>';\r
-       $res .= '<a href="' . $social['url'] . '" id="s-' . $social['icon'] . '" class="social-link fb-' . $social['icon'] . '" target="_blank">';\r
+       $res .= $this->link('', $social['url'], array('id' => 's-' . $social['icon'], 'class' => 'social-link fb-' . $social['icon'], 'data-event' => array('category' => 'social', 'action' => 'go', 'label' => $social['icon'])));\r
        $res .= '</a>';\r
 }\r
 $res .= '</div>'; // .footer-external\r
 \r
 $res .= '<div class="workshop">';\r
-$res .= $this->linkCMS($this->option('workshop'), array('class' => 'workshop-link'));\r
+$res .= $this->linkCMS($this->option('workshop'), array('class' => 'workshop-link', 'data-event' => array('category' => 'external', 'action' => 'go', 'label' => 'workshop')));\r
 $res .= '</div>'; // .workshop\r
 \r
 $res .= '</div>'; // .external-links\r
index 59b9b73cc4b69093bfeaa6685d2807218b81ae57..870716ca31e9e786ba9069f4103d9871ecd423de 100644 (file)
@@ -2,6 +2,49 @@ registerLoader(load_common, true);
 var zoom = 1;\r
 \r
 function load_common() {\r
+    // Google analytics\r
+\r
+    $('a[href^="mailto:"]').not('[data-event]').each(function () {\r
+        var email = $(this).attr('href').split(':');\r
+        var label = email.pop();\r
+        var e = {\r
+            category: 'email',\r
+            action: 'click',\r
+            label: label,\r
+            value: 1\r
+        };\r
+        $(this).attr('data-event', JSON.stringify(e));\r
+    });\r
+\r
+    $('a[href^="tel:"]').not('[data-event]').each(function () {\r
+        var tel = $(this).attr('href').split(':');\r
+        var label = tel.pop();\r
+\r
+        var e = {\r
+            category: 'tel',\r
+            action: 'call',\r
+            label: label,\r
+            value: 1\r
+        };\r
+        $(this).attr('data-event', JSON.stringify(e));\r
+    });\r
+\r
+    $(document).on('click', '[data-event]', function () {\r
+        var e = $(this).data('event');\r
+        if (e.value === undefined) {\r
+            e.value = 1;\r
+        }\r
+        if (e.action === undefined) {\r
+            e.action = 'click';\r
+        }\r
+\r
+        e.label = e.label.replace(/%href%/gi, $(this).attr('href'));\r
+\r
+        ga('send', 'event', e.category, e.action, e.label, e.value);\r
+        return true;\r
+    });\r
+\r
+\r
     $(window).on('cubeitresize', resize);\r
     resize();\r
 }\r
index c144112a906ba7f5dcac2c5fee4ee8c73ab13125..12192811563618e0037e6cf2d8661fe885627b55 100644 (file)
@@ -16,6 +16,7 @@ body {
        min-width: @content-min-width;\r
        -moz-text-size-adjust: 100%;\r
        -webkit-text-size-adjust: 100%;\r
+       color: #151e28;\r
 \r
        @media @m900 {\r
                font-size: 12px;\r
index a87f7c548070d338a7a4364b69f859620b4c0682..32acad32f3014ddf9cc3dbcc9513a79096046a54 100644 (file)
@@ -17,7 +17,7 @@ h2 {
        }\r
 }\r
 \r
-.content-wrapper {\r
+main .content-wrapper {\r
        width: auto !important;\r
        box-sizing: content-box; // Needed so we can control the content max-width without the % padding interfering\r
        max-width: 670px;\r