Compare commits
12
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
67ce55c047 | ||
|
|
ab9c1dcd4d | ||
|
|
f7225cdd01 | ||
|
|
65d95036c0 | ||
|
|
1904ab1352 | ||
|
|
77065246fc | ||
|
|
b6168089a7 | ||
|
|
249bc608b3 | ||
|
|
9c61825a17 | ||
|
|
f7c8728f20 | ||
|
|
7356c6cec6 | ||
|
|
7d11684731 |
@@ -79,7 +79,8 @@ class AgendaController extends ControllerBase {
|
||||
});
|
||||
|
||||
$data = [
|
||||
'rendered'=> $rendered
|
||||
'rendered'=> $rendered,
|
||||
'title'=>'Agenda',
|
||||
];
|
||||
|
||||
// translations links
|
||||
|
||||
@@ -25,12 +25,15 @@ class EdlpAjaxController extends ControllerBase {
|
||||
switch($this->entity_type){
|
||||
case 'node':
|
||||
$this->bundle = $this->entity->getType();
|
||||
$this->title = $this->entity->getTitle();
|
||||
break;
|
||||
case 'taxonomy_term':
|
||||
$this->bundle = $this->entity->bundle();
|
||||
$this->title = $this->entity->getName();
|
||||
break;
|
||||
default:
|
||||
$this->bundle = NULL;
|
||||
$this->title = '';
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -160,10 +163,13 @@ class EdlpAjaxController extends ControllerBase {
|
||||
return render($renderable);
|
||||
});
|
||||
|
||||
$title = $this->title;
|
||||
$title .= $this->viewmode != '' && $this->viewmode != 'default' ? ' | ' . $this->viewmode : '';
|
||||
|
||||
$data = [
|
||||
'date' => time(),
|
||||
'id' => $this->id,
|
||||
'title' => $title,
|
||||
'view_mode' => $this->viewmode,
|
||||
'bundle' => $this->bundle,
|
||||
'entity_type' => $this->entity_type,
|
||||
|
||||
@@ -25,16 +25,16 @@ newVelY1=(ma-mb)/(ma+mb)*na.p.velocity.y+2*mb/(ma+mb)*nb.p.velocity.y;newVelY2=(
|
||||
newVelX1=(ma-mb)/(ma+mb)*na.p.velocity.x+2*mb/(ma+mb)*nb.p.velocity.x;newVelX2=(mb-ma)/(mb+ma)*nb.p.velocity.x+2*ma/(mb+ma)*na.p.velocity.x;na.p.velocity.x=newVelX1;nb.p.velocity.x=newVelX2;}
|
||||
na.p.velocity.multiplyScalar(0.90);nb.p.velocity.multiplyScalar(0.90);}}};function openNodeByNid(nid){closeNode();if(typeof _nodes_Nid_Id[nid]!='undefined'){_node_opened_id=_nodes_Nid_Id[nid];_nodes[_nodes_Nid_Id[nid]].open();}}
|
||||
function closeNode(){if(_node_opened_id!=-1){_nodes[_node_opened_id].close();_node_opened_id=-1;}}
|
||||
function createNodesRepulsions(){purgeNodesRepulsions();for(var n=0;n<_nodes_centered.length;n++){for(var q=n+1;q<_nodes_centered.length;q++){_physics.makeAttraction(_nodes_centered[n].p,_nodes_centered[q].p,-0.4,10);}}};function purgeNodesRepulsions(){for(var a=_physics.attractions.length-1;a>=0;a--){if(Math.abs(_physics.attractions[a].constant)<1){_physics.attractions.splice(a,1);}else{break;}}};function updateRandomPlaylist(p){_$canvas.trigger({type:'update-random-playlist',playlist:p})};function toggleEntree(tid,bubbling){var $link=_$entrees_block_termlinks.filter('[tid="'+tid+'"]');var $li=$link.parents('li');var sys_path=$link.attr('data-drupal-link-system-path');var url=$link.attr('href');if(!$li.is('.opened')){_$entrees_block_termlinks.parents('li').removeClass('opened');$li.addClass('opened');$li.parents('.item-list').addClass('opened')
|
||||
filterEntree(tid);if(bubbling){_$body.trigger({'type':'open_entree','tid':tid,'url':url,'sys_path':sys_path});}}else if(bubbling){$li.removeClass('opened');$li.parents('.item-list').removeClass('opened')
|
||||
function createNodesRepulsions(){purgeNodesRepulsions();for(var n=0;n<_nodes_centered.length;n++){for(var q=n+1;q<_nodes_centered.length;q++){_physics.makeAttraction(_nodes_centered[n].p,_nodes_centered[q].p,-0.4,10);}}};function purgeNodesRepulsions(){for(var a=_physics.attractions.length-1;a>=0;a--){if(Math.abs(_physics.attractions[a].constant)<1){_physics.attractions.splice(a,1);}else{break;}}};function updateRandomPlaylist(p){_$canvas.trigger({type:'update-random-playlist',playlist:p})};function toggleEntree(tid,bubbling){var $link=_$entrees_block_termlinks.filter('[tid="'+tid+'"]');var $li=$link.parents('li');var sys_path=$link.attr('data-drupal-link-system-path');var url=$link.attr('href');var title=$link.text();if(!$li.is('.opened')){_$entrees_block_termlinks.parents('li').removeClass('opened');$li.addClass('opened');$li.parents('.item-list').addClass('opened')
|
||||
filterEntree(tid);if(bubbling){_$body.trigger({'type':'open_entree','tid':tid,'url':url,'sys_path':sys_path,'title':title});}}else if(bubbling){$li.removeClass('opened');$li.parents('.item-list').removeClass('opened')
|
||||
scrambleCollection();_$body.trigger({'type':'close_entree','tid':tid});}};function filterEntree(t){shutDownArticles();_nodes_centered=[];for(var n=0;n<_nodes.length;n++){if(_nodes[n].entrees.indexOf(t)==-1){_nodes[n].setAside();}else{_nodes[n].setCenteredOnEntree(t);_nodes_centered.push(_nodes[n]);}}
|
||||
updateRandomPlaylist(_nodes_centered);createNodesRepulsions();};function highlightEntries(){_$entrees_block_termlinks.parents('li').removeClass('highlighted').parents('.item-list').removeClass('highlighted');var id=-1;if(_node_hover_id!=-1){id=_node_hover_id;}else if(_node_opened_id!=-1){id=_node_opened_id;}
|
||||
var entree;if(id!=-1){for(var i=0;i<_nodes[id].entrees.length;i++){entree=_nodes[id].entrees[i];_$entrees_block_termlinks.filter(function(){return $(this).attr('tid')==entree;}).parents('li').addClass('highlighted').parents('.item-list').addClass('highlighted');}}};function filterSearchResults(nids){shutDownArticles();_nodes_centered=[];for(var n=0;n<_nodes.length;n++){if(nids.indexOf(_nodes[n].nid)==-1){_nodes[n].setAside();}else{_nodes[n].setCentered();_nodes_centered.push(_nodes[n]);}}
|
||||
updateRandomPlaylist(_nodes_centered);createNodesRepulsions();};function scrambleCollection(){for(var i=0;i<_nodes.length;i++){_nodes[i].scramble();}
|
||||
updateRandomPlaylist(_playlist);};function closeAllEntries(){_$entrees_block_termlinks.each(function(index,el){if($(this).parents('li').is('.opened')){$(this).trigger('click');return false;}});};function initArtilesLink(){_$articles_link=$('<a>').html('Articles').attr("href","#articles").addClass('articles-link').on('click',onCLickedOnArticles);$('.item-list ul',_$entrees_block).append($('<li>').append($('<span class="oblique-wrapper">').append(_$articles_link)));};function onCLickedOnArticles(e){e.preventDefault();$(this).toggleClass('is-active');if($(this).is('.is-active')){activateArticlesFilter();closeAllEntries();}else{deactivateArticlesFilter();}
|
||||
return false;};function activateArticlesFilter(){_articles_filter_on=true;for(var i=0;i<_no_articles_nodes.length;i++){_no_articles_nodes[i].fade();}
|
||||
updateRandomPlaylist(_articles_nodes);};function deactivateArticlesFilter(){_articles_filter_on=false;for(var i=0;i<_no_articles_nodes.length;i++){_no_articles_nodes[i].unFade();}
|
||||
updateRandomPlaylist(_playlist);};function shutDownArticles(){if(_$articles_link.is('.is-active'))
|
||||
updateRandomPlaylist(_articles_nodes);if(typeof _paq!=='undefined'){_paq.push(['trackEvent','Corpus Articles','on']);}};function deactivateArticlesFilter(){_articles_filter_on=false;for(var i=0;i<_no_articles_nodes.length;i++){_no_articles_nodes[i].unFade();}
|
||||
updateRandomPlaylist(_playlist);if(typeof _paq!=='undefined'){_paq.push(['trackEvent','Corpus Articles','off']);}};function shutDownArticles(){if(_$articles_link.is('.is-active'))
|
||||
_$articles_link.trigger('click');};function initEvents(){void 0;_$canvas.on('mousemove',function(event){event.preventDefault();_m_pos.x=event.originalEvent.clientX;_m_pos.y=event.originalEvent.clientY;}).on('mouseenter',function(event){_mouse_in=true;}).on('mouseout',function(event){_mouse_in=false;_node_pop_up.removeNode();}).on('click',function(event){if(event.target.tagName!="A"&&event.target.tagName!="INPUT"){event.preventDefault();if(_node_hover_id!=-1){var event={'type':'corpus-cliked-on-node','target_node':_nodes[_node_hover_id],'article':_articles_filter_on};_$canvas.trigger(event);}else{_$canvas.trigger('corpus-cliked-on-map');shutDownArticles();}}}).on('mouseover-audio-link',function(e){void 0;_nodes_by_nid[e.nid].setHover();}).on('mouseout-audio-link',function(e){void 0;_nodes_by_nid[e.nid].unsetHover();}).on('audio-node-opened',function(e){openNodeByNid(e.nid);}).on('audio-node-closed',function(e){closeNode();}).on('open-entree',function(e){toggleEntree(e.tid);}).on('close-all-entree',function(e){closeAllEntries();});_$entrees_block_termlinks.on('click',function(event){event.preventDefault();toggleEntree($(this).attr('tid'),true);return false;});_$body.on('chutier-action-done',function(e){_nodes_by_nid[e.target_id].chutier_action=e.new_action;}).on('search-results-loaded',function(e){filterSearchResults(e.results);}).on('search-closed',function(e){scrambleCollection();}).on('new-content-not-entree-ajax-loaded',function(e){if(_$entrees_block_termlinks.parents('li.opened').length){_$entrees_block_termlinks.parents('li').removeClass('opened').parents('.item-list').removeClass('opened');scrambleCollection();}});};function checkPreOpenedEntry(){_$entrees_block.find('li.entree').each(function(index,el){var $li=$(this);if($('a.is-active',$li).length){$li.addClass('opened').parents('.item-list').addClass('opened');filterEntree($li.attr('tid'));return false;}});};function initNodePopup(){_node_pop_up=new NodePopUp();};function NodePopUp(){this.visible=false;this.node;this.$dom=$('<div>').addClass('node-popup').attr('pos','top-right').appendTo('body');this.$content=$('<div>').addClass('inner').appendTo(this.$dom);if(typeof NodePopUp.initialized=="undefined"){NodePopUp.prototype.setNode=function(n){this.node=n;this.setPositioning();this.setContent();};NodePopUp.prototype.setPositioning=function(){switch(true){case this.node.x>this.node.wall_limits.right-350&&this.node.y<this.node.wall_limits.top+200:this.$dom.attr('pos','bottom-left');break;case this.node.x>this.node.wall_limits.right-350:this.$dom.attr('pos','top-left');break;case this.node.y<this.node.wall_limits.top+200:this.$dom.attr('pos','bottom-right');break;default:this.$dom.attr('pos','top-right');}};NodePopUp.prototype.setContent=function(){this.$content.html('');var $entrees=$('<div>').addClass('entrees');for(var i=0;i<this.node.entrees.length;i++){var tid=this.node.entrees[i];$entrees.append($('<span>').addClass('entree').attr('tid',tid));}
|
||||
var $chutier_action=$('<span>').addClass('chutier-icon').attr('action',this.node.chutier_action);this.$content.append($entrees).append('<h2 class="title">'+this.node.title+'</h2>').append('<section class="description">'+this.node.description+'</section>').append($chutier_action);};NodePopUp.prototype.removeNode=function(){this.node=false;};NodePopUp.prototype.draw=function(){if(this.node){this.$dom.css({'display':"block",'left':this.node.x+"px",'top':this.node.y+"px",});}else{this.$dom.css({'display':"none",});}};NodePopUp.initialized=true;}}
|
||||
function render(){_ctx.clearRect(0,0,_canvas.width,_canvas.height);checkParticulesCollisions();for(var i=0;i<_nodes.length;i++){_nodes[i].onUpdate();}
|
||||
|
||||
@@ -662,13 +662,20 @@
|
||||
var $li = $link.parents('li');
|
||||
var sys_path = $link.attr('data-drupal-link-system-path');
|
||||
var url = $link.attr('href');
|
||||
var title = $link.text();
|
||||
if(!$li.is('.opened')){
|
||||
_$entrees_block_termlinks.parents('li').removeClass('opened');
|
||||
$li.addClass('opened');
|
||||
$li.parents('.item-list').addClass('opened')
|
||||
filterEntree(tid);
|
||||
if(bubbling){
|
||||
_$body.trigger({'type':'open_entree', 'tid':tid, 'url':url, 'sys_path':sys_path});
|
||||
_$body.trigger({
|
||||
'type':'open_entree',
|
||||
'tid':tid,
|
||||
'url':url,
|
||||
'sys_path':sys_path,
|
||||
'title':title
|
||||
});
|
||||
}
|
||||
// bubbling is true only when event is a real click on entree link
|
||||
}else if(bubbling){
|
||||
@@ -800,6 +807,10 @@
|
||||
_no_articles_nodes[i].fade();
|
||||
}
|
||||
updateRandomPlaylist(_articles_nodes);
|
||||
if(typeof _paq !== 'undefined'){
|
||||
// trackEvent(category, action, [name], [value])
|
||||
_paq.push(['trackEvent', 'Corpus Articles', 'on']);
|
||||
}
|
||||
};
|
||||
function deactivateArticlesFilter(){
|
||||
//console.log('deactivateArticlesFilter');
|
||||
@@ -808,6 +819,10 @@
|
||||
_no_articles_nodes[i].unFade();
|
||||
}
|
||||
updateRandomPlaylist(_playlist);
|
||||
if(typeof _paq !== 'undefined'){
|
||||
// trackEvent(category, action, [name], [value])
|
||||
_paq.push(['trackEvent', 'Corpus Articles', 'off']);
|
||||
}
|
||||
};
|
||||
function shutDownArticles(){
|
||||
// shutdown articles if active
|
||||
|
||||
@@ -102,6 +102,7 @@ class ProductionsController extends ControllerBase {
|
||||
|
||||
$data = [
|
||||
'rendered'=> $rendered,
|
||||
'title'=> 'Productions',
|
||||
// 'block' => array(
|
||||
// 'rendered'=> \Drupal::service('renderer')->renderRoot($block_render),
|
||||
// 'region'=> str_replace('_', '-', $block->getRegion()),
|
||||
@@ -120,7 +121,7 @@ class ProductionsController extends ControllerBase {
|
||||
'#set_active_class' => TRUE,
|
||||
];
|
||||
$translations_rendered = \Drupal::service('renderer')->executeInRenderContext(new RenderContext(), function () use ($translations_build) {return render($translations_build);});
|
||||
|
||||
|
||||
$data ['translations_links'] = $translations_rendered;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
|
||||
(function($,Drupal,drupalSettings){var settings=drupalSettings.edlp_search;var _$body=$('body');var _$container;var _$form;function init(){initEvents();initAjax();};function initEvents(){$('body').on('new-content-ajax-loaded',initAjax).on('edlp_search_search_form-col-closed',onSearchClosed);};function initAjax(){_$form=$('#edlp-search-form:not(.ajax-enabled)');if(!_$form.length)return false;_$form=$('#edlp-search-form:not(.ajax-enabled)').on('submit',onSubmitForm).addClass('ajax-enabled');_$container=_$form.parents('.row');if(!_$container.length){_$container=_$form.parent();}};function onSubmitForm(e){e.preventDefault();var args={};args.keys=$('input[type="search"]',this).val();args.entries=[];$('input[type="checkbox"]:checked','#edit-entries').each(function(index,el){args.entries.push($(this).val());});args.langues=$('input[name="language"]',this).val();args.genres=$('input[name="genres"]',this).val();loadResults(args);return false;};function loadResults(args){_$form.addClass('ajax-loading');_$body.addClass('ajax-loading');$('[theme="edlp_search_results"]',_$container).addClass('ajax-loading');var path=window.location.origin+drupalSettings.path.baseUrl+settings.results_ajax_url;$.getJSON(path,args).done(function(data){onResultsLoaded(data);}).fail(function(jqxhr,textStatus,error){onResultsLoadFail(jqxhr,textStatus,error);});};function onResultsLoaded(data){_$form.removeClass('ajax-loading');_$body.removeClass('ajax-loading');$prev_results=$('[theme="edlp_search_results"]',_$container);if($prev_results.length){$prev_results.replaceWith(data.rendered);}else{_$container.append(data.rendered);}
|
||||
_$body.trigger({'type':'search-results-loaded','results':data.results_nids});};function onResultsLoadFail(jqxhr,textStatus,error){void 0;};function onSearchClosed(e){$('div[theme="edlp_search_results"]').remove();_$body.trigger({'type':'search-closed'});}
|
||||
_$body.trigger({'type':'search-results-loaded','results':data.results_nids});if(typeof _paq!=='undefined'){var search_name='keys:'+data.keys
|
||||
+';langues:'+data.langues
|
||||
+';genres:'+data.genres
|
||||
+';entries:'+data.entry_names.join(',');_paq.push(['trackEvent','AjaxSearch','Results',search_name,data.results_nids.length]);}};function onResultsLoadFail(jqxhr,textStatus,error){void 0;};function onSearchClosed(e){$('div[theme="edlp_search_results"]').remove();_$body.trigger({'type':'search-closed'});}
|
||||
init();})(jQuery,Drupal,drupalSettings);
|
||||
@@ -92,6 +92,22 @@
|
||||
'results':data.results_nids
|
||||
});
|
||||
|
||||
|
||||
// piwik
|
||||
if(typeof _paq !== 'undefined'){
|
||||
// page tracking
|
||||
// https://matomo.org/blog/2017/02/how-to-track-single-page-websites-using-piwik-analytics/
|
||||
// _paq.push(['setCustomUrl', state.url]);
|
||||
// _paq.push(['setDocumentTitle', data.title]);
|
||||
// _paq.push(['trackPageView']);
|
||||
|
||||
// trackEvent(category, action, [name], [value])
|
||||
var search_name = 'keys:'+data.keys
|
||||
+';langues:'+data.langues
|
||||
+';genres:'+data.genres
|
||||
+';entries:'+data.entry_names.join(',');
|
||||
_paq.push(['trackEvent', 'AjaxSearch', 'Results', search_name, data.results_nids.length]);
|
||||
}
|
||||
};
|
||||
|
||||
function onResultsLoadFail(jqxhr, textStatus, error){
|
||||
|
||||
@@ -78,7 +78,8 @@ class EdlpSearchController extends ControllerBase {
|
||||
|
||||
$rendered = render($this->renderable);
|
||||
$data = [
|
||||
'rendered' => $rendered
|
||||
'rendered' => $rendered,
|
||||
'title' => 'Search',
|
||||
];
|
||||
|
||||
// translations links
|
||||
@@ -249,6 +250,9 @@ class EdlpSearchController extends ControllerBase {
|
||||
'test'=>'search results',
|
||||
'keys'=>$this->keys,
|
||||
'entries' => $this->entries,
|
||||
'entry_names' => $this->entry_names,
|
||||
'langues' => $this->langues,
|
||||
'genres' => $this->genres,
|
||||
'rendered'=> $rendered,
|
||||
'results_nids'=>$results_nids,
|
||||
]);
|
||||
@@ -325,10 +329,13 @@ class EdlpSearchController extends ControllerBase {
|
||||
}
|
||||
|
||||
// entries
|
||||
$this->entry_names = [];
|
||||
if (!empty($this->entries)){
|
||||
$terms = entity_load_multiple('taxonomy_term', $this->entries);
|
||||
$entries_condition_group = $query->createConditionGroup();
|
||||
foreach ($this->entries as $tid) {
|
||||
foreach ($terms as $tid => $term) {
|
||||
$entries_condition_group->addCondition('field_entrees', (int)$tid, "=");
|
||||
$this->entry_names[] = $term->getName();
|
||||
}
|
||||
// dpm($entries_condition_group);
|
||||
$query->addConditionGroup($entries_condition_group);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
|
||||
(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;function init(){void 0;_audioPlayer=new AudioPlayer();_compoPlayer=new CompoPlayer();initAjaxLinks();initHistory();if(!drupalSettings.path.isFront)
|
||||
return;initEvents();};function initEvents(){_$body.on('corpus-map-ready',onCorpusMapReady).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();_$body.removeClass();if(typeof e.url!='undefined'){var state=getSysPathState(e.sys_path);history.pushState(state,null,e.url);}}).on('close_entree',function(e){backToFrontPage();});}
|
||||
return;initEvents();};function initEvents(){_$body.on('corpus-map-ready',onCorpusMapReady).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();_$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();});}
|
||||
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');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)
|
||||
@@ -13,7 +13,7 @@ if(state.sys_path=="productions"){initProductions();}else{addCloseModalBtnToCols
|
||||
if(data.entity_type=="node"&&data.bundle=="enregistrement"&&data.view_mode=="transcript"){initEnregistrementTranscript();}
|
||||
if(typeof data.translations_links!='undefined'){void 0;var lang_code=drupalSettings.path.currentLanguage;var $links=$(data.translations_links);$links.find('li[hreflang="'+lang_code+'"]').addClass('is-active').find('a').addClass('is-active');if(state.view_mode){$links.find('a').each(function(i,e){var $a=$(this);$a.attr('href',$a.attr('href')+'#'+state.view_mode);});}
|
||||
$('ul','.block.language-switcher-language-url').replaceWith($links);}
|
||||
initAjaxLinks();_$body.trigger({'type':'new-content-ajax-loaded'});Drupal.attachBehaviors(_$row[0]);_$body.attr('booted','booted');_$body.removeClass('ajax-loading');if(state.url){history.pushState(state,null,state.url);}};function initAudioLinksInContent(){_$row.find('a.audio-link').on('mouseover',function(event){event.preventDefault();if(_corpus_ready){_$corpus_canvas.trigger({type:'mouseover-audio-link',nid:$(this).attr('nid')});}}).on('mouseout',function(event){event.preventDefault();if(_corpus_ready){_$corpus_canvas.trigger({type:'mouseout-audio-link',nid:$(this).attr('nid')});}});};function addCloseModalBtnToCols(){$('.col',_$row).each(function(index,el){if($('span.close-col-btn',this).length)
|
||||
initAjaxLinks();_$body.trigger({'type':'new-content-ajax-loaded'});Drupal.attachBehaviors(_$row[0]);_$body.attr('booted','booted');_$body.removeClass('ajax-loading');if(state.url){history.pushState(state,null,state.url);if(typeof _paq!=='undefined'){_paq.push(['setCustomUrl',state.url]);_paq.push(['setDocumentTitle',data.title]);_paq.push(['trackPageView']);_paq.push(['trackEvent','AjaxNav','loaded',state.url]);}}};function initAudioLinksInContent(){_$row.find('a.audio-link').on('mouseover',function(event){event.preventDefault();if(_corpus_ready){_$corpus_canvas.trigger({type:'mouseover-audio-link',nid:$(this).attr('nid')});}}).on('mouseout',function(event){event.preventDefault();if(_corpus_ready){_$corpus_canvas.trigger({type:'mouseout-audio-link',nid:$(this).attr('nid')});}});};function addCloseModalBtnToCols(){$('.col',_$row).each(function(index,el){if($('span.close-col-btn',this).length)
|
||||
return true;$(this).children('.wrapper').prepend($('<span>').addClass('close-col-btn').on('click',onCloseModal));});};function onCloseModal(e){var $col=$(this).parents('.col');var theme=$col.attr('theme');if(theme!=''){_$body.trigger({'type':theme+'-col-closed'});}
|
||||
$col.remove();if(!$('.col',_$row).length&&!_$body.is('.entity-type-node.bundle-page')&&!_$body.is('.entity-type-taxonomy_term.bundle-entrees')){backToFrontPage();}};function refreshAllBlocks(){var path=window.location.origin+Drupal.url(_ajax_settings.blocksjson_path);$.getJSON(path,{}).done(function(data){onAjaxBlockLoaded(data);}).fail(function(jqxhr,textStatus,error){onAjaxBlockLoadError(jqxhr,textStatus,error);});};function onAjaxBlockLoadError(jqxhr,textStatus,error){void 0;};function onAjaxBlockLoaded(data){void 0;for(var blockname in data.blocks){var block=data.blocks[blockname];void 0;$(block.id).replaceWith(block.rendered);}};function initHistory(){initFirstLoad();window.addEventListener('popstate',onHistoryPopState);};function initFirstLoad(){void 0;var edlp_origin=JSON.parse(window.localStorage.getItem('edlp_origin'));void 0;if(edlp_origin!=null&&edlp_origin.sys_path){var view_mode=edlp_origin.hash.replace('#','');var state=getSysPathState(edlp_origin.sys_path,view_mode);if(edlp_origin.entity_type=="taxonomy_term"&&edlp_origin.entity_bundle=="entrees"&&view_mode){state.selector='entree-'+view_mode+'-link-'+edlp_origin.entity_id;if(_corpus_ready){_$corpus_canvas.trigger({type:'open-entree',tid:edlp_origin.entity_id});}else{$('li.entree[tid="'+edlp_origin.entity_id+'"] a.term-link').addClass('is-active');}}
|
||||
if(edlp_origin.audio_url){var node={nid:edlp_origin.entity_id,audio_url:edlp_origin.audio_url};_audioPlayer.openDocument(node,'history_first_load');if(view_mode==""){state.audio=true;state.node=node;_$body.attr('booted','booted');}else{ajaxLoadContent(state);}}
|
||||
@@ -23,7 +23,7 @@ history.replaceState(state,null,edlp_origin.url+edlp_origin.hash);window.localSt
|
||||
else if(e.state.audio){_audioPlayer.openDocument(e.state.node,'popstate',e.state.historic_index);}
|
||||
else{if(e.state.entree_tid){openEntree(e.state.entree_tid);}
|
||||
if(e.state.ajax_path){e.state.url=null;ajaxLoadContent(e.state);}}};function initAjaxLinks(){$('a.site-name','#block-edlptheme-branding').add('a','#block-mainnavigation').add('a','#block-footer.menu--footer').add('a','#block-productions').add('a','article.node:not(.node--type-enregistrement) h2.node-title').add('a','.productions-subtree').add('a','.productions-parent').addClass('ajax-link');_$ajaxLinks=$('.ajax-link:not(.ajax-enabled)').each(function(i,e){var $this=$(this);if($this.is('.ajax-enable'))return;if($this.attr('data-drupal-link-system-path')){$this.on('click',onClickAjaxLink).addClass('ajax-enable');}});};function onClickAjaxLink(e){e.preventDefault();var $link=$(this);if($link.is('.is-active'))
|
||||
return false;if($link.is('.audio-link')){_audioPlayer.emmit('stop-shuffle').openDocument({nid:$link.attr('nid'),audio_url:$link.attr('audio_url')});return false;}
|
||||
return false;if($link.is('.audio-link')){_audioPlayer.emmit('stop-shuffle').openDocument({nid:$link.attr('nid'),audio_url:$link.attr('audio_url'),title:$link.find('.field--name-title').html()});return false;}
|
||||
var sys_path=$(this).attr('data-drupal-link-system-path');if(sys_path=='<front>'){backToFrontPage();return false;}
|
||||
var view_mode=$link.attr('viewmode');var state=getSysPathState(sys_path,view_mode);state.url=$(this).attr('href');if(view_mode){state.url+="#"+view_mode;}
|
||||
if($link.is('[selector]')){state.selector=$link.attr('selector');}
|
||||
@@ -31,12 +31,13 @@ $link.addClass('ajax-loading');ajaxLoadContent(state);return false;};function on
|
||||
function openEntree(tid){if(tid){closeAllModals();_$body.removeClass();if(_corpus_ready){_$corpus_canvas.trigger({type:'open-entree',tid:tid});}else{$('li.entree[tid="'+tid+'"] a.term-link').addClass('is-active');}}};function AudioPlayer(){var that=this;this.fid;this.audio=new Audio();this.audio_events=["loadedmetadata","canplay","playing","pause","timeupdate","ended","error"];this.$container=$('<div id="audio-player">');this.$btns=$('<div>').addClass('btns').appendTo(this.$container);this.$previous=$('<div>').addClass('previous').appendTo(this.$btns);this.$playpause=$('<div>').addClass('play-pause').appendTo(this.$btns);this.$next=$('<div>').addClass('next').appendTo(this.$btns);this.$timelinecont=$('<div>').addClass('time-line-container').appendTo(this.$container);this.$timeline=$('<div>').addClass('time-line').appendTo(this.$timelinecont);this.$loader=$('<div>').addClass('loader').appendTo(this.$timeline);this.$cursor=$('<div>').addClass('cursor').appendTo(this.$timeline);this.$time=$('<div>').addClass('time').appendTo(this.$container);this.$currentTime=$('<div>').addClass('current-time').html('00:00').appendTo(this.$time);this.$duration=$('<div>').addClass('duration').html('00:00').appendTo(this.$time);this.$fav=$('<div>').addClass('favoris').appendTo(this.$container);this.$cartel=$('<div>').addClass('cartel').appendTo(this.$container);this.hideTimer=false;this.hideTimeMS=10000;this.currentHistoricIndex=null;this.historic=[];this.shuffle_is_active=false;this.auto_open_article=false;this.event_handlers={'audio-open-document':[],'audio-play':[],'audio-pause':[],'audio-play-next':[],'audio-ended':[],'stop-shuffle':[]};this.init();};AudioPlayer.prototype={init(){this.$container.appendTo('header[role="banner"] .region-header');this.timeline_w=parseInt(this.$timeline.width());var fn='';for(var i=0;i<this.audio_events.length;i++){fn=this.audio_events[i];fn='on'+fn.charAt(0).toUpperCase()+fn.slice(1);this.audio.addEventListener(this.audio_events[i],this[fn].bind(this),true);}
|
||||
this.$previous.on('click',this.playPrevious.bind(this));this.$playpause.on('click',this.togglePlayPause.bind(this));this.$next.on('click',this.playNext.bind(this));},openDocument(node,caller,historic_index){if(typeof node=='undefined'||typeof node.nid=='undefined'||typeof node.audio_url=='undfined'){void 0;return false;}
|
||||
if(typeof caller=='undefined'||caller!='popstate'){this.historic.push(node);this.currentHistoricIndex=this.historic.length-1;if(caller!="history_first_load"){state={audio:true,node:node,historic_index:this.currentHistoricIndex,};history.pushState(state,null,node.document_url);}}else{this.currentHistoricIndex=historic_index;}
|
||||
this.emmit('audio-open-document',{caller:caller});this.launch();},launch(){this.clearTimeOutToHide();this.setSRC(this.historic[this.currentHistoricIndex].audio_url);this.loadNode(this.historic[this.currentHistoricIndex].nid);try{_$corpus_canvas.trigger({'type':'audio-node-opened','nid':this.historic[this.currentHistoricIndex].nid});}catch(e){void 0;}
|
||||
this.showHidePreviousBtn();this.showHideNextBtn();this.show();},setSRC(url){void 0;this.audio.src=url;},onLoadedmetadata(){var rem=parseInt(this.audio.duration,10),mins=Math.floor(rem/60,10),secs=rem-mins*60;this.$duration.html('<span>'+(mins<10?'0':'')+mins+':'+(secs<10?'0':'')+secs+'</span>');this.updateLoadingBar();},updateLoadingBar(){this.$loader.css({'width':parseInt((100*this.audio.buffered.end(0)/this.audio.duration),10)+'%'});if(this.audio.buffered.end(0)<this.audio.duration){var that=this;window.requestAnimationFrame(that.updateLoadingBar.bind(that));}else{}},onCanplay(){this.play();},onError(){void 0;},play(){this.clearTimeOutToHide();this.audio.play();},playPrevious(){if(this.currentHistoricIndex>0){this.currentHistoricIndex-=1;this.launch();}},playNext(){if(this.currentHistoricIndex<this.historic.length-1){this.currentHistoricIndex+=1;this.launch();}else{this.emmit('audio-play-next');}},togglePlayPause(e){if(this.audio.paused){this.audio.play();}else{this.audio.pause();}},stop(){this.audio.pause();if(!(_$body.is('.path-node-'+this.historic[this.currentHistoricIndex].nid)&&(_$body.is('.view-mode-article')||_$body.is('.view-mode-transcript')))){this.timeOutToHide();}},onPlaying(){this.$btns.addClass('is-playing');this.emmit('audio-play');},onPause(){this.$btns.removeClass('is-playing');this.emmit('audio-pause');},onTimeupdate(){this.$cursor.css({'left':(this.audio.currentTime/this.audio.duration*this.timeline_w)+"px"});var rem=parseInt(this.audio.currentTime,10),mins=Math.floor(rem/60,10),secs=rem-mins*60;this.$currentTime.html('<span>'+(mins<10?'0':'')+mins+':'+(secs<10?'0':'')+secs+'</span>');},onEnded(){void 0;this.emmit('audio-ended');this.stop();},loadNode(nid){this.$cartel.addClass('loading');var vm='player_cartel';var ajax_path=_ajax_settings.entityjson_path+'/node/'+nid+'/'+vm;var path=window.location.origin+Drupal.url(ajax_path);$.getJSON(path,{}).done(this.onNodeLoaded.bind(this)).fail(this.onNodeLoadFail.bind(this));},onNodeLoaded(data){this.$cartel.html(data.rendered).removeClass('loading');_$body.trigger({'type':'new-audio-cartel-loaded'});initAjaxLinks();if(this.auto_open_article){this.$cartel.find('a.link-article').trigger('click');this.auto_open_article=false;}},onNodeLoadFail(jqxhr,textStatus,error){void 0;this.$cartel.removeClass('loading').html('');},setAutoOpenArticle(art){this.auto_open_article=art;return this;},show(){this.$container.addClass('visible');},showHidePreviousBtn(){if(this.historic.length>1&&this.currentHistoricIndex>0){this.$previous.addClass('is-active');}else{this.$previous.removeClass('is-active');}},showHideNextBtn(){if(this.currentHistoricIndex<this.historic.length-1||this.shuffle_is_active){this.$next.addClass('is-active');}else{this.$next.removeClass('is-active');}},timeOutToHide(){this.clearTimeOutToHide();this.hideTimer=setTimeout(this.hide.bind(this),this.hideTimeMS);},clearTimeOutToHide(){if(this.hideTimer){clearTimeout(this.hideTimer);this.hideTimer=false;}},hide(){this.$container.removeClass('visible');try{_$corpus_canvas.trigger('audio-node-closed');}catch(e){void 0;}},on(event_name,handler){if(typeof this.event_handlers[event_name]=='undefined'){void 0;}
|
||||
this.emmit('audio-open-document',{caller:caller});if(typeof _paq!=='undefined'){if(typeof node.title!='undefined'){_paq.push(['trackEvent','Audio','play',node.title]);}}
|
||||
this.launch();},launch(){this.clearTimeOutToHide();this.setSRC(this.historic[this.currentHistoricIndex].audio_url);this.loadNode(this.historic[this.currentHistoricIndex].nid);try{_$corpus_canvas.trigger({'type':'audio-node-opened','nid':this.historic[this.currentHistoricIndex].nid});}catch(e){void 0;}
|
||||
this.showHidePreviousBtn();this.showHideNextBtn();this.show();},setSRC(url){void 0;this.audio.src=url;},onLoadedmetadata(){var rem=parseInt(this.audio.duration,10),mins=Math.floor(rem/60,10),secs=rem-mins*60;this.$duration.html('<span>'+(mins<10?'0':'')+mins+':'+(secs<10?'0':'')+secs+'</span>');this.updateLoadingBar();},updateLoadingBar(){if(this.audio.buffered.length>0){this.$loader.css({'width':parseInt((100*this.audio.buffered.end(0)/this.audio.duration),10)+'%'});if(this.audio.buffered.end(0)<this.audio.duration){var that=this;window.requestAnimationFrame(that.updateLoadingBar.bind(that));}else{}}},onCanplay(){this.play();},onError(){void 0;},play(){this.clearTimeOutToHide();this.audio.play();},playPrevious(){if(this.currentHistoricIndex>0){this.currentHistoricIndex-=1;this.launch();}},playNext(){if(this.currentHistoricIndex<this.historic.length-1){this.currentHistoricIndex+=1;this.launch();}else{this.emmit('audio-play-next');}},togglePlayPause(e){if(this.audio.paused){this.audio.play();}else{this.audio.pause();}},stop(){this.audio.pause();if(!(_$body.is('.path-node-'+this.historic[this.currentHistoricIndex].nid)&&(_$body.is('.view-mode-article')||_$body.is('.view-mode-transcript')))){this.timeOutToHide();}},onPlaying(){this.$btns.addClass('is-playing');this.emmit('audio-play');},onPause(){this.$btns.removeClass('is-playing');this.emmit('audio-pause');},onTimeupdate(){this.$cursor.css({'left':(this.audio.currentTime/this.audio.duration*this.timeline_w)+"px"});var rem=parseInt(this.audio.currentTime,10),mins=Math.floor(rem/60,10),secs=rem-mins*60;this.$currentTime.html('<span>'+(mins<10?'0':'')+mins+':'+(secs<10?'0':'')+secs+'</span>');},onEnded(){void 0;this.emmit('audio-ended');this.stop();},loadNode(nid){this.$cartel.addClass('loading');var vm='player_cartel';var ajax_path=_ajax_settings.entityjson_path+'/node/'+nid+'/'+vm;var path=window.location.origin+Drupal.url(ajax_path);$.getJSON(path,{}).done(this.onNodeLoaded.bind(this)).fail(this.onNodeLoadFail.bind(this));},onNodeLoaded(data){this.$cartel.html(data.rendered).removeClass('loading');_$body.trigger({'type':'new-audio-cartel-loaded'});initAjaxLinks();if(this.auto_open_article){this.$cartel.find('a.link-article').trigger('click');this.auto_open_article=false;}},onNodeLoadFail(jqxhr,textStatus,error){void 0;this.$cartel.removeClass('loading').html('');},setAutoOpenArticle(art){this.auto_open_article=art;return this;},show(){this.$container.addClass('visible');},showHidePreviousBtn(){if(this.historic.length>1&&this.currentHistoricIndex>0){this.$previous.addClass('is-active');}else{this.$previous.removeClass('is-active');}},showHideNextBtn(){if(this.currentHistoricIndex<this.historic.length-1||this.shuffle_is_active){this.$next.addClass('is-active');}else{this.$next.removeClass('is-active');}},timeOutToHide(){this.clearTimeOutToHide();this.hideTimer=setTimeout(this.hide.bind(this),this.hideTimeMS);},clearTimeOutToHide(){if(this.hideTimer){clearTimeout(this.hideTimer);this.hideTimer=false;}},hide(){this.$container.removeClass('visible');try{_$corpus_canvas.trigger('audio-node-closed');}catch(e){void 0;}},on(event_name,handler){if(typeof this.event_handlers[event_name]=='undefined'){void 0;}
|
||||
this.event_handlers[event_name].push(handler);return this;},emmit(event_name,args){var handler;var args=args||{};for(var i=this.event_handlers[event_name].length-1;i>=0;i--){handler=this.event_handlers[event_name][i];setTimeout(function(){handler(args);},0);}
|
||||
return this;},}
|
||||
function RandomPlayer(playlist){this.active=false;this.playlist=playlist;this.$btn=$('<a>').html('Shuffle').addClass('random-player-btn');this.init();};RandomPlayer.prototype={init(){$('<div>').addClass('block random-player').append(this.$btn).prependTo('.region-footer-right');this.$btn.on('click',this.toggleActive.bind(this));_audioPlayer.on('audio-ended',this.onAudioPlayerEnded.bind(this)).on('audio-play-next',this.onAudioPlayNext.bind(this)).on('stop-shuffle',this.stop.bind(this));_$corpus_canvas.on('update-random-playlist',this.updatePlaylist.bind(this));},updatePlaylist(e){this.playlist=e.playlist;this.shuffle();},shuffle(){var tempPLaylist=[];for(var i=this.playlist.length-1;i>=0;i--){tempPLaylist.push(this.playlist[i]);}
|
||||
this.shuffledPlaylist=[];while(tempPLaylist.length>0){var r=Math.floor(Math.random()*tempPLaylist.length);this.shuffledPlaylist.push(tempPLaylist.splice(r,1)[0]);}},toggleActive(e){if(this.active){this.stop();}else{this.start();}},start(){this.active=_audioPlayer.shuffle_is_active=true;this.$btn.addClass('is-active');this.shuffle();this.next();},stop(){this.active=_audioPlayer.shuffle_is_active=false;this.$btn.removeClass('is-active');},next(){if(this.active&&this.shuffledPlaylist.length>0)
|
||||
this.shuffledPlaylist=[];while(tempPLaylist.length>0){var r=Math.floor(Math.random()*tempPLaylist.length);this.shuffledPlaylist.push(tempPLaylist.splice(r,1)[0]);}},toggleActive(e){if(this.active){this.stop();}else{this.start();}},start(){this.active=_audioPlayer.shuffle_is_active=true;this.$btn.addClass('is-active');this.shuffle();this.next();if(typeof _paq!=='undefined'){_paq.push(['trackEvent','RandomPlayer','start']);}},stop(){this.active=_audioPlayer.shuffle_is_active=false;this.$btn.removeClass('is-active');if(typeof _paq!=='undefined'){_paq.push(['trackEvent','RandomPlayer','stop']);}},next(){if(this.active&&this.shuffledPlaylist.length>0)
|
||||
_audioPlayer.openDocument(this.shuffledPlaylist.splice(0,1)[0]);},onAudioPlayNext(){this.next();},onAudioPlayerEnded(){this.next();}};function CompoPlayer(){this.active=false;this.playing=false;this.paused=false;this.playlist=[];this.current_index=0;this.$composer=null;this.$compo=null;this.$controls=null;this.init();};CompoPlayer.prototype={init(){_audioPlayer.on('audio-open-document',this.onAudioOpenDocument.bind(this)).on('audio-play',this.onAudioPlayerPlay.bind(this)).on('audio-pause',this.onAudioPlayerPause.bind(this)).on('audio-ended',this.onAudioPlayerEnded.bind(this));},newCompo(){this.initControls();},initControls(){this.$composer=$('.composition_ui .composer');this.$compo=$('.composition_ui .composer .composition');this.$controls=$('.composition_ui .composer .compo-player-controls');if(!this.$controls.is('.ready')&&this.$compo){this.$previous=$('<div>').addClass('previous').on('click',this.prev.bind(this)).appendTo(this.$controls);this.$playpause=$('<div>').addClass('play-pause').on('click',this.togglePlayPause.bind(this)).appendTo(this.$controls);this.$next=$('<div>').addClass('next').on('click',this.next.bind(this)).appendTo(this.$controls);this.$controls.addClass('ready');this.refresh();this.active=true;}},refresh(){this.stop();this.playlist=[];var that=this;$('.field--name-documents .field__item',this.$compo).each(function(i,el){var $link=$('a.audio-link',this);that.playlist.push({item:$(this),audio_url:$link.attr("audio_url"),nid:$link.attr("nid"),});});this.showHideControls();},togglePlayPause(){if(this.playing&&!this.paused){this.pause();}else{if(this.playing&&this.paused){this.play();}else{this.start();}}},start(){this.playing=true;this.play();},play(){if(this.paused){this.paused=false;_audioPlayer.play();}else{_audioPlayer.openDocument(this.playlist[this.current_index],this);}
|
||||
this.setActiveItem().showHideControls();},pause(){this.paused=true;this.showHideControls();_audioPlayer.stop();},next(){if(this.playing){this.current_index+=1;if(this.current_index<this.playlist.length){this.play();}else{this.stop();}}},prev(){if(this.playing){this.current_index-=1;if(this.current_index>=0){this.play();}else{this.stop();}}},stop(){if(this.playing){_audioPlayer.stop();}
|
||||
this.reset();},reset(){this.playing=false;this.paused=false;this.resetIndex();},resetIndex(){this.current_index=0;this.showHideControls().resetActiveItems();},setActiveItem(){this.resetActiveItems();if(this.playing&&this.current_index>=0){this.playlist[this.current_index].item.addClass('is-active');}
|
||||
|
||||
@@ -79,6 +79,18 @@
|
||||
// };
|
||||
var state = getSysPathState(e.sys_path);
|
||||
history.pushState(state, null, e.url);
|
||||
|
||||
// piwik
|
||||
if(typeof _paq !== 'undefined'){
|
||||
// page tracking
|
||||
// https://matomo.org/blog/2017/02/how-to-track-single-page-websites-using-piwik-analytics/
|
||||
_paq.push(['setCustomUrl', e.url]);
|
||||
_paq.push(['setDocumentTitle', e.title]);
|
||||
_paq.push(['trackPageView']);
|
||||
// js event
|
||||
// trackEvent(category, action, [name], [value])
|
||||
// _paq.push(['trackEvent', 'AjaxNav', 'loaded', state.url]);
|
||||
}
|
||||
}
|
||||
})
|
||||
.on('close_entree', function(e){
|
||||
@@ -299,6 +311,18 @@
|
||||
// console.log(window.location);
|
||||
// /!\ we can not pushestate with absolute url /!\
|
||||
history.pushState(state, null, state.url);
|
||||
|
||||
// piwik
|
||||
if(typeof _paq !== 'undefined'){
|
||||
// page tracking
|
||||
// https://matomo.org/blog/2017/02/how-to-track-single-page-websites-using-piwik-analytics/
|
||||
_paq.push(['setCustomUrl', state.url]);
|
||||
_paq.push(['setDocumentTitle', data.title]);
|
||||
_paq.push(['trackPageView']);
|
||||
// js event
|
||||
// trackEvent(category, action, [name], [value])
|
||||
_paq.push(['trackEvent', 'AjaxNav', 'loaded', state.url]);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -543,7 +567,8 @@
|
||||
.emmit('stop-shuffle')
|
||||
.openDocument({
|
||||
nid:$link.attr('nid'),
|
||||
audio_url:$link.attr('audio_url')
|
||||
audio_url:$link.attr('audio_url'),
|
||||
title:$link.find('.field--name-title').html()
|
||||
});
|
||||
return false;
|
||||
}
|
||||
@@ -747,6 +772,22 @@
|
||||
|
||||
this.emmit('audio-open-document', {caller:caller});
|
||||
|
||||
|
||||
// piwik
|
||||
// debugger;
|
||||
if(typeof _paq !== 'undefined'){
|
||||
// page tracking
|
||||
// https://matomo.org/blog/2017/02/how-to-track-single-page-websites-using-piwik-analytics/
|
||||
// _paq.push(['setCustomUrl', state.url]);
|
||||
// _paq.push(['setDocumentTitle', data.title]);
|
||||
// _paq.push(['trackPageView']);
|
||||
// js event
|
||||
// trackEvent(category, action, [name], [value])
|
||||
if(typeof node.title != 'undefined'){
|
||||
_paq.push(['trackEvent', 'Audio', 'play', node.title]);
|
||||
}
|
||||
}
|
||||
|
||||
this.launch();
|
||||
},
|
||||
launch(){
|
||||
@@ -780,15 +821,18 @@
|
||||
this.updateLoadingBar();
|
||||
},
|
||||
updateLoadingBar(){
|
||||
this.$loader.css({
|
||||
'width':parseInt((100 * this.audio.buffered.end(0) / this.audio.duration), 10)+'%'
|
||||
});
|
||||
if( this.audio.buffered.end(0) < this.audio.duration ){
|
||||
// loop through this function until file is fully loaded
|
||||
var that = this;
|
||||
window.requestAnimationFrame(that.updateLoadingBar.bind(that));
|
||||
}else{
|
||||
//console.log('Audio fully loaded');
|
||||
// if (this.audio.readyState === 4){
|
||||
if(this.audio.buffered.length>0){
|
||||
this.$loader.css({
|
||||
'width':parseInt((100 * this.audio.buffered.end(0) / this.audio.duration), 10)+'%'
|
||||
});
|
||||
if( this.audio.buffered.end(0) < this.audio.duration ){
|
||||
// loop through this function until file is fully loaded
|
||||
var that = this;
|
||||
window.requestAnimationFrame(that.updateLoadingBar.bind(that));
|
||||
}else{
|
||||
//console.log('Audio fully loaded');
|
||||
}
|
||||
}
|
||||
},
|
||||
onCanplay(){
|
||||
@@ -1012,12 +1056,21 @@
|
||||
this.$btn.addClass('is-active');
|
||||
this.shuffle();
|
||||
this.next();
|
||||
// piwik
|
||||
if(typeof _paq !== 'undefined'){
|
||||
// trackEvent(category, action, [name], [value])
|
||||
_paq.push(['trackEvent', 'RandomPlayer', 'start']);
|
||||
}
|
||||
},
|
||||
stop(){
|
||||
this.active = _audioPlayer.shuffle_is_active = false;
|
||||
this.$btn.removeClass('is-active');
|
||||
// stop audio player
|
||||
// _audioPlayer.stop();
|
||||
if(typeof _paq !== 'undefined'){
|
||||
// trackEvent(category, action, [name], [value])
|
||||
_paq.push(['trackEvent', 'RandomPlayer', 'stop']);
|
||||
}
|
||||
},
|
||||
next(){
|
||||
if(this.active && this.shuffledPlaylist.length > 0)
|
||||
|
||||
@@ -16,7 +16,7 @@ provider: null
|
||||
plugin: system_branding_block
|
||||
settings:
|
||||
id: system_branding_block
|
||||
label: 'Site branding'
|
||||
label: 'Marque du site'
|
||||
provider: system
|
||||
label_display: '0'
|
||||
use_site_logo: true
|
||||
|
||||
@@ -16,7 +16,7 @@ provider: null
|
||||
plugin: system_branding_block
|
||||
settings:
|
||||
id: system_branding_block
|
||||
label: 'Site branding'
|
||||
label: 'Marque du site'
|
||||
provider: system
|
||||
label_display: '0'
|
||||
use_site_logo: true
|
||||
|
||||
@@ -5,6 +5,6 @@ dependencies: { }
|
||||
_core:
|
||||
default_config_hash: 5VpawMrKPEPCkoO4YpPa0TDFO2dgiIHfTziJtwlmUxc
|
||||
id: html_yearless_date
|
||||
label: 'Date sans année HTML'
|
||||
label: 'Date HTML sans année'
|
||||
locked: true
|
||||
pattern: m-d
|
||||
|
||||
@@ -11,21 +11,29 @@ dependencies:
|
||||
- node.type.evenement
|
||||
module:
|
||||
- datetime_range
|
||||
- text
|
||||
- user
|
||||
id: node.evenement.aside
|
||||
targetEntityType: node
|
||||
bundle: evenement
|
||||
mode: aside
|
||||
content:
|
||||
body:
|
||||
type: text_default
|
||||
weight: 2
|
||||
region: content
|
||||
label: hidden
|
||||
settings: { }
|
||||
third_party_settings: { }
|
||||
field_date:
|
||||
weight: 1
|
||||
label: hidden
|
||||
settings:
|
||||
timezone_override: ''
|
||||
format_type: long
|
||||
date_format: 'l j F Y G\hi'
|
||||
separator: '-'
|
||||
third_party_settings: { }
|
||||
type: daterange_default
|
||||
type: daterange_custom
|
||||
region: content
|
||||
links:
|
||||
weight: 0
|
||||
@@ -33,7 +41,6 @@ content:
|
||||
settings: { }
|
||||
third_party_settings: { }
|
||||
hidden:
|
||||
body: true
|
||||
field_page_liee: true
|
||||
field_workflow_generic: true
|
||||
langcode: true
|
||||
|
||||
@@ -29,10 +29,10 @@ content:
|
||||
label: hidden
|
||||
settings:
|
||||
timezone_override: ''
|
||||
format_type: long
|
||||
date_format: 'l j F Y G\hi'
|
||||
separator: '-'
|
||||
third_party_settings: { }
|
||||
type: daterange_default
|
||||
type: daterange_custom
|
||||
region: content
|
||||
field_page_liee:
|
||||
weight: 3
|
||||
|
||||
@@ -5,10 +5,12 @@ dependencies:
|
||||
config:
|
||||
- core.entity_view_mode.node.teaser
|
||||
- field.field.node.evenement.body
|
||||
- field.field.node.evenement.field_date
|
||||
- field.field.node.evenement.field_page_liee
|
||||
- field.field.node.evenement.field_workflow_generic
|
||||
- node.type.evenement
|
||||
module:
|
||||
- datetime_range
|
||||
- text
|
||||
- user
|
||||
id: node.evenement.teaser
|
||||
@@ -18,18 +20,34 @@ mode: teaser
|
||||
content:
|
||||
body:
|
||||
label: hidden
|
||||
type: text_summary_or_trimmed
|
||||
weight: 2
|
||||
settings:
|
||||
trim_length: 600
|
||||
type: text_default
|
||||
weight: 3
|
||||
settings: { }
|
||||
third_party_settings: { }
|
||||
region: content
|
||||
field_date:
|
||||
type: daterange_custom
|
||||
weight: 2
|
||||
region: content
|
||||
label: hidden
|
||||
settings:
|
||||
timezone_override: ''
|
||||
date_format: 'l j F Y G\hi'
|
||||
separator: '-'
|
||||
third_party_settings: { }
|
||||
field_page_liee:
|
||||
type: entity_reference_label
|
||||
weight: 1
|
||||
region: content
|
||||
label: hidden
|
||||
settings:
|
||||
link: false
|
||||
third_party_settings: { }
|
||||
links:
|
||||
weight: 0
|
||||
region: content
|
||||
settings: { }
|
||||
third_party_settings: { }
|
||||
hidden:
|
||||
field_page_liee: true
|
||||
field_workflow_generic: true
|
||||
langcode: true
|
||||
|
||||
@@ -7,6 +7,6 @@ dependencies:
|
||||
_core:
|
||||
default_config_hash: Mz9qWr1kUYK0mjRAGDsr5XS6PvtZ24en_7ndt-pyWe4
|
||||
id: node.teaser
|
||||
label: Teaser
|
||||
label: Accroche
|
||||
targetEntityType: node
|
||||
cache: true
|
||||
|
||||
@@ -5,7 +5,7 @@ dependencies: { }
|
||||
_core:
|
||||
default_config_hash: CMuvuRCfGZ5k3XgsXmkEc54rI8etDY1Qz2JP7JzKL-g
|
||||
name: linkit_result_thumbnail
|
||||
label: 'Linkit result thumbnail'
|
||||
label: 'Vignette de résultat Linkit'
|
||||
effects:
|
||||
2943df29-38ea-459c-ba1d-290489bb1807:
|
||||
uuid: 2943df29-38ea-459c-ba1d-290489bb1807
|
||||
|
||||
@@ -7,7 +7,7 @@ dependencies:
|
||||
_core:
|
||||
default_config_hash: N0RDBTqiK4dKoN4p4oW2j0SGWycdHyALUe9M-Ofp89U
|
||||
id: node_promote_action
|
||||
label: 'Promouvoir un contenu en page d''accueil'
|
||||
label: 'Promouvoir le contenu en page d''accueil'
|
||||
type: node
|
||||
plugin: node_promote_action
|
||||
configuration: { }
|
||||
|
||||
@@ -7,7 +7,7 @@ dependencies:
|
||||
_core:
|
||||
default_config_hash: '-SdRoSbsl_FULjbX8mgESZdeoEOjgi7rDhHNdLOJ8n8'
|
||||
id: pathauto_update_alias_node
|
||||
label: 'Update URL alias'
|
||||
label: 'Mettre à jour l''alias d''URL'
|
||||
type: node
|
||||
plugin: pathauto_update_alias
|
||||
configuration: { }
|
||||
|
||||
@@ -7,7 +7,7 @@ dependencies:
|
||||
_core:
|
||||
default_config_hash: fWszFHPeJ_dhZ8kJEEWo4w-FQH_etR4AxTQkQCW9OLk
|
||||
id: pathauto_update_alias_user
|
||||
label: 'Update URL alias'
|
||||
label: 'Mettre à jour l''alias d''URL'
|
||||
type: user
|
||||
plugin: pathauto_update_alias
|
||||
configuration: { }
|
||||
|
||||
@@ -10,7 +10,7 @@ dependencies:
|
||||
_core:
|
||||
default_config_hash: QmBeFeWHnYLbMWN48tWZZJmZIHZw0XEWUfxLYZFXhzQ
|
||||
id: redirect_delete_action
|
||||
label: 'Delete redirect'
|
||||
label: 'Supprimer une redirection'
|
||||
type: redirect
|
||||
plugin: redirect_delete_action
|
||||
configuration: { }
|
||||
|
||||
@@ -193,7 +193,7 @@ display:
|
||||
relationship: none
|
||||
group_type: group
|
||||
admin_label: ''
|
||||
label: From
|
||||
label: 'A partir de'
|
||||
exclude: false
|
||||
alter:
|
||||
alter_text: false
|
||||
|
||||
@@ -11,7 +11,7 @@ dependencies:
|
||||
_core:
|
||||
default_config_hash: rwRoOr3DiobxwoWSmtUcna1LQz5_HxHvS7H5dl7_-Uo
|
||||
id: frontpage
|
||||
label: Frontpage
|
||||
label: 'Page d''accueil'
|
||||
module: node
|
||||
description: 'All content promoted to the front page.'
|
||||
tag: default
|
||||
|
||||
@@ -67,10 +67,10 @@ display:
|
||||
offset: false
|
||||
offset_label: Offset
|
||||
tags:
|
||||
previous: '‹ previous'
|
||||
next: 'next ›'
|
||||
first: '« first'
|
||||
last: 'last »'
|
||||
previous: "‹\_précédent"
|
||||
next: "suivant\_›"
|
||||
first: "«\_premier"
|
||||
last: "dernier\_»"
|
||||
quantity: 9
|
||||
style:
|
||||
type: table
|
||||
@@ -287,7 +287,7 @@ display:
|
||||
relationship: none
|
||||
group_type: group
|
||||
admin_label: ''
|
||||
label: From
|
||||
label: 'A partir de'
|
||||
exclude: false
|
||||
alter:
|
||||
alter_text: false
|
||||
|
||||
@@ -56,10 +56,10 @@ display:
|
||||
id: 0
|
||||
total_pages: null
|
||||
tags:
|
||||
previous: '‹ previous'
|
||||
next: 'next ›'
|
||||
first: '« first'
|
||||
last: 'last »'
|
||||
previous: "‹\_précédent"
|
||||
next: "suivant\_›"
|
||||
first: "«\_premier"
|
||||
last: "dernier\_»"
|
||||
expose:
|
||||
items_per_page: false
|
||||
items_per_page_label: 'Items per page'
|
||||
@@ -195,7 +195,7 @@ display:
|
||||
relationship: none
|
||||
group_type: group
|
||||
admin_label: ''
|
||||
label: From
|
||||
label: 'A partir de'
|
||||
exclude: false
|
||||
alter:
|
||||
alter_text: false
|
||||
@@ -347,7 +347,7 @@ display:
|
||||
exposed: true
|
||||
expose:
|
||||
operator_id: redirect_source__path_op
|
||||
label: From
|
||||
label: 'A partir de'
|
||||
description: ''
|
||||
use_operator: false
|
||||
operator: redirect_source__path_op
|
||||
@@ -455,49 +455,49 @@ display:
|
||||
default_group_multiple: { }
|
||||
group_items:
|
||||
1:
|
||||
title: '300 Multiple Choices'
|
||||
title: '300 Choix Multiples'
|
||||
operator: '='
|
||||
value:
|
||||
value: '300'
|
||||
min: ''
|
||||
max: ''
|
||||
2:
|
||||
title: '301 Moved Permanently'
|
||||
title: '301 Redirection Permanente'
|
||||
operator: '='
|
||||
value:
|
||||
value: '301'
|
||||
min: ''
|
||||
max: ''
|
||||
3:
|
||||
title: '302 Found'
|
||||
title: '302 Trouvé'
|
||||
operator: '='
|
||||
value:
|
||||
value: '302'
|
||||
min: ''
|
||||
max: ''
|
||||
4:
|
||||
title: '303 See Other'
|
||||
title: '303 Voir Ailleurs'
|
||||
operator: '='
|
||||
value:
|
||||
value: '303'
|
||||
min: ''
|
||||
max: ''
|
||||
5:
|
||||
title: '304 Not Modified'
|
||||
title: '304 Non Modifié'
|
||||
operator: '='
|
||||
value:
|
||||
value: '304'
|
||||
min: ''
|
||||
max: ''
|
||||
6:
|
||||
title: '305 Use Proxy'
|
||||
title: '305 Utilise un Proxy'
|
||||
operator: '='
|
||||
value:
|
||||
value: '305'
|
||||
min: ''
|
||||
max: ''
|
||||
7:
|
||||
title: '307 Temporary Redirect'
|
||||
title: '307 Redirection Temporaire'
|
||||
operator: '='
|
||||
value:
|
||||
value: '307'
|
||||
|
||||
@@ -535,7 +535,7 @@ display:
|
||||
relationship: none
|
||||
group_type: group
|
||||
admin_label: ''
|
||||
label: 'Log message'
|
||||
label: 'Message de journal'
|
||||
exclude: false
|
||||
alter:
|
||||
alter_text: false
|
||||
|
||||
Reference in New Issue
Block a user