many misc bug fix

This commit is contained in:
2024-10-10 22:12:34 +02:00
parent fb7d736bc4
commit 68bc5527d9
20 changed files with 162 additions and 148 deletions
+3
View File
@@ -133,6 +133,9 @@
"drupal/login_emailusername": {
"rest login email or user name https://www.drupal.org/project/login_emailusername/issues/2910511#comment-12564801" : "https://www.drupal.org/files/issues/2018-04-10/allow-rest-login-with-email-2910511-9.patch",
"Flood service is undefined https://www.drupal.org/project/login_emailusername/issues/3276966" : "https://www.drupal.org/files/issues/2024-09-30/login_emailusername_issues_3276966_%2312.patch"
},
"drupal/date_range_formatter":{
"Passing empty value to t() when same day + time for start and end date https://www.drupal.org/project/date_range_formatter/issues/3309324":"https://www.drupal.org/files/issues/2024-10-10/date_range_formatter_3309324_%2330.patch"
}
},
"old-patches": {
@@ -0,0 +1,13 @@
diff --git a/src/Plugin/Field/FieldFormatter/DateRangeFormatterRangeFormatter.php b/src/Plugin/Field/FieldFormatter/DateRangeFormatterRangeFormatter.php
index 92ec640..4e843f0 100644
--- a/src/Plugin/Field/FieldFormatter/DateRangeFormatterRangeFormatter.php
+++ b/src/Plugin/Field/FieldFormatter/DateRangeFormatterRangeFormatter.php
@@ -79,7 +79,7 @@ class DateRangeFormatterRangeFormatter extends DateTimeCustomFormatter {
}
if (!array_key_exists($delta, $elements)) {
// No end date provided or end date equals start date use single formatting.
- $single_format = $this->getSetting('single');
+ $single_format = $this->getSetting('one_day');
$elements[$delta] = ['#markup' => \Drupal::service('date.formatter')->format($start_date, 'custom', $this->t($single_format))];
}
}
@@ -90,7 +90,7 @@ class EdlpAjaxController extends ControllerBase {
'#items' => [],
);
foreach($future_nodes as $node){
$future_list['#items'][] = $node_view_builder->view($node, 'aside');
$future_list['#items'][] = $node_view_builder->view($node, 'aside', $this->langcode);
}
$aside['future_events'] = array(
"#type"=>"container",
@@ -109,7 +109,7 @@ class EdlpAjaxController extends ControllerBase {
'#items' => [],
);
foreach($past_nodes as $node){
$past_list['#items'][] = $node_view_builder->view($node, 'aside');
$past_list['#items'][] = $node_view_builder->view($node, 'aside', $this->langcode);
}
$aside['past_events'] = array(
"#type"=>"container",
@@ -1,42 +1,25 @@
(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);}
(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);}
this.debug=d;this.mass=Math.max(1,this.entrees.length);this.velocity_threshold=0.01;switch(true){case this.entrees.length>3:this.r=8;break;case this.entrees.length>1&&this.entrees.length<=3:this.r=5;break;default:this.r=3;break;}
this.d=this.r*2;this.e_color='e_col_'+this.entrees[Math.floor(Math.random(this.entrees.length))];this.canvas=document.createElement('canvas');this.canvas_ctx=this.canvas.getContext('2d');this.line_width=1;this.w=this.r*2+this.line_width*2;this.w_2=this.w/2;this.canvas.width=this.w;this.canvas.height=this.w;this.canvas_ctx.fillStyle='rgb(255,255,255)';this.canvas_ctx.lineWidth=this.line_width;this.wall_bouncing_elasticity=0.75;this.hover=false;this.opened=false;this.faded=false;this.center=false;this.aside=false;this.scrambling=false;if(typeof Node.initialized=="undefined"){Node.prototype.init=function(){this.calcWallLimits();this.x=this.wall_limits.left+Math.random()*(this.wall_limits.right-this.wall_limits.left);this.y=this.wall_limits.top+Math.random()*(this.wall_limits.bottom-this.wall_limits.top);this.ori_pos={x:this.x,y:this.y};this.initPhysics();};Node.prototype.initPhysics=function(){this.p=_physics.makeParticle(this.mass,this.x,this.y);this.p.velocity=new Physics.Vector((Math.random()-0.5)*_p_velocity_factor,(Math.random()-0.5)*_p_velocity_factor);this.ori_p=_physics.makeParticle(1000,this.ori_pos.x,this.ori_pos.y);this.ori_p.fixed=true;this.ori_p_attract=_physics.makeAttraction(this.ori_p,this.p,1000,_scene_props.width*2);this.ori_p_attract.on=false;this.attract=_physics.makeAttraction(_attracter,this.p,1000,_scene_props.width*2);this.attract.on=false;};Node.prototype.calcWallLimits=function(){this.wall_limits={top:_scene_props.margin_top+this.r,right:_scene_props.width-_scene_props.margin_right-this.r,bottom:_scene_props.height-_scene_props.margin_bottom-this.r,left:_scene_props.margin_left+this.r}};Node.prototype.onResizeCanvas=function(){this.calcWallLimits();this.shuffleOriP();};Node.prototype.shuffleOriP=function(){this.ori_pos.x=this.wall_limits.left+Math.random()*(this.wall_limits.right-this.wall_limits.left);this.ori_pos.y=this.wall_limits.top+Math.random()*(this.wall_limits.bottom-this.wall_limits.top);this.scramble();};Node.prototype.onUpdate=function(){if(this.hover||this.opened){this.p.fixed=true;}else{this.p.fixed=false;if(this.center)
this.limitEvolutionZone();this.checkWallBouncing();this.updatePos();if(this.scrambling){this.checkOriPDist();}}
if(_mouse_in&&!this.aside&&!this.faded)
this.checkMouse();this.redraw();};Node.prototype.checkVelocityThreshold=function(){if(!this.centered||!this.aside){if(Math.abs(this.p.velocity.x)<this.velocity_threshold&&Math.abs(this.p.velocity.y)<this.velocity_threshold){this.p.velocity.multiplyScalar(0);}}};Node.prototype.checkWallBouncing=function(){switch(true){case this.x<this.wall_limits.left&&this.p.velocity.x<0:this.p.position.x=this.wall_limits.left;this.p.velocity.multiplyScalarXY(-1,1).multiplyScalar(this.wall_bouncing_elasticity);break;case this.x>this.wall_limits.right&&this.p.velocity.x>0:this.p.position.x=this.wall_limits.right;this.p.velocity.multiplyScalarXY(-1,1).multiplyScalar(this.wall_bouncing_elasticity);break;case this.y<this.wall_limits.top&&this.p.velocity.y<0:this.p.position.y=this.wall_limits.top;this.p.velocity.multiplyScalarXY(1,-1).multiplyScalar(this.wall_bouncing_elasticity);break;case this.y>this.wall_limits.bottom&&this.p.velocity.y>0:this.p.position.y=this.wall_limits.bottom;this.p.velocity.multiplyScalarXY(1,-1).multiplyScalar(this.wall_bouncing_elasticity);break;}};Node.prototype.updatePos=function(){this.x=this.p.position.x;this.y=this.p.position.y;};Node.prototype.checkMouse=function(){if(_m_pos.x>this.x-this.r&&_m_pos.x<this.x+this.r&&_m_pos.y>this.y-this.r&&_m_pos.y<this.y+this.r){if(_node_hover_id==-1||_node_hover_id!==this.id){this.setHover();}}else{this.unsetHover();}};Node.prototype.setHover=function(){this.hover=true;_node_hover_id=this.id;_node_pop_up.setNode(this);};Node.prototype.unsetHover=function(){this.hover=false;if(_node_hover_id==this.id){_node_hover_id=-1;_node_pop_up.removeNode();}};Node.prototype.open=function(){this.opened=true;_node_opened_id=this.id;_$body.trigger({'type':'map-node-opened','node':this});};Node.prototype.close=function(){this.opened=false;};Node.prototype.fade=function(){this.faded=true;};Node.prototype.unFade=function(){this.faded=false;};Node.prototype.setCenteredOnEntree=function(tid){this.e_color='e_col_'+tid;this.setCentered();};Node.prototype.setCentered=function(){this.center=true;this.stopScrambling();this.unsetAside();this.attract.on=true;}
Node.prototype.unsetCentered=function(){this.center=false;this.attract.on=false;}
Node.prototype.limitEvolutionZone=function(){this.dist_to_attracter=this.p.distanceTo(_attracter);if(this.dist_to_attracter<_scene_props.width/4){if(this.p.velocity.length()>0.4){this.p.velocity.multiplyScalar(0.99);}}
if(this.x<_evolution_zone.left||this.x>_evolution_zone.right||Math.abs(_attracter.position.y-this.y)>_scene_props.height/4){this.attract.on=true;}else{this.attract.on=false;}}
Node.prototype.setAside=function(){this.aside=true;this.stopScrambling();this.unsetCentered();this.ori_p.position.x=this.x<_scene_props.width/2?this.wall_limits.left:this.wall_limits.right;this.ori_p_attract.on=true;this.wall_bouncing_elasticity=0.15;}
Node.prototype.unsetAside=function(){this.aside=false;this.ori_p_attract.on=false;this.ori_p.position.x=this.ori_pos.x;this.wall_bouncing_elasticity=0.75;}
Node.prototype.resolveNormalPos=function(){switch(true){case this.center:this.unsetCentered();break;case this.aside:this.unsetAside();break;}};Node.prototype.scramble=function(){this.scrambling=true;this.unsetCentered();this.unsetAside();this.ori_p.position.x=this.ori_pos.x;this.ori_p.position.y=this.ori_pos.y;this.ori_p_attract.on=true;}
Node.prototype.checkOriPDist=function(){if(this.p.distanceTo(this.ori_p)<50){this.stopScrambling();}};Node.prototype.stopScrambling=function(){this.scrambling=false;this.ori_p_attract.on=false;}
Node.prototype.move=function(){_ctx.drawImage(this.canvas,this.x-this.w_2,this.y-this.w_2);};Node.prototype.redraw=function(){_ctx.beginPath();_ctx.fillStyle='rgb(255,255,255)';_ctx.fillRect(this.x-this.r,this.y-this.r,this.d,this.d);_ctx.globalAlpha=this.faded?0.15:1;if(this.opened){_ctx.fillStyle=_ecolors[this.e_color];_ctx.fillRect(this.x-this.r,this.y-this.r,this.d,this.d);}
this.d=this.r*2;this.e_color='e_col_'+this.entrees[Math.floor(Math.random(this.entrees.length))];this.canvas=document.createElement('canvas');this.canvas_ctx=this.canvas.getContext('2d');this.line_width=1;this.w=this.r*2+this.line_width*2;this.w_2=this.w/2;this.canvas.width=this.w;this.canvas.height=this.w;this.canvas_ctx.fillStyle='rgb(255,255,255)';this.canvas_ctx.lineWidth=this.line_width;this.wall_bouncing_elasticity=0.75;this.hover=false;this.opened=false;this.faded=false;this.center=false;this.aside=false;this.scrambling=false;if(typeof Node.initialized=="undefined"){Node.prototype.init=function(){this.calcWallLimits();this.x=this.wall_limits.left+Math.random()*(this.wall_limits.right-this.wall_limits.left);this.y=this.wall_limits.top+Math.random()*(this.wall_limits.bottom-this.wall_limits.top);this.ori_pos={x:this.x,y:this.y};this.initPhysics();};Node.prototype.initPhysics=function(){this.p=_physics.makeParticle(this.mass,this.x,this.y);this.p.velocity=new Physics.Vector((Math.random()-0.5)*_p_velocity_factor,(Math.random()-0.5)*_p_velocity_factor);this.ori_p=_physics.makeParticle(1000,this.ori_pos.x,this.ori_pos.y);this.ori_p.fixed=true;this.ori_p_attract=_physics.makeAttraction(this.ori_p,this.p,1000,_scene_props.width*2);this.ori_p_attract.on=false;this.attract=_physics.makeAttraction(_attracter,this.p,1000,_scene_props.width*2);this.attract.on=false;};Node.prototype.calcWallLimits=function(){this.wall_limits={top:_scene_props.margin_top+this.r,right:_scene_props.width-_scene_props.margin_right-this.r,bottom:_scene_props.height-_scene_props.margin_bottom-this.r,left:_scene_props.margin_left+this.r};};Node.prototype.onResizeCanvas=function(){this.calcWallLimits();this.shuffleOriP();};Node.prototype.shuffleOriP=function(){this.ori_pos.x=this.wall_limits.left+Math.random()*(this.wall_limits.right-this.wall_limits.left);this.ori_pos.y=this.wall_limits.top+Math.random()*(this.wall_limits.bottom-this.wall_limits.top);this.scramble();};Node.prototype.onUpdate=function(){if(this.hover||this.opened){this.p.fixed=true;}else{this.p.fixed=false;if(this.center)this.limitEvolutionZone();this.checkWallBouncing();this.updatePos();if(this.scrambling){this.checkOriPDist();}}
if(_mouse_in&&!this.aside&&!this.faded)this.checkMouse();this.redraw();};Node.prototype.checkVelocityThreshold=function(){if(!this.centered||!this.aside){if(Math.abs(this.p.velocity.x)<this.velocity_threshold&&Math.abs(this.p.velocity.y)<this.velocity_threshold){this.p.velocity.multiplyScalar(0);}}};Node.prototype.checkWallBouncing=function(){switch(true){case this.x<this.wall_limits.left&&this.p.velocity.x<0:this.p.position.x=this.wall_limits.left;this.p.velocity.multiplyScalarXY(-1,1).multiplyScalar(this.wall_bouncing_elasticity);break;case this.x>this.wall_limits.right&&this.p.velocity.x>0:this.p.position.x=this.wall_limits.right;this.p.velocity.multiplyScalarXY(-1,1).multiplyScalar(this.wall_bouncing_elasticity);break;case this.y<this.wall_limits.top&&this.p.velocity.y<0:this.p.position.y=this.wall_limits.top;this.p.velocity.multiplyScalarXY(1,-1).multiplyScalar(this.wall_bouncing_elasticity);break;case this.y>this.wall_limits.bottom&&this.p.velocity.y>0:this.p.position.y=this.wall_limits.bottom;this.p.velocity.multiplyScalarXY(1,-1).multiplyScalar(this.wall_bouncing_elasticity);break;}};Node.prototype.updatePos=function(){this.x=this.p.position.x;this.y=this.p.position.y;};Node.prototype.checkMouse=function(){if(_m_pos.x>this.x-this.r&&_m_pos.x<this.x+this.r&&_m_pos.y>this.y-this.r&&_m_pos.y<this.y+this.r){if(_node_hover_id==-1||_node_hover_id!==this.id){this.setHover();}}else{this.unsetHover();}};Node.prototype.setHover=function(){this.hover=true;_node_hover_id=this.id;_node_pop_up.setNode(this);};Node.prototype.unsetHover=function(){this.hover=false;if(_node_hover_id==this.id){_node_hover_id=-1;_node_pop_up.removeNode();}};Node.prototype.open=function(){this.opened=true;_node_opened_id=this.id;_$body.trigger({'type':'map-node-opened','node':this});};Node.prototype.close=function(){this.opened=false;};Node.prototype.fade=function(){this.faded=true;};Node.prototype.unFade=function(){this.faded=false;};Node.prototype.setCenteredOnEntree=function(tid){this.e_color='e_col_'+tid;this.setCentered();};Node.prototype.setCentered=function(){this.center=true;this.stopScrambling();this.unsetAside();this.attract.on=true;};Node.prototype.unsetCentered=function(){this.center=false;this.attract.on=false;};Node.prototype.limitEvolutionZone=function(){this.dist_to_attracter=this.p.distanceTo(_attracter);if(this.dist_to_attracter<_scene_props.width/4){if(this.p.velocity.length()>0.4){this.p.velocity.multiplyScalar(0.99);}}
if(this.x<_evolution_zone.left||this.x>_evolution_zone.right||Math.abs(_attracter.position.y-this.y)>_scene_props.height/4){this.attract.on=true;}else{this.attract.on=false;}};Node.prototype.setAside=function(){this.aside=true;this.stopScrambling();this.unsetCentered();this.ori_p.position.x=this.x<_scene_props.width/2?this.wall_limits.left:this.wall_limits.right;this.ori_p_attract.on=true;this.wall_bouncing_elasticity=0.15;};Node.prototype.unsetAside=function(){this.aside=false;this.ori_p_attract.on=false;this.ori_p.position.x=this.ori_pos.x;this.wall_bouncing_elasticity=0.75;};Node.prototype.resolveNormalPos=function(){switch(true){case this.center:this.unsetCentered();break;case this.aside:this.unsetAside();break;}};Node.prototype.scramble=function(){this.scrambling=true;this.unsetCentered();this.unsetAside();this.ori_p.position.x=this.ori_pos.x;this.ori_p.position.y=this.ori_pos.y;this.ori_p_attract.on=true;};Node.prototype.checkOriPDist=function(){if(this.p.distanceTo(this.ori_p)<50){this.stopScrambling();}};Node.prototype.stopScrambling=function(){this.scrambling=false;this.ori_p_attract.on=false;};Node.prototype.move=function(){_ctx.drawImage(this.canvas,this.x-this.w_2,this.y-this.w_2);};Node.prototype.redraw=function(){_ctx.beginPath();_ctx.fillStyle='rgb(255,255,255)';_ctx.fillRect(this.x-this.r,this.y-this.r,this.d,this.d);_ctx.globalAlpha=this.faded?0.15:1;if(this.opened){_ctx.fillStyle=_ecolors[this.e_color];_ctx.fillRect(this.x-this.r,this.y-this.r,this.d,this.d);}
_ctx.strokeStyle=_ecolors[this.e_color];_ctx.strokeRect(this.x-this.r,this.y-this.r,this.d,this.d);_ctx.closePath();};Node.initialized=true;}
this.init();};function checkParticulesCollisions(){if(check_parts_colid_tick<check_parts_colid_frq){check_parts_colid_tick++;return;}
check_parts_colid_tick=1;var na,nb,ma,mb,w,h,dx,dy,makeup,newVelX1,newVelY1,newVelX2,newVelY2,Smamb;for(var n=0,l=_nodes.length;n<l;n++){na=_nodes[n];if(na.scrambling||na.aside)continue;ma=na.p.mass;for(var q=n+1;q<l;q++){nb=_nodes[q];if(nb.aside)
continue;if(na.center&&nb.center){if(Math.min(na.p.distanceTo(_attracter),nb.p.distanceTo(_attracter))>300){if(Math.random()>0.3)continue;}}
w=h=(na.r+nb.r);w=h+=4;dx=na.p.position.x-nb.p.position.x;if(Math.abs(dx)>w)continue;dy=na.p.position.y-nb.p.position.y;if(Math.abs(dy)>h)continue
mb=nb.p.mass;Smamb=ma+mb;if(Math.abs(dx)<Math.abs(dy)){makeup=(h-Math.abs(dy))/2;if(dy>0){na.p.position.y+=makeup;nb.p.position.y-=makeup;}else{na.p.position.y-=makeup;nb.p.position.y+=makeup;}
check_parts_colid_tick=1;var na,nb,ma,mb,w,h,dx,dy,makeup,newVelX1,newVelY1,newVelX2,newVelY2,Smamb;for(var n=0,l=_nodes.length;n<l;n++){na=_nodes[n];if(na.scrambling||na.aside)continue;ma=na.p.mass;for(var q=n+1;q<l;q++){nb=_nodes[q];if(nb.aside)continue;if(na.center&&nb.center){if(Math.min(na.p.distanceTo(_attracter),nb.p.distanceTo(_attracter))>300){if(Math.random()>0.3)continue;}}
w=h=na.r+nb.r;w=h+=4;dx=na.p.position.x-nb.p.position.x;if(Math.abs(dx)>w)continue;dy=na.p.position.y-nb.p.position.y;if(Math.abs(dy)>h)continue;mb=nb.p.mass;Smamb=ma+mb;if(Math.abs(dx)<Math.abs(dy)){makeup=(h-Math.abs(dy))/2;if(dy>0){na.p.position.y+=makeup;nb.p.position.y-=makeup;}else{na.p.position.y-=makeup;nb.p.position.y+=makeup;}
newVelY1=(ma-mb)/Smamb*na.p.velocity.y+2*mb/Smamb*nb.p.velocity.y;newVelY2=(mb-ma)/Smamb*nb.p.velocity.y+2*ma/Smamb*na.p.velocity.y;na.p.velocity.y=newVelY1;nb.p.velocity.y=newVelY2;}else{makeup=(w-Math.abs(dx))/2;if(dx>0){na.p.position.x+=makeup;nb.p.position.x-=makeup;}else{na.p.position.x-=makeup;nb.p.position.x+=makeup;}
newVelX1=(ma-mb)/Smamb*na.p.velocity.x+2*mb/Smamb*nb.p.velocity.x;newVelX2=(mb-ma)/Smamb*nb.p.velocity.x+2*ma/Smamb*na.p.velocity.x;na.p.velocity.x=newVelX1;nb.p.velocity.x=newVelX2;}
na.p.velocity.multiplyScalar(0.90);nb.p.velocity.multiplyScalar(0.90);}}};function openNodeByNid(nid){closeNode();if(typeof _nodes_Nid_Id[nid]!='undefined'){_node_opened_id=_nodes_Nid_Id[nid];_nodes[_nodes_Nid_Id[nid]].open();}}
function closeNode(){if(_node_opened_id!=-1){_nodes[_node_opened_id].close();_node_opened_id=-1;}}
function createNodesRepulsions(){purgeNodesRepulsions();for(var n=0;n<_nodes_centered.length;n++){for(var q=n+1;q<_nodes_centered.length;q++){_physics.makeAttraction(_nodes_centered[n].p,_nodes_centered[q].p,-0.4,10);}}};function purgeNodesRepulsions(){for(var a=_physics.attractions.length-1;a>=0;a--){if(Math.abs(_physics.attractions[a].constant)<1){_physics.attractions.splice(a,1);}else{break;}}};function moveEvolutionZone(l,r){var left=l||0;var right=r||0;void 0;void 0;_evolution_zone.left=left==0?left+20:Math.max(_scene_props.width/5,left+20);_evolution_zone.right=right==0?_scene_props.width-right+20:Math.min(_scene_props.width-_scene_props.width/5,_scene_props.width-right+20);_evolution_zone.center=_evolution_zone.left+(_evolution_zone.right-_evolution_zone.left)/2;void 0;resizePhysics();}
function updateRandomPlaylist(p){_$canvas.trigger({type:'update-random-playlist',playlist:p})};function toggleEntree(tid,bubbling){var $link=_$entrees_block_termlinks.filter('[tid="'+tid+'"]');var $li=$link.parents('li');var sys_path=$link.attr('data-drupal-link-system-path');var url=$link.attr('href');var title=$link.text();if(!$li.is('.opened')){_$entrees_block_termlinks.parents('li').removeClass('opened');$li.addClass('opened');$li.parents('.item-list').addClass('opened')
filterEntree(tid);if(bubbling){_$body.trigger({'type':'open_entree','tid':tid,'url':url,'sys_path':sys_path,'title':title});}}else if(bubbling){$li.removeClass('opened');$li.parents('.item-list').removeClass('opened')
scrambleCollection();_$body.trigger({'type':'close_entree','tid':tid});}};function filterEntree(t){_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]);}}
function updateRandomPlaylist(p){_$canvas.trigger({type:'update-random-playlist',playlist:p});};function toggleEntree(tid,bubbling){var $link=_$entrees_block_termlinks.filter('[tid="'+tid+'"]');var $li=$link.parents('li');var sys_path=$link.attr('data-drupal-link-system-path');var url=$link.attr('href');var title=$link.text();if(!$li.is('.opened')){_$entrees_block_termlinks.parents('li').removeClass('opened');$li.addClass('opened');$li.parents('.item-list').addClass('opened');filterEntree(tid);if(bubbling){_$body.trigger({'type':'open_entree','tid':tid,'url':url,'sys_path':sys_path,'title':title});}}else if(bubbling){$li.removeClass('opened');$li.parents('.item-list').removeClass('opened');scrambleCollection();_$body.trigger({'type':'close_entree','tid':tid});}};function filterEntree(t){_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(){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;}}
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($){void 0;if(drupalSettings.path.isFront&&!edlp_mobile.device_is_mobile){void 0;var edlpcorpus=new EdlpCorpus();}});})(jQuery,Drupal,drupalSettings);
highlightEntries();};function startAnime(){_physics.onUpdate(render);_physics.play();$('body').attr('corpus','map-ready').trigger({'type':'corpus-map-ready','playlist':_playlist});};init();};$(document).ready(function($){void 0;if(drupalSettings.path.isFront&&!edlp_mobile.device_is_mobile){void 0;var edlpcorpus=new EdlpCorpus();}});})(jQuery,Drupal,drupalSettings);
@@ -1,17 +1,19 @@
require=(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){var _=require('./common'),Vector=require('./vector');function Attraction(a,b,k,d){this.a=a;this.b=b;this.constant=k;this.on=true;this.distanceMin=d;this.distanceMinSquared=d*d;}
_.extend(Attraction.prototype,{update:function(){var a=this.a,b=this.b;if(!this.on||(a.fixed&&b.fixed)){return;}
var a2bx=a.position.x-b.position.x;var a2by=a.position.y-b.position.y;var a2b=new Vector().sub(a.position,b.position);var a2bdistanceSquared=Math.max(a2b.lengthSquared(),this.distanceMinSquared);var force=(this.constant*a.mass*b.mass)/a2bdistanceSquared;var length=Math.sqrt(a2bdistanceSquared);if(force===0||length===0){a2b.clear();}else{a2b.divideScalar(length).multiplyScalar(force);}
require=function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'");}
var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e);},f,f.exports,e,t,n,r);}
return n[o].exports;}
var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s;}({1:[function(require,module,exports){var _=require('./common'),Vector=require('./vector');function Attraction(a,b,k,d){this.a=a;this.b=b;this.constant=k;this.on=true;this.distanceMin=d;this.distanceMinSquared=d*d;}
_.extend(Attraction.prototype,{update:function(){var a=this.a,b=this.b;if(!this.on||a.fixed&&b.fixed){return;}
var a2bx=a.position.x-b.position.x;var a2by=a.position.y-b.position.y;var a2b=new Vector().sub(a.position,b.position);var a2bdistanceSquared=Math.max(a2b.lengthSquared(),this.distanceMinSquared);var force=this.constant*a.mass*b.mass/a2bdistanceSquared;var length=Math.sqrt(a2bdistanceSquared);if(force===0||length===0){a2b.clear();}else{a2b.divideScalar(length).multiplyScalar(force);}
if(!a.fixed){a.force.subSelf(a2b);}
if(!b.fixed){b.force.addSelf(a2b);}
return this;},resting:function(){var a=this.a;var b=this.b;var l=this.distanceMin;return!this.on||(a.fixed&&b.fixed)||(a.fixed&&b.position.distanceTo(a.position)<=l&&b.resting())||(b.fixed&&a.position.distanceTo(b.position)<=l&&a.resting());}});module.exports=Attraction;},{"./common":8,"./vector":12}],2:[function(require,module,exports){var _=require('./common'),Vector=require('./vector');function Integrator(s){this.s=s;this.originalPositions=[];this.originalVelocities=[];this.k1Forces=[];this.k1Velocities=[];this.k2Forces=[];this.k2Velocities=[];this.k3Forces=[];this.k3Velocities=[];this.k4Forces=[];this.k4Velocities=[];}
return this;},resting:function(){var a=this.a;var b=this.b;var l=this.distanceMin;return!this.on||a.fixed&&b.fixed||a.fixed&&b.position.distanceTo(a.position)<=l&&b.resting()||b.fixed&&a.position.distanceTo(b.position)<=l&&a.resting();}});module.exports=Attraction;},{"./common":8,"./vector":12}],2:[function(require,module,exports){var _=require('./common'),Vector=require('./vector');function Integrator(s){this.s=s;this.originalPositions=[];this.originalVelocities=[];this.k1Forces=[];this.k1Velocities=[];this.k2Forces=[];this.k2Velocities=[];this.k3Forces=[];this.k3Velocities=[];this.k4Forces=[];this.k4Velocities=[];}
_.extend(Integrator.prototype,{allocateParticles:function(){while(this.s.particles.length>this.originalPositions.length){this.originalPositions.push(new Vector());this.originalVelocities.push(new Vector());this.k1Forces.push(new Vector());this.k1Velocities.push(new Vector());this.k2Forces.push(new Vector());this.k2Velocities.push(new Vector());this.k3Forces.push(new Vector());this.k3Velocities.push(new Vector());this.k4Forces.push(new Vector());this.k4Velocities.push(new Vector());}
return this;},step:function(dt){var s=this.s;var p,x,y;this.allocateParticles();_.each(s.particles,function(p,i){if(!p.fixed){this.originalPositions[i].copy(p.position);this.originalVelocities[i].copy(p.velocity);}
p.force.clear();},this);s.applyForces();_.each(s.particles,function(p,i){if(!p.fixed){this.k1Forces[i].copy(p.force);this.k1Velocities[i].copy(p.velocity);}
p.force.clear();},this);_.each(s.particles,function(p,i){if(!p.fixed){var op=this.originalPositions[i];var k1v=this.k1Velocities[i];x=op.x+k1v.x*0.5*dt;y=op.y+k1v.y*0.5*dt;p.position.set(x,y);var ov=this.originalVelocities[i];var k1f=this.k1Forces[i];x=ov.x+k1f.x*0.5*dt/p.mass;y=ov.y+k1f.y*0.5*dt/p.mass;p.velocity.set(x,y);}},this);s.applyForces();_.each(s.particles,function(p,i){if(!p.fixed){this.k2Forces[i].copy(p.force);this.k2Velocities[i].copy(p.velocity);}
p.force.clear();},this);_.each(s.particles,function(p,i){if(!p.fixed){var op=this.originalPositions[i];var k2v=this.k2Velocities[i];p.position.set(op.x+k2v.x*0.5*dt,op.y+k2v.y*0.5*dt);var ov=this.originalVelocities[i];var k2f=this.k2Forces[i];p.velocity.set(ov.x+k2f.x*0.5*dt/p.mass,ov.y+k2f.y*0.5*dt/p.mass);}},this);s.applyForces();_.each(s.particles,function(p,i){if(!p.fixed){this.k3Forces[i].copy(p.force);this.k3Velocities[i].copy(p.velocity);}
p.force.clear();},this);_.each(s.particles,function(p,i){if(!p.fixed){var op=this.originalPositions[i];var k3v=this.k3Velocities[i];p.position.set(op.x+k3v.x*dt,op.y+k3v.y*dt)
var ov=this.originalVelocities[i];var k3f=this.k3Forces[i];p.velocity.set(ov.x+k3f.x*dt/p.mass,ov.y+k3f.y*dt/p.mass);}},this);s.applyForces();_.each(s.particles,function(p,i){if(!p.fixed){this.k4Forces[i].copy(p.force);this.k4Velocities[i].copy(p.velocity);}},this);_.each(s.particles,function(p,i){p.age+=dt;if(!p.fixed){var op=this.originalPositions[i];var k1v=this.k1Velocities[i];var k2v=this.k2Velocities[i];var k3v=this.k3Velocities[i];var k4v=this.k4Velocities[i];var x=op.x+dt/6.0*(k1v.x+2.0*k2v.x+2.0*k3v.x+k4v.x);var y=op.y+dt/6.0*(k1v.y+2.0*k2v.y+2.0*k3v.y+k4v.y);p.position.set(x,y);var ov=this.originalVelocities[i];var k1f=this.k1Forces[i];var k2f=this.k2Forces[i];var k3f=this.k3Forces[i];var k4f=this.k4Forces[i];x=ov.x+dt/(6.0*p.mass)*(k1f.x+2.0*k2f.x+2.0*k3f.x+k4f.x);y=ov.y+dt/(6.0*p.mass)*(k1f.y+2.0*k2f.y+2.0*k3f.y+k4f.y);p.velocity.set(x,y);}},this);return this;}});module.exports=Integrator;},{"./common":8,"./vector":12}],3:[function(require,module,exports){var _=require('./common'),Vector=require('./vector');function Particle(mass){this.position=new Vector();this.velocity=new Vector();this.force=new Vector();this.mass=mass;this.fixed=false;this.age=0;this.dead=false;}
p.force.clear();},this);_.each(s.particles,function(p,i){if(!p.fixed){var op=this.originalPositions[i];var k3v=this.k3Velocities[i];p.position.set(op.x+k3v.x*dt,op.y+k3v.y*dt);var ov=this.originalVelocities[i];var k3f=this.k3Forces[i];p.velocity.set(ov.x+k3f.x*dt/p.mass,ov.y+k3f.y*dt/p.mass);}},this);s.applyForces();_.each(s.particles,function(p,i){if(!p.fixed){this.k4Forces[i].copy(p.force);this.k4Velocities[i].copy(p.velocity);}},this);_.each(s.particles,function(p,i){p.age+=dt;if(!p.fixed){var op=this.originalPositions[i];var k1v=this.k1Velocities[i];var k2v=this.k2Velocities[i];var k3v=this.k3Velocities[i];var k4v=this.k4Velocities[i];var x=op.x+dt/6.0*(k1v.x+2.0*k2v.x+2.0*k3v.x+k4v.x);var y=op.y+dt/6.0*(k1v.y+2.0*k2v.y+2.0*k3v.y+k4v.y);p.position.set(x,y);var ov=this.originalVelocities[i];var k1f=this.k1Forces[i];var k2f=this.k2Forces[i];var k3f=this.k3Forces[i];var k4f=this.k4Forces[i];x=ov.x+dt/(6.0*p.mass)*(k1f.x+2.0*k2f.x+2.0*k3f.x+k4f.x);y=ov.y+dt/(6.0*p.mass)*(k1f.y+2.0*k2f.y+2.0*k3f.y+k4f.y);p.velocity.set(x,y);}},this);return this;}});module.exports=Integrator;},{"./common":8,"./vector":12}],3:[function(require,module,exports){var _=require('./common'),Vector=require('./vector');function Particle(mass){this.position=new Vector();this.velocity=new Vector();this.force=new Vector();this.mass=mass;this.fixed=false;this.age=0;this.dead=false;}
_.extend(Particle.prototype,{distanceTo:function(p){return this.position.distanceTo(p.position);},makeFixed:function(){this.fixed=true;this.velocity.clear();return this;},reset:function(){this.age=0;this.dead=false;this.position.clear();this.velocity.clear();this.force.clear();this.mass=1.0;return this;},resting:function(){return this.fixed||this.velocity.isZero()&&this.force.isZero();}});module.exports=Particle;},{"./common":8,"./vector":12}],4:[function(require,module,exports){var _=require('./common'),Vector=require('./Vector'),Particle=require('./Particle'),Spring=require('./Spring'),Attraction=require('./Attraction'),Integrator=require('./Integrator');function ParticleSystem(){this.__equilibriumCriteria={particles:true,springs:true,attractions:true};this.__equilibrium=false;this.__optimized=false;this.particles=[];this.springs=[];this.attractions=[];this.forces=[];this.integrator=new Integrator(this);this.hasDeadParticles=false;var args=arguments.length;if(args===1){this.gravity=new Vector(0,arguments[0]);this.drag=ParticleSystem.DEFAULT_DRAG;}else if(args===2){this.gravity=new Vector(0,arguments[0]);this.drag=arguments[1];}else if(args===3){this.gravity=new Vector(arguments[0],arguments[1]);this.drag=arguments[3];}else{this.gravity=new Vector(0,ParticleSystem.DEFAULT_GRAVITY);this.drag=ParticleSystem.DEFAULT_DRAG;}}
_.extend(ParticleSystem,{DEFAULT_GRAVITY:0,DEFAULT_DRAG:0.001,Attraction:Attraction,Integrator:Integrator,Particle:Particle,Spring:Spring,Vector:Vector});_.extend(ParticleSystem.prototype,{optimize:function(b){this.__optimized=!!b;return this;},setGravity:function(x,y){this.gravity.set(x,y);return this;},setEquilibriumCriteria:function(particles,springs,attractions){this.__equilibriumCriteria.particles=!!particles;this.__equilibriumCriteria.springs=!!springs;this.__equilibriumCriteria.attractions=!!attractions;},tick:function(){this.integrator.step(arguments.length===0?1:arguments[0]);if(this.__optimized){this.__equilibrium=!this.needsUpdate();}
return this;},needsUpdate:function(){var i=0;if(this.__equilibriumCriteria.particles){for(i=0,l=this.particles.length;i<l;i++){if(!this.particles[i].resting()){return true;}}}
@@ -31,8 +33,8 @@ module.exports=Physics;},{"./ParticleSystem":4,"./common":8,"./requestAnimationF
_.extend(Spring.prototype,{currentLength:function(){return this.a.position.distanceTo(this.b.position);},update:function(){var a=this.a;var b=this.b;if(!(this.on&&(!a.fixed||!b.fixed)))return this;var a2b=new Vector().sub(a.position,b.position);var d=a2b.length();if(d===0){a2b.clear();}else{a2b.divideScalar(d);}
var fspring=-1*(d-this.length)*this.constant;var va2b=new Vector().sub(a.velocity,b.velocity);var fdamping=-1*this.damping*va2b.dot(a2b);var fr=fspring+fdamping;a2b.multiplyScalar(fr);if(!a.fixed){a.force.addSelf(a2b);}
if(!b.fixed){b.force.subSelf(a2b);}
return this;},resting:function(){var a=this.a;var b=this.b;var l=this.length;return!this.on||(a.fixed&&b.fixed)||(a.fixed&&(l===0?b.position.equals(a.position):b.position.distanceTo(a.position)<=l)&&b.resting())||(b.fixed&&(l===0?a.position.equals(b.position):a.position.distanceTo(b.position)<=l)&&a.resting());}});module.exports=Spring;},{"./common":8,"./vector":12}],7:[function(require,module,exports){var _=require('./common');function Vector(x,y){this.x=x||0;this.y=y||0;}
return this;},resting:function(){var a=this.a;var b=this.b;var l=this.length;return!this.on||a.fixed&&b.fixed||a.fixed&&(l===0?b.position.equals(a.position):b.position.distanceTo(a.position)<=l)&&b.resting()||b.fixed&&(l===0?a.position.equals(b.position):a.position.distanceTo(b.position)<=l)&&a.resting();}});module.exports=Spring;},{"./common":8,"./vector":12}],7:[function(require,module,exports){var _=require('./common');function Vector(x,y){this.x=x||0;this.y=y||0;}
_.extend(Vector.prototype,{set:function(x,y){this.x=x;this.y=y;return this;},copy:function(v){this.x=v.x;this.y=v.y;return this;},clear:function(){this.x=0;this.y=0;return this;},clone:function(){return new Vector(this.x,this.y);},add:function(v1,v2){this.x=v1.x+v2.x;this.y=v1.y+v2.y;return this;},addSelf:function(v){this.x+=v.x;this.y+=v.y;return this;},sub:function(v1,v2){this.x=v1.x-v2.x;this.y=v1.y-v2.y;return this;},subSelf:function(v){this.x-=v.x;this.y-=v.y;return this;},multiplySelf:function(v){this.x*=v.x;this.y*=v.y;return this;},multiplyScalar:function(s){this.x*=s;this.y*=s;return this;},multiplyScalarXY:function(sx,sy){this.x*=sx;this.y*=sy;return this;},divideScalar:function(s){if(s){this.x/=s;this.y/=s;}else{this.set(0,0);}
return this;},negate:function(){return this.multiplyScalar(-1);},dot:function(v){return this.x*v.x+this.y*v.y;},lengthSquared:function(){return this.x*this.x+this.y*this.y;},length:function(){return Math.sqrt(this.lengthSquared());},normalize:function(){return this.divideScalar(this.length());},distanceTo:function(v){return Math.sqrt(this.distanceToSquared(v));},distanceToSquared:function(v){var dx=this.x-v.x,dy=this.y-v.y;return dx*dx+dy*dy;},setLength:function(l){return this.normalize().multiplyScalar(l);},equals:function(v){return(this.distanceTo(v)<0.0001);},lerp:function(v,t){var x=(v.x-this.x)*t+this.x;var y=(v.y-this.y)*t+this.y;return this.set(x,y);},isZero:function(){return(this.length()<0.0001);}});module.exports=Vector;},{"./common":8}],8:[function(require,module,exports){var breaker={};var ArrayProto=Array.prototype;var ObjProto=Object.prototype;var hasOwnProperty=ObjProto.hasOwnProperty;var slice=ArrayProto.slice;var nativeForEach=ArrayProto.forEach;var nativeIndexOf=ArrayProto.indexOf;var toString=ObjProto.toString;var has=function(obj,key){return hasOwnProperty.call(obj,key);};var each=function(obj,iterator,context){if(obj==null)return;if(nativeForEach&&obj.forEach===nativeForEach){obj.forEach(iterator,context);}else if(obj.length===+obj.length){for(var i=0,l=obj.length;i<l;i++){if(i in obj&&iterator.call(context,obj[i],i,obj)===breaker)return;}}else{for(var key in obj){if(_.has(obj,key)){if(iterator.call(context,obj[key],key,obj)===breaker)return;}}}};var identity=function(value){return value;};var sortedIndex=function(array,obj,iterator){iterator||(iterator=identity);var low=0,high=array.length;while(low<high){var mid=(low+high)>>1;iterator(array[mid])<iterator(obj)?low=mid+1:high=mid;}
return this;},negate:function(){return this.multiplyScalar(-1);},dot:function(v){return this.x*v.x+this.y*v.y;},lengthSquared:function(){return this.x*this.x+this.y*this.y;},length:function(){return Math.sqrt(this.lengthSquared());},normalize:function(){return this.divideScalar(this.length());},distanceTo:function(v){return Math.sqrt(this.distanceToSquared(v));},distanceToSquared:function(v){var dx=this.x-v.x,dy=this.y-v.y;return dx*dx+dy*dy;},setLength:function(l){return this.normalize().multiplyScalar(l);},equals:function(v){return this.distanceTo(v)<0.0001;},lerp:function(v,t){var x=(v.x-this.x)*t+this.x;var y=(v.y-this.y)*t+this.y;return this.set(x,y);},isZero:function(){return this.length()<0.0001;}});module.exports=Vector;},{"./common":8}],8:[function(require,module,exports){var breaker={};var ArrayProto=Array.prototype;var ObjProto=Object.prototype;var hasOwnProperty=ObjProto.hasOwnProperty;var slice=ArrayProto.slice;var nativeForEach=ArrayProto.forEach;var nativeIndexOf=ArrayProto.indexOf;var toString=ObjProto.toString;var has=function(obj,key){return hasOwnProperty.call(obj,key);};var each=function(obj,iterator,context){if(obj==null)return;if(nativeForEach&&obj.forEach===nativeForEach){obj.forEach(iterator,context);}else if(obj.length===+obj.length){for(var i=0,l=obj.length;i<l;i++){if(i in obj&&iterator.call(context,obj[i],i,obj)===breaker)return;}}else{for(var key in obj){if(_.has(obj,key)){if(iterator.call(context,obj[key],key,obj)===breaker)return;}}}};var identity=function(value){return value;};var sortedIndex=function(array,obj,iterator){iterator||(iterator=identity);var low=0,high=array.length;while(low<high){var mid=low+high>>1;iterator(array[mid])<iterator(obj)?low=mid+1:high=mid;}
return low;};module.exports={has:has,each:each,extend:function(obj){each(slice.call(arguments,1),function(source){for(var prop in source){obj[prop]=source[prop];}});return obj;},indexOf:function(array,item,isSorted){if(array==null)return-1;var i,l;if(isSorted){i=sortedIndex(array,item);return array[i]===item?i:-1;}
if(nativeIndexOf&&array.indexOf===nativeIndexOf)return array.indexOf(item);for(i=0,l=array.length;i<l;i++)if(i in array&&array[i]===item)return i;return-1;},sortedIndex:sortedIndex,identity:identity,isNumber:function(obj){return toString.call(obj)=='[object Number]';},isFunction:function(obj){return toString.call(obj)=='[object Function]'||typeof obj=='function';},isUndefined:function(obj){return obj===void 0;},isNull:function(obj){return obj===null;}};},{}],"H99CHA":[function(require,module,exports){var root=(function(){return this;})(),previousShortcut=root.Physics;module.exports=root.Physics=require('./Physics');},{"./Physics":5}],"physics":[function(require,module,exports){module.exports=require('H99CHA');},{}],11:[function(require,module,exports){module.exports=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(callback){window.setTimeout(callback,1000/60);};},{}],12:[function(require,module,exports){module.exports=require(7)},{"./common":8}]},{},["H99CHA"])
if(nativeIndexOf&&array.indexOf===nativeIndexOf)return array.indexOf(item);for(i=0,l=array.length;i<l;i++)if(i in array&&array[i]===item)return i;return-1;},sortedIndex:sortedIndex,identity:identity,isNumber:function(obj){return toString.call(obj)=='[object Number]';},isFunction:function(obj){return toString.call(obj)=='[object Function]'||typeof obj=='function';},isUndefined:function(obj){return obj===void 0;},isNull:function(obj){return obj===null;}};},{}],"H99CHA":[function(require,module,exports){var root=function(){return this;}(),previousShortcut=root.Physics;module.exports=root.Physics=require('./Physics');},{"./Physics":5}],"physics":[function(require,module,exports){module.exports=require('H99CHA');},{}],11:[function(require,module,exports){module.exports=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(callback){window.setTimeout(callback,1000/60);};},{}],12:[function(require,module,exports){module.exports=require(7);},{"./common":8}]},{},["H99CHA"]);
@@ -1 +1 @@
canvas#corpus-map{position:absolute;box-sizing:border-box;top:0;left:0;z-index:0}canvas#corpus-map.de-activated{background-color:#f4f4f4}div.node-popup{z-index:10;position:absolute;box-sizing:content-box;width:300px;min-height:30px;top:60%;left:30%;pointer-events:none}div.node-popup .inner{padding:.6em;outline:red solid 1px;background-color:#fff}div.node-popup:before{content:"";position:absolute;width:60px;height:0;border-top:1px solid red}div.node-popup[pos=bottom-right]{transform:translateY(42px) translateX(42px)}div.node-popup[pos=bottom-right]:before{top:-1px;left:-61px;transform-origin:bottom right;transform:rotateZ(45deg)}div.node-popup[pos=bottom-left]{transform:translateX(-100%) translateY(42px) translateX(-42px)}div.node-popup[pos=bottom-left]:before{top:calc(100% +1px);left:100%;transform-origin:top left;transform:rotateZ(-45deg)}div.node-popup[pos=top-left]{transform:translateY(-100%) translateX(-100%) translateY(-42px) translateX(-42px)}div.node-popup[pos=top-left]:before{bottom:0;left:100%;transform-origin:top left;transform:rotateZ(45deg)}div.node-popup[pos=top-right]{transform:translateY(-100%) translateY(-42px) translateX(42px)}div.node-popup[pos=top-right]:before{top:calc(100% + 1px);left:-61px;transform-origin:top right;transform:rotateZ(-45deg)}
canvas#corpus-map{position:absolute;box-sizing:border-box;top:0;left:0;z-index:0}canvas#corpus-map.de-activated{background-color:#f4f4f4}div.node-popup{z-index:10;position:absolute;box-sizing:content-box;width:300px;min-height:30px;top:60%;left:30%;pointer-events:none}div.node-popup .inner{padding:.6em;outline:red solid 1px;background-color:#fff}div.node-popup:before{content:"";position:absolute;width:60px;height:0;border-top:1px solid red}div.node-popup[pos=bottom-right]{transform:translateY(42px) translateX(42px)}div.node-popup[pos=bottom-right]:before{top:-1px;left:-61px;transform-origin:bottom right;transform:rotateZ(45deg)}div.node-popup[pos=bottom-left]{transform:translateX(-100%) translateY(42px) translateX(-42px)}div.node-popup[pos=bottom-left]:before{top:calc(100% + 1px);left:100%;transform-origin:top left;transform:rotateZ(-45deg)}div.node-popup[pos=top-left]{transform:translateY(-100%) translateX(-100%) translateY(-42px) translateX(-42px)}div.node-popup[pos=top-left]:before{bottom:0;left:100%;transform-origin:top left;transform:rotateZ(45deg)}div.node-popup[pos=top-right]{transform:translateY(-100%) translateY(-42px) translateX(42px)}div.node-popup[pos=top-right]:before{top:calc(100% + 1px);left:-61px;transform-origin:top right;transform:rotateZ(-45deg)}
@@ -1,23 +1,16 @@
// @Author: Bachir Soussi Chiadmi <bach>
// @Date: 18-12-2017
// @Email: bachir@figureslibres.io
// @Filename: corpus.scss
// @Last modified by: bach
// @Last modified time: 20-12-2017
// @License: GPL-V3
canvas#corpus-map{
&.de-activated{
background-color: rgb(244, 244, 244);
}
position: absolute;
box-sizing: border-box;
top:0; left:0;
// width:100%; height:100%;
z-index:0;
&.de-activated{
background-color: rgb(244, 244, 244);
}
}
// _ _ _ ___ _ _
// | \| |___ __| |___| _ \___ _ __| | | |_ __
// | .` / _ \/ _` / -_) _/ _ \ '_ \ |_| | '_ \
@@ -40,7 +33,7 @@ div.node-popup{
}
$w:60px; // diagonal length
$s:($w *1.4)*0.5; // side given the diagonal (1.4 is the square root of 2)
$s:($w * 1.4) * 0.5; // side given the diagonal (1.4 is the square root of 2)
&:before{
content:"";
position: absolute;
@@ -60,7 +53,7 @@ div.node-popup{
&[pos="bottom-left"]{
transform: translateX(-100%) translateY($s) translateX(-$s);
&:before{
top:calc(100% +1px);
top:calc(100% + 1px);
left: 100%;
transform-origin: top left;
transform: rotateZ(-45deg);
@@ -79,9 +72,10 @@ div.node-popup{
transform: translateY(-100%) translateY(-$s) translateX($s);
&:before{
top:calc(100% + 1px);
left: - ($w +1px);
left: - ($w + 1px);
transform-origin: top right;
transform: rotateZ(-45deg);
}
}
}
@@ -1,12 +1,11 @@
(function($,Drupal,drupalSettings){var _settings=drupalSettings.edlp_studio;var _$composer;function init(){initEvents();initStudio();};function initEvents(){$('body').on('new-audio-cartel-loaded',initAjaxChutierLinks).on('new-content-ajax-loaded',initAjaxChutierLinks).on('new-content-ajax-loaded',initStudio).on('all-modal-closed',initStudio);};function initStudio(){if($('#studio-ui').length){_$composer=$('.composition_ui .composer','#studio-ui');initAjaxChutierLinks();initAjaxCompoLinks();initDragAndDropUI();initUsedChutierInCompo();$('body').trigger({'type':'studio-initialized'});}else{$('body').trigger({'type':'studio-not-active'});}}
function initAjaxChutierLinks(){$('.chutier-ajax-link:not(.ajax-enabled)').addClass('ajax-enabled').on('click',onClickChutierAjaxLink);};function onClickChutierAjaxLink(e){e.preventDefault();addRemoveToChutier($(this));return false;};function addRemoveToChutier($link){var ajax_path=$link.attr('data-drupal-link-system-path');var path=window.location.origin+drupalSettings.path.baseUrl+ajax_path;$link.addClass('ajax-loading');$.getJSON(path,{}).done(function(data){onActionToChutierDone($link,data);}).fail(function(jqxhr,textStatus,error){onErrorActionToChutier(jqxhr,textStatus,error,$link);});};function onActionToChutierDone($link,data){$('body').trigger({'type':'chutier-action-done','action_done':data.action_done,'new_action':data.action_done=='add'?'remove':'add','target_id':$link.attr('target_id'),});$link.replaceWith(data.new_link);initAjaxChutierLinks();updateStudioChutier();};function onErrorActionToChutier(jqxhr,textStatus,error,$link){void 0;};function initAjaxCompoLinks(){$('.new-composition-link:not(.ajax-enabled)').on('click',onClickNewCompoLink).addClass('ajax-enabled');$('.composition-link:not(.ajax-enabled)').on('click',onClickCompoLink).addClass('ajax-enabled');$('.delete-composition-link:not(.ajax-enabled)').on('click',onClickDeleteCompoLink).addClass('ajax-enabled');};function initUsedChutierInCompo(){void 0;$('.documents',"#studio-ui .chutier_ui").on("wheel",function(event){void 0;this.scrollLeft+=event.originalEvent.deltaY;})
$('.chutier-link.on-compo','#studio-ui .chutier_ui').removeClass('on-compo');var nid;$('.audio-link',_$composer).each(function(index,el){nid=$(el).attr('nid');void 0;$('.chutier-link[target_id="'+nid+'"]','#studio-ui .chutier_ui').addClass('on-compo');});};function onClickCompoLink(e){e.preventDefault();openCompo($(this));return false;};function openCompo($link){var cid=$link.attr('cid');var ajax_path=_settings.open_compo_ajax_url+'/'+cid;var path=window.location.origin+Drupal.url(ajax_path);$link.addClass('ajax-loading');_$composer.addClass('ajax-loading');$.getJSON(path,{}).done(function(data){onOpenCompoDone(data,$link);}).fail(function(jqxhr,textStatus,error){onErrorOpenCompo(jqxhr,textStatus,error,$link);});};function onOpenCompoDone(data,$link){void 0;$('.composition-link').removeClass('is-active');$link.removeClass('ajax-loading').addClass('is-active');if($('.composition',_$composer).length){$('.composition',_$composer).replaceWith(data.compo);}else{$('header',_$composer).after(data.compo);}
function initAjaxChutierLinks(){$('.chutier-ajax-link:not(.ajax-enabled)').addClass('ajax-enabled').on('click',onClickChutierAjaxLink);};function onClickChutierAjaxLink(e){e.preventDefault();addRemoveToChutier($(this));return false;};function addRemoveToChutier($link){var ajax_path=$link.attr('data-drupal-link-system-path');var path=window.location.origin+drupalSettings.path.baseUrl+ajax_path;$link.addClass('ajax-loading');$.getJSON(path,{}).done(function(data){onActionToChutierDone($link,data);}).fail(function(jqxhr,textStatus,error){onErrorActionToChutier(jqxhr,textStatus,error,$link);});};function onActionToChutierDone($link,data){$('body').trigger({'type':'chutier-action-done','action_done':data.action_done,'new_action':data.action_done=='add'?'remove':'add','target_id':$link.attr('target_id')});$link.replaceWith(data.new_link);initAjaxChutierLinks();updateStudioChutier();};function onErrorActionToChutier(jqxhr,textStatus,error,$link){void 0;};function initAjaxCompoLinks(){$('.new-composition-link:not(.ajax-enabled)').on('click',onClickNewCompoLink).addClass('ajax-enabled');$('.composition-link:not(.ajax-enabled)').on('click',onClickCompoLink).addClass('ajax-enabled');$('.delete-composition-link:not(.ajax-enabled)').on('click',onClickDeleteCompoLink).addClass('ajax-enabled');};function initUsedChutierInCompo(){void 0;$('.documents',"#studio-ui .chutier_ui").on("wheel",function(event){void 0;this.scrollLeft+=event.originalEvent.deltaY;});$('.chutier-link.on-compo','#studio-ui .chutier_ui').removeClass('on-compo');var nid;$('.audio-link',_$composer).each(function(index,el){nid=$(el).attr('nid');void 0;$('.chutier-link[target_id="'+nid+'"]','#studio-ui .chutier_ui').addClass('on-compo');});};function onClickCompoLink(e){e.preventDefault();openCompo($(this));return false;};function openCompo($link){var cid=$link.attr('cid');var ajax_path=_settings.open_compo_ajax_url+'/'+cid;var path=window.location.origin+Drupal.url(ajax_path);$link.addClass('ajax-loading');_$composer.addClass('ajax-loading');$.getJSON(path,{}).done(function(data){onOpenCompoDone(data,$link);}).fail(function(jqxhr,textStatus,error){onErrorOpenCompo(jqxhr,textStatus,error,$link);});};function onOpenCompoDone(data,$link){void 0;$('.composition-link').removeClass('is-active');$link.removeClass('ajax-loading').addClass('is-active');if($('.composition',_$composer).length){$('.composition',_$composer).replaceWith(data.compo);}else{$('header',_$composer).after(data.compo);}
_$composer.removeClass('ajax-loading');if(!$('.field--name-documents .field__item',_$composer).length){_$composer.addClass('empty');}else{_$composer.removeClass('empty');}
initDragAndDropUI();initUsedChutierInCompo();$('body').trigger({'type':'on-studio-compo-opened'});};function onErrorOpenCompo(jqxhr,textStatus,error,$link){$link.removeClass('ajax-loading');void 0;};function onClickNewCompoLink(e){e.preventDefault();setInputForNewCompoName($(this));return false;};function setInputForNewCompoName($link){var $form=$('<form>').addClass('new-compo-form').append($('<input>').attr('type','text').attr('placeholder','new name')).append($('<button>').attr('type','submit').html('+')).submit(function(e){onNewCompoFormSubmit(e,$link,$(this));});$link.after($form).addClass('folded');$form.children('input[type="text"]').focus();};function onNewCompoFormSubmit(e,$link,$form){var name=$('input[type="text"]',$form).val();if(name!=''){$form.addClass('ajax-loading').children('*').attr('disabled','disabled');createNewCompo(name,$link,$form);}
e.preventDefault();};function createNewCompo(name,$link,$form){var ajax_path=$link.attr('data-drupal-link-system-path');var path=window.location.origin+drupalSettings.path.baseUrl+ajax_path;$.getJSON(path,{'new_name':name}).done(function(data){onCreateCompoDone(data,$link,$form);}).fail(function(jqxhr,textStatus,error){onErrorCreateCompo(jqxhr,textStatus,error,$link);});};function onCreateCompoDone(data,$link,$form){var $new_link=$(data.new_link);var $delete_link=$(data.delete_link);$link.removeClass('folded').parents('li').after($('<li>').append($new_link).append($delete_link));$form.remove();initAjaxCompoLinks();openCompo($new_link);};function onErrorCreateCompo(jqxhr,textStatus,error,$link){void 0;};function onClickDeleteCompoLink(e){e.preventDefault();deleteCompo($(this));return false;};function deleteCompo($link){var ajax_path=$link.attr('data-drupal-link-system-path');var path=window.location.origin+Drupal.url(ajax_path);$link.parents('li').addClass('ajax-loading');$.getJSON(path,{}).done(function(data){onDeleteCompoDone(data,$link);}).fail(function(jqxhr,textStatus,error){onErrorDeleteCompo(jqxhr,textStatus,error,$link);});};function onDeleteCompoDone(data,$link,$form){if(data.status=="ok"){$link.parents('li').remove();if($('.composition-link').length){openCompo($('.composition-link').eq(0));}else{$('.composition',_$composer).html();}}else{void 0;}};function onErrorDeleteCompo(jqxhr,textStatus,error,$link){$link.parents('li').removeClass('ajax-loading');void 0;};function updateStudioChutier(){$studioChutier=$('#studio-ui .chutier_ui');if($studioChutier.length){var ajax_path=_settings.chutier_ui_ajax;var path=window.location.origin+drupalSettings.path.baseUrl+ajax_path;$studioChutier.addClass('loading');$.getJSON(path,{}).done(function(data){onLoadedChutier($studioChutier,data);}).fail(function(jqxhr,textStatus,error){onLoadChutierError(jqxhr,textStatus,error,$studioChutier);});}};function onLoadedChutier($studioChutier,data){$studioChutier.replaceWith(data.rendered);initAjaxChutierLinks();setChutierDraggable();$('body').trigger({'type':'on-studio-chutier-updated'});}
function onLoadChutierError(jqxhr,textStatus,error,$studioChutier){void 0;$studioChutier.removeClass('loading');}
function initDragAndDropUI(){if(!$('.composition_ui .composer .composition .field--name-documents').length){$field_documents=$('<div>').addClass('field').addClass('field--name-documents').appendTo('.composition_ui .composer .composition');}else{$field_documents=$('.composition_ui .composer .composition .field--name-documents');$('.field__item',$field_documents).each(function(i){$(this).prepend($('<span>').addClass('handler'));});}
var $remove_zone=$('<div>').addClass('remove-drop-zone').appendTo('.composition_ui .composer .composition').droppable({tolerance:'pointer',over:function(e,ui){ui.draggable.addClass('ready-to-remove');},out:function(e,ui){ui.draggable.removeClass('ready-to-remove');},drop:function(e,ui){ui.draggable.remove();}});$field_documents.sortable({revert:false,handle:".handler",receive:function(e,ui){$('.field__item',this).attr('style','');},update:function(e,ui){onOrderChanged(e,ui);},connectWith:$remove_zone,});setChutierDraggable();};function setChutierDraggable(){$('.chutier_ui .item-list li>div').draggable({containment:$('#studio-ui'),scroll:false,helper:function(e){return $('<div>').addClass('field__item').append($('<article>').addClass('node').append($('<h2>').addClass('node-title').append($('.audio-link',this).clone().removeClass('ajax-enable')))).prepend($('<span>').addClass('handler'));},cursorAt:{bottom:10,left:10},zIndex:999,revert:true,revertDuration:0,connectToSortable:$('.composition_ui .composer .composition .field--name-documents'),});}
var $remove_zone=$('<div>').addClass('remove-drop-zone').appendTo('.composition_ui .composer .composition').droppable({tolerance:'pointer',over:function(e,ui){ui.draggable.addClass('ready-to-remove');},out:function(e,ui){ui.draggable.removeClass('ready-to-remove');},drop:function(e,ui){ui.draggable.remove();}});$field_documents.sortable({revert:false,handle:".handler",receive:function(e,ui){$('.field__item',this).attr('style','');},update:function(e,ui){onOrderChanged(e,ui);},connectWith:$remove_zone});setChutierDraggable();};function setChutierDraggable(){$('.chutier_ui .item-list li>div').draggable({containment:$('#studio-ui'),scroll:false,helper:function(e){return $('<div>').addClass('field__item').append($('<article>').addClass('node').append($('<h2>').addClass('node-title').append($('.audio-link',this).clone().removeClass('ajax-enable')))).prepend($('<span>').addClass('handler'));},cursorAt:{bottom:10,left:10},zIndex:999,revert:true,revertDuration:0,connectToSortable:$('.composition_ui .composer .composition .field--name-documents')});}
function onOrderChanged(e,ui){var cid=$(e.target).parents('.composition').attr('cid');var documents={};$('a',e.target).each(function(i){documents[i]=$(this).attr('nid');});initUsedChutierInCompo();_$composer.removeClass('empty');recordCompoList(cid,documents);};function recordCompoList(cid,docs){var ajax_path=_settings.save_compo_ajax_url+'/'+cid;var path=window.location.origin+Drupal.url(ajax_path);$.getJSON(path,{documents:docs}).done(function(data){onRecordCompoDone(data);}).fail(function(jqxhr,textStatus,error){onErrorRecordCompo(jqxhr,textStatus,error);});$('body').trigger({'type':'on-studio-compo-updated'});}
function onRecordCompoDone(data){if(data.status=="ok"){}else{void 0;}};function onErrorRecordCompo(jqxhr,textStatus,error){void 0;};init();})(jQuery,Drupal,drupalSettings);
@@ -305,6 +305,7 @@
}
// ___ __ ___ _ _ ___
// | \ _ _ __ _ __ _ / _|___ | \ _ _ ___ _ __ | | | |_ _|
// | |) | '_/ _` / _` | > _|_ _| | |) | '_/ _ \ '_ \ | |_| || |
@@ -5,7 +5,7 @@ edlp_studio-library:
- core/drupalSettings
- core/once
- core/jquery
- jquery_ui_draggable/draggable
- jquery_ui_droppable/droppable
- jquery_ui_sortable/sortable
# - core/jquery.once
- jquery_ui_draggable/jquery_ui_draggable
- jquery_ui_droppable/jquery_ui_droppable
- jquery_ui_sortable/jquery_ui_sortable
@@ -26,7 +26,7 @@ function template_preprocess_composition(array &$vars) {
// $variables['page'] = $variables['view_mode'] == 'full' && taxonomy_term_is_page($term);
$vars['url'] = $composition->url();
$vars['url'] = $composition->toUrl()->toString();
$vars['attributes']['cid'] = $composition->id();
$vars['attributes']['class'] = array('composition');
@@ -73,7 +73,7 @@ class CompositionController extends ControllerBase {
case 'save':
if($cid){
$name = $request->query->get('new_name');
$documents = $request->query->get('documents');
$documents = $request->query->all('documents');
$this->saveComposition($cid, $name, $documents);
}else{
$this->error_message = t("Composition saving needs a cid as query paramater!");
+53 -16
View File
@@ -15,12 +15,25 @@ import minimist from 'minimist';
// var es = require('event-stream');
var modules = ['edlp_corpus', 'edlp_studio', 'edlp_search'];
var modules = [
{
modname:'edlp_studio',
srcjs:['./edlp_studio/assets/scripts/edlp_studio.js']
},
{
modname:'edlp_search',
srcjs:['./edlp_search/assets/scripts/edlp_search.js']
},
{
modname:'edlp_corpus',
srcjs:['./edlp_corpus/assets/scripts/corpus.js', './edlp_corpus/assets/scripts/physics.js'],
srccss:['./edlp_corpus/assets/styles/corpus.scss']
}];
// to get minified assets run `gulp --env=prod`
var argv = minimist(process.argv.slice(2));
console.dir(argv);
var prod = argv.env == 'prod' ? true : false;
var prod = argv.env === 'prod' ? true : false;
function handleError(err) {
console.log(err.toString());
@@ -29,46 +42,70 @@ function handleError(err) {
function scripts() {
return new Promise(function(resolve, reject) {
modules.map(function(module) {
src('./'+module+'/assets/scripts/*.js')
// console.log('module', module);
src(module.srcjs, {allowEmpty: true})
.on('data', function(file) {
console.log('File src:', file.path);
})
.pipe(gulpif(prod, stripDebug()))
.pipe(gulpif(prod, jsmin()))
.pipe(rename({suffix: '.min'}))
.pipe(gulp.dest('./'+module+'/assets/dist/scripts/'));
.pipe(dest(`./${module.modname}/assets/dist/scripts/`));
// .on('data', function(file) {
// console.log('File dest:', file.path);
// });
});
resolve();
});
// return src(['./edlp_studio/assets/scripts/edlp_studio.js'])
// .pipe(gulpif(prod, stripDebug()))
// .pipe(gulpif(prod, jsmin()))
// .pipe(rename({suffix: '.min'}))
// .pipe(dest('./edlp_studio/assets/dist/scripts/'));
};
function styles() {
return new Promise(function(resolve, reject) {
modules.map(function(module) {
src('./'+module+'/assets/styles/*.scss')
.pipe(sass().on('error', sass.logError))
.pipe(autoprefixer({
cascade: false
})).on('error', handleError)
.pipe(gulpif(prod, cssmin()))
// .pipe(cssmin())
.pipe(rename({suffix: '.min'}))
.pipe(gulp.dest('./'+module+'/assets/dist/styles/'));
if (module.srccss) {
src(module.srccss, {allowEmpty: true})
.pipe(sass().on('error', sass.logError))
.pipe(autoprefixer({
cascade: false
})).on('error', handleError)
.pipe(gulpif(prod, cssmin()))
// .pipe(cssmin())
.pipe(rename({suffix: '.min'}))
.pipe(dest('./'+module.modname+'/assets/dist/styles/'));
}
});
resolve();
});
// return src('./edlp_studio/assets/styles/*.scss')
// .pipe(sass().on('error', sass.logError))
// .pipe(autoprefixer({
// cascade: false
// })).on('error', handleError)
// .pipe(gulpif(prod, cssmin()))
// // .pipe(cssmin())
// .pipe(rename({suffix: '.min'}))
// .pipe(dest('./edlp_studio/assets/dist/styles/'));
};
// default gulp task
function devwatch () {
// series(scripts, styles, done => {
for (var i = 0; i < modules.length; i++) {
watch('./'+modules[i]+'/assets/styles/*.scss', styles);
watch('./'+modules[i]+'/assets/scripts/*.js', scripts);
watch('./'+modules[i].modname+'/assets/styles/*.scss', styles);
watch('./'+modules[i].modname+'/assets/scripts/*.js', scripts);
}
// done()
// })
};
export default series(scripts, styles);
export default series(scripts, styles); //
export { devwatch }
@@ -33,7 +33,7 @@ if(edlp_origin.audio_url){var node={nid:edlp_origin.entity_id,audio_url:edlp_ori
else if(state.ajax_path){ajaxLoadContent(state);}
if(state.entree_tid){openEntree(state.entree_tid);}
history.replaceState(state,null,edlp_origin.url+edlp_origin.hash);window.localStorage.removeItem("edlp_origin");}else{history.replaceState({home:true},null,window.location.pathname+window.location.hash);initGrid();_$body.attr('booted','booted');}};function onHistoryPopState(e){void 0;if(e.state.home){backToFrontPage(true);}else if(e.state.audio){void 0;_audioPlayer.openDocument(e.state.node,'popstate',e.state.historic_index);if(_is_mobile){ajaxLoadContent(e.state);}}else{if(e.state.entree_tid){openEntree(e.state.entree_tid);}
if(e.state.ajax_path){e.state.url=null;ajaxLoadContent(e.state);}}};function initAjaxLinks(){$('a','#block-mainnavigation').add('a','#block-mainnavigation-2').add('a','#block-footer.menu--footer').add('a','#block-productions').add('a','article.node:not(.node--type-enregistrement) h2.node-title').add('a','.productions-subtree').add('a','.productions-parent').add('a','.field--name-field-son').addClass('ajax-link');if(!_is_mobile){$('a.site-name','#block-edlptheme-branding').addClass('ajax-link');}
if(e.state.ajax_path){e.state.url=null;ajaxLoadContent(e.state);}}};function initAjaxLinks(){$('a','#block-edlptheme-mainnavigation').add('a','#block-mainnavigation-2').add('a','#block-footer.menu--footer').add('a','#block-productions').add('a','article.node:not(.node--type-enregistrement) h2.node-title').add('a','.productions-subtree').add('a','.productions-parent').add('a','.field--name-field-son').addClass('ajax-link');if(!_is_mobile){$('a.site-name','#block-edlptheme-branding').addClass('ajax-link');}
_$ajaxLinks=$('.ajax-link');activateAjaxLinks();};function activateAjaxLinks(){_$ajaxLinks.each(function(i,e){var $this=$(this);if($this.is('.ajax-enable'))return;if($this.attr('data-drupal-link-system-path')||$this.is('[type^="audio"]')){$this.on('click',onClickAjaxLink).addClass('ajax-enable');}});};function onClickAjaxLink(e){e.preventDefault();var $link=$(this);if($link.is('.is-active')&&!$link.is('.site-name'))return false;if($link.is('.audio-link')){caller=$link.parents('.lastdocs, .lastdocs-home').length?'lastdocs':null;if(!caller){caller=$link.parents('.composition_ui').length?'studio-compo':null;}
if(caller=='studio-compo'){var index=$link.parents('.field__item').index();void 0;_compoPlayer.start(index);}else{_audioPlayer.emmit('stop-shuffle').openDocument({nid:$link.attr('nid'),audio_url:$link.attr('audio_url'),title:$link.find('.field--name-title').html()},caller);}
return false;}
-14
View File
@@ -1,14 +0,0 @@
body {
background: white; }
.btn--hollow {
background: red;
display: inline-block;
padding: 10px; }
body, html {
position: relative;
width: 100%;
height: 100%;
font-family: Georgia, serif;
font-style: normal; }
File diff suppressed because one or more lines are too long
@@ -860,7 +860,7 @@
function initAjaxLinks(){
// console.log('initAjaxLinks');
$('a', '#block-mainnavigation')
$('a', '#block-edlptheme-mainnavigation')
.add('a', '#block-mainnavigation-2')
// .add('a', '.block.language-switcher-language-url')
.add('a', '#block-footer.menu--footer')
@@ -13,11 +13,11 @@
@import 'base/fonts';
@mixin spining-loader-square{
animation: rotation 2s infinite linear;
@keyframes rotation {
from {transform: rotate(0deg);}
to {transform: rotate(359deg);}
}
animation: rotation 2s infinite linear;
}
@mixin entree-micro-square {
@@ -132,6 +132,9 @@ header[role="banner"]{
#block-edlptheme-branding{
display: inline-block;
opacity: 1;
transition: opacity 0.7s ease-in-out;
h1{
margin:0; display: inline-block;
a.site-name{
@@ -152,15 +155,12 @@ header[role="banner"]{
}
}
}
opacity: 1;
transition: opacity 0.7s ease-in-out;
.audio-player-visible &{
opacity: 0;
}
}
#block-mainnavigation, #block-mainnavigation-2{
#block-mainnavigation, #block-edlptheme-mainnavigation{
float:right;
margin-top: 25px;
z-index: 21;
@@ -497,11 +497,11 @@ main[role="main"]{
}
.agenda{
text-align: center;
.past-events{
border-top: 1px solid red;
margin-top: 1em;
}
text-align: center;
h3{
@include content_titles;
}
@@ -956,20 +956,18 @@ main[role="main"]{
min-width:700px;
width: calc(100% - 460px);
// width: calc(100% - 950px);
@media only screen and (max-width: 1270px) {
width: calc(100% - 180px);
}
z-index: 20;
opacity: 0;
pointer-events: none;
transition: opacity 0.7s ease-in-out;
white-space: nowrap;
@media only screen and (max-width: 1270px) {
width: calc(100% - 180px);
}
&.visible{
opacity: 1;
pointer-events:all;
}
white-space: nowrap;
&>*{
display: inline-block;
vertical-align: middle;
@@ -1041,8 +1039,8 @@ main[role="main"]{
// background-color: white;
opacity: 1;
transition: opacity 0.5s ease-in-out;
&.loading{opacity: 0;}
white-space: nowrap;
&.loading{opacity: 0;}
.actions, .cartels{
display: inline-block;
vertical-align: top;
@@ -1280,7 +1278,7 @@ main[role="main"]{
transform: translateY(-100%) translateY(-$s) translateX($s);
&:before{
top:calc(100% + 1px);
left: - ($w +1px);
left: - ($w + 1px);
transform-origin: top right;
transform: rotateZ(-45deg);
}
@@ -1296,7 +1294,6 @@ main[role="main"]{
}
}
// ___ _ _ _
// / __| |_ _ _ __| (_)___
// \__ \ _| || / _` | / _ \
@@ -1314,10 +1311,10 @@ main[role="main"]{
background-repeat: no-repeat;
background-size: contain;
background-image: url(../img/favori-off.svg);
transition: opacity 0.2s ease-in-out;
&[action="remove"]{
background-image: url(../img/favori-on.svg);
}
transition: opacity 0.2s ease-in-out;
&.ajax-loading{
opacity: 0.2;
}
@@ -1365,11 +1362,11 @@ main[role="main"]{
// margin-right: 25px;
width:25px;
height: 100%;
opacity: 1;
transition: opacity 0.1s ease-in-out;
&.ui-draggable-dragging{
height:100px;
}
opacity: 1;
transition: opacity 0.1s ease-in-out;
&.ready-to-remove{
opacity:0.3;
cursor:crosshair;
@@ -1388,6 +1385,7 @@ main[role="main"]{
text-transform: none;
a{
white-space: nowrap!important;
font-size: 0.756em;
&:before{
content:"";
display: inline-block;
@@ -1397,7 +1395,6 @@ main[role="main"]{
background-color: white;
// TODO: entries color;
}
font-size: 0.756em;
}
}
}
@@ -1544,7 +1541,7 @@ main[role="main"]{
display: inline-block;
box-sizing: border-box;
// width:100%;
width: calc(100% - #{$w +$s +$m +2});
width: calc(100% - #{$w + $s + $m + 2});
&:before{
content: "";
width:$w; height:$w;
@@ -1575,23 +1572,25 @@ main[role="main"]{
}
&.new-composition-link{
// padding-left: 1em;
&:before{
content:"+";
// font-weight: bold;
margin-right: $m;
}
display: inline-block;
vertical-align: top;
overflow: hidden;
margin-top: 0.4em;
height:1em;
transition: height 0.2s ease-in-out;
&:before{
content:"+";
// font-weight: bold;
margin-right: $m;
}
&.folded{
height:0;
}
}
}
.new-compo-form{
opacity: 1;
transition: opacity 0.2s ease-in-out;
input[type="text"]{
font-size: 0.756em;
padding:0 0.5em;
@@ -1608,8 +1607,6 @@ main[role="main"]{
line-height: 1;
font-weight: bold;
}
opacity: 1;
transition: opacity 0.2s ease-in-out;
&.ajax-loading{
opacity: 0.4;
}
@@ -1661,7 +1658,7 @@ main[role="main"]{
}
&:before{
border-top: 1px solid $c;
height:$h /2;
height:calc($h / 2);
}
&:after{
border-left: 1px solid $c;
@@ -2096,7 +2093,6 @@ body.path-frontpage, body.path-productions{
display: inline-block;
position: relative;
list-style: none;
margin: 0 1.5em 0 0;
// width:2em; height:10em;
padding: 0;
a{
@@ -2239,6 +2235,7 @@ footer{
padding:0;
li{
pointer-events: all;
margin: 0 1.5em 0 0;
@include oblique-list;
&:first-of-type{
margin-left: 1em;
@@ -2306,11 +2303,11 @@ footer{
.block-block-edlp-entrees{
pointer-events: none;
display: inline-block;
body.path-productions &,
body.entity-type-node.bundle-page &,
body.path-agenda & {display:none}
display: inline-block;
// vertical-align: top;
// outline: 1px dotted green;
div.item-list{
@@ -2318,10 +2315,10 @@ footer{
margin:0;
white-space: nowrap;
li{
@include oblique-list;
margin:0;
white-space: nowrap;
pointer-events: none;
margin:0;
@include oblique-list;
// docsindex
&:first-of-type{
margin-right: 3.4em;
@@ -2688,8 +2685,8 @@ footer{
#block-edlpsearchlinkblock{
margin-bottom: 1em;
@include iconlinkblock(url(../img/search.svg), url(../img/search-active.svg));
margin-left: 0.2em;
@include iconlinkblock(url(../img/search.svg), url(../img/search-active.svg));
}
.block-language{
@@ -2807,11 +2804,11 @@ footer{
}
}
.chutier-icon{
position:absolute;
top:0.4em; right:0.4em;
&[action="add"]{
display:none;
}
position:absolute;
top:0.4em; right:0.4em;
}
}
body.domain-expo-encyclopediedelaparole-org &{
@@ -16,7 +16,7 @@ $med-bp:1080px;
}
}
%col-reset {
@mixin col-reset {
width: 100%;
// display: inline-block;
// white-space:normal;
@@ -26,21 +26,22 @@ $med-bp:1080px;
}
@mixin col($col, $offset: 0, $sum: $default_sum, $gap: $default_gap, $align: top) {
@extend %col-reset;
@include col-reset;
padding-left: $gap*$offset;
@if $col == $default_sum {
padding-right: 0;
}@else{
padding-right: $gap;
}
&:last-child{padding-right: 0;}
margin-left: percentage(($col/$sum)*$offset);
margin-left: percentage(calc($col / $sum) * $offset);
// @media only screen and (min-width: 768px) {
width: percentage($col/$sum);
width: percentage(calc($col / $sum));
// vertical-align: $align;
// }
// }
&:last-child{padding-right: 0;}
}
.row{
@@ -64,14 +65,14 @@ $med-bp:1080px;
// medium
.med-col-#{$c} {
@media only screen and (min-width: $small-bp+1) and (max-width: $med-bp) {
@media only screen and (min-width: $small-bp + 1) and (max-width: $med-bp) {
@include col($c);
}
}
// large
.large-col-#{$c} {
@media only screen and (min-width: $med-bp+1) {
@media only screen and (min-width: $med-bp + 1) {
@include col($c);
}
}
+6 -8
View File
@@ -11,17 +11,16 @@ import stripDebug from 'gulp-strip-debug';
import jsmin from 'gulp-jsmin';
import cssmin from 'gulp-cssmin';
import rename from 'gulp-rename';
import minimist from 'minimist';
import mainBowerFiles from 'main-bower-files';
import svgmin from 'gulp-svgmin';
import minimist from 'minimist';
// var shared_variables = JSON.parse(fs.readFileSync('./assets/json/shared_variables.json'));
// to get minified assets run `gulp --env=prod`
var argv = minimist(process.argv.slice(2));
console.dir(argv);
// var prod = argv.env === 'prod' ? true : false;
var prod = true;
var prod = argv.env === 'prod' ? true : false;
function handleError(err) {
console.log(err.toString());
@@ -41,14 +40,13 @@ async function styles() {
return src(['./assets/styles/app.scss'])
.pipe(sass().on('error', sass.logError))
.pipe(autoprefixer({
browsers: ['last 2 versions'],
cascade: false
})).on('error', handleError)
// .pipe(prod ? cssmin() : util.noop())
.pipe(gulpif(prod, cssmin()))
// .pipe(cssmin())
.pipe(rename({suffix: '.min'}))
.pipe(gulp.dest('./assets/dist/styles/'));
.pipe(dest('./assets/dist/styles/'));
}
async function bower(){
@@ -67,18 +65,18 @@ async function bower(){
"outlayer":{"ignore":true},
}
}))
.pipe(gulp.dest('./assets/dist/bower/'));
.pipe(dest('./assets/dist/bower/'));
}
async function minsvg(){
return src(['./assets/img/*.svg', '!./assets/img/edlp-loader-anim.svg'])
.pipe(svgmin())
.pipe(gulp.dest('./assets/dist/img'));
.pipe(dest('./assets/dist/img'));
}
async function svg(){
return src('./assets/img/edlp-loader-anim.svg')
.pipe(gulp.dest('./assets/dist/img'));
.pipe(dest('./assets/dist/img'));
}
function devwatch(){