expo interface using own subdomain, fix #544
This commit is contained in:
@@ -24,6 +24,7 @@ visibility:
|
||||
id: domain
|
||||
domains:
|
||||
encyclopediedelaparole_org: encyclopediedelaparole_org
|
||||
expo_encyclopediedelaparole_org: expo_encyclopediedelaparole_org
|
||||
negate: false
|
||||
context_mapping:
|
||||
'entity:domain': '@domain.current_domain_context:entity:domain'
|
||||
|
||||
@@ -3,6 +3,7 @@ langcode: fr
|
||||
status: true
|
||||
dependencies:
|
||||
module:
|
||||
- domain
|
||||
- edlp_search
|
||||
theme:
|
||||
- edlptheme
|
||||
@@ -17,4 +18,11 @@ settings:
|
||||
label: 'Edlp search link block'
|
||||
provider: edlp_search
|
||||
label_display: '0'
|
||||
visibility: { }
|
||||
visibility:
|
||||
domain:
|
||||
id: domain
|
||||
domains:
|
||||
encyclopediedelaparole_org: encyclopediedelaparole_org
|
||||
m_encyclopediedelaparole_org: m_encyclopediedelaparole_org
|
||||
negate: false
|
||||
context_mapping: { }
|
||||
|
||||
@@ -3,6 +3,7 @@ langcode: fr
|
||||
status: true
|
||||
dependencies:
|
||||
module:
|
||||
- domain
|
||||
- system
|
||||
theme:
|
||||
- edlptheme
|
||||
@@ -22,4 +23,11 @@ settings:
|
||||
use_site_logo: true
|
||||
use_site_name: true
|
||||
use_site_slogan: true
|
||||
visibility: { }
|
||||
visibility:
|
||||
domain:
|
||||
id: domain
|
||||
domains:
|
||||
encyclopediedelaparole_org: encyclopediedelaparole_org
|
||||
m_encyclopediedelaparole_org: m_encyclopediedelaparole_org
|
||||
negate: false
|
||||
context_mapping: { }
|
||||
|
||||
@@ -3,6 +3,7 @@ langcode: fr
|
||||
status: true
|
||||
dependencies:
|
||||
module:
|
||||
- domain
|
||||
- system
|
||||
theme:
|
||||
- edlptheme
|
||||
@@ -11,7 +12,7 @@ _core:
|
||||
id: edlptheme_content
|
||||
theme: edlptheme
|
||||
region: content
|
||||
weight: -2
|
||||
weight: -5
|
||||
provider: null
|
||||
plugin: system_main_block
|
||||
settings:
|
||||
@@ -19,4 +20,12 @@ settings:
|
||||
label: 'Main page content'
|
||||
provider: system
|
||||
label_display: '0'
|
||||
visibility: { }
|
||||
visibility:
|
||||
domain:
|
||||
id: domain
|
||||
domains:
|
||||
encyclopediedelaparole_org: encyclopediedelaparole_org
|
||||
m_encyclopediedelaparole_org: m_encyclopediedelaparole_org
|
||||
negate: false
|
||||
context_mapping:
|
||||
'entity:domain': '@domain.current_domain_context:entity:domain'
|
||||
|
||||
@@ -5,6 +5,7 @@ dependencies:
|
||||
config:
|
||||
- system.menu.main
|
||||
module:
|
||||
- domain
|
||||
- domain_menu_access
|
||||
theme:
|
||||
- edlptheme
|
||||
@@ -21,5 +22,12 @@ settings:
|
||||
label_display: visible
|
||||
level: '1'
|
||||
depth: '0'
|
||||
expand_all_items: false
|
||||
visibility: { }
|
||||
expand_all_items: 0
|
||||
visibility:
|
||||
domain:
|
||||
id: domain
|
||||
domains:
|
||||
encyclopediedelaparole_org: encyclopediedelaparole_org
|
||||
m_encyclopediedelaparole_org: m_encyclopediedelaparole_org
|
||||
negate: false
|
||||
context_mapping: { }
|
||||
|
||||
@@ -9,7 +9,7 @@ dependencies:
|
||||
id: messages
|
||||
theme: edlptheme
|
||||
region: content
|
||||
weight: -4
|
||||
weight: -7
|
||||
provider: null
|
||||
plugin: system_messages_block
|
||||
settings:
|
||||
|
||||
@@ -3,6 +3,7 @@ langcode: fr
|
||||
status: true
|
||||
dependencies:
|
||||
module:
|
||||
- domain
|
||||
- edlp_studio
|
||||
theme:
|
||||
- edlptheme
|
||||
@@ -17,4 +18,11 @@ settings:
|
||||
label: 'Studio link block'
|
||||
provider: edlp_studio
|
||||
label_display: '0'
|
||||
visibility: { }
|
||||
visibility:
|
||||
domain:
|
||||
id: domain
|
||||
domains:
|
||||
encyclopediedelaparole_org: encyclopediedelaparole_org
|
||||
m_encyclopediedelaparole_org: m_encyclopediedelaparole_org
|
||||
negate: false
|
||||
context_mapping: { }
|
||||
|
||||
@@ -3,6 +3,7 @@ langcode: fr
|
||||
status: true
|
||||
dependencies:
|
||||
module:
|
||||
- domain
|
||||
- edlp_studio
|
||||
theme:
|
||||
- edlptheme
|
||||
@@ -17,4 +18,11 @@ settings:
|
||||
label: 'Studio User login'
|
||||
provider: edlp_studio
|
||||
label_display: visible
|
||||
visibility: { }
|
||||
visibility:
|
||||
domain:
|
||||
id: domain
|
||||
domains:
|
||||
encyclopediedelaparole_org: encyclopediedelaparole_org
|
||||
m_encyclopediedelaparole_org: m_encyclopediedelaparole_org
|
||||
negate: false
|
||||
context_mapping: { }
|
||||
|
||||
@@ -3,6 +3,7 @@ langcode: fr
|
||||
status: true
|
||||
dependencies:
|
||||
module:
|
||||
- domain
|
||||
- node
|
||||
- user
|
||||
theme:
|
||||
@@ -10,7 +11,7 @@ dependencies:
|
||||
id: tabs
|
||||
theme: edlptheme
|
||||
region: content
|
||||
weight: -3
|
||||
weight: -6
|
||||
provider: null
|
||||
plugin: local_tasks_block
|
||||
settings:
|
||||
@@ -39,3 +40,10 @@ visibility:
|
||||
negate: false
|
||||
context_mapping:
|
||||
user: '@user.current_user_context:current_user'
|
||||
domain:
|
||||
id: domain
|
||||
domains:
|
||||
encyclopediedelaparole_org: encyclopediedelaparole_org
|
||||
m_encyclopediedelaparole_org: m_encyclopediedelaparole_org
|
||||
negate: false
|
||||
context_mapping: { }
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
uuid: 1b44e5e7-bba8-4a19-9063-535e4ee09615
|
||||
langcode: en
|
||||
status: true
|
||||
dependencies: { }
|
||||
id: expo_encyclopediedelaparole_org
|
||||
domain_id: 110224
|
||||
hostname: expo.encyclopediedelaparole.org
|
||||
name: 'Encyclopédie de la parole EXPO'
|
||||
scheme: https
|
||||
weight: 3
|
||||
is_default: false
|
||||
@@ -1,7 +1,7 @@
|
||||
allow_non_ascii: false
|
||||
www_prefix: false
|
||||
login_paths: /user/login\r\n/user/password
|
||||
css_classes: ''
|
||||
css_classes: 'domain-[domain:id] domain-[domain:machine-name]'
|
||||
_core:
|
||||
default_config_hash: cGy1RN-NwgFrdUwA-OY7bvwtQ6Nz6UxhenvnJ4Pp4-k
|
||||
langcode: fr
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
uuid: bf2e0afd-4ee3-4d84-910c-1a274091a092
|
||||
langcode: fr
|
||||
status: true
|
||||
dependencies: { }
|
||||
id: beta_encyclopediedelaparole_org
|
||||
domain_id: encyclopediedelaparole_org
|
||||
pattern: beta.encyclopediedelaparole.org
|
||||
redirect: 0
|
||||
environment: development
|
||||
@@ -1,9 +0,0 @@
|
||||
uuid: 92fa7238-52c4-4bd3-b183-45cdb85a51eb
|
||||
langcode: fr
|
||||
status: true
|
||||
dependencies: { }
|
||||
id: beta_m_encyclopediedelaparole_org
|
||||
domain_id: m_encyclopediedelaparole_org
|
||||
pattern: beta.m.encyclopediedelaparole.org
|
||||
redirect: 0
|
||||
environment: testing
|
||||
@@ -0,0 +1,9 @@
|
||||
uuid: cd1a12bc-5ff9-477c-bf94-cc05093961c6
|
||||
langcode: en
|
||||
status: true
|
||||
dependencies: { }
|
||||
id: dev_expo_encyclopediedelaparole_org
|
||||
domain_id: expo_encyclopediedelaparole_org
|
||||
pattern: dev.expo.encyclopediedelaparole.org
|
||||
redirect: 0
|
||||
environment: local
|
||||
@@ -1,9 +0,0 @@
|
||||
uuid: 2b55dc7d-81c1-4074-918e-78833a72b2a2
|
||||
langcode: fr
|
||||
status: true
|
||||
dependencies: { }
|
||||
id: edlp_figli_io
|
||||
domain_id: encyclopediedelaparole_org
|
||||
pattern: edlp.figli.io
|
||||
redirect: 0
|
||||
environment: testing
|
||||
@@ -1,9 +0,0 @@
|
||||
uuid: 3ea77fdb-0d81-4c7a-8cf4-1fc67c5538ab
|
||||
langcode: fr
|
||||
status: true
|
||||
dependencies: { }
|
||||
id: edlp_m_figli_io
|
||||
domain_id: m_encyclopediedelaparole_org
|
||||
pattern: edlp.m.figli.io
|
||||
redirect: 0
|
||||
environment: development
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
uuid: 68e32c87-ed2f-4047-a098-f779258ea8be
|
||||
langcode: en
|
||||
status: true
|
||||
dependencies:
|
||||
config:
|
||||
- domain.record.expo_encyclopediedelaparole_org
|
||||
module:
|
||||
- domain_access
|
||||
id: domain_access_add_action.expo_encyclopediedelaparole_org
|
||||
label: 'Add selected content to the Encyclopédie de la parole domain'
|
||||
type: node
|
||||
plugin: domain_access_add_action
|
||||
configuration:
|
||||
domain_id: expo_encyclopediedelaparole_org
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
uuid: 7ec41e65-c60f-4eb2-8d13-137d765fe086
|
||||
langcode: en
|
||||
status: true
|
||||
dependencies:
|
||||
config:
|
||||
- domain.record.expo_encyclopediedelaparole_org
|
||||
module:
|
||||
- domain_access
|
||||
id: domain_access_add_editor_action.expo_encyclopediedelaparole_org
|
||||
label: 'Add editors to the Encyclopédie de la parole domain'
|
||||
type: user
|
||||
plugin: domain_access_add_editor_action
|
||||
configuration:
|
||||
domain_id: expo_encyclopediedelaparole_org
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
uuid: 0a61de2c-75c7-40a8-83f9-f2b7c2e6b297
|
||||
langcode: en
|
||||
status: true
|
||||
dependencies:
|
||||
config:
|
||||
- domain.record.expo_encyclopediedelaparole_org
|
||||
module:
|
||||
- domain_access
|
||||
id: domain_access_remove_action.expo_encyclopediedelaparole_org
|
||||
label: 'Remove selected content from the Encyclopédie de la parole domain'
|
||||
type: node
|
||||
plugin: domain_access_remove_action
|
||||
configuration:
|
||||
domain_id: expo_encyclopediedelaparole_org
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
uuid: b2943b17-1e04-4fa8-aa3f-f6fc1b3f2757
|
||||
langcode: en
|
||||
status: true
|
||||
dependencies:
|
||||
config:
|
||||
- domain.record.expo_encyclopediedelaparole_org
|
||||
module:
|
||||
- domain_access
|
||||
id: domain_access_remove_editor_action.expo_encyclopediedelaparole_org
|
||||
label: 'Remove editors from the Encyclopédie de la parole domain'
|
||||
type: user
|
||||
plugin: domain_access_remove_editor_action
|
||||
configuration:
|
||||
domain_id: expo_encyclopediedelaparole_org
|
||||
@@ -1,5 +1,5 @@
|
||||
|
||||
(function($,Drupal,drupalSettings){EdlpCorpus=function(){var _activated=true;var _$body=$('body');var _$container=_$body;var _$canvas=$('<canvas id="corpus-map">').appendTo(_$container);var _canvas=_$canvas[0];var _ctx=_canvas.getContext('2d');var _dpi=window.devicePixelRatio;var _scene_props={width:window.innerWidth,height:window.innerHeight,'margin_top':75,'margin_right':0,'margin_bottom':65,'margin_left':0};var _evolution_zone={left:_scene_props.width/4,right:_scene_props.width-_scene_props.width/4,center:_scene_props.width/2,};var _physics=new Physics();var _nodes=[];var _articles_nodes=[];var _no_articles_nodes=[];var _nodes_by_entries={};var _nodes_by_nid={};var _nodes_Nid_Id={};var _nodes_centered=[];var _nodes_centered_attractions=[];var _loaded=false;var _playlist=[];var _p_velocity_factor=0.5;var _mouse_in=true;var _m_pos={x:0,y:0};var _node_hover_id=-1;var _node_opened_id=-1;var _$entrees_block=$('#block-edlpentreesblock');var _$entrees_block_termlinks=$('a.term-link',_$entrees_block);var _$articles_link;var _node_pop_up;var _settings=drupalSettings.edlp_corpus;var _ecolors=_settings.colors;var _attracter;var check_parts_colid_frq=2;var check_parts_colid_tick=1;function init(){initCanvas();if(_activated){loadCorpus();}else{_$canvas.addClass('de-activated');}};function initCanvas(){window.addEventListener('resize',onResizeCanvas,false);onResizeCanvas();};function onResizeCanvas(){_scene_props.width=window.innerWidth;_scene_props.height=window.innerHeight;_canvas.style.width=_scene_props.width+'px';_canvas.style.height=_scene_props.height+'px';_canvas.width=_scene_props.width*_dpi;_canvas.height=_scene_props.height*_dpi;_ctx.scale(_dpi,_dpi);moveEvolutionZone();if(_loaded){for(var i=0;i<_nodes.length;i++){_nodes[i].onResizeCanvas();}}};function loadCorpus(){var ajax_path=_settings.load_corpus_ajax_url;var path=window.location.origin+Drupal.url(ajax_path);$.getJSON(path,{}).done(function(data){onCorpusLoaded(data);}).fail(function(jqxhr,textStatus,error){onCorpusLoadError(jqxhr,textStatus,error);});};function onCorpusLoadError(jqxhr,textStatus,error){void 0;};function onCorpusLoaded(data){void 0;initPhysics();buildNodes(data.nodes);initArtilesLink();initNodePopup();initEvents();checkPreOpenedEntry();startAnime();_loaded=true;};function initPhysics(){_attracter=_physics.makeParticle(1000);_attracter.fixed=true;resizePhysics();};function resizePhysics(){if(typeof _attracter!='undefined'){_attracter.position={x:_evolution_zone.center,y:_scene_props.height/2};}};function buildNodes(nodes){var d;for(var i in nodes){d=i<1?true:false;new Node(i,nodes[i],d);_playlist.push({'id':i,'nid':nodes[i].nid,'audio_url':nodes[i].audio_url,'document_url':nodes[i].document_url,});}};function Node(i,node,d){this.id=i;for(key in node)
|
||||
(function($,Drupal,drupalSettings){EdlpCorpus=function(){var _activated=true;var _$body=$('body');var _$container=_$body;var _$canvas=$('<canvas id="corpus-map">').appendTo(_$container);var _canvas=_$canvas[0];var _ctx=_canvas.getContext('2d');var _dpi=window.devicePixelRatio;var _is_expo=$('body').hasClass('domain-expo-encyclopediedelaparole-org');var _scene_props={width:window.innerWidth,height:window.innerHeight,'margin_top':_is_expo?0:75,'margin_right':0,'margin_bottom':_is_expo?0:65,'margin_left':0};var _evolution_zone={left:_scene_props.width/4,right:_scene_props.width-_scene_props.width/4,center:_scene_props.width/2,};var _physics=new Physics();var _nodes=[];var _articles_nodes=[];var _no_articles_nodes=[];var _nodes_by_entries={};var _nodes_by_nid={};var _nodes_Nid_Id={};var _nodes_centered=[];var _nodes_centered_attractions=[];var _loaded=false;var _playlist=[];var _p_velocity_factor=0.5;var _mouse_in=true;var _m_pos={x:0,y:0};var _node_hover_id=-1;var _node_opened_id=-1;var _$entrees_block=$('#block-edlpentreesblock');var _$entrees_block_termlinks=$('a.term-link',_$entrees_block);var _$articles_link;var _node_pop_up;var _settings=drupalSettings.edlp_corpus;var _ecolors=_settings.colors;var _attracter;var check_parts_colid_frq=2;var check_parts_colid_tick=1;function init(){void 0;initCanvas();if(_activated){loadCorpus();}else{_$canvas.addClass('de-activated');}};function initCanvas(){window.addEventListener('resize',onResizeCanvas,false);onResizeCanvas();};function onResizeCanvas(){_scene_props.width=window.innerWidth;_scene_props.height=window.innerHeight;_canvas.style.width=_scene_props.width+'px';_canvas.style.height=_scene_props.height+'px';_canvas.width=_scene_props.width*_dpi;_canvas.height=_scene_props.height*_dpi;_ctx.scale(_dpi,_dpi);moveEvolutionZone();if(_loaded){for(var i=0;i<_nodes.length;i++){_nodes[i].onResizeCanvas();}}};function loadCorpus(){var ajax_path=_settings.load_corpus_ajax_url;var path=window.location.origin+Drupal.url(ajax_path);$.getJSON(path,{}).done(function(data){onCorpusLoaded(data);}).fail(function(jqxhr,textStatus,error){onCorpusLoadError(jqxhr,textStatus,error);});};function onCorpusLoadError(jqxhr,textStatus,error){void 0;};function onCorpusLoaded(data){void 0;initPhysics();buildNodes(data.nodes);initArtilesLink();initNodePopup();initEvents();checkPreOpenedEntry();startAnime();_loaded=true;};function initPhysics(){_attracter=_physics.makeParticle(1000);_attracter.fixed=true;resizePhysics();};function resizePhysics(){if(typeof _attracter!='undefined'){_attracter.position={x:_evolution_zone.center,y:_scene_props.height/2};}};function buildNodes(nodes){var d;for(var i in nodes){d=i<1?true:false;new Node(i,nodes[i],d);_playlist.push({'id':i,'nid':nodes[i].nid,'audio_url':nodes[i].audio_url,'document_url':nodes[i].document_url,});}};function Node(i,node,d){this.id=i;for(key in node)
|
||||
this[key]=node[key];_nodes.push(this);_nodes_by_nid[this.nid]=this;_nodes_Nid_Id[this.nid]=this.id;if(this.has_article==1){_articles_nodes.push(this);}else{_no_articles_nodes.push(this);}
|
||||
for(var j=0;j<this.entrees.length;j++){if(typeof _nodes_by_entries[this.entrees[j]]=='undefined')
|
||||
_nodes_by_entries[this.entrees[j]]=[];_nodes_by_entries[this.entrees[j]].push(this);}
|
||||
@@ -32,11 +32,11 @@ filterEntree(tid);if(bubbling){_$body.trigger({'type':'open_entree','tid':tid,'u
|
||||
scrambleCollection();_$body.trigger({'type':'close_entree','tid':tid});}};function filterEntree(t){_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 filterByNids(nids){_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(_nodes_centered);createNodesRepulsions();};function scrambleCollection(){void 0;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(){var href=window.location.origin+drupalSettings.path.baseUrl+_settings.articlesindex_url;_$articles_link=$('<a>').html('Articles').attr("href",href).attr("data-drupal-link-system-path",_settings.articlesindex_url).addClass('articles-link ajax-link');$('.item-list ul',_$entrees_block).append($('<li>').append($('<span class="oblique-wrapper">').append(_$articles_link)));};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],};_$canvas.trigger(event);}else{_$canvas.trigger('corpus-cliked-on-map');}}}).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();}).on('scramble-collection',function(e){void 0;scrambleCollection();}).on('shuffle-collection',function(e){void 0;onResizeCanvas();});_$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('ajax-node-loaded-linked-documents',function(e){void 0;filterByNids(e.nids);}).on('search-results-loaded',function(e){filterByNids(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();}}).on('visible-space-changed',function(e){moveEvolutionZone(e.left_limit,e.right_limit);});};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>_evolution_zone.right-350&&this.node.y<this.node.wall_limits.top+200:this.$dom.attr('pos','bottom-left');break;case this.node.x>_evolution_zone.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,_scene_props.width,_scene_props.height);checkParticulesCollisions();for(var i=0;i<_nodes.length;i++){_nodes[i].onUpdate();}
|
||||
_node_pop_up.draw();if(_node_hover_id!=-1){_canvas.style.cursor='pointer';}else{_canvas.style.cursor='auto';}
|
||||
highlightEntries();};function startAnime(){_physics.onUpdate(render);_physics.play()
|
||||
$('body').attr('corpus','map-ready').trigger({'type':'corpus-map-ready','playlist':_playlist});};init();}
|
||||
$(document).ready(function($){if(drupalSettings.path.isFront&&!edlp_mobile.device_is_mobile){var edlpcorpus=new EdlpCorpus();}});})(jQuery,Drupal,drupalSettings);
|
||||
$(document).ready(function($){void 0;if(drupalSettings.path.isFront&&!edlp_mobile.device_is_mobile){void 0;var edlpcorpus=new EdlpCorpus();}});})(jQuery,Drupal,drupalSettings);
|
||||
@@ -25,14 +25,15 @@
|
||||
var _canvas = _$canvas[0];
|
||||
var _ctx = _canvas.getContext('2d');
|
||||
var _dpi = window.devicePixelRatio;
|
||||
var _is_expo = $('body').hasClass('domain-expo-encyclopediedelaparole-org');
|
||||
var _scene_props = {
|
||||
width:window.innerWidth,
|
||||
height:window.innerHeight,
|
||||
// 'margin_top':90, // with red border on head
|
||||
'margin_top':75, // without red border on head
|
||||
'margin_top': _is_expo ? 0 : 75, // without red border on head
|
||||
// 'margin_top':0,
|
||||
'margin_right':0,
|
||||
'margin_bottom':65,
|
||||
'margin_bottom': _is_expo ? 0 : 65,
|
||||
// 'margin_bottom':0,
|
||||
'margin_left':0
|
||||
};
|
||||
@@ -81,6 +82,7 @@
|
||||
// _/ // / / / / /_(__ )
|
||||
// /___/_/ /_/_/\__/____/
|
||||
function init(){
|
||||
console.log("Corpus init()");
|
||||
initCanvas();
|
||||
if(_activated){
|
||||
loadCorpus();
|
||||
@@ -888,7 +890,7 @@
|
||||
// };
|
||||
|
||||
function scrambleCollection(){
|
||||
// console.log('scrambleCollection');
|
||||
console.log('Corpus scrambleCollection');
|
||||
for (var i = 0; i < _nodes.length; i++) {
|
||||
_nodes[i].scramble();
|
||||
}
|
||||
@@ -1305,7 +1307,9 @@
|
||||
|
||||
|
||||
$(document).ready(function($) {
|
||||
console.log("Corpus ready");
|
||||
if(drupalSettings.path.isFront && !edlp_mobile.device_is_mobile){
|
||||
console.log("Corpus new edlpCorpus()");
|
||||
var edlpcorpus = new EdlpCorpus();
|
||||
}
|
||||
});
|
||||
|
||||
@@ -71,6 +71,9 @@ function edlp_mobile_page_attachments(array &$attachments) {
|
||||
$desktop_domain = $domain_storage->load('encyclopediedelaparole_org');
|
||||
// dpm($desktop_domain, 'desktop_domain');
|
||||
|
||||
$expo_domain = $domain_storage->load('expo_encyclopediedelaparole_org');
|
||||
// dpm($expo_domain, 'expo_domain');
|
||||
|
||||
$current_domain = $domain_storage->loadByHostname($current_hostname);
|
||||
// dpm($current_domain, 'current_domain');
|
||||
|
||||
@@ -79,6 +82,7 @@ function edlp_mobile_page_attachments(array &$attachments) {
|
||||
$is_mobile_domain = ($current_domain->id() == $mobile_domain->id());
|
||||
$mobile_url = $mobile_domain->getHostname();
|
||||
$desktop_url = $desktop_domain->getHostname();
|
||||
$expo_url = $expo_domain->getHostname();
|
||||
}else{
|
||||
// we are not in a main domain, so we look for an alias
|
||||
$domain_alias_storage = \Drupal::entityTypeManager()->getStorage('domain_alias');
|
||||
@@ -93,34 +97,30 @@ function edlp_mobile_page_attachments(array &$attachments) {
|
||||
$env_aliases = $domain_alias_storage->loadByEnvironment($env);
|
||||
// dpm($env_aliases, '$env_aliases');
|
||||
// find out mibile alias and desktop alias
|
||||
// this is dirty
|
||||
// get mobile pattern
|
||||
foreach ($env_aliases as $env_alias_id => $env_alias) {
|
||||
switch ($env_alias->getDomainId()) {
|
||||
case 'm_encyclopediedelaparole_org':
|
||||
$mobile_url = $env_alias->getPattern();
|
||||
break;
|
||||
case 'encyclopediedelaparole_org':
|
||||
$desktop_url = $env_alias->getPattern();
|
||||
break;
|
||||
case 'expo_encyclopediedelaparole_org':
|
||||
$expo_url = $env_alias->getPattern();
|
||||
break;
|
||||
}
|
||||
}
|
||||
// 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
|
||||
// we assume that there is only two alias by env (mobile or desktop)
|
||||
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();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}elseif($domain_id == 'expo_encyclopediedelaparole_org'){
|
||||
// current domain/alias is expo
|
||||
$is_mobile_domain = false;
|
||||
}else{
|
||||
// current domain/alias is desktop
|
||||
$is_mobile_domain = false;
|
||||
$desktop_url = $alias->getPattern();
|
||||
// find mobile pattern
|
||||
// we assume that there is only two alias by env (mobile or desktop)
|
||||
foreach ($env_aliases as $env_alias_id => $env_alias) {
|
||||
if($env_alias_id != $alias->id()){
|
||||
// we found the mobile pattern
|
||||
$mobile_url = $env_alias->getPattern();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -135,6 +135,8 @@ function edlp_mobile_page_attachments(array &$attachments) {
|
||||
// $desktop_home_path = "???";
|
||||
$desktop_home_path = \Drupal::config('domain_site_settings.domainconfigsettings')->get('encyclopediedelaparole_org.site_frontpage', FALSE);
|
||||
|
||||
$expo_home_path = \Drupal::config('domain_site_settings.domainconfigsettings')->get('expo_encyclopediedelaparole_org.site_frontpage', FALSE);
|
||||
|
||||
// $redirect = false;
|
||||
$js_str = "var edlp_mobile = {\n
|
||||
current_url:'".$base_root."',\n
|
||||
@@ -146,6 +148,8 @@ function edlp_mobile_page_attachments(array &$attachments) {
|
||||
mobile_home_path:'".$mobile_home_path."',\n
|
||||
desktop_url:'".$desktop_url."',\n
|
||||
desktop_home_path:'".$desktop_home_path."',\n
|
||||
expo_url:'".$expo_url."',\n
|
||||
expo_home_path:'".$expo_home_path."',\n
|
||||
};";
|
||||
|
||||
$attachments['#attached']['html_head'][] = [
|
||||
|
||||
+11
-8
@@ -1,5 +1,5 @@
|
||||
|
||||
(function($,Drupal,drupalSettings){EdlpTheme=function(){var _origin=window.location.origin;var _base_url=drupalSettings.path.baseUrl;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;var _is_mobile=edlp_mobile.device_is_mobile;var _is_loggedin=drupalSettings.user.uid===0?false:true;var _$log_form;var _user_tokens;var _states_history=[];function init(){void 0;if(!_is_loggedin){initLogForm();}
|
||||
(function($,Drupal,drupalSettings){EdlpTheme=function(){var _origin=window.location.origin;var _base_url=drupalSettings.path.baseUrl;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;var _is_mobile=edlp_mobile.device_is_mobile;var _is_loggedin=drupalSettings.user.uid===0?false:true;var _$log_form;var _user_tokens;var _states_history=[];var _is_expo=$('body').hasClass('domain-expo-encyclopediedelaparole-org');function init(){void 0;if(!_is_loggedin){initLogForm();}
|
||||
if(_is_mobile){initMobile();}
|
||||
initEvents();_audioPlayer=new AudioPlayer();_compoPlayer=new CompoPlayer();initAjaxLinks();initHistory();if(!_is_mobile){checkLayout();initAudioLinksHover();}
|
||||
if(_is_mobile){if(drupalSettings.path.isFront){initHomeMobile();}
|
||||
@@ -55,8 +55,10 @@ if(typeof _states_history[0]!="undefined"){if(_states_history[0].caller){state.c
|
||||
break;}}else{state.context=null;}
|
||||
if($link.is('[selector]')){state.selector=$link.attr('selector');}
|
||||
$link.addClass('ajax-loading');ajaxLoadContent(state);return false;};function refreshFavoritesLinks(){void 0;_audioPlayer.reloadNode();if(_states_history[0].view_mode=='index'||_states_history[0].sys_path=="docsindex"){ajaxLoadContent(_states_history[0]);}}
|
||||
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').openDocument(e.target_node);});_randomPlayer=new RandomPlayer(e.playlist);initAjaxLinks();_$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 checkVisibleCorpusMapSpace(){var left_limit=0,right_limit=0;_$row.find('.col').each(function(i,e){var $col=$(this);var offset=$col.offset();void 0;switch(true){case $col.is('.float-right'):right_limit=Math.max(right_limit,Math.abs(offset.left-15-window.innerWidth));break;default:left_limit=Math.max(left_limit,offset.left+$col.width()+15);break;}});void 0;if(_corpus_ready){_$body.trigger({type:'visible-space-changed',left_limit:left_limit,right_limit:right_limit});}else{_corpus_promise.done(function(){_$body.trigger({type:'visible-space-changed',left_limit:left_limit,right_limit:right_limit});});}};function AudioPlayer(){var that=this;this.fid;this.audio=new Audio();this.audio_events=["loadedmetadata","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.scndCartel_visible=0;this.cartelSwitchIntervalMS=7000;this.cartelSwitchInterval=false;this.visible=false;this.hideTimer=false;this.hideTimeMS=15000;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_parent=$('header[role="banner"] .region-header');this.$container.appendTo(this.$container_parent);this.timeline_w=parseInt(this.$timeline.width());this.$loader.on('click',this.seek.bind(this));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 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').openDocument(e.target_node);});_randomPlayer=new RandomPlayer(e.playlist);if(_is_expo){_randomPlayer.start();}
|
||||
initAjaxLinks();_$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 checkVisibleCorpusMapSpace(){var left_limit=0,right_limit=0;_$row.find('.col').each(function(i,e){var $col=$(this);var offset=$col.offset();void 0;switch(true){case $col.is('.float-right'):right_limit=Math.max(right_limit,Math.abs(offset.left-15-window.innerWidth));break;default:left_limit=Math.max(left_limit,offset.left+$col.width()+15);break;}});void 0;if(_corpus_ready){_$body.trigger({type:'visible-space-changed',left_limit:left_limit,right_limit:right_limit});}else{_corpus_promise.done(function(){_$body.trigger({type:'visible-space-changed',left_limit:left_limit,right_limit:right_limit});});}};function AudioPlayer(){var that=this;this.fid;this.audio=new Audio();this.audio_events=["loadedmetadata","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.scndCartel_visible=0;this.cartelSwitchIntervalMS=7000;this.cartelSwitchInterval=false;this.visible=false;this.hideTimer=false;this.hideTimeMS=15000;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(){if(!_is_expo){this.$container_parent=$('header[role="banner"] .region-header');}else{this.$container_parent=$('main[role="main"]');}
|
||||
this.$container.appendTo(this.$container_parent);this.timeline_w=parseInt(this.$timeline.width());this.$loader.on('click',this.seek.bind(this));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){void 0;if(typeof node=='undefined'||typeof node.nid=='undefined'||typeof node.audio_url=='undefined'){void 0;return false;}
|
||||
if(typeof caller=='undefined'||caller!='popstate'){void 0;this.historic.push(node);this.currentHistoricIndex=this.historic.length-1;if(caller!="history_first_load"){if(typeof node.document_url=='undefined'){void 0;}else{var state={audio:true,node:{nid:node.nid,audio_url:node.audio_url,document_url:node.document_url,title:node.title||null,},historic_index:this.currentHistoricIndex,};var url=node.document_url+(caller=='random'?'#random':'');history.pushState(state,null,url);}}}else{this.currentHistoricIndex=historic_index;}
|
||||
if(_$body.is('.path-frontpage')&&caller!=='lastdocs'&&!_is_mobile){closeAllModals();}
|
||||
@@ -64,15 +66,16 @@ this.emmit('audio-open-document',{caller:caller});if(typeof _paq!=='undefined'){
|
||||
this.launch();},launch(){this.clearTimeOutToHide();this.clearIntervalAutoCartelSwitch();this.setSRC(this.historic[this.currentHistoricIndex].audio_url);if(!_is_mobile){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;var that=this;_corpus_promise.done(function(){_$corpus_canvas.trigger({'type':'audio-node-opened','nid':that.historic[that.currentHistoricIndex].nid});});}
|
||||
this.showHidePreviousBtn();this.showHideNextBtn();this.show();},openSound(url,title){this.hide();this.clearTimeOutToHide();this.$cartel.html("");this.setSRC(url);this.show();if(typeof _paq!=='undefined'){_paq.push(['trackEvent','Audio','play',url]);}},setSRC(url){void 0;this.audio.src=url;this.play();},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(){void 0;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){window.requestAnimationFrame(this.updateLoadingBar.bind(this));}else{void 0;}}else{window.requestAnimationFrame(this.updateLoadingBar.bind(this));}},onError(){void 0;},play(){this.clearTimeOutToHide();var promise=this.audio.play();if(promise!==undefined){promise.catch(function(error){void 0;}).then(function(){void 0;});}},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.play();}else{this.stop();}},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();}},seek(e){var seek=e.originalEvent.layerX/this.timeline_w*this.audio.duration
|
||||
void 0;this.audio.currentTime=seek;},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.stop();this.emmit('audio-ended');},reloadNode(){if(this.visible){if(!_is_mobile){void 0;this.loadNode(this.historic[this.currentHistoricIndex].nid);}}},loadNode(nid){this.$cartel.addClass('loading');var vm='player_cartel';var ajax_path=_ajax_settings.entityjson_path+'/node/'+nid+'/'+vm;var path=_origin+Drupal.url(ajax_path);$.getJSON(path,{}).done(this.onNodeLoaded.bind(this)).fail(this.onNodeLoadFail.bind(this));},onNodeLoaded(data){void 0;this.$cartel.html(data.rendered).removeClass('loading');_$body.trigger({'type':'new-audio-cartel-loaded'});initAjaxLinks();this.scndCartel_visible=0;this.$cartel.removeClass('second-visible');if(this.$cartel.find('.second-cartel .col-left').children().length>1||this.$cartel.find('.second-cartel').children('.col-right').length){this.cartelSwitchInterval=setInterval(this.switchCartel.bind(this),this.cartelSwitchIntervalMS);}
|
||||
Drupal.attachBehaviors(this.$cartel);this.setAutoOpenArticle();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=$('a.articles-link').is('.is-active');return this;},show(){this.visible=true;this.$container_parent.addClass('audio-player-visible');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;}},switchCartel(){if(this.scndCartel_visible){this.$cartel.removeClass('second-visible');this.scndCartel_visible=0;this.clearIntervalAutoCartelSwitch();}else{this.$cartel.addClass('second-visible');this.scndCartel_visible=1;}},clearIntervalAutoCartelSwitch(){if(this.cartelSwitchInterval){clearInterval(this.cartelSwitchInterval);this.cartelSwitchInterval=false;}},hide(){this.visible=false;this.$container_parent.removeClass('audio-player-visible');this.$container.removeClass('visible');try{_$corpus_canvas.trigger('audio-node-closed');}catch(e){void 0;}},deActivateRandom(){this.shuffle_is_active=false;this.showHideNextBtn();},on(event_name,handler){if(typeof this.event_handlers[event_name]=='undefined'){void 0;}
|
||||
void 0;this.audio.currentTime=seek;},seekToEnd(){if(this.audio.duration>40){void 0;this.audio.currentTime=this.audio.duration-20;}},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.stop();this.emmit('audio-ended');},reloadNode(){if(this.visible){if(!_is_mobile){void 0;this.loadNode(this.historic[this.currentHistoricIndex].nid);}}},loadNode(nid){this.$cartel.addClass('loading');var vm='player_cartel';var ajax_path=_ajax_settings.entityjson_path+'/node/'+nid+'/'+vm;var path=_origin+Drupal.url(ajax_path);$.getJSON(path,{}).done(this.onNodeLoaded.bind(this)).fail(this.onNodeLoadFail.bind(this));},onNodeLoaded(data){void 0;this.$cartel.html(data.rendered).removeClass('loading');_$body.trigger({'type':'new-audio-cartel-loaded'});initAjaxLinks();this.scndCartel_visible=0;this.$cartel.removeClass('second-visible');if(!_is_expo){if(this.$cartel.find('.second-cartel .col-left').children().length>1||this.$cartel.find('.second-cartel').children('.col-right').length){this.cartelSwitchInterval=setInterval(this.switchCartel.bind(this),this.cartelSwitchIntervalMS);}
|
||||
Drupal.attachBehaviors(this.$cartel);}
|
||||
this.setAutoOpenArticle();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=$('a.articles-link').is('.is-active');return this;},show(){this.visible=true;this.$container_parent.addClass('audio-player-visible');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;}},switchCartel(){if(this.scndCartel_visible){this.$cartel.removeClass('second-visible');this.scndCartel_visible=0;this.clearIntervalAutoCartelSwitch();}else{this.$cartel.addClass('second-visible');this.scndCartel_visible=1;}},clearIntervalAutoCartelSwitch(){if(this.cartelSwitchInterval){clearInterval(this.cartelSwitchInterval);this.cartelSwitchInterval=false;}},hide(){this.visible=false;this.$container_parent.removeClass('audio-player-visible');this.$container.removeClass('visible');try{_$corpus_canvas.trigger('audio-node-closed');}catch(e){void 0;}},deActivateRandom(){this.shuffle_is_active=false;this.showHideNextBtn();},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){void 0;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];(function(handler,args){setTimeout(function(){handler(args);},0);}(handler,args));}
|
||||
return this;},}
|
||||
function RandomPlayer(playlist){this.active=false;this.playlist=playlist;this.path=_base_url+drupalSettings.path.pathPrefix+'#random'
|
||||
this.$btn=$('<a>').html('Shuffle').attr('href',this.path).attr('alt',drupalSettings.edlp_corpus.random_link_title).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-play-next',this.onAudioPlayNext.bind(this)).on('audio-ended',this.onAudioPlayerEnded.bind(this)).on('stop-shuffle',this.stop.bind(this));_$corpus_canvas.on('update-random-playlist',this.updatePlaylist.bind(this));if(window.location.hash=='#random'){this.start();}},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.$btn=$('<a>').html('Shuffle').attr('href',this.path).attr('alt',drupalSettings.edlp_corpus.random_link_title).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-play-next',this.onAudioPlayNext.bind(this)).on('audio-ended',this.onAudioPlayerEnded.bind(this)).on('stop-shuffle',this.stop.bind(this));_$corpus_canvas.on('update-random-playlist',this.updatePlaylist.bind(this));if(window.location.hash=='#random'){this.start();}},updatePlaylist(e){if(!_is_expo){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){e.preventDefault();if(this.active){this.stop();}else{this.start();}
|
||||
return false;},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=false;this.$btn.removeClass('is-active');history.replaceState(history.state,null,window.location.pathname);_audioPlayer.deActivateRandom();if(typeof _paq!=='undefined'){_paq.push(['trackEvent','RandomPlayer','stop']);}},next(){void 0;if(this.active&&this.shuffledPlaylist.length>0)
|
||||
_audioPlayer.openDocument(this.shuffledPlaylist.splice(0,1)[0],'random');},onAudioPlayNext(){void 0;if(this.active){this.next();}},onAudioPlayerEnded(){void 0;if(this.active){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(){void 0;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.active=true;}
|
||||
return false;},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=false;this.$btn.removeClass('is-active');history.replaceState(history.state,null,window.location.pathname);_audioPlayer.deActivateRandom();if(typeof _paq!=='undefined'){_paq.push(['trackEvent','RandomPlayer','stop']);}},next(){void 0;if(this.active){if(this.shuffledPlaylist.length==0){this.shuffle();}
|
||||
_audioPlayer.openDocument(this.shuffledPlaylist.splice(0,1)[0],'random');}},onAudioPlayNext(){void 0;if(this.active){this.next();}},onAudioPlayerEnded(){void 0;if(this.active){this.next();if(_is_expo){_$corpus_canvas.trigger({'type':'scramble-collection'});}}}};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(){void 0;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.active=true;}
|
||||
this.refresh();},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(i){this.current_index=i||0;this.playing=true;this.play();},play(){void 0;if(this.paused){this.paused=false;_audioPlayer.play();}else{void 0;_audioPlayer.emmit('stop-shuffle').openDocument(this.playlist[this.current_index],this);}
|
||||
this.setActiveItem().showHideControls();},pause(){this.paused=true;this.showHideControls();_audioPlayer.stop();},next(){void 0;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');}
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -23,6 +23,7 @@
|
||||
var _$log_form;
|
||||
var _user_tokens;
|
||||
var _states_history = [];
|
||||
var _is_expo = $('body').hasClass('domain-expo-encyclopediedelaparole-org');
|
||||
|
||||
// ___ _ _
|
||||
// |_ _|_ _ (_) |_
|
||||
@@ -1040,7 +1041,11 @@
|
||||
.openDocument(e.target_node);
|
||||
});
|
||||
|
||||
_randomPlayer = new RandomPlayer(e.playlist);
|
||||
_randomPlayer = new RandomPlayer(e.playlist);
|
||||
|
||||
if (_is_expo) {
|
||||
_randomPlayer.start();
|
||||
}
|
||||
|
||||
// mainly for articles link
|
||||
initAjaxLinks();
|
||||
@@ -1167,7 +1172,11 @@
|
||||
};
|
||||
AudioPlayer.prototype = {
|
||||
init(){
|
||||
this.$container_parent = $('header[role="banner"] .region-header');
|
||||
if(!_is_expo){
|
||||
this.$container_parent = $('header[role="banner"] .region-header');
|
||||
}else{
|
||||
this.$container_parent = $('main[role="main"]');
|
||||
}
|
||||
// append ui to document
|
||||
this.$container.appendTo(this.$container_parent);
|
||||
// record timeline width
|
||||
@@ -1343,6 +1352,11 @@
|
||||
this.clearTimeOutToHide();
|
||||
// this.audio.play();
|
||||
|
||||
// making sound shorter for debuging purpose
|
||||
// if(_is_expo){
|
||||
// setTimeout(this.seekToEnd.bind(this), 20000);
|
||||
// }
|
||||
|
||||
// Not really needed has we trigger play right after setting the source https://stackoverflow.com/questions/47431439/mp4-video-safari-showing-unhandled-promise-rejection-object-domerror-in-c
|
||||
var promise = this.audio.play();
|
||||
// console.log('promise', promise);
|
||||
@@ -1397,6 +1411,12 @@
|
||||
console.log("Audio seeking : seek", seek);
|
||||
this.audio.currentTime = seek;
|
||||
},
|
||||
seekToEnd(){
|
||||
if (this.audio.duration > 40) {
|
||||
console.log("seekToEnd", this.audio.duration);
|
||||
this.audio.currentTime = this.audio.duration - 20;
|
||||
}
|
||||
},
|
||||
// audio events
|
||||
onPlaying(){
|
||||
this.$btns.addClass('is-playing');
|
||||
@@ -1448,14 +1468,16 @@
|
||||
// cartel autoswitch
|
||||
this.scndCartel_visible = 0;
|
||||
this.$cartel.removeClass('second-visible');
|
||||
// if second cartel has special info ?
|
||||
if (this.$cartel.find('.second-cartel .col-left').children().length > 1
|
||||
|| this.$cartel.find('.second-cartel').children('.col-right').length){
|
||||
// init cartel auto switch
|
||||
this.cartelSwitchInterval = setInterval(this.switchCartel.bind(this), this.cartelSwitchIntervalMS);
|
||||
if(!_is_expo){
|
||||
// if second cartel has special info ?
|
||||
if (this.$cartel.find('.second-cartel .col-left').children().length > 1
|
||||
|| this.$cartel.find('.second-cartel').children('.col-right').length){
|
||||
// init cartel auto switch
|
||||
this.cartelSwitchInterval = setInterval(this.switchCartel.bind(this), this.cartelSwitchIntervalMS);
|
||||
}
|
||||
// call drupal behaviours (for addtoany)
|
||||
Drupal.attachBehaviors(this.$cartel);
|
||||
}
|
||||
// call drupal behaviours (for addtoany)
|
||||
Drupal.attachBehaviors(this.$cartel);
|
||||
// open automaticly tha article if needed
|
||||
this.setAutoOpenArticle();
|
||||
if(this.auto_open_article){
|
||||
@@ -1599,25 +1621,21 @@
|
||||
_audioPlayer
|
||||
.on('audio-play-next', this.onAudioPlayNext.bind(this))
|
||||
.on('audio-ended', this.onAudioPlayerEnded.bind(this))
|
||||
// .on('audio-ended', function(e){
|
||||
// console.log('RandomPlayer, audio-ended', e);
|
||||
// })
|
||||
.on('stop-shuffle', this.stop.bind(this));
|
||||
|
||||
|
||||
_$corpus_canvas
|
||||
.on('update-random-playlist', this.updatePlaylist.bind(this));
|
||||
|
||||
// provide a link to auto start random player
|
||||
if(window.location.hash == '#random'){
|
||||
this.start();
|
||||
// window.location.hash = '';
|
||||
}
|
||||
},
|
||||
updatePlaylist(e){
|
||||
// debugger;
|
||||
this.playlist = e.playlist;
|
||||
this.shuffle();
|
||||
if (!_is_expo) {
|
||||
this.playlist = e.playlist;
|
||||
this.shuffle();
|
||||
}
|
||||
},
|
||||
shuffle(){
|
||||
var tempPLaylist = [];
|
||||
@@ -1667,8 +1685,12 @@
|
||||
},
|
||||
next(){
|
||||
console.log('RandomPlayer next', this.active, this.shuffledPlaylist.length);
|
||||
if(this.active && this.shuffledPlaylist.length > 0)
|
||||
if(this.active){
|
||||
if (this.shuffledPlaylist.length == 0) {
|
||||
this.shuffle();
|
||||
}
|
||||
_audioPlayer.openDocument(this.shuffledPlaylist.splice(0,1)[0], 'random');
|
||||
}
|
||||
},
|
||||
onAudioPlayNext(){
|
||||
console.log('RandomPlayer : onAudioPlayNext()');
|
||||
@@ -1680,6 +1702,9 @@
|
||||
console.log('RandomPlayer : onAudioPlayerEnded()');
|
||||
if(this.active){
|
||||
this.next();
|
||||
if(_is_expo){
|
||||
_$corpus_canvas.trigger({'type':'scramble-collection'}); //shuffle-collection scramble-collection
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1092,6 +1092,40 @@ main[role="main"]{
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
// ___
|
||||
// | __|_ ___ __ ___
|
||||
// | _|\ \ / '_ \/ _ \
|
||||
// |___/_\_\ .__/\___/
|
||||
// |_|
|
||||
body.domain-expo-encyclopediedelaparole-org &{
|
||||
position: absolute;
|
||||
box-sizing: content-box;
|
||||
width:550px; height:100px;
|
||||
left: 50vw; top:50vh;
|
||||
transform: translate(-50%, -50%);
|
||||
background-color: rgba(255,255,255, 0.8);
|
||||
outline: 1px solid red;
|
||||
padding:2em 1em 2em 2em; margin:0;
|
||||
.btns,
|
||||
.actions,
|
||||
.favoris{
|
||||
display: none;
|
||||
}
|
||||
.time-line-container{
|
||||
margin:0.80em 0 0;
|
||||
}
|
||||
.time{
|
||||
margin:0.75em 0 0;
|
||||
}
|
||||
.cartel{
|
||||
margin-top: 0;
|
||||
width:calc(100% - 190px);
|
||||
}
|
||||
* {
|
||||
background-color: transparent;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2309,6 +2343,13 @@ footer{
|
||||
}
|
||||
}
|
||||
|
||||
body.domain-expo-encyclopediedelaparole-org &{
|
||||
.block-block-edlp-entrees{
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$icons_w:20px;
|
||||
$mobile_icon_w:15px;
|
||||
@mixin iconlinkblock($bgimgurl, $bgimgurlactive) {
|
||||
|
||||
@@ -102,6 +102,12 @@ body.toolbar-horizontal.toolbar-themes.toolbar-no-tabs{
|
||||
// // overflow-y: hidden;
|
||||
// }
|
||||
// }
|
||||
body.domain-expo-encyclopediedelaparole-org{
|
||||
main[role="main"] .layout-content{
|
||||
padding:0; margin:0;
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
footer[role="contentinfo"]{
|
||||
// outline: 1px solid pink;
|
||||
|
||||
@@ -62,7 +62,7 @@ function edlptheme_preprocess_html(&$vars) {
|
||||
}
|
||||
|
||||
function edlptheme_preprocess_page(&$vars){
|
||||
// dsm($vars, 'vars');
|
||||
// dpm($vars, 'vars');
|
||||
}
|
||||
|
||||
function edlptheme_preprocess_node(&$vars){
|
||||
|
||||
Reference in New Issue
Block a user