Browse Source

home for mobile is ok

Bachir Soussi Chiadmi 7 years ago
parent
commit
f0c2883d0e
24 changed files with 235 additions and 65 deletions
  1. 9 0
      sites/all/modules/figli/edlp_corpus/assets/dist/scripts/corpus.min.js
  2. 22 0
      sites/all/modules/figli/edlp_corpus/assets/dist/scripts/physics.min.js
  3. 0 0
      sites/all/modules/figli/edlp_corpus/assets/dist/styles/corpus.min.css
  4. 4 1
      sites/all/modules/figli/edlp_corpus/assets/scripts/corpus.js
  5. 1 0
      sites/all/modules/figli/edlp_search/assets/dist/scripts/edlp_search.min.js
  6. 1 0
      sites/all/modules/figli/edlp_studio/assets/dist/scripts/edlp_studio.min.js
  7. 1 1
      sites/all/themes/custom/edlptheme/assets/dist/scripts/main.min.js
  8. 1 0
      sites/all/themes/custom/edlptheme/assets/dist/scripts/redirect.min.js
  9. 0 0
      sites/all/themes/custom/edlptheme/assets/dist/styles/app.min.css
  10. 3 3
      sites/all/themes/custom/edlptheme/assets/scripts/main.js
  11. 12 8
      sites/all/themes/custom/edlptheme/assets/scripts/redirect.js
  12. 111 35
      sites/all/themes/custom/edlptheme/assets/styles/app.scss
  13. 6 1
      sites/all/themes/custom/edlptheme/assets/styles/base/_grid.scss
  14. 15 1
      sites/all/themes/custom/edlptheme/assets/styles/base/_layout.scss
  15. 0 1
      sites/all/themes/custom/edlptheme/templates/navigation/links--language-block.html.twig
  16. 1 1
      sites/default/config/sync/block.block.edlpsearchlinkblock.yml
  17. 1 1
      sites/default/config/sync/block.block.footer.yml
  18. 1 1
      sites/default/config/sync/block.block.languageswitcher.yml
  19. 27 0
      sites/default/config/sync/block.block.languageswitcher_2.yml
  20. 1 8
      sites/default/config/sync/block.block.mainnavigation.yml
  21. 8 0
      sites/default/config/sync/block.block.productions.yml
  22. 8 1
      sites/default/config/sync/block.block.selecteurdelangue_2.yml
  23. 1 1
      sites/default/config/sync/block.block.studiolinkblock.yml
  24. 1 1
      sites/default/config/sync/block.block.userlogin.yml

File diff suppressed because it is too large
+ 9 - 0
sites/all/modules/figli/edlp_corpus/assets/dist/scripts/corpus.min.js


File diff suppressed because it is too large
+ 22 - 0
sites/all/modules/figli/edlp_corpus/assets/dist/scripts/physics.min.js


File diff suppressed because it is too large
+ 0 - 0
sites/all/modules/figli/edlp_corpus/assets/dist/styles/corpus.min.css


+ 4 - 1
sites/all/modules/figli/edlp_corpus/assets/scripts/corpus.js

@@ -1225,8 +1225,11 @@
     init();
   }
 
+
   $(document).ready(function($) {
-    var edlpcorpus = new EdlpCorpus();
+    if(drupalSettings.path.isFront && !edlp_mobile.device_is_mobile){
+      var edlpcorpus = new EdlpCorpus();
+    }
   });
 
 })(jQuery, Drupal, drupalSettings);

File diff suppressed because it is too large
+ 1 - 0
sites/all/modules/figli/edlp_search/assets/dist/scripts/edlp_search.min.js


File diff suppressed because it is too large
+ 1 - 0
sites/all/modules/figli/edlp_studio/assets/dist/scripts/edlp_studio.min.js


File diff suppressed because it is too large
+ 1 - 1
sites/all/themes/custom/edlptheme/assets/dist/scripts/main.min.js


File diff suppressed because it is too large
+ 1 - 0
sites/all/themes/custom/edlptheme/assets/dist/scripts/redirect.min.js


File diff suppressed because it is too large
+ 0 - 0
sites/all/themes/custom/edlptheme/assets/dist/styles/app.min.css


+ 3 - 3
sites/all/themes/custom/edlptheme/assets/scripts/main.js

@@ -24,8 +24,8 @@
     function init(){
       console.log("EdlpTheme init()");
 
-      if(!drupalSettings.path.isFront)
-        return;
+      // if(!drupalSettings.path.isFront)
+      //   return;
 
       initEvents();
 
@@ -1659,7 +1659,7 @@
   } // end EdlpTheme()
 
   $(document).ready(function($) {
-    if(drupalSettings.path.isFront){
+    if(drupalSettings.path.isFront && !edlp_mobile.device_is_mobile){
       var edlptheme = new EdlpTheme();
     }else{
       $('body').attr('booted', 'booted');

+ 12 - 8
sites/all/themes/custom/edlptheme/assets/scripts/redirect.js

@@ -7,33 +7,37 @@ function checkMobile(){
 
 // var edlp_mobile is provided by edlp_mobile.module file
 if(typeof edlp_mobile != "undefined"){
-  console.log(edlp_mobile);
-  console.log('window.location', window.location);
+  // console.log(edlp_mobile);
+  // console.log('window.location', window.location);
   var device_redirect = false;
   var device_is_mobile = checkMobile();
-  console.log('is_mobile_domain', edlp_mobile.is_mobile_domain);
-  console.log('device_is_mobile', device_is_mobile);
+  // console.log('is_mobile_domain', edlp_mobile.is_mobile_domain);
+  // console.log('device_is_mobile', device_is_mobile);
+  edlp_mobile.device_is_mobile = device_is_mobile;
   switch(true){
     case (device_is_mobile && !edlp_mobile.is_mobile_domain):
-      console.log('redirect to mobile domain', window.location.protocol +'//'+ edlp_mobile.mobile_url);
+      // console.log('redirect to mobile domain', window.location.protocol +'//'+ edlp_mobile.mobile_url);
       device_redirect = true;
       // TODO: redirect to mobile domain
       window.location.replace(window.location.protocol +'//'+ edlp_mobile.mobile_url);
       break;
     case (edlp_mobile.is_mobile_domain && !device_is_mobile):
-      console.log('redirect to desktop domain', window.location.protocol +'//'+ edlp_mobile.desktop_url);
+      // console.log('redirect to desktop domain', window.location.protocol +'//'+ edlp_mobile.desktop_url);
       device_redirect = true;
       // TODO: redirect to desktop domain
       window.location.replace(window.location.protocol +'//'+ edlp_mobile.desktop_url);
       break;
     default:
-      console.log('do not redirect');
+      // console.log('do not redirect');
       break;
   }
+  if(device_is_mobile){
+    document.documentElement.className += "is-mobile";
+  }
 }
 
 // var edlp is provided by edlp_ajax.module file
-if(edlp.redirect && !device_redirect){
+if(edlp.redirect && !device_redirect && !device_is_mobile){
   console.log('redirect', edlp);
   console.log('window.location', window.location);
   // window.localStorage.setItem('edlp_origin_path', edlp.sys_path.replace(/^\//, ''));

+ 111 - 35
sites/all/themes/custom/edlptheme/assets/styles/app.scss

@@ -89,6 +89,10 @@ header[role="banner"]{
       white-space: nowrap;
       text-indent: 500px;
       overflow: hidden;
+      html.is-mobile &{
+        $w:170px;
+        width:$w; height:$w * 0.22;
+      }
     }
   }
   opacity: 1;
@@ -151,6 +155,16 @@ header[role="banner"]{
       }
     }
   }
+  html.is-mobile &{
+    // outline: 1px solid orange;
+    margin-top:4px;
+    li{
+      a{
+        font-size: 0.680em;
+        padding:0; margin:0;
+      }
+    }
+  }
 }
 
 .block-language{
@@ -1651,40 +1665,6 @@ footer{
     }
   }
 
-  // .block-language{
-  //   display: inline-block;
-  //   position: relative;
-  //   ul{
-  //     position: absolute;
-  //     bottom:0;
-  //     margin:0;
-  //     padding:0;
-  //     transform-origin: left bottom;
-  //     transform: rotateZ(-45deg);
-  //     white-space: nowrap;
-  //     pointer-events: all;
-  //     li{
-  //       margin:0; padding:0;
-  //       list-style: none;
-  //       display: inline-block;
-  //       &:last-of-type{
-  //         &:before{
-  //           content:"/";
-  //           margin:0 0.2em;
-  //         }
-  //       }
-  //       a{
-  //         color: inherit;
-  //         text-decoration: none;
-  //         font-size: 0.756em;
-  //       }
-  //       &.is-active{
-  //         a{color: red;}
-  //       }
-  //     }
-  //   }
-  // }
-
   nav#block-productions.block-menu{
     position: relative;
     pointer-events: none;
@@ -1926,14 +1906,15 @@ footer{
   }
 
   $icons_w:20px;
+  $mobile_icon_w:15px;
   @mixin iconlinkblock($bgimgurl, $bgimgurlactive) {
     pointer-events: all;
     margin-left: 0.5em;
     // @include btn;
     a{
       box-sizing: border-box;
-      $wh:$icons_w;
       display: block;
+      $wh:$icons_w;
       width:$wh; height:$wh;
       text-indent: $wh*2;
       margin: 0;
@@ -1950,6 +1931,12 @@ footer{
         // background-color: red;
         background-image: $bgimgurlactive;
       }
+      html.is-mobile &{
+        $wh:$mobile_icon_w;
+        width:$wh; height:$wh;
+        text-indent: $wh*2;
+
+      }
     }
   }
 
@@ -2041,6 +2028,95 @@ footer{
     margin-left: 0.2em;
   }
 
+  .block-language{
+    float: none;
+    margin-top: 0;
+    margin-right: 2em;
+    ul{
+      margin:0; padding:0;
+      li{
+        display: inline-block; vertical-align: middle;
+        list-style: none;
+        pointer-events: all;
+        a{
+          font-size: 0.690em;
+          color:inherit;
+          text-decoration: none;
+          text-transform: capitalize;
+          margin-left: 0.8em;
+          @include btn;
+          &:before{
+            content: "";
+            display:inline-block;
+            $sq:0.6em;
+            width: $sq; height:$sq;
+            border: 1px solid red;
+            margin-right: 0.3em;
+          }
+        }
+        &.is-active,
+        &:hover{
+          a:before{
+            border-color: red;
+            background-color: red;
+          }
+        }
+      }
+    }
+
+    html.is-mobile &{
+      // outline: 1px solid green;
+      border-left: none;
+      ul{
+        margin-right:0.5em;
+      }
+      li{
+        line-height: 0;
+        a{
+          padding:0;
+          margin:0;
+          // &:before{display: none;}
+          &.is-active{
+            display:none;
+          }
+        }
+      }
+    }
+  }
+
+  html.is-mobile &{
+    position: fixed;
+    box-sizing: border-box;
+    bottom:0; left:0;
+    width:100%;
+    background-color: #fff;
+    padding-top:0;
+    padding-bottom:0;
+    .region-footer-left, .region-footer-right{
+      width: 50%;
+      >*{
+        margin:0.4em 0!important;
+      }
+    }
+
+    #block-footer, .block-language{
+      // margin-top: 0;
+      li{
+        display: inline-block;
+        a{
+          font-size: 0.680em;
+          &:before{
+            $sq:5px;
+            width: $sq; height:$sq;
+          }
+        }
+      }
+    }
+    .region-footer-right{
+      text-align: right;
+    }
+  }
+
 }
 
 //  _  _         _       ___

+ 6 - 1
sites/all/themes/custom/edlptheme/assets/styles/base/_grid.scss

@@ -28,8 +28,13 @@ $med-bp:1080px;
 @mixin col($col, $offset: 0, $sum: $default_sum, $gap: $default_gap, $align: top) {
   @extend %col-reset;
   padding-left: $gap*$offset;
-  padding-right: $gap;
+  @if $col == $default_sum {
+    padding-right: 0;
+  }@else{
+    padding-right: $gap;
+  }
   &:last-child{padding-right: 0;}
+
   margin-left: percentage(($col/$sum)*$offset);
 
   // @media only screen and (min-width: 768px) {

+ 15 - 1
sites/all/themes/custom/edlptheme/assets/styles/base/_layout.scss

@@ -37,6 +37,15 @@ header[role="banner"]{
     }
   }
 }
+html.is-mobile header[role="banner"]{
+  position:fixed;
+  box-sizing: border-box;
+  top:0; left:0; width:100%;
+  background-color: #fff;
+  >.wrapper{
+    height:50px;
+  }
+}
 
 aside.messages{
   border: none;
@@ -49,7 +58,7 @@ aside.messages{
   overflow-y: auto;
 }
 
-main[role="main"]{
+html:not(.is-mobile) main[role="main"]{
   // outline:1px solid green;
   z-index: 1;
   position: absolute;
@@ -69,6 +78,11 @@ main[role="main"]{
   }
 }
 
+html.is-mobile main[role="main"]{
+  padding:80px 1em 40px;
+  // background-color: blue;
+}
+
 body.toolbar-horizontal.toolbar-themes.toolbar-no-tabs{
     main[role="main"]{
       padding-top: 7em + 1em;

+ 0 - 1
sites/all/themes/custom/edlptheme/templates/navigation/links--language-block.html.twig

@@ -43,7 +43,6 @@
   {%- endif -%}
   <ul{{ attributes }}>
     {%- for item in links -%}
-    <!-- {{ dump(item) }} -->
       <li{{ item.attributes }}>
         {%- if item.link -%}
           {{ item.link }}

+ 1 - 1
sites/default/config/sync/block.block.edlpsearchlinkblock.yml

@@ -9,7 +9,7 @@ dependencies:
 id: edlpsearchlinkblock
 theme: edlptheme
 region: footer_right
-weight: 0
+weight: -3
 provider: null
 plugin: edlp_search_link_block
 settings:

+ 1 - 1
sites/default/config/sync/block.block.footer.yml

@@ -12,7 +12,7 @@ dependencies:
 id: footer
 theme: edlptheme
 region: footer_left
-weight: -4
+weight: -7
 provider: null
 plugin: 'system_menu_block:footer'
 settings:

+ 1 - 1
sites/default/config/sync/block.block.languageswitcher.yml

@@ -10,7 +10,7 @@ dependencies:
 id: languageswitcher
 theme: edlptheme
 region: footer_left
-weight: -3
+weight: -6
 provider: null
 plugin: 'language_block:language_interface'
 settings:

+ 27 - 0
sites/default/config/sync/block.block.languageswitcher_2.yml

@@ -0,0 +1,27 @@
+uuid: c9f90b2a-6eb4-49ec-a5d0-38e824469041
+langcode: en
+status: true
+dependencies:
+  module:
+    - domain
+    - language
+  theme:
+    - edlptheme
+id: languageswitcher_2
+theme: edlptheme
+region: footer_right
+weight: -6
+provider: null
+plugin: 'language_block:language_interface'
+settings:
+  id: 'language_block:language_interface'
+  label: 'Language switcher'
+  provider: language
+  label_display: '0'
+visibility:
+  domain:
+    id: domain
+    domains:
+      m_encyclopediedelaparole_org: m_encyclopediedelaparole_org
+    negate: false
+    context_mapping: {  }

+ 1 - 8
sites/default/config/sync/block.block.mainnavigation.yml

@@ -5,7 +5,6 @@ dependencies:
   config:
     - system.menu.main
   module:
-    - domain
     - system
   theme:
     - edlptheme
@@ -22,10 +21,4 @@ settings:
   label_display: '0'
   level: 1
   depth: 0
-visibility:
-  domain:
-    id: domain
-    domains:
-      encyclopediedelaparole_org: encyclopediedelaparole_org
-    negate: false
-    context_mapping: {  }
+visibility: {  }

+ 8 - 0
sites/default/config/sync/block.block.productions.yml

@@ -5,6 +5,7 @@ dependencies:
   config:
     - system.menu.productions
   module:
+    - domain
     - system
   theme:
     - edlptheme
@@ -27,3 +28,10 @@ visibility:
     pages: '<front>'
     negate: false
     context_mapping: {  }
+  domain:
+    id: domain
+    domains:
+      encyclopediedelaparole_org: encyclopediedelaparole_org
+    negate: false
+    context_mapping:
+      'entity:domain': '@domain.current_domain_context:entity:domain'

+ 8 - 1
sites/default/config/sync/block.block.selecteurdelangue_2.yml

@@ -3,6 +3,7 @@ langcode: fr
 status: true
 dependencies:
   module:
+    - domain
     - language
   theme:
     - edlptheme
@@ -17,4 +18,10 @@ settings:
   label: 'Sélecteur de langue'
   provider: language
   label_display: '0'
-visibility: {  }
+visibility:
+  domain:
+    id: domain
+    domains:
+      encyclopediedelaparole_org: encyclopediedelaparole_org
+    negate: false
+    context_mapping: {  }

+ 1 - 1
sites/default/config/sync/block.block.studiolinkblock.yml

@@ -9,7 +9,7 @@ dependencies:
 id: studiolinkblock
 theme: edlptheme
 region: footer_right
-weight: -6
+weight: -5
 provider: null
 plugin: edlp_studio_link_block
 settings:

+ 1 - 1
sites/default/config/sync/block.block.userlogin.yml

@@ -10,7 +10,7 @@ dependencies:
 id: userlogin
 theme: edlptheme
 region: footer_right
-weight: -5
+weight: -4
 provider: null
 plugin: user_login_block
 settings:

Some files were not shown because too many files changed in this diff