# HG changeset patch # User veltr # Date 1342711802 -7200 # Node ID f00eb382bff1d4cfceba7c7c8a3aa3bd0cdb6bc8 # Parent bf6adf981cc2409958aa56f9eee0e7961b7634ef Bugfixes diff -r bf6adf981cc2 -r f00eb382bff1 timeline/css/timeline.css --- a/timeline/css/timeline.css Thu Jul 19 14:09:23 2012 +0200 +++ b/timeline/css/timeline.css Thu Jul 19 17:30:02 2012 +0200 @@ -53,7 +53,7 @@ .Onglets li { display: inline-block; background: url(../img/barbgd.png); font-size: 14px; height: 15px; padding: 5px; - border: 1px solid #cccccc; cursor: pointer; + border: 1px solid #cccccc; cursor: pointer; border-bottom: none; border-top-left-radius: 8px; border-top-right-radius: 8px; } diff -r bf6adf981cc2 -r f00eb382bff1 timeline/js/timeline.js --- a/timeline/js/timeline.js Thu Jul 19 14:09:23 2012 +0200 +++ b/timeline/js/timeline.js Thu Jul 19 17:30:02 2012 +0200 @@ -237,7 +237,7 @@ + '{{#occurrences}}
' + '{{#locked}}
{{/locked}}
{{/occurrences}}{{/open_cluster}}'; -Tlns.Templates.Occurrence_List = '{{#occurrences}}
  • {{title}}

    ' +Tlns.Templates.Occurrence_List = '{{#occurrences}}
  • {{title}}

    ' + '

    {{formatted_date}} — {{univers.title}} — {{translated_status}} — {{#jt}}Au JT{{/jt}}{{^jt}}Hors JT{{/jt}}

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

    {{title}}

    {{formatted_date}} — {{translated_status}}

    ' @@ -259,6 +259,7 @@ height : this.height + "px" }); this.main_height = this.height - this.$.find('.Tl-TopBar').outerHeight(); + //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-Overlay-Container').css("left", (this.$.find('.Tl-BottomPart').outerWidth() - this.main_width) + "px"); @@ -436,28 +437,30 @@ /* BINDING MEDIADATA EVENTS */ $("body").bind("AjoutOccurrenceEditeur MiseAJourOccurrenceEditeur", function(_event, _data) { - var _type = _data.typeOccurrence.replace(/^occurrence/i,'').toLowerCase(); + var _type = _data.typeOccurrence.replace(/^Occurrence/i,'').toLowerCase(); _this.createOrUpdateOccurrence(_type, _data); _this.throttledDrawGrid(); + _this.throttledDrawList(); }); $("body").bind("SuppressionOccurrenceEditeur", function(_event, _data) { - var _id = _data.typeOccurrence.replace(/^occurrence/i,'').toLowerCase() + '_' + _data.id; + var _id = _data.typeOccurrence.replace(/^Occurrence/i,'').toLowerCase() + '_' + _data.id; _this.deleteOccurrence(_id); _this.throttledDrawGrid(); + _this.throttledDrawList(); }); $("body").bind("AjoutDependanceEditeur", function(_event, _data) { - var _sourceId = _data.typeOccurrence.replace(/^occurrence/i,'').toLowerCase() + '_' + _data.id, - _targetId = _data.typeOccurrenceCible.replace(/^occurrence/i,'').toLowerCase() + '_' + _data.idCible; + var _sourceId = _data.typeOccurrence.replace(/^Occurrence/i,'').toLowerCase() + '_' + _data.id, + _targetId = _data.typeOccurrenceCible.replace(/^Occurrence/i,'').toLowerCase() + '_' + _data.idCible; _this.getOccurrence(_sourceId).addDependency(_targetId); _this.throttledDrawGrid(); }); $("body").bind("SuppressionDependanceEditeur", function(_event, _data) { - var _sourceId = _data.typeOccurrence.replace(/^occurrence/i,'').toLowerCase() + '_' + _data.id, - _targetId = _data.typeOccurrenceCible.replace(/^occurrence/i,'').toLowerCase() + '_' + _data.idCible; - _this.getOccurrence(_sourceId).addDependency(_targetId); + var _sourceId = _data.typeOccurrence.replace(/^Occurrence/i,'').toLowerCase() + '_' + _data.id, + _targetId = _data.typeOccurrenceCible.replace(/^Occurrence/i,'').toLowerCase() + '_' + _data.idCible; + _this.getOccurrence(_sourceId).removeDependency(_targetId); _this.throttledDrawGrid(); }); @@ -484,7 +487,7 @@ var _event = ( this.editing_occurrence.just_created ? "Ajout" : "MiseAJour" ) + "OccurrenceTimeline", _data = { id: this.editing_occurrence.original_id, - typeOccurrence: "occurrence" + this.editing_occurrence.type.replace(/^./,function(_l) { return _l.toUpperCase()}), + typeOccurrence: "Occurrence" + this.editing_occurrence.type.replace(/^./,function(_l) { return _l.toUpperCase()}), datePublication : Math.floor(this.editing_occurrence.date / 1000), titre : this.editing_occurrence.title, idUnivers: this.editing_occurrence.univers_id, @@ -511,7 +514,7 @@ } else { var _data = { id: this.editing_occurrence.original_id, - typeOccurrence: "occurrence" + this.editing_occurrence.type.replace(/^./,function(_l) { return _l.toUpperCase()}) + typeOccurrence: "Occurrence" + this.editing_occurrence.type.replace(/^./,function(_l) { return _l.toUpperCase()}) } $("body").trigger("SelectionOccurrenceTimeline", _data); } @@ -871,9 +874,9 @@ $("body").trigger("AjoutDependanceTimeline", { id: _this.editing_occurrence.original_id, - typeOccurrence: "occurrence" + _this.editing_occurrence.type.replace(/^./,function(_l) { return _l.toUpperCase()}), + typeOccurrence: "Occurrence" + _this.editing_occurrence.type.replace(/^./,function(_l) { return _l.toUpperCase()}), idCible: _target.replace(/^.*_/,''), - typeOccurrenceCible: "occurrence" + _target.replace(/_.*$/,'').replace(/^./,function(_l) { return _l.toUpperCase()}) + typeOccurrenceCible: "Occurrence" + _target.replace(/_.*$/,'').replace(/^./,function(_l) { return _l.toUpperCase()}) } ); } @@ -948,6 +951,15 @@ $(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()}) + } + $("body").trigger("SelectionOccurrenceTimeline", _data); + return false; + }); } Tlns.Classes.Timeline.prototype.getUnivers = function(_id) { diff -r bf6adf981cc2 -r f00eb382bff1 timeline/timeline.html --- a/timeline/timeline.html Thu Jul 19 14:09:23 2012 +0200 +++ b/timeline/timeline.html Thu Jul 19 17:30:02 2012 +0200 @@ -38,8 +38,8 @@ sync_now: false, central_time: Date.parse("2012-07-26T00:00:00Z") }); - $("body").bind("AjoutOccurrenceEditeur MiseAJourOccurrenceEditeur SuppressionOccurrenceEditeur AjoutDependanceEditeur SuppressionDependanceEditeur AjoutDependanceTimeline AjoutOccurrenceTimeline MiseAJourOccurrenceTimeline SelectionOccurrenceTimeline SelectionOccurrenceMediadata", function(_event, _data) { - console.log(_event.type + " called with data " + JSON.stringify(_data)); + $("body").bind("AjoutOccurrenceEditeur MiseAJourOccurrenceEditeur SuppressionOccurrenceEditeur AjoutDependanceEditeur SuppressionDependanceEditeur AjoutDependanceTimeline AjoutOccurrenceTimeline MiseAJourOccurrenceTimeline SelectionOccurrenceTimeline SelectionOccurrenceMediadata", function(_event, data) { + console.log(_event.type + " called with data " + JSON.stringify(data)); }); });