equal
deleted
inserted
replaced
157 sync_now: true, |
157 sync_now: true, |
158 api_endpoint: "", |
158 api_endpoint: "", |
159 api_method: "searchForTimelineEdito", |
159 api_method: "searchForTimelineEdito", |
160 occurrences: [], |
160 occurrences: [], |
161 grid_spacing: 12, |
161 grid_spacing: 12, |
162 tooltip_date_format: '{{dayOfMonth}} {{shortMonthName}} {{year}} {{0hours}}:{{0minutes}}', |
162 tooltip_date_format: '{{dayOfMonth}} {{monthName}} {{year}} à {{0hours}}:{{0minutes}}', |
163 class_info: { |
163 class_info: { |
164 "Cms\\Previously": { |
164 "Cms\\Previously": { |
165 label: "Précédemment", |
165 label: "Précédemment", |
166 univers_id: 0, |
166 univers_id: 0, |
167 picto: "previously.png", |
167 picto: "previously.png", |
237 + '{{#image}}<img src="{{image}}" />{{/image}}' |
237 + '{{#image}}<img src="{{image}}" />{{/image}}' |
238 + '</div>{{/occurrences}}'; |
238 + '</div>{{/occurrences}}'; |
239 |
239 |
240 Tlns.Templates.OccurrenceTooltip = '<h3 class="Tl-Tooltip-Title">{{title}}</h3>'; |
240 Tlns.Templates.OccurrenceTooltip = '<h3 class="Tl-Tooltip-Title">{{title}}</h3>'; |
241 |
241 |
242 Tlns.Templates.OccurrenceDetails = '<div class="Tl-Detail"><img class="Tl-Detail-Image" src="{{detail_image}}" />' |
242 Tlns.Templates.OccurrenceDetails = '<div class="Tl-Detail"><div class="Tl-Detail-X"></div><img class="Tl-Detail-Image" src="{{detail_image}}" />' |
243 + '<h2 class="Tl-Detail-Title">{{title}}</h2><p class="Tl-Detail-Description">{{detail_description}}</p>' |
243 + '<h2 class="Tl-Detail-Title">{{title}}</h2><p class="Tl-Detail-Description">{{detail_description}}</p>' |
244 + '<div class="Tl-Detail-Bottom"><span class="Tl-Detail-Date">{{formatted_date}}</span><a class="Tl-Detail-Read" href="{{url}}" target="_blank">Lire la suite</a></div></div>'; |
244 + '<div class="Tl-Detail-Bottom"><span class="Tl-Detail-Date">Publié le {{formatted_date}}</span><a class="Tl-Detail-Read" href="{{url}}" target="_blank">Lire la suite</a></div></div>'; |
245 |
245 |
246 /* Classes */ |
246 /* Classes */ |
247 |
247 |
248 Tlns.Classes.Timeline = function(_options) { |
248 Tlns.Classes.Timeline = function(_options) { |
249 |
249 |
612 var _occurrence = _this.getOccurrence(_id); |
612 var _occurrence = _this.getOccurrence(_id); |
613 _this.hideTooltip(); |
613 _this.hideTooltip(); |
614 } |
614 } |
615 }); |
615 }); |
616 |
616 |
|
617 if (this.editing_occurrence) { |
|
618 $(".Tl-Grid-Editing, .Tl-Detail-X").css("left", this.editing_occurrence.x); |
|
619 if (this.editing_occurrence.date > this.end_time || this.editing_occurrence.date < this.start_time) { |
|
620 $(".Tl-Detail-X").hide(); |
|
621 } else { |
|
622 $(".Tl-Detail-X").show(); |
|
623 } |
|
624 } |
|
625 |
617 }; |
626 }; |
618 |
627 |
619 Tlns.Classes.Timeline.prototype.getUnivers = function(_id) { |
628 Tlns.Classes.Timeline.prototype.getUnivers = function(_id) { |
620 return _(this.univers).find(function(_univ) { |
629 return _(this.univers).find(function(_univ) { |
621 return (_univ.id == _id); |
630 return (_univ.id == _id); |
652 |
661 |
653 Tlns.Classes.Occurrence.prototype.update = function(_data) { |
662 Tlns.Classes.Occurrence.prototype.update = function(_data) { |
654 this.original_data = _data; |
663 this.original_data = _data; |
655 this.id = _data.id; |
664 this.id = _data.id; |
656 this.date = new Date(1000 * (_data.dateFirstPublication || _data.dateCreate) || Date.now); |
665 this.date = new Date(1000 * (_data.dateFirstPublication || _data.dateCreate) || Date.now); |
657 this.formatted_date = Tlns.Utils.dateFormat(this.date,Tlns.Defaults.Timeline.tooltip_date_format); |
666 this.formatted_date = Tlns.Utils.dateFormat(this.date,this.timeline.tooltip_date_format); |
658 this.title = _data.title; |
667 this.title = _data.title; |
659 this.type = _data.__CLASS__; |
668 this.type = _data.__CLASS__; |
660 this.importance = _data.importance; |
669 this.importance = _data.importance; |
661 var typeinfo = this.timeline.class_info[_data.__CLASS__]; |
670 var typeinfo = this.timeline.class_info[_data.__CLASS__]; |
662 this.univers_id = typeinfo.univers_id; |
671 this.univers_id = typeinfo.univers_id; |