mobile dev alpha, redirecting is working, started mobile display
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
name: 'edlp_mobile'
|
||||
type: module
|
||||
description: 'Handle some mobile behaviours'
|
||||
core: 8.x
|
||||
package: 'Edlp'
|
||||
dependencies:
|
||||
- domain
|
||||
@@ -0,0 +1,150 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Contains edlp_mobile.module.
|
||||
*/
|
||||
|
||||
use Drupal\Core\Routing\RouteMatchInterface;
|
||||
// use Drupal\domain\DomainStorage;
|
||||
// use Drupal\domain\DomainElementManager;
|
||||
|
||||
/**
|
||||
* Implements hook_help().
|
||||
*/
|
||||
function edlp_mobile_help($route_name, RouteMatchInterface $route_match) {
|
||||
switch ($route_name) {
|
||||
// Main module help for the edlp_mobile module.
|
||||
case 'help.page.edlp_mobile':
|
||||
$output = '';
|
||||
$output .= '<h3>' . t('About') . '</h3>';
|
||||
$output .= '<p>' . t('Handle some mobile behaviours') . '</p>';
|
||||
return $output;
|
||||
|
||||
default:
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* hook_entity_extra_field_info()
|
||||
*/
|
||||
// function edlp_mobile_entity_extra_field_info(){
|
||||
// $extra = [];
|
||||
// $extra['domain']['relations'] = [
|
||||
// 'label' => t('Relations'),
|
||||
// 'description' => 'Display enregistrement relations with other content types',
|
||||
// 'weight' => 99,
|
||||
// ];
|
||||
// return $extra;
|
||||
// }
|
||||
|
||||
// should be the right way
|
||||
// function edlp_mobile_entity_field_storage_info(\Drupal\Core\Entity\EntityTypeInterface $entity_type) {
|
||||
// if ($entity_type->id() == 'domain') {
|
||||
// $definitions['device'] = \Drupal\Core\Field\BaseFieldDefinition::create('string')
|
||||
// ->setName('Device')
|
||||
// ->setLabel(t('Define a target device for this domain (mobile|desktop)'))
|
||||
// ->setTargetEntityTypeId($entity_type->id());
|
||||
// return $definitions;
|
||||
// }
|
||||
// }
|
||||
|
||||
/**
|
||||
* Implements hook_page_attachments().
|
||||
* @param array $attachments
|
||||
*/
|
||||
function edlp_mobile_page_attachments(array &$attachments) {
|
||||
$is_mobile_domain = false;
|
||||
|
||||
global $base_root;
|
||||
//dpm($base_root, '$base_root');
|
||||
|
||||
$current_domain = preg_replace('/http:\/\/|https:\/\//i', '', $base_root);
|
||||
//dpm($current_domain, '$current_domain');
|
||||
|
||||
$domain_storage = \Drupal::entityTypeManager()->getStorage('domain');
|
||||
$domains = $domain_storage->loadMultiple();
|
||||
//dpm($domains);
|
||||
$domain_alias_storage = \Drupal::entityTypeManager()->getStorage('domain_alias');
|
||||
//dpm($domain_alias_storage);
|
||||
|
||||
foreach ($domains as $domain_id => $domain) {
|
||||
if($domain->isActive()){
|
||||
//dpm($domain);
|
||||
|
||||
$alias_ids = $domain_alias_storage->getQuery()->condition('domain_id', $domain_id)->execute();
|
||||
//dpm($alias_ids, 'alias_ids');
|
||||
|
||||
$aliases = $domain_alias_storage->loadMultiple($alias_ids);
|
||||
// dpm($aliases, 'aliases');
|
||||
|
||||
foreach ($aliases as $alias_id => $alias) {
|
||||
if($alias->getPattern() == $current_domain){
|
||||
// we found the current domain and current alias
|
||||
dpm($domain, 'domain');
|
||||
dpm($alias, 'alias');
|
||||
$env = $alias->getEnvironment();
|
||||
$env_aliases = $domain_alias_storage->loadByEnvironment($env);
|
||||
dpm($env_aliases, '$env_aliases');
|
||||
// find out mibile alias and desktop alias
|
||||
// this is dirty
|
||||
// TODO: set target device as domain setting
|
||||
if ($domain->id() == 'm_encyclopediedelaparole_org'){
|
||||
// current domain/alias is mobile
|
||||
$is_mobile_domain = true;
|
||||
$mobile_url = $alias->getPattern();
|
||||
// find desktop pattern
|
||||
foreach ($env_aliases as $env_alias_id => $env_alias) {
|
||||
if($env_alias_id != $alias_id){
|
||||
// we found the desktop pattern
|
||||
$desktop_url = $env_alias->getPattern();
|
||||
}
|
||||
}
|
||||
}else{
|
||||
// current domain/alias is mobile
|
||||
$is_mobile_domain = false;
|
||||
$desktop_url = $alias->getPattern();
|
||||
// find desktop pattern
|
||||
foreach ($env_aliases as $env_alias_id => $env_alias) {
|
||||
if($env_alias_id != $alias_id){
|
||||
// we found the desktop pattern
|
||||
$mobile_url = $env_alias->getPattern();
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// $mobile =
|
||||
$current_path = \Drupal::service('path.current')->getPath();
|
||||
$is_front = \Drupal::service('path.matcher')->isFrontPage();
|
||||
$current_language = \Drupal::languageManager()->getCurrentLanguage()->getId();
|
||||
|
||||
// $redirect = false;
|
||||
$js_str = "var edlp_mobile = {\n
|
||||
current_url:'".$base_root."',\n
|
||||
current_path:'".$current_path."',\n
|
||||
is_front:".($is_front ? 'true':'false').",\n
|
||||
lang_code:'".$current_language."',\n
|
||||
is_mobile_domain:".($is_mobile_domain ? 'true':'false').",\n
|
||||
mobile_url:'".$mobile_url."',\n
|
||||
desktop_url:'".$desktop_url."',\n
|
||||
};";
|
||||
|
||||
$attachments['#attached']['html_head'][] = [
|
||||
[
|
||||
'#type' => 'html_tag',
|
||||
'#tag' => 'script',
|
||||
'#value' => $js_str,
|
||||
'#weight' => -1000,
|
||||
'#group' => 'edlp'
|
||||
],
|
||||
// A key, to make it possible to recognize this HTML element when altering.
|
||||
'edlp_mobile',
|
||||
];
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
|
||||
void 0;if(edlp.redirect){void 0;void 0;edlp.sys_path=edlp.sys_path.replace(/^\//,'');edlp.url=window.location.pathname;edlp.hash=window.location.hash;window.localStorage.setItem('edlp_origin',JSON.stringify(edlp));window.location.replace(window.location.origin+'/'+edlp.lang_code);}else{void 0;}
|
||||
@@ -1,7 +1,7 @@
|
||||
|
||||
(function($,Drupal,drupalSettings){EdlpTheme=function(){var _ajax_settings=drupalSettings.edlp_ajax;var _$body=$('body');var _corpus_ready=false;var _$corpus_canvas;var _$row=$('main[role="main"]>.layout-content>.row');var _$ajaxLinks;var _audioPlayer;var _randomPlayer;var _compoPlayer;var _ajax_timing={start:0,end:0};var _corpus_promise;function init(){void 0;if(!drupalSettings.path.isFront)
|
||||
return;initEvents();_audioPlayer=new AudioPlayer();_compoPlayer=new CompoPlayer();checkLayout();initAjaxLinks();initHistory();};function initEvents(){var $corpus_df=$.Deferred();_corpus_promise=$corpus_df.promise();_$body.on('corpus-map-ready',function(e){onCorpusMapReady(e);$corpus_df.resolve();}).on('on-studio-chutier-updated',initAjaxLinks).on('studio-initialized',function(e){_compoPlayer.newCompo();}).on('studio-not-active',function(e){_compoPlayer.deactivate();}).on('on-studio-compo-updated',function(e){initAjaxLinks();_compoPlayer.refresh();}).on('on-studio-compo-opened',function(e){initAjaxLinks();_compoPlayer.newCompo();}).on('search-results-loaded',initAjaxLinks).on('open_entree',function(e){void 0;closeAllModals();checkLayout();_$body.removeClass();if(typeof e.url!='undefined'){var state=getSysPathState(e.sys_path);history.pushState(state,null,e.url);if(typeof _paq!=='undefined'){_paq.push(['setCustomUrl',e.url]);_paq.push(['setDocumentTitle',e.title]);_paq.push(['trackPageView']);}}}).on('close_entree',function(e){backToFrontPage();checkLayout();});window.addEventListener('resize',checkLayout,false);}
|
||||
function checkLayout(){var $audioplayer=$("#audio-player");if($audioplayer.length){var navpos=$('#block-mainnavigation').position();void 0;$audioplayer.css({'width':navpos.left+'px'});}};function initScrollbars(){};function getSysPathState(sys_path,view_mode){var state={'sys_path':sys_path,'ajax_path':sys_path};var node_match=state.ajax_path.match(/^\/?(node\/(\d+))$/i);void 0;var term_match=state.ajax_path.match(/^\/?(taxonomy\/term\/(\d+))$/i);void 0;if(node_match){state.ajax_path=_ajax_settings.entityjson_path+'/'+node_match[1];state.node_nid=node_match[2];if(view_mode){state.ajax_path+='/'+view_mode;state.view_mode=view_mode;}}else if(term_match){state.ajax_path=_ajax_settings.entityjson_path+'/'+term_match[1];state.ajax_path=state.ajax_path.replace(/taxonomy\/term/,'taxonomy_term');state.entree_tid=term_match[2];if(view_mode){state.ajax_path+='/'+view_mode;state.view_mode=view_mode;}else{state.ajax_path=null;}}else{state.ajax_path+='/ajax'}
|
||||
function checkLayout(){var $audioplayer=$("#audio-player");if($audioplayer.length){var navpos=$('#block-mainnavigation').position();void 0;if(typeof navpos!='undefined'){$audioplayer.css({'width':navpos.left+'px'});}}};function initScrollbars(){};function getSysPathState(sys_path,view_mode){var state={'sys_path':sys_path,'ajax_path':sys_path};var node_match=state.ajax_path.match(/^\/?(node\/(\d+))$/i);void 0;var term_match=state.ajax_path.match(/^\/?(taxonomy\/term\/(\d+))$/i);void 0;if(node_match){state.ajax_path=_ajax_settings.entityjson_path+'/'+node_match[1];state.node_nid=node_match[2];if(view_mode){state.ajax_path+='/'+view_mode;state.view_mode=view_mode;}}else if(term_match){state.ajax_path=_ajax_settings.entityjson_path+'/'+term_match[1];state.ajax_path=state.ajax_path.replace(/taxonomy\/term/,'taxonomy_term');state.entree_tid=term_match[2];if(view_mode){state.ajax_path+='/'+view_mode;state.view_mode=view_mode;}else{state.ajax_path=null;}}else{state.ajax_path+='/ajax'}
|
||||
return state;};function ajaxLoadContent(state){void 0;_$body.addClass('ajax-loading');_ajax_timing.start=performance.now();var path=window.location.origin+Drupal.url(state.ajax_path);$.getJSON(path,{}).done(function(data){onAjaxLoaded(data,state);}).fail(function(jqxhr,textStatus,error){onAjaxLoadError(jqxhr,textStatus,error,state.sys_path);});};function onAjaxLoadError(jqxhr,textStatus,error,sys_path){void 0;$('.ajax-loading').removeClass('ajax-loading');_$body.removeClass('ajax-loading');};function onAjaxLoaded(data,state){void 0;if(data.entity_type=="node"&&data.bundle=="evenement"){if(_$row.find('.col.event').length){_$row.find('.col.event').replaceWith(data.rendered);}else if(_$row.find('.col.aside').length){_$row.find('.col.aside').replaceWith(data.rendered);}else{_$row.append(data.rendered);}}else{_$row.removeAttr('style').html(data.rendered);}
|
||||
var body_classes=['path-'+state.sys_path.replace(/\//g,'-'),'entity-type-'+data.entity_type,'bundle-'+data.bundle,'view-mode-'+data.view_mode];_$body.removeClass().addClass(body_classes.join(' '));if(state.node_nid)
|
||||
_$body.addClass('path-edlp-node');$('.ajax-loading').removeClass('ajax-loading');$('.ajax-link.is-active').removeClass('is-active');$('.is-active-trail').removeClass('is-active-trail');if(typeof state.selector!='undefined'){void 0;$('a[selector="'+state.selector+'"]').addClass('is-active');initAudioLinksInContent();}else{if(typeof state.view_mode!='undefined'){$('a[viewmode="'+state.view_mode+'"][data-drupal-link-system-path="'+state.sys_path+'"]').addClass('is-active');}else{$('a[data-drupal-link-system-path="'+state.sys_path+'"]').addClass('is-active');}
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
|
||||
void 0;function checkMobile(){var user_agent=navigator.userAgent||navigator.vendor||window.opera;return/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge|maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm(os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(user_agent)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(user_agent.substr(0,4));}
|
||||
if(typeof edlp_mobile!="undefined"){void 0;void 0;var device_redirect=false;var device_is_mobile=checkMobile();void 0;void 0;switch(true){case(device_is_mobile&&!edlp_mobile.is_mobile_domain):void 0;device_redirect=true;window.location.replace(window.location.protocol+'//'+edlp_mobile.mobile_url);break;case(edlp_mobile.is_mobile_domain&&!device_is_mobile):void 0;device_redirect=true;window.location.replace(window.location.protocol+'//'+edlp_mobile.desktop_url);break;default:void 0;break;}}
|
||||
if(edlp.redirect&&!device_redirect){void 0;void 0;edlp.sys_path=edlp.sys_path.replace(/^\//,'');edlp.url=window.location.pathname;edlp.hash=window.location.hash;window.localStorage.setItem('edlp_origin',JSON.stringify(edlp));window.location.replace(window.location.origin+'/'+edlp.lang_code);}else{void 0;}
|
||||
@@ -1,20 +0,0 @@
|
||||
console.log('EDLP THEME HISTORY.js');
|
||||
// var edlp is provided by edlp_ajax.module file
|
||||
if(edlp.redirect){
|
||||
console.log('history redirect', edlp);
|
||||
console.log('window.location', window.location);
|
||||
// window.localStorage.setItem('edlp_origin_path', edlp.sys_path.replace(/^\//, ''));
|
||||
edlp.sys_path = edlp.sys_path.replace(/^\//, '');
|
||||
|
||||
// window.localStorage.setItem('edlp_origin_url', window.location.pathname);
|
||||
edlp.url = window.location.pathname;
|
||||
|
||||
// window.localStorage.setItem('edlp_origin_hash', window.location.hash);
|
||||
edlp.hash = window.location.hash;
|
||||
|
||||
window.localStorage.setItem('edlp_origin', JSON.stringify(edlp));
|
||||
// redirect to home
|
||||
window.location.replace(window.location.origin+'/'+edlp.lang_code);
|
||||
}else{
|
||||
console.log('history do not redirect');
|
||||
}
|
||||
@@ -121,9 +121,11 @@
|
||||
if($audioplayer.length){
|
||||
var navpos = $('#block-mainnavigation').position();
|
||||
console.log('navpos', navpos);
|
||||
$audioplayer.css({
|
||||
'width':navpos.left+'px'
|
||||
});
|
||||
if(typeof navpos != 'undefined'){
|
||||
$audioplayer.css({
|
||||
'width':navpos.left+'px'
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// entrees
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
console.log('EDLP THEME redirect.js');
|
||||
|
||||
function checkMobile(){
|
||||
var user_agent = navigator.userAgent||navigator.vendor||window.opera;
|
||||
return /(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(user_agent) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(user_agent.substr(0,4));
|
||||
}
|
||||
|
||||
// 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);
|
||||
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);
|
||||
switch(true){
|
||||
case (device_is_mobile && !edlp_mobile.is_mobile_domain):
|
||||
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);
|
||||
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');
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// var edlp is provided by edlp_ajax.module file
|
||||
if(edlp.redirect && !device_redirect){
|
||||
console.log('redirect', edlp);
|
||||
console.log('window.location', window.location);
|
||||
// window.localStorage.setItem('edlp_origin_path', edlp.sys_path.replace(/^\//, ''));
|
||||
edlp.sys_path = edlp.sys_path.replace(/^\//, '');
|
||||
|
||||
// window.localStorage.setItem('edlp_origin_url', window.location.pathname);
|
||||
edlp.url = window.location.pathname;
|
||||
|
||||
// window.localStorage.setItem('edlp_origin_hash', window.location.hash);
|
||||
edlp.hash = window.location.hash;
|
||||
|
||||
window.localStorage.setItem('edlp_origin', JSON.stringify(edlp));
|
||||
// redirect to home
|
||||
window.location.replace(window.location.origin+'/'+edlp.lang_code);
|
||||
}else{
|
||||
console.log('history do not redirect');
|
||||
}
|
||||
@@ -5,7 +5,7 @@ base theme: classy
|
||||
core: 8.x
|
||||
libraries:
|
||||
- core/normalize
|
||||
- edlptheme/history-js
|
||||
- edlptheme/redirect-js
|
||||
- edlptheme/global-css
|
||||
- edlptheme/global-js
|
||||
|
||||
|
||||
@@ -4,11 +4,11 @@ global-css:
|
||||
theme:
|
||||
assets/dist/styles/app.min.css: {}
|
||||
|
||||
history-js:
|
||||
redirect-js:
|
||||
version: VERSION
|
||||
header: true
|
||||
js:
|
||||
assets/dist/scripts/history.min.js: { weight:-998, preprocess: false, minified: true }
|
||||
assets/dist/scripts/redirect.min.js: { weight:-998, preprocess: false, minified: true }
|
||||
|
||||
global-js:
|
||||
version: VERSION
|
||||
|
||||
@@ -29,7 +29,7 @@ function handleError(err) {
|
||||
}
|
||||
|
||||
gulp.task('scripts', function () {
|
||||
gulp.src(['./assets/scripts/main.js', './assets/scripts/history.js']) // './assets/scripts/shared_variables.js',
|
||||
gulp.src(['./assets/scripts/main.js', './assets/scripts/redirect.js']) // './assets/scripts/shared_variables.js',
|
||||
// .pipe(concat('main.js'))
|
||||
.pipe(gulpif(prod, stripDebug()))
|
||||
.pipe(gulpif(prod, jsmin()))
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
<div class="grid">
|
||||
|
||||
{% for node in nodes %}
|
||||
<div class="col col-{{ node.cols }}">
|
||||
<div class="col small-col-12 med-col-4 large-col-{{ node.cols }}">
|
||||
<div class="wrapper">
|
||||
{{ node.build }}
|
||||
</div>
|
||||
@@ -26,7 +26,7 @@
|
||||
{% endfor %}
|
||||
|
||||
|
||||
<div class="agenda col col-3">
|
||||
<div class="agenda col small-col-12 med-col-4 large-col-3">
|
||||
<div class="wrapper">
|
||||
{{ agenda }}
|
||||
</div>
|
||||
|
||||
@@ -2,7 +2,7 @@ position: tr
|
||||
vertical: 70
|
||||
horizontal: 10
|
||||
fixed: 1
|
||||
width: 400px
|
||||
width: 600px
|
||||
autoclose: 7
|
||||
opendelay: 0.3
|
||||
disable_autoclose: 1
|
||||
@@ -15,8 +15,8 @@ popout:
|
||||
effect: fadeIn
|
||||
duration: fast
|
||||
jquery_ui:
|
||||
draggable: 0
|
||||
resizable: 0
|
||||
draggable: 1
|
||||
resizable: 1
|
||||
visibility:
|
||||
message_type:
|
||||
id: message_type
|
||||
|
||||
@@ -25,7 +25,8 @@ visibility:
|
||||
domains:
|
||||
encyclopediedelaparole_org: encyclopediedelaparole_org
|
||||
negate: false
|
||||
context_mapping: { }
|
||||
context_mapping:
|
||||
'entity:domain': '@domain.current_domain_context:entity:domain'
|
||||
request_path:
|
||||
id: request_path
|
||||
pages: '<front>'
|
||||
|
||||
@@ -45,6 +45,7 @@ content:
|
||||
link: false
|
||||
third_party_settings: { }
|
||||
hidden:
|
||||
addtoany: true
|
||||
body: true
|
||||
chutier_actions: true
|
||||
field_collectionneurs: true
|
||||
|
||||
@@ -39,6 +39,7 @@ module:
|
||||
edlp_fils: 0
|
||||
edlp_home: 0
|
||||
edlp_migrate: 0
|
||||
edlp_mobile: 0
|
||||
edlp_productions: 0
|
||||
edlp_search: 0
|
||||
edlp_studio: 0
|
||||
|
||||
Reference in New Issue
Block a user