# HG changeset patch # User veltr # Date 1376403752 -7200 # Node ID 6b1a038edbf755219be5a546efe00f958f829901 # Parent 8bab0eb0d79159eea9f2c9ce3828386f050c8cdc Removed List diff -r 8bab0eb0d791 -r 6b1a038edbf7 .project --- a/.project Tue Aug 13 13:16:26 2013 +0200 +++ b/.project Tue Aug 13 16:22:32 2013 +0200 @@ -1,17 +1,17 @@ - - - eulalie - - - - - - org.python.pydev.PyDevBuilder - - - - - - org.python.pydev.pythonNature - - + + + eulalie + + + + + + com.aptana.ide.core.unifiedBuilder + + + + + + com.aptana.projects.webnature + + diff -r 8bab0eb0d791 -r 6b1a038edbf7 timeline/css/timeline.css --- a/timeline/css/timeline.css Tue Aug 13 13:16:26 2013 +0200 +++ b/timeline/css/timeline.css Tue Aug 13 16:22:32 2013 +0200 @@ -45,43 +45,15 @@ font-size: 10px; font-family: Arial, Helvetica, sans-serif; } -/*************************************************/ - -ul.Onglets { - margin: 0 10px; text-align: left; -} - -.Onglets li { - display: inline-block; background: url(../img/barbgd.png); font-size: 14px; height: 15px; padding: 5px; - border: 1px solid #cccccc; cursor: pointer; border-bottom: none; - border-top-left-radius: 8px; border-top-right-radius: 8px; -} - -.Onglets li.active, .Onglets li:hover { - background-position: 0 -25px; -} - /************************************************/ .Tl-Main { - border: 1px solid #ccc; font-family: Arial, Helvetica, sans-serif; text-align: left; + font-family: Arial, Helvetica, sans-serif; text-align: left; + position: relative; } .Tl-TopBar { - height: 25px; border-style: solid none; border-color: #ccc; border-width: 1px; - background: url(../img/barbgd.png); -} - -.Tl-TopBar-Button { - float: left; background: url(../img/barbgd.png); cursor: pointer; -} - -.Tl-TopBar-TextBtn { - font-size: 12px; height: 15px; padding: 5px; -} - -.Tl-TopBar-Button.active, .Tl-TopBar-Button:hover { - background-position: 0 -25px; + height: 20px; width: 100%; } .Tl-Border-Right { @@ -92,73 +64,47 @@ border-left: 1px solid #ccc; } -.Tl-TopBar-Spacer { - float: left; height: 25px; width: 25px; -} - -.Tl-TopBar-AddButton { - width: 25px; height: 25px; background: url(../img/sprites.png); background-position: -50px 0; -} - -.Tl-TopBar-AddButton.active, .Tl-TopBar-AddButton:hover { - background-position: -50px -25px; -} - -.Tl-TopBar-PreviousButton { - width: 25px; height: 25px; background: url(../img/sprites.png); background-position: -100px 0; -} - -.Tl-TopBar-PreviousButton.active, .Tl-TopBar-PreviousButton:hover { - background-position: -100px -25px; -} - -.Tl-TopBar-NextButton { - width: 25px; height: 25px; background: url(../img/sprites.png); background-position: -75px 0; -} - -.Tl-TopBar-NextButton.active, .Tl-TopBar-NextButton:hover { - background-position: -75px -25px; -} - -.Tl-TopBar-SyncButton { - width: 25px; height: 25px; background: url(../img/sprites.png); background-position: 0 0; -} - -.Tl-TopBar-SyncButton.active, .Tl-TopBar-SyncButton:hover { - background-position: 0 -25px; -} - -.Tl-TopBar-TimeSpan { - float: left; width: 140px; text-align: center; -} - .Tl-BottomPart { - position: relative; + position: absolute; bottom: 0; left: 0; right: 0; } .Tl-MainPart { - position: absolute; right: 0; top: 0; bottom: 0; border-left: 1px solid #ccc; overflow: hidden; - box-shadow: 0 0 20px #999999 inset + position: absolute; right: 0; top: 0; bottom: 0; overflow: hidden; } .Tl-UniversLabels { list-style: none; margin: 0; padding: 0; border: none; + font-size: 13px; +} + +.Tl-UniversLabels li { + position: relative; float: left; clear: both; width: 100%; +} + +.Tl-UniversLabels li:before { + content: "."; position: absolute; height: 1px; text-indent: -9999px; + width: 100%; top: 0; background: #DEDEDE; +} + +.Tl-UniversLabels li:after { + content: "."; position: absolute; height: 0; text-indent: -9999px; + width: 0; right: -8px; top: 50%; margin-top: -6px; + border-top: 6px solid transparent; + border-bottom: 6px solid transparent; + border-left: 8px solid #ffffff; } .Tl-UniversText { - font-size: 13px; margin: 2px 0; -} - -.Tl-Layer { - position: absolute; top: 0; left: 0; height: 100%; + margin-right: 2px; } .Tl-Grid { - width: 100%; overflow: hidden; + position: absolute; top: 0; right: 0; bottom: 0; overflow: hidden; + background: -moz-linear-gradient(to right, #cccccc 0, #ffffff 3%, #ffffff 97%, #cccccc 100% ) } .Tl-Grid-Column { - position: absolute; top: 0; height: 100%; border-left: 1px solid #999; + position: absolute; top: 10px; bottom: 0; border-left: 1px solid #999; } /* .Tl-Grid-Major { @@ -166,7 +112,7 @@ } */ .Tl-Grid-Label { - position: absolute; height: 12px; bottom: 0; left: 1px; font-size: 10px; z-index: 4; width: 80px; + position: absolute; height: 12px; top: -10px; left: 2px; font-size: 11px; z-index: 4; width: 80px; } .Tl-Grid-Now { @@ -325,86 +271,4 @@ .Tl-AddOccurrence { float: right; margin: -3px; -} - -/**********************************/ - -.Ls-Main { - display: none; width: 950px; height: 200px; background: #fafafa; border: 1px solid #cccccc; text-align: left; -} - -.Ls-Filtres { - width: 540px; - float: left; -} - -.Ls-Column { - width: 130px; height: 160px; - float: left; -} - -.Ls-Main h2 { - text-align: center; margin: 0; font-size: 14px; font-weight: bold; clear: both; -} - -.Ls-Resultats { - height: 200px; overflow: auto; border-left: 1px solid #cccccc; -} - -.Ls-Search { - width: 120px; -} - -.Ls-Input { - width: 80px; -} - -.Ls-Label { - display: inline-block; width: 30px; font-size: 12px; -} - -.Ls-Main h3 { - font-size: 12px; font-weight: bold; margin: 5px 0 0; - clear: both; -} - -.Ls-Critere { - font-size: 11px; background: #ffffff; color: #333333; cursor: pointer; - border-radius: 4px; margin: 2px; padding: 3px; display: inline-block; clear: both; -} - -.Ls-Critere.Ls-Active { - background: #ffb0ff; -} - -.Ls-Critere:hover { - background: #ffe0ff; -} - -.Ls-Resultats ul { - border-top: 1px solid #cccccc; -} - -li.Ls-Occurrence { - border-bottom: 1px solid #cccccc; clear: both; padding: 3px; -} - -h4.Ls-Occurrence-Title { - font-size: 13px; font-weight: bold; -} - -p.Ls-Occ-More { - font-size: 12px; -} - -.Ls-CrWithIcon { - padding: 5px 2px; -} - -.Ls-OccIcon { - float: right; -} - -.Ls-CrWithIcon .Ls-OccIcon { - margin: -4px 0; -} +} \ No newline at end of file diff -r 8bab0eb0d791 -r 6b1a038edbf7 timeline/js/timeline.js --- a/timeline/js/timeline.js Tue Aug 13 13:16:26 2013 +0200 +++ b/timeline/js/timeline.js Tue Aug 13 16:22:32 2013 +0200 @@ -21,7 +21,7 @@ if(/^m(in|ax)_/.test(_k)) { var _tab = _k.split('_') if( typeof _object[_tab[1]] !== "undefined") { - var _fn = (_tab[0] === "min" ? Math.max : Math.min); + var _fn = Math[_tab[0] === "max" ? "min":"max"]; _object[_tab[1]] = _fn(_object[_tab[1]], _v); } } else { @@ -40,6 +40,7 @@ } var _params = { hours: _date.getHours(), + isDayStart: !_date.getHours(), "0hours": Tlns.Utils.zeroPad(_date.getHours()), minutes: _date.getMinutes(), "0minutes": Tlns.Utils.zeroPad(_date.getMinutes()), @@ -108,21 +109,6 @@ } } -Tlns.Utils.clickActiveProcess = function(_el) { - if (_el.hasClass("Ls-Active")) { - if (!_el.siblings(":not(.Ls-Active)").length) { - _el.siblings().removeClass("Ls-Active"); - } else { - if (!_el.siblings(".Ls-Active").length) { - _el.siblings().addClass("Ls-Active"); - } - _el.removeClass("Ls-Active"); - } - } else { - _el.addClass("Ls-Active"); - } -} - /* Defaults */ Tlns.Defaults.Timeline = { @@ -136,53 +122,39 @@ main_width : 700, linelabels : [], timescales : [{ - label : "Mois", - span : 32 * 86400 * 1000, - grid_interval : 5 * 86400 * 1000, - grid_date_format : '{{dayOfMonth}} {{shortMonthName}}', - start_date_format : '{{dayOfMonth}} {{shortMonthName}}', - end_date_format : '{{dayOfMonth}} {{shortMonthName}} {{year}}' - }, { label : "Semaine", - span : 8 * 86400 * 1000, + span : 7 * 86400 * 1000, grid_interval : 86400 * 1000, - grid_date_format : '{{shortDayOfWeek}} {{0dayOfMonth}}/{{0monthNumber}}', + grid_date_format : '{{dayOfMonth}} {{monthName}}', start_date_format : '{{dayOfMonth}} {{shortMonthName}}', end_date_format : '{{dayOfMonth}} {{shortMonthName}}' }, { - label : "2 jours", - span : 2 * 86400 * 1000, - grid_interval : 8 * 3600 * 1000, - grid_date_format : '{{shortDayOfWeek}} {{0dayOfMonth}}/{{0monthNumber}} {{hours}}h', + label : "3 jours", + span : 3 * 86400 * 1000, + grid_interval : 6 * 3600 * 1000, + grid_date_format : '{{^isDayStart}}{{0hours}}h{{0minutes}}{{/isDayStart}}{{#isDayStart}}{{dayOfMonth}} {{shortMonthName}}{{/isDayStart}}', start_date_format : '{{dayOfMonth}} {{shortMonthName}}', end_date_format : '{{dayOfMonth}} {{shortMonthName}}' }, { - label : "Demi-Journée", - span : 12 * 3600 * 1000, + label : "Journée", + span : 86400 * 1000, grid_interval : 2 * 3600 * 1000, - grid_date_format : '{{hours}}h', + grid_date_format : '{{^isDayStart}}{{0hours}}h{{0minutes}}{{/isDayStart}}{{#isDayStart}}{{dayOfMonth}} {{shortMonthName}}{{/isDayStart}}', start_date_format : '{{dayOfMonth}} {{shortMonthName}} {{hours}}h', end_date_format : '{{dayOfMonth}} {{shortMonthName}} {{hours}}h' }, { - label : "3 Heures", - span : 3 * 3600 * 1000, - grid_interval : 30 * 60 * 1000, - grid_date_format : '{{0hours}}:{{0minutes}}', - start_date_format : '{{dayOfMonth}} {{shortMonthName}} {{0hours}}:{{0minutes}}', - end_date_format : '{{0hours}}:{{0minutes}}' - }, { - label : "1 Heure", - span : 60 * 60 * 1000, - grid_interval : 15 * 60 * 1000, - grid_date_format : '{{0hours}}:{{0minutes}}', - start_date_format : '{{dayOfMonth}} {{shortMonthName}} {{0hours}}:{{0minutes}}', - end_date_format : '{{0hours}}:{{0minutes}}' + label : "Demi-Journée", + span : 6 * 3600 * 1000, + grid_interval : 3600 * 1000, + grid_date_format : '{{^isDayStart}}{{0hours}}h{{0minutes}}{{/isDayStart}}{{#isDayStart}}{{dayOfMonth}} {{shortMonthName}}{{/isDayStart}}', + start_date_format : '{{dayOfMonth}} {{shortMonthName}} {{hours}}h', + end_date_format : '{{dayOfMonth}} {{shortMonthName}} {{hours}}h' }], level: 0, central_time: 0, sync_now: true, api_endpoint: "", - api_method: "fetchAll", + api_method: "searchForTimelineEdito", occurrences: [], cluster_spacing: 12, tooltip_date_format: '{{dayOfMonth}} {{shortMonthName}} {{year}} {{0hours}}:{{0minutes}}', @@ -199,28 +171,13 @@ /* Templates */ -Tlns.Templates.Timeline = '
' - + '
--/--
' - + '
' - + '
{{#timescales}}
{{label}}
{{/timescales}}
' +Tlns.Templates.Timeline = '
' + '
    ' - + '
    ' + + '
    ' + '
    ' + '
    ' - +'
    ' - + '

    Filtres :

    Univers :

      ' - + '

      Type d\'occurrence :

      • Narratives
      • de Publication
      ' - + '

      Statut :

      • À réaliser
      • À valider
      • Validé
      ' - + '

      Format :

        Est au JT :

        • Oui
        • Non
        ' - + '

        Réinitialiser filtres :

        • Tous les contenus

        Recherche par titre :

        Date :

        ' - + '

        Occurrences :

          '; - -Tlns.Templates.Univers = '{{title}}'; - -Tlns.Templates.Univers_List = '{{#univers}}
        • {{title}}
        • {{/univers}}'; - -Tlns.Templates.Formats_List = '{{#formats}}
        • {{.}}
        • {{/formats}}'; +Tlns.Templates.Univers = '
          {{title}}
          '; Tlns.Templates.Occurrence = '{{#clusters}}
          ' + '
          {{occurrences.length}}
          {{/clusters}}' @@ -230,9 +187,6 @@ + '{{#occurrences}}
          ' + '{{#locked}}
          {{/locked}}
          {{/occurrences}}
          {{/open_cluster}}'; -Tlns.Templates.Occurrence_List = '{{#occurrences}}
        • {{title}}

          ' - + '

          {{formatted_date}} — {{univers.title}} — {{translated_status}}{{#format}} — {{format}}{{/format}}

        • {{/occurrences}}'; - Tlns.Templates.OccurrenceTooltip = '

          {{title}}

          {{formatted_date}} — {{translated_status}} — {{#jt}}Au JT{{/jt}}{{^jt}}Hors JT{{/jt}}{{#format}} — {{format}}{{/format}}

          ' + '

          {{description}}

          ' // + '

          {{univers.mainCharacter}}{{#characters}}, {{.}}{{/characters}}

          ' @@ -251,10 +205,11 @@ width : this.width + "px", height : this.height + "px" }); - this.main_height = this.height - this.$.find('.Tl-TopBar').outerHeight(); + this.top_height = this.$.find('.Tl-TopBar').outerHeight(); + this.main_height = this.height - this.top_height; //this.main_height = this.height - 27; this.$.find('.Tl-BottomPart').css("height", this.main_height + "px"); - this.$.find('.Tl-MainPart').css("width", this.main_width + "px"); + this.$.find('.Tl-MainPart, .Tl-Grid').css("width", this.main_width + "px"); this.$.find('.Tl-Overlay-Container').css("left", (this.$.find('.Tl-BottomPart').outerWidth() - this.main_width) + "px"); var _o = this.$.find('.Tl-MainPart').offset(); @@ -274,29 +229,8 @@ _this.drawGrid(); }, 150); - this.throttledDrawList = _.throttle(function() { - _this.drawList(); - }, 150); - this.setLevel(this.level); - - this.$.find('.Tl-TopBar-Timescales>div').click(function() { - _this.setLevel($(this).attr("data-level")); - }); - - this.$.find('.Tl-TopBar-SyncButton').click(function() { - _this.sync_now = !_this.sync_now; - _this.changeSpan(); - }) - - this.$.find('.Tl-TopBar-PreviousButton').click(function() { - _this.offsetTime(-_this.timescales[_this.level].span / 4); - }); - - this.$.find('.Tl-TopBar-NextButton').click(function() { - _this.offsetTime(_this.timescales[_this.level].span / 4); - }); - + this.$.find('.Tl-MainPart').mousedown(function(_event) { _this.onMouseDown(_event); return false; @@ -331,70 +265,7 @@ }).mouseout(function(_event) { $(this).hide(); }); - - /* LIST */ - - this.$.find("li.Ls-Critere").click(function() { - Tlns.Utils.clickActiveProcess($(this)); - _this.throttledDrawList(); - }); - this.$.find(".Ls-Search").bind("keyup change click", function() { - _this.throttledDrawList(); - }); - this.$.find(".Ls-From-Date, .Ls-To-Date").datepicker( - { - dateFormat: "dd/mm/yy", - dayNames: [ "Dimanche", "Lundi", "Mardi", "Mercredi", "Jeudi", "Vendredi", "Samedi" ], - dayNamesShort: [ "Dim", "Lun", "Mar", "Mer", "Jeu", "Ven", "Sam" ], - dayNamesMin: [ "D", "L", "Ma", "Me", "J", "V", "S" ], - monthNames: [ "Janvier", "Février", "Mars", "Avril", "Mai", "Juin", "Juillet", "Août", "Septembre", "Octobre", "Novembre", "Décembre" ], - monthNamesShort: [ "Jan", "Fév", "Mar", "Avr", "Mai", "Jun", "Jul", "Aoû", "Sep", "Oct", "Nov", "Déc" ], - showOtherMonths: true, - selectOtherMonths: true - } - ).change(function() { - var _val = $(this).val(); - if (_val) { - $(this).val(Tlns.Utils.dateFieldProcess( _val ).text); - } - _this.drawList(); - }).bind("keyup", function() { - _this.throttledDrawList(); - }); - this.$.find(".Ls-From-Time, .Ls-To-Time").change(function() { - var _val = $(this).val(); - if (_val) { - $(this).val(Tlns.Utils.timeFieldProcess( _val ).text); - } - _this.throttledDrawList(); - }).bind("keyup", function() { - _this.throttledDrawList(); - }); - this.$.find(".Ls-All").click(function() { - _this.$.find(".Ls-Critere").addClass("Ls-Active"); - _this.throttledDrawList(); - }); - this.$.find(".Ls-None").click(function() { - _this.$.find(".Ls-Critere").removeClass("Ls-Active"); - _this.throttledDrawList(); - }); - - this.$.find(".Onglet-Tl").click(function() { - _this.$.find(".Tl-Main").show(); - _this.$.find(".Ls-Main").hide(); - _this.$.find(".Onglet-Ls").removeClass("active"); - _this.$.find(".Onglet-Tl").addClass("active"); - _this.throttledDrawGrid(); - }); - - this.$.find(".Onglet-Ls").click(function() { - _this.$.find(".Ls-Main").show(); - _this.$.find(".Tl-Main").hide(); - _this.$.find(".Onglet-Tl").removeClass("active"); - _this.$.find(".Onglet-Ls").addClass("active"); - _this.throttledDrawList(); - }); this.onUniversLoaded(this.linelabels); @@ -463,24 +334,6 @@ this.univers.push(new Tlns.Classes.Univers(_data[_i], this, _i)); } - this.$.find(".Ls-Univers").html( - Mustache.to_html( - Tlns.Templates.Univers_List, - { - univers: _(this.univers).map(function(_u) { - return { - id: _u.id, - title: _u.title.replace(/(^.{10,20})[\s].+$/m,'$1…') - } - }) - } - ) - ); - var _this = this; - this.$.find(".Ls-Univers li.Ls-Critere").click( function() { - Tlns.Utils.clickActiveProcess($(this)); - _this.throttledDrawList(); - }); this.loadOccurrences(); } @@ -496,14 +349,6 @@ Tlns.Classes.Timeline.prototype.setLevel = function(_level) { if (_level >= 0 && _level < this.timescales.length) { - this.$.find('.Tl-TopBar-Timescales>div').each(function() { - var _el = $(this); - if (_el.attr("data-level") == _level) { - _el.addClass("active"); - } else { - _el.removeClass("active"); - } - }); this.level = _level; this.changeSpan(); } @@ -518,27 +363,16 @@ this.current_scale = this.main_width / (_timescale.span); this.start_time = this.central_time - (_timescale.span / 2); this.end_time = this.central_time + (_timescale.span / 2); - this.$.find(".Ls-From-Time").val(Tlns.Utils.dateFormat(this.start_time, '{{0hours}}:{{0minutes}}')); - this.$.find(".Ls-From-Date").val(Tlns.Utils.dateFormat(this.start_time, '{{0dayOfMonth}}/{{0monthNumber}}/{{year}}')); - this.$.find(".Ls-To-Time").val(Tlns.Utils.dateFormat(this.end_time, '{{0hours}}:{{0minutes}}')); - this.$.find(".Ls-To-Date").val(Tlns.Utils.dateFormat(this.end_time, '{{0dayOfMonth}}/{{0monthNumber}}/{{year}}')); this.throttledDrawGrid(); - this.throttledDrawList(); } Tlns.Classes.Timeline.prototype.drawGrid = function() { - if (this.sync_now) { - this.$.find('.Tl-TopBar-SyncButton').addClass("active"); - } else { - this.$.find('.Tl-TopBar-SyncButton').removeClass("active"); - } var _now = new Date().valueOf(), _timescale = this.timescales[this.level], _offset = new Date().getTimezoneOffset() * 60000, _grid_width = Math.floor(_timescale.grid_interval * this.current_scale), _roundstart = Math.floor((this.start_time - _offset) / _timescale.grid_interval) * _timescale.grid_interval + _offset, _html = ''; - this.$.find('.Tl-TopBar-TimeSpan').html(Tlns.Utils.dateFormat(this.start_time, _timescale.start_date_format) + ' - ' + Tlns.Utils.dateFormat(this.end_time, _timescale.end_date_format)); for (var _t = _roundstart; _t < this.end_time; _t += _timescale.grid_interval) { var _x = this.current_scale * (_t - this.start_time); if (_x > 0) { @@ -573,20 +407,6 @@ if (!this.mouse_down) { this.drawOccurrences(); } - this.$.find(".Ls-Formats").html( - Mustache.to_html( - Tlns.Templates.Formats_List, - { - formats: _(this.occurrences).chain().pluck('format').unique().value() - } - ) - ); - var _this = this; - this.$.find(".Ls-Formats li.Ls-Critere").click( function() { - Tlns.Utils.clickActiveProcess($(this)); - _this.throttledDrawList(); - }); - this.throttledDrawList(); } Tlns.Classes.Timeline.prototype.deleteOccurrence = function(_id) { @@ -763,66 +583,6 @@ }) } -Tlns.Classes.Timeline.prototype.drawList = function() { - var _universfilter = this.$.find(".Ls-Univers li.Ls-Active").map(function(){return $(this).attr("data")}), - _occtypefilter = this.$.find(".Ls-Occtypes li.Ls-Active").map(function(){return $(this).attr("data")}), - _formatsfilter = this.$.find(".Ls-Formats li.Ls-Active").map(function(){return $(this).text()}), - _statusfilter = this.$.find(".Ls-Occstatuses li.Ls-Active").map(function(){return $(this).attr("data")}), - _jtfilter = this.$.find(".Ls-IsJt li.Ls-Active").map(function(){return !!+$(this).attr("data")}), - _title = this.$.find(".Ls-Search").val() || "", - _titleregexp = new RegExp( "(" + _title.replace(/(\W)/gm, "\\$1") + ")", "gim" ), - _startdate = false, - _enddate = false, - _fromDate = this.$.find(".Ls-From-Date").val(), - _toDate = this.$.find(".Ls-To-Date").val(); - if (_fromDate) { - var _date = Tlns.Utils.dateFieldProcess(_fromDate), - _time = Tlns.Utils.timeFieldProcess(this.$.find(".Ls-From-Time").val()); - _startdate = new Date(_date.year, _date.month - 1, _date.date, _time.hours, _time.minutes); - } - if (_toDate) { - var _date = Tlns.Utils.dateFieldProcess(_toDate), - _time = Tlns.Utils.timeFieldProcess(this.$.find(".Ls-To-Time").val()); - _enddate = new Date(_date.year, _date.month - 1, _date.date, _time.hours, _time.minutes); - } - this.$.find(".Ls-Occurrences").html( - Mustache.to_html( - Tlns.Templates.Occurrence_List, - { - occurrences: _(this.occurrences).chain().filter(function(_occ) { - var _titletest = (!!_occ.title.match(_titleregexp)), - _keep = ( - ( !_title || _titletest ) - && _(_occtypefilter).include(_occ.type) - && _(_universfilter).include(_occ.univers_id) - && _(_statusfilter).include(_occ.status) - && _(_formatsfilter).include(_occ.format) - && _(_jtfilter).include(_occ.jt) - && ( !_fromDate || _occ.date >= _startdate ) - && ( !_toDate || _occ.date <= _enddate ) - ); - return _keep; - }).sortBy(function(_occ) { - return _occ.date; - }).value() - } - ) - ); - if (_title) { - this.$.find(".Ls-Occurrence-Title").each(function() { - $(this).html($(this).text().replace(_titleregexp, "$1")); - }); - } - this.$.find(".Ls-Occurrence").click(function() { - var _id = $(this).attr("data-id"), - _data = { - id: _id.replace(/^.*_/,''), - typeOccurrence: "Occurrence" + _id.replace(/_.*$/,'').replace(/^./,function(_l) { return _l.toUpperCase()}) - } - return false; - }); -} - Tlns.Classes.Timeline.prototype.getUnivers = function(_id) { return _(this.univers).find(function(_univ) { return (_univ.id == _id); @@ -845,6 +605,9 @@ }).html(Mustache.to_html(Tlns.Templates.Univers, this)); _timeline.$.find('.Tl-UniversLabels').append(this.$label); + + var txtdiv = this.$label.find(".Tl-UniversText"); + txtdiv.css("margin-top", Math.floor((_timeline.univers_height - txtdiv.height()) / 2)); } /* diff -r 8bab0eb0d791 -r 6b1a038edbf7 timeline/timeline.html --- a/timeline/timeline.html Tue Aug 13 13:16:26 2013 +0200 +++ b/timeline/timeline.html Tue Aug 13 16:22:32 2013 +0200 @@ -40,7 +40,6 @@ ], api_endpoint: "http://anarchy2.solicis.fr/api/cms/content?callback=?", container: "timeline", - level: 1, sync_now: false, central_time: Date.parse("2013-07-18T00:00:00Z") });