# HG changeset patch # User veltr # Date 1341411229 -7200 # Node ID 642ef9139fad91aa4edafc8c85ecf9e4117a8aa4 # Parent a000f6a29dfaa59f29d2c2f8434627a888bf414d Replaced "Production" by "Publication". Added beautiful arrows diff -r a000f6a29dfa -r 642ef9139fad timeline/css/timeline.css --- a/timeline/css/timeline.css Mon Jul 02 18:45:22 2012 +0200 +++ b/timeline/css/timeline.css Wed Jul 04 16:13:49 2012 +0200 @@ -123,7 +123,7 @@ background-position: 0 -50px; } -.Tl-Occproduction { +.Tl-Occpublication { background-position: -19px -50px; } @@ -131,7 +131,7 @@ background-position: 0 -72px; } -.Tl-Occproduction.Tl-Editing { +.Tl-Occpublication.Tl-Editing { background-position: -19px -72px; } diff -r a000f6a29dfa -r 642ef9139fad timeline/data/occurrences.json --- a/timeline/data/occurrences.json Mon Jul 02 18:45:22 2012 +0200 +++ b/timeline/data/occurrences.json Wed Jul 04 16:13:49 2012 +0200 @@ -65,12 +65,12 @@ ] } ], - "occurrencesProduction" : [ + "occurrencesPublication" : [ { "id" : "P01", "datePublication" : 1336608060000, - "titre" : "Production 1", - "description" : "Ma première occurrence de production", + "titre" : "Publication 1", + "description" : "Ma première occurrence de publication", "univers" : "U06", "statut" : "valide", "publie" : true, @@ -82,8 +82,8 @@ { "id" : "P02", "datePublication" : 1336608240000, - "titre" : "Production 2", - "description" : "Ma deuxième occurrence de production", + "titre" : "Publication 2", + "description" : "Ma deuxième occurrence de publication", "univers" : "U04", "statut" : "valide", "publie" : true, @@ -93,8 +93,8 @@ { "id" : "P03", "datePublication" : 1336608300000, - "titre" : "Production 3", - "description" : "Ma troisième occurrence de production", + "titre" : "Publication 3", + "description" : "Ma troisième occurrence de publication", "univers" : "U04", "statut" : "valide", "publie" : true, diff -r a000f6a29dfa -r 642ef9139fad timeline/js/timeline.js --- a/timeline/js/timeline.js Mon Jul 02 18:45:22 2012 +0200 +++ b/timeline/js/timeline.js Wed Jul 04 16:13:49 2012 +0200 @@ -63,6 +63,32 @@ }); } +Tlns.Utils.drawArrow = function(_ctx, _color, _x1, _y1, _x2, _y2) { + _ctx.strokeStyle = _color; + _ctx.fillStyle = _color; + _ctx.beginPath(); + _ctx.moveTo(_x1,_y1); + _ctx.lineTo(_x2,_y2); + _ctx.stroke(); + var _mod = Math.sqrt(Math.pow(_x2 - _x1, 2) + Math.pow(_y2 - _y1, 2)), + _xu = (_x2 - _x1) / _mod, + _yu = (_y2 - _y1) / _mod, + _xm = (_x1 + _x2) / 2, + _ym = (_y1 + _y2) / 2, + _arrowWidth = 4, + _arrowLength = 8, + _x3 = _xm - _arrowLength * _xu + _arrowWidth * _yu, + _y3 = _ym - _arrowLength * _yu - _arrowWidth * _xu, + _x4 = _xm - _arrowLength * _xu - _arrowWidth * _yu, + _y4 = _ym - _arrowLength * _yu + _arrowWidth * _xu; + _ctx.beginPath(); + _ctx.moveTo(_x3, _y3); + _ctx.lineTo(_xm, _ym); + _ctx.lineTo(_x4, _y4); + _ctx.fill(); + _ctx.stroke(); +} + /* Defaults */ Tlns.Defaults.Timeline = { @@ -138,7 +164,7 @@ + '