diff --git a/sites/all/modules/features/materio_content_types/materio_content_types.features.field_instance.inc b/sites/all/modules/features/materio_content_types/materio_content_types.features.field_instance.inc index 9d04f75a..72d90110 100644 --- a/sites/all/modules/features/materio_content_types/materio_content_types.features.field_instance.inc +++ b/sites/all/modules/features/materio_content_types/materio_content_types.features.field_instance.inc @@ -2394,7 +2394,7 @@ function materio_content_types_field_default_field_instances() { 'label' => 'hidden', 'settings' => array(), 'type' => 'hidden', - 'weight' => 15, + 'weight' => 16, ), 'cardsmall' => array( 'label' => 'above', @@ -2489,7 +2489,7 @@ function materio_content_types_field_default_field_instances() { 'viewmode' => 'cardmedium', ), 'type' => 'tode', - 'weight' => 10, + 'weight' => 23, ), 'cardsmall' => array( 'label' => 'above', @@ -2586,7 +2586,7 @@ function materio_content_types_field_default_field_instances() { 'viewmode' => 'cardmedium', ), 'type' => 'tode', - 'weight' => 9, + 'weight' => 22, ), 'cardsmall' => array( 'label' => 'above', @@ -2763,7 +2763,7 @@ function materio_content_types_field_default_field_instances() { 'label' => 'above', 'settings' => array(), 'type' => 'hidden', - 'weight' => 10, + 'weight' => 11, ), 'cardsmall' => array( 'label' => 'above', @@ -2844,7 +2844,7 @@ function materio_content_types_field_default_field_instances() { 'label' => 'above', 'settings' => array(), 'type' => 'hidden', - 'weight' => 11, + 'weight' => 12, ), 'cardsmall' => array( 'label' => 'above', @@ -2924,7 +2924,7 @@ function materio_content_types_field_default_field_instances() { 'label' => 'hidden', 'settings' => array(), 'type' => 'hidden', - 'weight' => 16, + 'weight' => 17, ), 'cardsmall' => array( 'label' => 'hidden', @@ -3219,7 +3219,7 @@ function materio_content_types_field_default_field_instances() { 'label' => 'above', 'settings' => array(), 'type' => 'hidden', - 'weight' => 13, + 'weight' => 14, ), 'cardsmall' => array( 'label' => 'above', @@ -3395,7 +3395,7 @@ function materio_content_types_field_default_field_instances() { 'label' => 'above', 'settings' => array(), 'type' => 'hidden', - 'weight' => 12, + 'weight' => 13, ), 'cardsmall' => array( 'label' => 'above', @@ -3574,7 +3574,7 @@ Vous devez avant d\'utiliser un nouveau tag le créer 'hidden', 'settings' => array(), 'type' => 'hidden', - 'weight' => 8, + 'weight' => 9, ), 'cardsmall' => array( 'label' => 'above', @@ -3743,7 +3743,7 @@ Vous devez avant d\'utiliser un nouveau tag le créer 'hidden', @@ -211,6 +208,11 @@ function materio_showroom_field_widget_form(&$form, &$form_state, $field, $insta '#maxlength' => 255, ); + $widget['#attached'] = array( + // Add javascript to remove the draggable behaviour. + 'js' => array(drupal_get_path('module', 'materio_showroom') . '/js/materio_showroom.js'), + ); + break; } @@ -279,6 +281,8 @@ function _materio_showroom_alter_location_field_form(&$form, &$form_state, $form $node = $form['#node']; $nodetype = $form['type']['#value']; + // dsm($form_state, 'form_state'); + global $user; $user = user_load($user->uid); // Make sure the user object is fully loaded // dsm($user, 'user'); @@ -311,13 +315,14 @@ function _materio_showroom_alter_location_field_form(&$form, &$form_state, $form foreach ($showroomfieldinstances as $field_name) { // retrive various field infos $field_info = field_info_field($field_name); - $field_instance = field_info_instance('node', $field_name, $nodetype); // dsm($field_info, 'field_info'); + $field_instance = field_info_instance('node', $field_name, $nodetype); // get all terms from chosen vocabulary in field instance widget settings $vid = $field_instance['widget']['settings']['vocabulary']; $voc = taxonomy_vocabulary_load($vid); $tree = taxonomy_get_tree($vid); + // dsm($tree, 'tree'); foreach ($tree as $key => $term) { $terms[$term->tid] = $term->name; } @@ -334,44 +339,58 @@ function _materio_showroom_alter_location_field_form(&$form, &$form_state, $form // get already recorded values $old_items = field_get_items('node', $node, $field_name); + // dsm($old_items, 'old_items'); foreach ($old_items as $i => $value) { $values[$value['showroom_tid']] = $value['location']; } // dsm($values, 'values'); // build new item list - foreach ($terms as $tid => $name) { - $items[] = array( - 'showroom_tid' => $tid, - 'location' => isset($values[$tid]) ? $values[$tid] : '' - ); - } + // for ($k=0; $k < 3; $k++) { + foreach ($terms as $tid => $name) { + $items[] = array( + 'showroom_tid' => "$tid", + 'location' => isset($values[$tid]) ? $values[$tid] : '' + ); + } + // } // dsm($items, 'items'); + // change form_state items count + // without this, form wont populated with all wanted items + $form_state['field'][$field_name][LANGUAGE_NONE]['items_count'] = count($items); + // retrieve new field form with our custom items - $new_field_form = field_default_form('node', $node, $field_info, $field_instance, LANGUAGE_NONE, $items, $form, $form_state); - // dsm($new_field_form, 'default_form'); + $new_field_form = field_default_form('node', null, $field_info, $field_instance, LANGUAGE_NONE, $items, $form, $form_state)[$field_name]; + // dsm($new_field_form, 'new_field_form'); + + + // $elements = field_multiple_value_form($field_info, $field_instance, LANGUAGE_NONE, $items, $form, $form_state); + // dsm($elements, 'elements'); + // change items location field title // and check access comparing term id with user taged with $i = 0; foreach ($terms as $tid => $name) { - $item = $new_field_form[$field_name][LANGUAGE_NONE][$i]; - $new_field_form[$field_name][LANGUAGE_NONE][$i]['location']['#title'] = $terms[$item['showroom_tid']['#default_value']]; + $item = $new_field_form[LANGUAGE_NONE][$i]; + $new_field_form[LANGUAGE_NONE][$i]['location']['#title'] = $terms[$item['showroom_tid']['#default_value']]; $disabled = !user_access('materio showroom edit all samples fields', $user) && !in_array($tid, $user_showrooms); - $new_field_form[$field_name][LANGUAGE_NONE][$i]['location']['#disabled'] = $disabled; + $new_field_form[LANGUAGE_NONE][$i]['location']['#disabled'] = $disabled; $i++; } // remove the last one more item added by default - unset($new_field_form[$field_name][LANGUAGE_NONE][$i]); + unset($new_field_form[LANGUAGE_NONE][$i]); + + // remove "add more" button + unset($new_field_form[LANGUAGE_NONE]['add_more']); + + // dsm($new_field_form, 'new_field_form'); // delete normal field form and replace it with our new custom field form unset($form[$field_name]); - $form[$field_name] = $new_field_form[$field_name]; - - // remove "add more" button - unset($form[$field_name]['und']['add_more']); + $form[$field_name] = $new_field_form; } } } diff --git a/sites/all/themes/gui/materiobasetheme/css/styles.css b/sites/all/themes/gui/materiobasetheme/css/styles.css index 560c666b..3d81330f 100644 --- a/sites/all/themes/gui/materiobasetheme/css/styles.css +++ b/sites/all/themes/gui/materiobasetheme/css/styles.css @@ -4176,16 +4176,16 @@ article.node-materiau.vm-bookmark, article.node-breve.vm-bookmark { height: 17px; } article.node-materiau.vm-bookmark div.workflow, article.node-breve.vm-bookmark div.workflow { position: absolute; - top: 0; - left: 0; + bottom: 0; + right: 0; z-index: 11; padding: 5px; - border-radius: 5px 0 3px 0; + border-radius: 3px 0 5px 0; background-clip: padding-box; font-size: 10px; vertical-align: top; - background-color: rgba(255, 255, 255, 0.9); - color: #000; } + background-color: rgba(20, 20, 20, 0.9); + color: #fff; } article.node-materiau.vm-bookmark div.workflow span, article.node-breve.vm-bookmark div.workflow span { padding: 3px 0 0 4px; display: moz-inline-stack; @@ -4378,16 +4378,16 @@ article.node-materiau.vm-cardsmall, article.node-breve.vm-cardsmall { height: 17px; } article.node-materiau.vm-cardsmall div.workflow, article.node-breve.vm-cardsmall div.workflow { position: absolute; - top: 0; - left: 0; + bottom: 0; + right: 0; z-index: 11; padding: 5px; - border-radius: 5px 0 3px 0; + border-radius: 3px 0 5px 0; background-clip: padding-box; font-size: 10px; vertical-align: top; - background-color: rgba(255, 255, 255, 0.9); - color: #000; } + background-color: rgba(20, 20, 20, 0.9); + color: #fff; } article.node-materiau.vm-cardsmall div.workflow span, article.node-breve.vm-cardsmall div.workflow span { padding: 3px 0 0 4px; display: moz-inline-stack; @@ -4642,16 +4642,16 @@ article.node-materiau.vm-cardmedium, article.node-breve.vm-cardmedium { height: 17px; } article.node-materiau.vm-cardmedium div.workflow, article.node-breve.vm-cardmedium div.workflow { position: absolute; - top: 0; - left: 0; + bottom: 0; + right: 0; z-index: 11; padding: 5px; - border-radius: 5px 0 3px 0; + border-radius: 3px 0 5px 0; background-clip: padding-box; font-size: 10px; vertical-align: top; - background-color: rgba(255, 255, 255, 0.9); - color: #000; } + background-color: rgba(20, 20, 20, 0.9); + color: #fff; } article.node-materiau.vm-cardmedium div.workflow span, article.node-breve.vm-cardmedium div.workflow span { padding: 3px 0 0 4px; display: moz-inline-stack; @@ -4998,16 +4998,16 @@ article.node-materiau.vm-cardbig, article.node-breve.vm-cardbig { height: 17px; } article.node-materiau.vm-cardbig div.workflow, article.node-breve.vm-cardbig div.workflow { position: absolute; - top: 0; - left: 0; + bottom: 0; + right: 0; z-index: 11; padding: 5px; - border-radius: 5px 0 3px 0; + border-radius: 3px 0 5px 0; background-clip: padding-box; font-size: 10px; vertical-align: top; - background-color: rgba(255, 255, 255, 0.9); - color: #000; } + background-color: rgba(20, 20, 20, 0.9); + color: #fff; } article.node-materiau.vm-cardbig div.workflow span, article.node-breve.vm-cardbig div.workflow span { padding: 3px 0 0 4px; display: moz-inline-stack; @@ -5350,16 +5350,16 @@ article.node-materiau.vm-cardfull, article.node-breve.vm-cardfull { height: 17px; } article.node-materiau.vm-cardfull div.workflow, article.node-breve.vm-cardfull div.workflow { position: absolute; - top: 0; - left: 0; + bottom: 0; + right: 0; z-index: 11; padding: 5px; - border-radius: 5px 0 3px 0; + border-radius: 3px 0 5px 0; background-clip: padding-box; font-size: 10px; vertical-align: top; - background-color: rgba(255, 255, 255, 0.9); - color: #000; } + background-color: rgba(20, 20, 20, 0.9); + color: #fff; } article.node-materiau.vm-cardfull div.workflow span, article.node-breve.vm-cardfull div.workflow span { padding: 3px 0 0 4px; display: moz-inline-stack; @@ -5648,16 +5648,16 @@ article.node-materiau.vm-cardfull, article.node-breve.vm-cardfull { height: 17px; } .print-node-materiau div.workflow { position: absolute; - top: 0; - left: 0; + bottom: 0; + right: 0; z-index: 11; padding: 5px; - border-radius: 5px 0 3px 0; + border-radius: 3px 0 5px 0; background-clip: padding-box; font-size: 10px; vertical-align: top; - background-color: rgba(255, 255, 255, 0.9); - color: #000; } + background-color: rgba(20, 20, 20, 0.9); + color: #fff; } .print-node-materiau div.workflow span { padding: 3px 0 0 4px; display: moz-inline-stack; diff --git a/sites/all/themes/gui/materiobasetheme/js/script.js b/sites/all/themes/gui/materiobasetheme/js/script.js index f69d9221..d7010ffa 100644 --- a/sites/all/themes/gui/materiobasetheme/js/script.js +++ b/sites/all/themes/gui/materiobasetheme/js/script.js @@ -1,6 +1,3 @@ -// @koala-prepend "gui_ck_fw/gui.js" -// @codekit-prepend "gui.js" - (function($) { @@ -48,13 +45,13 @@ // touch scroll position = {x:null,y:null}, translate3d_content = 0, - _isLoggedIn = !$('body').is('.not-logged-in'), - _isFrontNotLogged = $('body').is('.front.not-logged-in'), + _isLoggedIn = !_$body.is('.not-logged-in'), + _isFrontNotLogged = _$body.is('.front.not-logged-in'), _isFrontHomeV2 = _$body.is('.home-v2'), _skrollr, - _isMembershipForm = $('body').is('.page-node-11186'), //$('body').is('.page-node-11187') || , - // _isBreveMateriauNodePage = $('body').is('.node-type-breve') || $('body').is('.node-type-materiau'); - _isBreveMateriauNodePage = _themeSettings.page_callback == 'node_page_view' && (_themeSettings.node_type == 'materiau' || _themeSettings.node_type == 'breve'), + _isMembershipForm = _$body.is('.page-node-11186'), //$('body').is('.page-node-11187') || , + _isBreveMateriauNodePage = _$body.is('.node-type-breve') || _$body.is('.node-type-materiau'), + // _isBreveMateriauNodePage = _themeSettings.page_callback == 'node_page_view' && (_themeSettings.node_type == 'materiau' || _themeSettings.node_type == 'breve'), _resizeTimer, _max_480 = function(){ return (viewport().width < 479); }, _480_768 = function(){ return ( !_max_480() && _max_768() ); }, @@ -531,7 +528,7 @@ }; function onResultsChanged(event){ - // trace('MaterioBaseTheme :: onResultsChanged',event); + trace('MaterioBaseTheme :: onResultsChanged',event); $(document).scrollTop(0); focusCard($('#content .search-results, #content .actuality-items').children('.node:first-child')); diff --git a/sites/all/themes/gui/materiobasetheme/js/script.min.js b/sites/all/themes/gui/materiobasetheme/js/script.min.js index 676ca2fd..319c83aa 100644 --- a/sites/all/themes/gui/materiobasetheme/js/script.min.js +++ b/sites/all/themes/gui/materiobasetheme/js/script.min.js @@ -1,13 +1,13 @@ (function($){Drupal.behaviors.init_theme={};Drupal.behaviors.init_theme.attach=function(context){$('#messages-and-help > div.messages:not(.processed)').addClass('processed').each(function(){if($('a',this).size()||$(this).is('.error')||$(this).is('.warning')||$(this).text().length>100){$(this).prepend("X");$('span.close',this).click(function(){$(this).parent().slideUp('fast');});} -else{$(this).animate({opacity:1},5000,'linear',function(){$(this).slideUp('fast');});}});};Drupal.behaviors.materio={};Drupal.behaviors.materio.attach=function(context){};MaterioBaseTheme=function(){var _settings=Drupal.settings,_themeSettings=_settings.materiobasetheme,_strings=_themeSettings.strings,_History=window.History,_this=this,_$body=$('body'),_$content=$('#content'),_jsp,_$tooltip=$('
').appendTo('body'),_$homeUtilities,_$homeBlockDidactique,_hoverHomeDidactique=false,_homeTimeInterval,_touch=$('html').is('.touch'),_statePushed=false,position={x:null,y:null},translate3d_content=0,_isLoggedIn=!$('body').is('.not-logged-in'),_isFrontNotLogged=$('body').is('.front.not-logged-in'),_isFrontHomeV2=_$body.is('.home-v2'),_skrollr,_isMembershipForm=$('body').is('.page-node-11186'),_isBreveMateriauNodePage=_themeSettings.page_callback=='node_page_view'&&(_themeSettings.node_type=='materiau'||_themeSettings.node_type=='breve'),_resizeTimer,_max_480=function(){return(viewport().width<479);},_480_768=function(){return(!_max_480()&&_max_768());},_max_768=function(){return(viewport().width<767);},_768_980=function(){return(!_max_768()&&_max_980());},_max_980=function(){return(viewport().width<979);},_980_1200=function(){return(!_max_980()&&_max_1200());},_max_1200=function(){return(viewport().width<1199);},_previewIsOpen=false,_viewmodes={bookmark:50,cardsmall:100,cardmedium:210,cardbig:425,cardfull:850};var v1,v2,v3,v4,v5;function init(){trace('init MaterioBaseTheme');checkIE();initHistoryNav();if(_isFrontHomeV2) +else{$(this).animate({opacity:1},5000,'linear',function(){$(this).slideUp('fast');});}});};Drupal.behaviors.materio={};Drupal.behaviors.materio.attach=function(context){};MaterioBaseTheme=function(){var _settings=Drupal.settings,_themeSettings=_settings.materiobasetheme,_strings=_themeSettings.strings,_History=window.History,_this=this,_$body=$('body'),_$content=$('#content'),_jsp,_$tooltip=$('
').appendTo('body'),_$homeUtilities,_$homeBlockDidactique,_hoverHomeDidactique=false,_homeTimeInterval,_touch=$('html').is('.touch'),_statePushed=false,position={x:null,y:null},translate3d_content=0,_isLoggedIn=!_$body.is('.not-logged-in'),_isFrontNotLogged=_$body.is('.front.not-logged-in'),_isFrontHomeV2=_$body.is('.home-v2'),_skrollr,_isMembershipForm=_$body.is('.page-node-11186'),_isBreveMateriauNodePage=_$body.is('.node-type-breve')||_$body.is('.node-type-materiau'),_resizeTimer,_max_480=function(){return(viewport().width<479);},_480_768=function(){return(!_max_480()&&_max_768());},_max_768=function(){return(viewport().width<767);},_768_980=function(){return(!_max_768()&&_max_980());},_max_980=function(){return(viewport().width<979);},_980_1200=function(){return(!_max_980()&&_max_1200());},_max_1200=function(){return(viewport().width<1199);},_previewIsOpen=false,_viewmodes={bookmark:50,cardsmall:100,cardmedium:210,cardbig:425,cardfull:850};var v1,v2,v3,v4,v5;function init(){trace('init MaterioBaseTheme');checkIE();initHistoryNav();if(_isFrontHomeV2) initHomeV2();if(_isMembershipForm) initMembershipForm();initForms();if(!_isFrontHomeV2) initLayout();initInfinitScroller();initEvents();initKeyboardShortcuts();initViewmodes();if(_isBreveMateriauNodePage) $.event.trigger({type:'resultschanged',container:'#content>.inner-content'});setTimeout(function(){$.event.trigger({type:'theme-ready'});},100);};function checkIE(){if($('.oldie body').size()&&!readCookie('oldie_checked')){setTimeout(function(){createCookie('oldie_checked',1);alert('Afin de profiter pleinement des fonctionalités de materio.com, nous vous invitons a mettre a jour votre navigateur dans ça denière version. Celui ci n\'étant pas compatible avec les technologie employer par materio.com, vous risquer de rencontrer des difficulter de navigation.');},4000);}};function initHistoryNav(){trace("initHistoryNav _History",_History);var state=_History.getState();_History.Adapter.bind(window,'statechange',onHistoryStateChange);$(document).bind('new-history-page',onNewHistoryPage);};function onNewHistoryPage(event){trace('theme :: onNewHistoryPage',event);var title=event.title.replace(/<(?:.|\n)*?>/gm,'')+' | '+_strings.site_name;_statePushed=true;_History.pushState({content:event.content,pagetitle:event.title},title,event.path);};function onHistoryStateChange(event){trace('theme :: onHistoryStateChange',event);var state=_History.getState();_History.log('statechange:',state.data,state.title,state.url);$.event.trigger({type:'record-stat',path:state.url});$('input[name=location]','#feedback-form').attr('value',state.url);$.event.trigger({type:'materio-page-title-refresh-block',title:state.data.pagetitle});if(!_statePushed){_statePushed=false;$('.inner-content',_$content).html(state.data.content);$.event.trigger('history-state-change');}};function initHome(){$('img.lazy','#block-materio-didactique-materio-didactique-home').each(function(){var $img=$(this);$img.attr('src',$img.attr('data-original'));});if(_max_768()){initHomeDidactiqueMobile();}else{initHomeDidactiqueDesktop();}};function initHomeDidactiqueMobile(){_$homeBlockDidactique=$('#block-materio-didactique-materio-didactique-home');$('.node-didactique',_$homeBlockDidactique).find('.field-name-title-field').bind('click',clickOnHomeDidactiqueTitle);};function clickOnHomeDidactiqueTitle(e){var $node=$(this).parent('.node-didactique');if($node.is('.opened')){$node.removeClass('opened');}else{$('.node-didactique',_$homeBlockDidactique).removeClass('opened');$node.addClass('opened');$('html,body').animate({scrollTop:$node.offset().top-$('#header').h()});}};function initHomeDidactiqueDesktop(){_$homeUtilities=$('#utilities');_$homeBlockDidactique=$('#block-materio-didactique-materio-didactique-home').append('
').append('
').bind('mouseenter',function(event){_hoverHomeDidactique=true;}).bind('mouseleave',function(event){_hoverHomeDidactique=false;});$('.node-didactique',_$homeBlockDidactique).each(function(index){if(index){$(this).addClass('op-hidden');}else{$(this).addClass('op-visible');} $('.field-name-title-field',this).clone().addClass(index?'':'active').click(function(event){$(this).addClass('active').siblings().removeClass('active');_$homeBlockDidactique.find('.node-didactique').removeClass('op-visible').addClass('op-hidden').eq(index).removeClass('op-hidden').addClass('op-visible');}).appendTo($('.tabs',_$homeBlockDidactique));}).appendTo($('.slides',_$homeBlockDidactique));if(!_touch){$(document).bind('scroll',function(event){if($(window).scrollTop()==0){if(_$homeUtilities.is('.closed')){_$homeUtilities.removeClass('closed');launchHomeDidactiqueInterval();initLayout();}}else{if(!_$homeUtilities.is('.closed')){_$homeUtilities.addClass('closed');clearInterval(_homeTimeInterval);initLayout();}}});} $(document).bind('cbox_complete',function(){clearInterval(_homeTimeInterval);}).bind('cbox_closed',function(){launchHomeDidactiqueInterval();});$('.side.oops a').click(function(event){event.preventDefault();window.location.href=$(this).attr('href');return false;});};function launchHomeDidactiqueInterval(){_homeTimeInterval=setInterval(function(){if(!_hoverHomeDidactique){var $next=$('.tabs .active',_$homeBlockDidactique).next();if(!$next.length) -$next=$('.tabs .active',_$homeBlockDidactique).siblings().eq(0);$next.trigger('click');}},15000);};function initHomeV2(){initCards('#home-v2 .panel-pane.news-panel .panel-col-first .views-row');$('.panel-pane.showroom .group-content-wrapper','#home-v2').attr('data-400-center-top','transform:translateX(-43em);opacity:0;').attr('data-100-center-center','transform[quadratic]:translateX(0em);opacity[quadratic]:1;').attr('data-top-bottom','transform[quadratic]:translateX(10em);');$('.panel-pane.showroom .field-name-field-bandeau img','#home-v2').attr('data-400-bottom-top','transform:translateY(-20em);').attr('data-200-top-bottom','transform:translateY(5em);');$('.panel-pane.bdd .group-content-wrapper','#home-v2').attr('data-400-center-top','transform:translateX(40em);opacity:0;').attr('data-200-center-center','transform[quadratic]:translateX(0em);opacity[quadratic]:1;');$('.panel-pane.bdd .field-name-field-bandeau img','#home-v2').attr('data-400-bottom-top','transform:translateX(0em);').attr('data-100-top-bottom','transform[quadratic]:translateX(-40em);');$('.panel-pane.news-panel .center-wrapper .panel-panel','#home-v2').each(function(i,e){$(this).attr('data-anchor-target',"#news-pane").attr('data--'+(i+1)*75+'-bottom-top','transform:translateY(20em);opacity:0;').attr('data-center-top','transform[quadratic]:translateY(0em);opacity:1;');});$('.panel-pane.formations .group-content-wrapper','#home-v2').attr('data-50-bottom-top','transform:translateX(20em);opacity:0;').attr('data-center-top','transform[quadratic]:translateX(0em);opacity:1;');$('.panel-pane.services .group-content-wrapper','#home-v2').attr('data-50-bottom-top','transform:translateX(20em);opacity:0;').attr('data-center-top','transform[quadratic]:translateX(0em);opacity:1;');$('.panel-pane.publication .views-row','#home-v2').each(function(i,e){$(this).attr('data--'+i*100+'-bottom-top','opacity:0;').attr('data-'+i*50+'-center-center','opacity:1;');});_skrollr=skrollr.init({skrollrBody:"root"});};function initLayout(){trace("initLayout");var height=$('#header').h()+$('#tasks').h();height+=$('#utilities').h();if(!$('html').is(".ie8")){$('#container').animate({'padding-top':height},300);}};function initInfinitScroller(){$.event.trigger({type:'init-scroller-pager',pager:$('ul.pager','#content')});$(document).bind('scroll',function(event){checkInfinitScroller();});};function checkInfinitScroller(){if($(window).scrollTop()+$(window).height()>getDocHeight()-200){infinitScrollPager();}};function infinitScrollPager(){if($('ul.pager','#content').length){var $nextpage=$('ul.pager .pager-current','#content').next(),href=$('a',$nextpage).attr('href');if(href){$.event.trigger({type:'record-stat',path:href});$.event.trigger({type:'load-scroller-pager',href:href});}}};function initEvents(){$(document).bind('init-layout',initLayout).bind('loading-content',onLoadingContent).bind('loaded-content',onLoadedContent).bind('resultschanged',onResultsChanged).bind('resultscompleted',onResultsCompleted).bind('mybookmarks-block-updated',onMybookmarksBlockUpdate).bind('mylists-block-builded',onMyListsBlockBuilded).bind('mylists-block-updated',onMyListsBlockUpdate).bind('flagGlobalAfterLinkUpdate',onAfterFlaging).bind('record-stat',onRecordStat).bind('view-mode-changed',onViewModeChanged).bind('ajax-register-block-loaded',onAjaxRegisterBlockLoaded);$(window).bind('resize',onResizeWindow);initFlagsEvent();$('#block-user-login h2, #block-menu-menu-top-menu h2').bind('click',function(event){event.preventDefault();$(this).parent('.block').toggleClass('hovered');$('.hovered').not($(this).parent('.block')).removeClass('hovered');return false;});$('#block-materio-search-api-materio-search-api-viewmode .viewmode-link').bind('vm-clicked-active',function(event){$(this).parents('.block').toggleClass('hovered');$('.hovered').not($(this).parents('.block')).removeClass('hovered');});$('#block-materio-search-api-materio-search-api-viewmode .viewmode-link').bind('vm-clicked',function(event){$(this).parents('.block').removeClass('hovered');$('.hovered').not($(this).parents('.block')).removeClass('hovered');});};function onLoadingContent(event){_$content.addClass('faded');$('#materio-search-api-search-form').addClass('loading');};function onLoadedContent(event){_$content.removeClass('faded');$('#materio-search-api-search-form').removeClass('loading');};function onResultsChanged(event){$(document).scrollTop(0);focusCard($('#content .search-results, #content .actuality-items').children('.node:first-child'));onResultsCompleted(event);};function onResultsCompleted(event){checkInfinitScroller();if(event.container!=undefined){setTimeout(function(){initCards(event.container);setUpGrid(event.container);},100);}};function initCards(container){trace('theme :: initCards',container);var $container=$(container);$container.children('.node:not(.listened)').bind('mouseenter focused mousemove click mouseleave',onCardEventDispatcher).each(function(i){protectFigures(this);if(_isLoggedIn){if(!$container.is('.modal-content')){initPreview(this);}else{if(!$(this).is(":first-child")){var $closebtn=$('
');$closebtn.bind('click',function(){$(this).parents('.node-materiau').remove();});$('nav.nav',this).append($closebtn);}}}}).addClass('listened');};function setUpGrid(container){var $card,top,old_top,col=0,line=0;$(container).children('.node').each(function(i){$card=$(this);top=$card.offset().top;if(old_top!=top){line++;old_top=top;col=0;} +$next=$('.tabs .active',_$homeBlockDidactique).siblings().eq(0);$next.trigger('click');}},15000);};function initHomeV2(){initCards('#home-v2 .panel-pane.news-panel .panel-col-first .views-row');$('.panel-pane.showroom .group-content-wrapper','#home-v2').attr('data-400-center-top','transform:translateX(-43em);opacity:0;').attr('data-100-center-center','transform[quadratic]:translateX(0em);opacity[quadratic]:1;').attr('data-top-bottom','transform[quadratic]:translateX(10em);');$('.panel-pane.showroom .field-name-field-bandeau img','#home-v2').attr('data-400-bottom-top','transform:translateY(-20em);').attr('data-200-top-bottom','transform:translateY(5em);');$('.panel-pane.bdd .group-content-wrapper','#home-v2').attr('data-400-center-top','transform:translateX(40em);opacity:0;').attr('data-200-center-center','transform[quadratic]:translateX(0em);opacity[quadratic]:1;');$('.panel-pane.bdd .field-name-field-bandeau img','#home-v2').attr('data-400-bottom-top','transform:translateX(0em);').attr('data-100-top-bottom','transform[quadratic]:translateX(-40em);');$('.panel-pane.news-panel .center-wrapper .panel-panel','#home-v2').each(function(i,e){$(this).attr('data-anchor-target',"#news-pane").attr('data--'+(i+1)*75+'-bottom-top','transform:translateY(20em);opacity:0;').attr('data-center-top','transform[quadratic]:translateY(0em);opacity:1;');});$('.panel-pane.formations .group-content-wrapper','#home-v2').attr('data-50-bottom-top','transform:translateX(20em);opacity:0;').attr('data-center-top','transform[quadratic]:translateX(0em);opacity:1;');$('.panel-pane.services .group-content-wrapper','#home-v2').attr('data-50-bottom-top','transform:translateX(20em);opacity:0;').attr('data-center-top','transform[quadratic]:translateX(0em);opacity:1;');$('.panel-pane.publication .views-row','#home-v2').each(function(i,e){$(this).attr('data--'+i*100+'-bottom-top','opacity:0;').attr('data-'+i*50+'-center-center','opacity:1;');});_skrollr=skrollr.init({skrollrBody:"root"});};function initLayout(){trace("initLayout");var height=$('#header').h()+$('#tasks').h();height+=$('#utilities').h();if(!$('html').is(".ie8")){$('#container').animate({'padding-top':height},300);}};function initInfinitScroller(){$.event.trigger({type:'init-scroller-pager',pager:$('ul.pager','#content')});$(document).bind('scroll',function(event){checkInfinitScroller();});};function checkInfinitScroller(){if($(window).scrollTop()+$(window).height()>getDocHeight()-200){infinitScrollPager();}};function infinitScrollPager(){if($('ul.pager','#content').length){var $nextpage=$('ul.pager .pager-current','#content').next(),href=$('a',$nextpage).attr('href');if(href){$.event.trigger({type:'record-stat',path:href});$.event.trigger({type:'load-scroller-pager',href:href});}}};function initEvents(){$(document).bind('init-layout',initLayout).bind('loading-content',onLoadingContent).bind('loaded-content',onLoadedContent).bind('resultschanged',onResultsChanged).bind('resultscompleted',onResultsCompleted).bind('mybookmarks-block-updated',onMybookmarksBlockUpdate).bind('mylists-block-builded',onMyListsBlockBuilded).bind('mylists-block-updated',onMyListsBlockUpdate).bind('flagGlobalAfterLinkUpdate',onAfterFlaging).bind('record-stat',onRecordStat).bind('view-mode-changed',onViewModeChanged).bind('ajax-register-block-loaded',onAjaxRegisterBlockLoaded);$(window).bind('resize',onResizeWindow);initFlagsEvent();$('#block-user-login h2, #block-menu-menu-top-menu h2').bind('click',function(event){event.preventDefault();$(this).parent('.block').toggleClass('hovered');$('.hovered').not($(this).parent('.block')).removeClass('hovered');return false;});$('#block-materio-search-api-materio-search-api-viewmode .viewmode-link').bind('vm-clicked-active',function(event){$(this).parents('.block').toggleClass('hovered');$('.hovered').not($(this).parents('.block')).removeClass('hovered');});$('#block-materio-search-api-materio-search-api-viewmode .viewmode-link').bind('vm-clicked',function(event){$(this).parents('.block').removeClass('hovered');$('.hovered').not($(this).parents('.block')).removeClass('hovered');});};function onLoadingContent(event){_$content.addClass('faded');$('#materio-search-api-search-form').addClass('loading');};function onLoadedContent(event){_$content.removeClass('faded');$('#materio-search-api-search-form').removeClass('loading');};function onResultsChanged(event){trace('MaterioBaseTheme :: onResultsChanged',event);$(document).scrollTop(0);focusCard($('#content .search-results, #content .actuality-items').children('.node:first-child'));onResultsCompleted(event);};function onResultsCompleted(event){checkInfinitScroller();if(event.container!=undefined){setTimeout(function(){initCards(event.container);setUpGrid(event.container);},100);}};function initCards(container){trace('theme :: initCards',container);var $container=$(container);$container.children('.node:not(.listened)').bind('mouseenter focused mousemove click mouseleave',onCardEventDispatcher).each(function(i){protectFigures(this);if(_isLoggedIn){if(!$container.is('.modal-content')){initPreview(this);}else{if(!$(this).is(":first-child")){var $closebtn=$('
');$closebtn.bind('click',function(){$(this).parents('.node-materiau').remove();});$('nav.nav',this).append($closebtn);}}}}).addClass('listened');};function setUpGrid(container){var $card,top,old_top,col=0,line=0;$(container).children('.node').each(function(i){$card=$(this);top=$card.offset().top;if(old_top!=top){line++;old_top=top;col=0;} col++;$card.attr('column',col).attr('line',line);});};function onViewModeChanged(event){if(_isBreveMateriauNodePage){$.event.trigger('loading-content');var url=_settings.basePath+_settings.pathPrefix+'materio_search_api_ajax/node/'+_themeSettings.node_nid;$.getJSON(url,function(json){$.event.trigger('loaded-content');$('#content>.inner-content').html(json.node);$.event.trigger({type:'resultschanged',container:'#content>.inner-content'});});}};function onCardEventDispatcher(event){var vmode=event.currentTarget.className.match(/vm-([a-z|A-Z]+)/);var cf='on_'+event.type+'_card';var f='on_'+event.type+'_'+vmode[1];if(typeof _this[cf]=='function') _this[cf].call(this,event);if(typeof _this[f]=='function') _this[f].call(this,event);};MaterioBaseTheme.prototype.on_mousemove_card=function(event){focusCard($(this));};MaterioBaseTheme.prototype.on_mouseenter_cardsmall=function(event){showLazyLoadedImages(event.currentTarget);};MaterioBaseTheme.prototype.on_focused_cardsmall=function(event){v1=$(this);v2=v1.offset();_$tooltip.html($('.group-header',this).clone().addClass('smallcard')).css({top:v2.top,left:v2.left+5+($(this).w())}).removeClass('op-hidden').addClass('op-visible');};MaterioBaseTheme.prototype.on_mousemove_cardsmall=function(event){horiHoverImagesSwitcher(event);_$tooltip.css({top:event.pageY-_$tooltip.h()-5,left:event.pageX+5+($(this).w()-event.layerX)});};MaterioBaseTheme.prototype.on_mouseleave_cardsmall=function(event){$('.images img.op-visible',this).removeClass('op-visible').addClass('op-hidden').eq(0).removeClass('op-hidden').addClass('op-visible');if($(this).is('.focused')) diff --git a/sites/all/themes/gui/materiobasetheme/preprocess/html.pre.php b/sites/all/themes/gui/materiobasetheme/preprocess/html.pre.php index b5e6713b..0891ef18 100644 --- a/sites/all/themes/gui/materiobasetheme/preprocess/html.pre.php +++ b/sites/all/themes/gui/materiobasetheme/preprocess/html.pre.php @@ -71,8 +71,8 @@ foreach ($heads as $type=>$head) drupal_add_html_head($head, $type); +// this is not working anymore, node object don't shows up on vars $node = isset($vars['node']) ? $vars['node'] : false; - # add body classes if($node){ @@ -142,5 +142,3 @@ foreach ($vars['head_title_array'] as $key => $value){ } } $vars['head_title'] = $vars['head_array']['title'] = strip_tags(implode(' | ', $head_title_array)); - - diff --git a/sites/all/themes/gui/materiobasetheme/scss/styles.scss b/sites/all/themes/gui/materiobasetheme/scss/styles.scss index bb717e34..1b1f33ad 100644 --- a/sites/all/themes/gui/materiobasetheme/scss/styles.scss +++ b/sites/all/themes/gui/materiobasetheme/scss/styles.scss @@ -1305,11 +1305,11 @@ $cardfull_h:610px; // &:hover{nav.nav{display:block;}} div.workflow{ - position:absolute; top:0; left:0; z-index:11; + position:absolute; bottom:0; right:0; z-index:11; padding: 5px; - @include border-radius(5px, 0, 3px, 0); + @include border-radius(3px, 0, 5px, 0); @include fs11; vertical-align: top; - background-color: rgba(255, 255, 255, 0.9); color:#000; + background-color: rgba(20, 20, 20, 0.9); color:#fff; span{padding: 3px 0 0 4px; @include inlineblock();} }