Compare commits
10
Commits
alpha-0.6
...
alpha-0.6.2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f7c8728f20 | ||
|
|
7356c6cec6 | ||
|
|
7d11684731 | ||
|
|
86573ebbe9 | ||
|
|
e31f0c34a7 | ||
|
|
452f41108b | ||
|
|
d62d02201b | ||
|
|
cfe15cebd8 | ||
|
|
8133aa66f0 | ||
|
|
94175c1df1 |
@@ -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="langues"]',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'});}
|
||||
(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});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);
|
||||
@@ -46,7 +46,7 @@
|
||||
});
|
||||
|
||||
// langues
|
||||
args.langues = $('input[name="langues"]', this).val();
|
||||
args.langues = $('input[name="language"]', this).val();
|
||||
|
||||
// genres
|
||||
args.genres = $('input[name="genres"]', this).val();
|
||||
@@ -92,6 +92,16 @@
|
||||
'results':data.results_nids
|
||||
});
|
||||
|
||||
|
||||
// piwik
|
||||
if(typeof _paq !== 'undefined'){
|
||||
// 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){
|
||||
|
||||
@@ -208,6 +208,9 @@ class EdlpSearchController extends ControllerBase {
|
||||
// if($this->request->query->get('field_synonyms')){
|
||||
$this->field_synonyms = $this->request->query->get('field_synonyms');
|
||||
// }
|
||||
// if($this->request->query->get('node_type')){
|
||||
// $this->node_type = $this->request->query->get('node_type');
|
||||
// }
|
||||
$this->keys = $this->request->query->get('q');
|
||||
}
|
||||
|
||||
@@ -246,6 +249,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,
|
||||
]);
|
||||
@@ -323,9 +329,12 @@ class EdlpSearchController extends ControllerBase {
|
||||
|
||||
// entries
|
||||
if (!empty($this->entries)){
|
||||
$terms = entity_load_multiple('taxonomy_term', $this->entries);
|
||||
$this->entry_names = [];
|
||||
$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);
|
||||
@@ -333,6 +342,10 @@ class EdlpSearchController extends ControllerBase {
|
||||
|
||||
// TODO: locuteurs
|
||||
|
||||
$language = \Drupal::languageManager()->getCurrentLanguage()->getId();
|
||||
// $language = \Drupal::languageManager()->getCurrentLanguage()->getName();
|
||||
$query->addCondition('search_api_language', $language);
|
||||
|
||||
$result = $query->execute();
|
||||
$items = $result->getResultItems();
|
||||
// dpm($items);
|
||||
|
||||
@@ -29,6 +29,8 @@ class EdlpSearchForm extends FormBase {
|
||||
'#title' => $this->t('Search'),
|
||||
'keys' => [
|
||||
'#type' => 'search',
|
||||
'#autocomplete_route_name' => 'edlp_search.edlp_search_controller_autocomplete',
|
||||
'#autocomplete_route_parameters' => array('field_name' => 'title'),
|
||||
'#maxlength' => 20,
|
||||
'#size' => 15,
|
||||
'#weight' => '0',
|
||||
|
||||
@@ -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(['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);}}
|
||||
@@ -28,11 +28,11 @@ var sys_path=$(this).attr('data-drupal-link-system-path');if(sys_path=='<front>'
|
||||
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');}
|
||||
$link.addClass('ajax-loading');ajaxLoadContent(state);return false;};function onCorpusMapReady(e){_corpus_ready=true;_$corpus_canvas=$('canvas#corpus-map');_$corpus_canvas.on('corpus-cliked-on-map',function(e){backToFrontPage();}).on('corpus-cliked-on-node',function(e){_audioPlayer.emmit('stop-shuffle').setAutoOpenArticle(e.article).openDocument(e.target_node);});_randomPlayer=new RandomPlayer(e.playlist);_$body.attr('corpus-map','ready');}
|
||||
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"];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);}
|
||||
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){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();},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.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.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]);}
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -299,6 +299,12 @@
|
||||
// console.log(window.location);
|
||||
// /!\ we can not pushestate with absolute url /!\
|
||||
history.pushState(state, null, state.url);
|
||||
|
||||
// piwik
|
||||
if(typeof _paq !== 'undefined'){
|
||||
// trackEvent(category, action, [name], [value])
|
||||
_paq.push(['trackEvent', 'AjaxNav', 'loaded', state.url]);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -646,7 +652,7 @@
|
||||
this.fid;
|
||||
this.audio = new Audio();
|
||||
// audio events
|
||||
this.audio_events = ["loadedmetadata","canplay","playing","pause","timeupdate","ended"];
|
||||
this.audio_events = ["loadedmetadata","canplay","playing","pause","timeupdate","ended","error"];
|
||||
|
||||
// UI dom objects
|
||||
this.$container = $('<div id="audio-player">');
|
||||
@@ -769,7 +775,7 @@
|
||||
},
|
||||
// audio functions
|
||||
setSRC(url){
|
||||
// console.log('AudioPlayer setSRC : url', url);
|
||||
console.log('AudioPlayer setSRC : url', url);
|
||||
this.audio.src = url;
|
||||
},
|
||||
onLoadedmetadata(){
|
||||
@@ -794,6 +800,9 @@
|
||||
onCanplay(){
|
||||
this.play();
|
||||
},
|
||||
onError(){
|
||||
console.warn("Audio Error " + this.audio.error.code + "; details: " + this.audio.error.message);
|
||||
},
|
||||
play(){
|
||||
this.clearTimeOutToHide();
|
||||
this.audio.play();
|
||||
|
||||
@@ -75,8 +75,9 @@ header[role="banner"]{
|
||||
margin:0; display: inline-block;
|
||||
a.site-name{
|
||||
display: block;
|
||||
$w:290px;
|
||||
$w:260px;
|
||||
width:$w; height:$w * 0.22;
|
||||
margin-top: 0.15em;
|
||||
background-image: url(../img/logo.svg);
|
||||
background-color: white;
|
||||
background-repeat:no-repeat;
|
||||
@@ -496,6 +497,7 @@ main[role="main"]{
|
||||
#audio-player{
|
||||
position: absolute;
|
||||
top:0; left:0;
|
||||
padding-left:1.2em;
|
||||
background-color: white;
|
||||
height:100%; min-width:300px;
|
||||
z-index: 20;
|
||||
@@ -526,7 +528,7 @@ main[role="main"]{
|
||||
width:70px; height:1px;
|
||||
background-color: #000;
|
||||
overflow: visible;
|
||||
transform: rotateZ(-45deg);
|
||||
transform: rotateZ(-46deg);
|
||||
.loader{
|
||||
width:0; height:100%;
|
||||
background-color: red;
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -7,6 +7,6 @@ dependencies:
|
||||
_core:
|
||||
default_config_hash: Mz9qWr1kUYK0mjRAGDsr5XS6PvtZ24en_7ndt-pyWe4
|
||||
id: node.teaser
|
||||
label: Teaser
|
||||
label: Accroche
|
||||
targetEntityType: node
|
||||
cache: true
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
definitions:
|
||||
system__admin_content:
|
||||
weight: -89
|
||||
weight: -94
|
||||
menu_name: admin
|
||||
parent: system.admin
|
||||
expanded: false
|
||||
@@ -84,13 +84,13 @@ definitions:
|
||||
expanded: false
|
||||
enabled: true
|
||||
help__main:
|
||||
weight: -82
|
||||
weight: -87
|
||||
menu_name: admin
|
||||
parent: system.admin
|
||||
expanded: false
|
||||
enabled: false
|
||||
system__admin_structure:
|
||||
weight: -88
|
||||
weight: -93
|
||||
menu_name: admin
|
||||
parent: system.admin
|
||||
expanded: false
|
||||
@@ -114,35 +114,41 @@ definitions:
|
||||
expanded: false
|
||||
enabled: true
|
||||
system__themes_page:
|
||||
weight: -87
|
||||
weight: -92
|
||||
menu_name: admin
|
||||
parent: system.admin
|
||||
expanded: false
|
||||
enabled: true
|
||||
system__modules_list:
|
||||
weight: -86
|
||||
weight: -91
|
||||
menu_name: admin
|
||||
parent: system.admin
|
||||
expanded: false
|
||||
enabled: true
|
||||
system__admin_config:
|
||||
weight: -85
|
||||
weight: -90
|
||||
menu_name: admin
|
||||
parent: system.admin
|
||||
expanded: false
|
||||
enabled: true
|
||||
entity__user__collection:
|
||||
weight: -84
|
||||
weight: -89
|
||||
menu_name: admin
|
||||
parent: system.admin
|
||||
expanded: false
|
||||
enabled: true
|
||||
system__admin_reports:
|
||||
weight: -83
|
||||
weight: -88
|
||||
menu_name: admin
|
||||
parent: system.admin
|
||||
expanded: false
|
||||
enabled: true
|
||||
system__admin:
|
||||
weight: -95
|
||||
menu_name: admin
|
||||
parent: ''
|
||||
enabled: true
|
||||
expanded: false
|
||||
_core:
|
||||
default_config_hash: jdY7AU0tU-QsjmiOw3W8vwpYMb-By--_MSFgbqKUTYM
|
||||
langcode: fr
|
||||
|
||||
@@ -2,7 +2,7 @@ page_alter: false
|
||||
raw_names: false
|
||||
error_handlers:
|
||||
4: 4
|
||||
rebuild_theme: true
|
||||
rebuild_theme: false
|
||||
debug_mail_file_format: '%to-%subject-%datetime.mail.txt'
|
||||
debug_mail_directory: 'temporary://devel-mails'
|
||||
devel_dumper: kint
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -197,62 +197,9 @@ processor_settings:
|
||||
h3: 2
|
||||
strong: 2
|
||||
b: 2
|
||||
em: 1
|
||||
u: 1
|
||||
weights:
|
||||
preprocess_index: -15
|
||||
preprocess_query: -15
|
||||
stopwords:
|
||||
all_fields: true
|
||||
fields:
|
||||
- body
|
||||
- title
|
||||
- field_description
|
||||
- field_transcript_trad
|
||||
- field_transcript_vo
|
||||
- name
|
||||
- field_genres
|
||||
- field_langues
|
||||
- field_synonyms
|
||||
stopwords:
|
||||
- a
|
||||
- an
|
||||
- and
|
||||
- are
|
||||
- as
|
||||
- at
|
||||
- be
|
||||
- but
|
||||
- by
|
||||
- for
|
||||
- if
|
||||
- in
|
||||
- into
|
||||
- is
|
||||
- it
|
||||
- 'no'
|
||||
- not
|
||||
- of
|
||||
- 'on'
|
||||
- or
|
||||
- s
|
||||
- such
|
||||
- t
|
||||
- that
|
||||
- the
|
||||
- their
|
||||
- then
|
||||
- there
|
||||
- these
|
||||
- they
|
||||
- this
|
||||
- to
|
||||
- was
|
||||
- will
|
||||
- with
|
||||
weights:
|
||||
preprocess_index: -5
|
||||
preprocess_query: -2
|
||||
ignorecase:
|
||||
all_fields: true
|
||||
fields:
|
||||
|
||||
@@ -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: { }
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
default_theme: toolbar_seven
|
||||
icons: 1
|
||||
icons: 0
|
||||
tabs: 0
|
||||
_core:
|
||||
default_config_hash: eKP5bVQyeFsyXTbwom9VK18EVYllpNq6xQPAx1QwXoA
|
||||
|
||||
@@ -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